%[text] %[text:anchor:T_40335778] # 454MI: Introduction to MATLAB - Part 6 - Symbolic Math Computations
%[text] %[text:anchor:T_7B7F584A] #
%[text] This is the sixth MATLAB live script of the collection \*\*\*Using MATLAB in the 454MI "\*\*\****Data Driven Digital Systems***" course, devoted to introduce the MATLAB/Simulink environment and tools for solving practical problems related to the topics of the 454MI course, i.e. performance analysis of dynamic systems, parametric estimation, identification of models from data, and prediction of the evolution of dynamic systems.
%[text] Use [this link](file:./usingMATLAB_454MI_Data_Driven_Digital_Systems.m) to go back to the main live script of the collection.
%[text]
%[text:tableOfContents]{"heading":"Table of Contents"}
%[text]
%[text] %[text:anchor:H_F448F9FB] ## Introduction
%[text]
%[text] Symbolic Math Toolbox provides functions for solving, representing and manipulating symbolic math equations. The toolbox offers functions for calculus, linear algebra, algebraic and differential equations, simplification and manipulation of equations. Symbolic Math Toolbox allows analytical derivations, Integrations, simplifications, solving of equations, applying Laplace and Z-transform, and much more.
%[text]
%[text] %[text:anchor:H_C0014442] ### Before You Start
%[text] In this live script you will learn, by running some examples
%[text] - How to define and manage symbolic variables;
%[text] - How to perform linear algebraic operations, such as computing the inverse, or the determinant, or the eigenvalues of a square matrix;
%[text] - How to apply the Laplace and the Z-transform. \
clear
close all
clc % cleaning the workspace
sympref('HeavisideAtOrigin',1) % forcing the default preferences for the Symbolic Math Toolbox %[output:9604bc4a]
%%
%[text] %[text:anchor:H_F0D9BA8C] ## Symbolic Scalar Variables, Matrix Variables & Functions
%[text]
%[text] %[text:anchor:H_88661CCE] ### Symbolic Scalar Variables
%[text] The command
%[text] ```matlabCodeExample
%[text] syms var1
%[text] ```
%[text] allows the definition of a scalar symbolic variable, named `var1`, assigning to the new variable a symbolic value corresponding to the variable's name
%[text] A simple example:
clear variables
syms x y
disp(x) %[output:4db7f541]
whos x %[output:2cc2848c]
disp(y) %[output:07a685ce]
%[text] Then, you may create a symbolic expression using the new variables, and assign the result to one of them
t = 2*y^2-sqrt(abs(x-pi))/sin(2*x-pi/6);
disp(t) %[output:0c658c5a]
%%
%[text] %[text:anchor:H_32D6011B] #### Assumptions on Symbolic Variables
%[text] It is possible to declare assumptions on symbolic variables, regarding particular features or data type of the variables. The `assumption` can be '`real`', '`rational`', '`integer`', or '`positive`'.
clear variables
syms a b integer
syms c positive rational
syms d real
assumptions %[output:4ceb629d]
%%
%[text] Alternatively, you may check assumptions on a single symbolic variable
syms a positive real
assumptions(a) %[output:43005c5b]
assumeAlso(b>0)
assumptions %[output:02940ec2]
%%
%[text] %[text:anchor:H_418192A9] ### Symbolic Vectors & Matrices: The Simplest Way to Create a Symbolic Array
%[text]
%[text] You have two possibilities:
%[text] - Assemble a symbolic array, using at least a symbolic scalar element into it. Example: \
clear variables
syms a b c d
A = [a, b; c, d] % <<- this is a symbolic variable (indeed a symbolic array) %[output:00541001]
whos A %[output:6ef36770]
% now you can use it
det(A) %[output:0bb13a3e]
%[text] - Exploit the "casting" capabilities of the MATLAB programming language. Example: \
% -->> magic() returns a NUMERIC array,
% BUT then we FORCE to change the data type into sym
M = sym([magic(3)]) %[output:24a0c422]
whos M %[output:2a5bbe84]
% now we can simply compute linear algebra computations
% using symbolic maths
b = sym([1; 2/3; 0]) %[output:15fb89b1]
v = M * b %[output:37f7d213]
whos v b %[output:5f3c16f2]
%[text]
%%
%[text] ### Symbolic Vectors & Matrices: More Sophisticate Approaches
%[text] A symbolic row or a column vector may be defined by using the command
%[text] ```matlabCodeExample
%[text] syms v [1 Nc]
%[text] ```
%[text] for a row vector with $N\_c$ elements, and
%[text] ```matlabCodeExample
%[text] syms w [Nr 1]
%[text] ```
%[text] in the case of a column vector, with $N\_r$ components.
%[text] In the general case of a matrix, the syntax of the command `syms` is obviously
%[text] ```matlabCodeExample
%[text] syms A [Nr Nc]
%[text] ```
%[text] %[text:anchor:H_07021644] #### Examples
syms a [1 3]
syms b [4 1]
syms M [4 3] real
disp(a) %[output:6c7bb78c]
disp(b) %[output:03913569]
b4 = sym(1/2) %[output:1db4af1e]
disp(M) %[output:5c281a1a]
%[text] Technically they are **arrays of symbolic scalar variables**.
%[text] To create a **symbolic matrix object**, the command syntax is different
%[text] ```matlabCodeExample
%[text] syms A [Nr Nc] matrix
%[text] ```
%[text] For example
syms T [4 3] matrix
disp(T) %[output:2f529e45]
%[text] Note the formal difference: the "matrix" symbolic object $T$ is an all-in-one object, but the array $M$is instead an array of symbolic scalar objects
class(T) %[output:22e182e9]
whos T* %[output:55a459d8]
class(M) %[output:1de43d78]
whos M* %[output:08c3617e]
%[text] ###
%%
%[text] %[text:anchor:H_E334AF00] ### Symbolic Functions
%[text] You may create symbolic scalar functions with one or two arguments, simply by typing, for example
%[text] ```matlabCodeExample
%[text] syms s(t) f(x, y)
%[text] ```
%[text] Both $s$ and $f$are abstract symbolic functions. You have to assign an expression to them before using them.
%[text] %[text:anchor:H_DEA34556] #### Example
clear variables
syms t x y
syms f(x, y)
f(x, y) = 2*x+sqrt(3*y^2+4) %[output:6dcf67a7]
%[text] Now, it is possible to evaluate the function at a specific input point:
f(1,2) %[output:248f8f0a]
%%
%[text] %[text:anchor:H_36A44044] #### **Function of Vector and Scalar**
%[text]
%[text] Let's create the function
%[text]{"align":"center"} $g\\left( v\\,,\\; \\alpha \\right) = \\displaystyle \\frac{\\vert\\vert v \\vert \\vert\_{2} }{\\alpha} \\qquad v \\in \\mathbf{R}^{3 \\text{x}1}\\,,\\quad \\alpha \\in \\mathbf{R}$
syms v [1 3] matrix
syms alpha
syms g(v,alpha) [1 1] matrix keepargs
%[text] The keyword `keepargs` allows to keep existing definitions of the vector $v$ and the scalar $\\alpha$ already in the MATLAB workspace.
%[text] Now, let's assign the formula of $g(v, \\alpha)$
g(v,alpha) = norm(v)/alpha %[output:068827f8]
%[text] Now we can evaluate the function
gResult = g([ 1 2 3], 4) %[output:9e7ecb59]
%[text] Finally, let's convert the result from the `symmatrix` datatype to the `sym` datatype
vSym = symmatrix2sym(gResult) %[output:0d8d333f]
%%
%[text] %[text:anchor:H_9FFCE83F] ## Linear Algebraic Operations
%[text]
%[text] %[text:anchor:H_521D5BE0] ### **An Example of an Ill-Conditioned Matrix**
%[text] In linear algebra, a Hilbert matrix is a square matrix with entries defined as
%[text]{"align":"center"} $H \\in \\mathbf{R}^{n \\text{x} n} \\;: \\quad H\_{i\\, j} = \\displaystyle \\frac{1}{i+j-1} \\,,\\quad i\\,\\;j = 1\\,,\\;2\\,,\\; \\ldots n$
%[text] The Hilbert matrices are classical examples of ill-conditioned matrices, i.e. difficult to use in numerical computations (computation of the eigenvalues and eigenvectors, the determinant, the inverse matrix are all difficult numerical problems for Hilbert matrices).
%[text] Generate the 20-by-20 Hilbert matrix. With `format short`, MATLAB prints the output
H = hilb(20) %[output:61113e6d]
%[text] The computed elements of the matrix $H$ are floating-point numbers that are the ratios of small integers. $H$ is a MATLAB array of class `double`.
%[text] Let's convert $H$ to a symbolic matrix:
H1=sym(H) %[output:963732b8]
%%
%[text] %[text:anchor:H_85ECFA22] ### **Symbolic Linear Algebra Operations**
%[text] Symbolic operations on $H\_s$ produce results that correspond to the infinite-precision Hilbert matrix, `sym(hilb(20))`, not its floating-point approximation, `hilb(20)`.
%[text] %[text:anchor:H_69B295A2] #### The Inverse Matrix
inv(H1) %[output:20376b22]
%[text] Compare with the numerical, ill conditioned, result
inv(hilb(20)) %[output:239e875e] %[output:0dabf441]
%[text] %[text:anchor:H_7614C3A4] ####
%[text] %[text:anchor:H_0C21F8FA] #### The Determinant of a Symbolic Matrix
%[text] Find the determinant of `H`.
disp(det(H1)) %[output:00fa7084]
%[text] One more time, compare with the numerical result:
det(hilb(20)) %[output:40b9c2a1]
%%
%[text] %[text:anchor:H_6C8D3470] #### The Adjoint Matrix
%[text] The following command returns the adjoint matrix $X$ for a given numeric or symbolic matrix $H$
help adjoint %[output:6e65f70e]
X = adjoint(H1) %[output:6e6d8bc0]
A = magic(4) %[output:4d444332]
XA = adjoint(A) %[output:326d0380]
%%
%[text] %[text:anchor:H_881131DD] #### The Column Space of a Matrix
%[text] Given a symbolic matrix $A$, the command `colspace(A)` returns a symbolic matrix whose columns form a basis for the column space of the matrix $A$
Rh = colspace(H1) %[output:061a4431]
Ra = colspace(sym(A)) %[output:80c7be36]
%%
%[text] %[text:anchor:H_28758CBC] #### Null Space of a Matrix
%[text] How to determine a basis for the null space of a symbolic matrix?
ZH = null(H1) %[output:59e405df]
%[text] Please remember: a Hilbert matrix is always a full rank matrix, so the null space is empty!
ZA = null(sym(A)) %[output:9cd73ebb]
%%
%[text] %[text:anchor:H_C743EB3E] #### Characteristic Polynomial of a Matrix
%[text] Given a symbolic square matrix, you can compute the **coefficients** of the **characteristic polynomial** of such a matrix
charpoly(H1) %[output:82150b4e]
%[text] or directly the expression of the characteristic polynomial in terms of a previously defined symbolic variable
A = sym([1 1 0; 0 1 0; 0 0 1]); % a symbolic matrix
syms x % the variable we want use to write
% the expression of the characteristic
% polynomial of the matrix A
polyA = charpoly(A,x) % the expression of the polynomial %[output:0bb530a1]
polyH = charpoly(H1, x) %[output:6ab8f856]
%%
%[text] %[text:anchor:H_732ABE81] #### Eigenvalues and Eigenvectors of Symbolic Matrix
%[text] Given a symbolic square matrix, you can compute eigenvalues and eigenvectors by using the command
A = sym([1 1 0; 0 1 0; 0 0 1]); % a symbolic matrix
lambda = eig(A) % just the eigenvalues of A %[output:14afdc8f]
%[text] To obtain both the eigenvalues and the corresponding eigenvectors, use
[eigVect, LambdaDiag] = eig(A) %#ok % "magic code" to suppress unwanded warning messagges %[output:941c3111] %[output:83a393e6]
% (remove the magic code and see what happens)
%[text] The columns of the matrix `eigVect` represent the eigenvectors of the matrix $A$. The elements on the main diagonal of the matrix `LambdaDiag` are the eigenvalues.
[eigVH, LambdaH] = eig(sym(hilb(4))) %[output:1ce7fcf5] %[output:1e110b4d]
%[text]
%[text] The `eig` function cannot find the exact eigenvalues in terms of symbolic numbers. Instead, it returns them in terms of the `root` function.
%[text] Use `vpa` to numerically approximate the eigenvalues
lambdaH = eig(hilb(4));
lambdaH_vpa = vpa(lambdaH) %[output:1cebc07a]
%[text] To have some insight about the command vpa, please use
%[text] ```matlabCodeExample
%[text] help vpa
%[text] ```
%%
%[text] What about the **algebraic** and **geometric** **multiplicity** of the **eigenvalues**?
%[text] Have a look at the size of the command output matrix `eigVect`:
%[text] - If `eigVect` is the same size as `A`, then the matrix `A` has a full set of linearly independent eigenvectors.
%[text] - If `eigVect`has fewer columns than `A`, then at least one of the eigenvalues *λ* of the matrix $A$ has an algebraic multiplicity *m* \> 1 with fewer than *m* linearly independent eigenvectors associated with *λ*. \
%[text] Example:
A = sym([1 1 0; 0 1 0; 0 0 1]); % a symbolic matrix
lambda = eig(A) % just the eigenvalues of A %[output:8afb4766]
%[text] Please, note: there is only one eigenvalue, with algebraic multiplicity 3.
[eigVect, LambdaDiag] = eig(A) %[output:22ead94c] %[output:602841d7]
%[text] There are only two linearly independent eigenvectors: the geometric multiplicity is 2. The matrix $A$does not admit the diagonal form (but Jordan's canonical form).
%%
%[text] %[text:anchor:H_A493BFC4] #### Matrix Exponential of Symbolic Matrices
%[text]
%[text] What if we have to compute the matrix exponential $e^{A}$ ?
%[text]
%[text]{"align":"center"} $e^{A} = \\displaystyle \\sum\_{k=0}^{\\infty}\\, \\frac{1}{k!}\\, A^{k} = I + A + \\frac{A^2}{2} + \\cdots$
A = sym([1 1 0; 0 1 0; 0 0 1]); % a symbolic matrix
expm(A) %[output:92de10b3]
%[text]
%%
%[text] %[text:anchor:H_AD0C52FF] ## The Laplace Transform
%[text] - For a detailed analysis of definition, fundamental properties and theorems regarding the Laplace Transform, refer to the [Part6-L1 live script](file:./Intro_MATLAB4DDDS_p6L_1_LAPLACE.m).
%[text] - You find a few applications of the Laplace Transform in the [live script Part6-L2](file:./Intro_MATLAB4DDDS_p6L_2_LAPLACE_APPLIC.m). \
%[text] You can use the symbolic toolbox to calculate Laplace transforms in MATLAB. For example:
syms t s % t and s are now symbolic variables
f = exp(-t) * cos(2 * t);
F = laplace(f, t, s) %[output:938d07e1]
%[text] You can also calculate the inverse Laplace transform:
ilaplace(F, s, t) %[output:71e1081c]
%[text] and the Laplace transform of unitary steps:
laplace(heaviside(t), t, s) %[output:8158ccba]
%[text]
%[text] MATLAB also knows many of the properties and tricks you also know:
F = exp(-s)/(s + 1) %[output:4d87e3e3]
ilaplace(F, s, t) %[output:836224fd]
%%
%[text] %[text:anchor:H_C8BB81B3] ### Laplace Transform: Rational Functions
%[text]
%[text] Standard MATLAB (not the symbolic toolbox) have a number of functions specialized to polynomial and rational functions. Polynomials are represented by their coefficients. The vectors:
num = [2] %[output:6a02b0ea]
den = [1 2 2] %[output:53bced9f]
%[text] can be used to represent the numerator and denominator of the rational function:
%[text]{"align":"center"} $F(s) = \\frac{2}{s^2 + 2 s + 2}$
%[text] For example:
[r,p,k] = residue(num, den) %[output:0eb1563a] %[output:1cfe4c0a] %[output:6f176826]
%[text] calculates its partial-fraction expansion. `r` contain the residues and `p` the corresponding poles. In this case this partial-fraction leads to the inverse Laplace transform:
%[text]{"align":"center"} $f(s) = j e^{(-1 -j) t} - j e^{(-1+j)t} = 2 \\sin(t) e^{-t}, \\quad t \\geq 0$
%[text] as show in Section 3.5. The output parameter `k` contains the remaining polynomial when $F(s)$ is not strictly proper. For example, for
%[text]{"align":"center"} $F(s) = \\frac{s-1}{s+1} = 1-\\frac{2}{s+1}$
num = [1 -1] %[output:844b67a2]
den = [1 1] %[output:4896e86a]
[r,p,k] = residue(num, den) %[output:80e17e73] %[output:6fcc0e83] %[output:5a65fa2f]
%[text] has a non-zero polynomial *remainder* $r = 1$.
%%
%[text] %[text:anchor:H_FE32E8BB] ### The State Movement of a Continuous-time LTI System
%[text]
%[text] Consider
%[text]{"align":"center"} $\\left\\{ \n\\begin{array}{lcl}\n\\dot{x} &=& \\left\[ \\begin{array}{cc}\n0 & 1 \\\\ 0 &-a\n\\end{array} \\right\] \\, x + \\left\[ \\begin{array}{c}\n0 \\\\ K\n\\end{array} \\right\]\\, u\\\\ \\\\\ny &=& \\left\[ \\begin{array}{cc} 1 & 0 \\end{array} \\right\] \\, x\n\\end{array}\n\\right.$
%[text]
%[text] and compute the state movement, starting from the initial state
%[text]{"align":"center"} $x(0) = \\left\[ \\begin{array}{c} 1\\\\0 \\end{array} \\right\]$
%[text] with the input
%[text]{"align":"center"} $u(t) = 2 \\sin \\left(4 t+\\frac{\\pi}{3}\\right) \\cdot 1(t)$
%[text] The state movement is expressed by
%[text]{"align":"center"} $x(t) = \\displaystyle e^{At}\\cdot x(0) + \\displaystyle \\int\_{0}^{t} e^{A(t-\\tau)} \\cdot B u(\\tau)\\,d \\, \\tau $
%[text] Let's compute the state movement, using the Symbolic Math Toolbox
syms s % the Laplace transform variable
syms a K % the symbolic parameters into the state equations
syms t % the time as symbolic variable
% assigning the state equation matrices
A = [0 , 1; 0 -a] %[output:1fa2ea6e]
x0 = [1; 0]; % the initial state
B = [0; K] %[output:72327575]
C = [1 0];
D = 0;
%[text] Now define the symbolic matrix $(s I -A)$, used in the Laplace transform of the exponential matrix
%[text]{"align":"center"} $\\displaystyle \\mathcal{L}\\big\\{ e^{At}\\big\\} = \\displaystyle \\left(sI-A\\right)^{-1}$
% now define the symbolic matrix (sI-A)
sIA = s*eye(size(A))-A;
sIA_inv = inv(sIA) %[output:0f716121]
%[text] Now, let's compute the movement using the Laplace transform
Us = laplace(2*sin(4*t+pi/3)) % the Laplace transform of the input %[output:3954a74b]
Xs = sIA_inv*x0 + sIA_inv*B*Us % the Laplace transform of the state movement %[output:5f26cfe0]
%[text] Finally, by using the inverse Laplace transform
xt = ilaplace(Xs) %[output:58c6b503]
%[text]
%%
%[text] %[text:anchor:H_C44CE671] ## The Z-Transform
%[text]
%[text] For a detailed analysis of definition, fundamental properties and theorems regarding the Z-Transform, refer to the [Part6-Z live script](file:./Intro_MATLAB4DDDS_p6Z_ZTRANSFORM.m).
%[text]
%[text] You can use the symbolic toolbox to calculate Z-transforms in MATLAB. For example:
syms n % the time samples variable
%[text] By default, the independent variable is $n$and the transformation variable is $z$.
f = sin(n);
F = ztrans(f) %[output:50b5def5]
%[text] You can also calculate the inverse Z-transform:
iztrans(F) %[output:0e441cf3]
%[text] and the Z-transform of unitary steps:
syms n
sympref('HeavisideAtOrigin',1); % Pay attention: the default value of the Heaviside function at the origin is 1/2.
collect(ztrans(heaviside(n))) %[output:5de3e669]
%[text] Check what happens if you restore the default preferences, by typing
%[text] ```matlabCodeExample
%[text] sympref('HeavisideAtOrigin', 'default');
%[text] ```
%[text] and execute the previous code.
%[text] You can also compute the Z-transform of the unitary impulse function
syms n
f = kroneckerDelta(n) %[output:7c9e1628]
F = ztrans(f) %[output:093352a3]
%%
%[text] %[text:anchor:H_78497451] ### **Z-Transforms Involving Heaviside Function and Binomial Coefficient**
%[text]
%[text] Let's compute the Z-transform of the sequence
%[text]{"align":"center"} $x(n) = 1(n-3) + \\displaystyle \\left(\\begin{array}{c} n \\\\ 2 \\end{array} \\right) \\cdot 1(n-2)$
%[text]{"align":"center"}
syms n z
x = nchoosek(n,2)*heaviside(n-2) %[output:50bd94c4]
Xz = simplify(ztrans(x,z)) %[output:9a013868]
%%
%[text] %[text:anchor:H_11618324] ### Inverse Z-transform
syms z a
F = 1/(a*z);
iztrans(F) %[output:9d57ec06]
%[text] Compute the inverse Z-transforms of delayed sequences. The results involve the Kronecker Delta function:
syms n z
iztrans(1/z,z,n) %[output:57999866]
f = (z^3 + 3*z^2)/z^5;
iztrans(f,z,n) %[output:4f756db7]
%[text]
%[text]
%%
%[text] %[text:anchor:H_BE2690D8] ## Summary
%[text]
%[text] Using this live script you have:
%[text] - learned how to define and manage symbolic variables;
%[text] - learned how to perform linear algebraic operations, such as computing the inverse, or the determinant, or the eigenvalues of a square matrix;
%[text] - learned how to apply the Laplace and the Z-transform. \
%[text]
%[text] %[text:anchor:H_B713125A] #### Back to the Index
%[text] Use [this link](file:./usingMATLAB_454MI_Data_Driven_Digital_Systems.m) to go back to the main live script of the collection.
%[text]
%[text] %[text:anchor:H_C8A86778] #### Back to the Previous Part: LTI Systems
%[text] Use [this link](file:./Intro_MATLAB4DDDS_p6.m) to go back to the previous live script of this collection.
%[text]
%[text] %[text:anchor:H_A2D5477B] #### Go to the Next Part: Visualization & Programming
%[text] Use [this link](file:./Intro_MATLAB4DDDS_p7.m) to go to the next live script of the collection.
%[text]
%[text]
%[appendix]{"version":"1.0"}
%---
%[metadata:view]
% data: {"layout":"inline","rightPanelPercent":40}
%---
%[output:9604bc4a]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"1"}}
%---
%[output:4db7f541]
% data: {"dataType":"symbolic","outputData":{"name":"","value":"x"}}
%---
%[output:2cc2848c]
% data: {"dataType":"text","outputData":{"text":" Name Size Bytes Class Attributes\n\n x 1x1 8 sym \n\n","truncated":false}}
%---
%[output:07a685ce]
% data: {"dataType":"symbolic","outputData":{"name":"","value":"y"}}
%---
%[output:0c658c5a]
% data: {"dataType":"symbolic","outputData":{"name":"","value":"2\\,y^2 -\\frac{\\sqrt{\\left|x-\\pi \\right|}}{\\sin \\left(2\\,x-\\frac{\\pi }{6}\\right)}"}}
%---
%[output:4ceb629d]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\left(\\begin{array}{ccccc}\na\\in \\mathbb{Z} & b\\in \\mathbb{Z} & c\\in \\mathbb{Q} & d\\in \\mathbb{R} & 0adjoint<\/strong> - Classical adjoint (adjugate) of square matrix\n This MATLAB function returns the Classical Adjoint (Adjugate) Matrix X\n of A, such that A*X = det(A)*eye(n) = X*A, where n is the number of rows\n in A.\n\n Syntax\n X = adjoint<\/strong>(A)\n\n Input Arguments\n A<\/a> - Square matrix\n numeric matrix | matrix of symbolic scalar variables |\n symbolic function | symbolic matrix variable |\n symbolic matrix function | symbolic expression\n\n Examples\n Classical Adjoint (Adjugate) of Matrix<\/a>\n Compute Inverse Using Classical Adjoint and Determinant<\/a>\n\n See also ctranspose<\/a>, det<\/a>, inv<\/a>, rank<\/a>\n\n Introduced in Symbolic Math Toolbox in R2013a\n Documentation for adjoint<\/a>\n Other uses of adjoint<\/a>\n\n","truncated":false}}
%---
%[output:6e6d8bc0]
% data: {"dataType":"symbolic","outputData":{"name":"X","value":""}}
%---
%[output:4d444332]
% data: {"dataType":"matrix","outputData":{"columns":4,"name":"A","rows":4,"type":"double","value":[["16","2","3","13"],["5","11","10","8"],["9","7","6","12"],["4","14","15","1"]]}}
%---
%[output:326d0380]
% data: {"dataType":"matrix","outputData":{"columns":4,"exponent":"3","name":"XA","rows":4,"type":"double","value":[["-0.1360","-0.4080","0.4080","0.1360"],["-0.4080","-1.2240","1.2240","0.4080"],["0.4080","1.2240","-1.2240","-0.4080"],["0.1360","0.4080","-0.4080","-0.1360"]]}}
%---
%[output:061a4431]
% data: {"dataType":"symbolic","outputData":{"name":"Rh","value":"\\left(\\begin{array}{cccccccccccccccccccc}\n1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\\\\n0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\n\\end{array}\\right)"}}
%---
%[output:80c7be36]
% data: {"dataType":"symbolic","outputData":{"name":"Ra","value":"\\left(\\begin{array}{ccc}\n1 & 0 & 0\\\\\n0 & 1 & 0\\\\\n0 & 0 & 1\\\\\n1 & 3 & -3\n\\end{array}\\right)"}}
%---
%[output:59e405df]
% data: {"dataType":"text","outputData":{"text":"ZH =\nEmpty sym: 20-by-0\n","truncated":false}}
%---
%[output:9cd73ebb]
% data: {"dataType":"symbolic","outputData":{"name":"ZA","value":"\\left(\\begin{array}{c}\n-1\\\\\n-3\\\\\n3\\\\\n1\n\\end{array}\\right)"}}
%---
%[output:82150b4e]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\left(\\begin{array}{ccccccccccccccccccccc}\n1 & -\\frac{414022624965424}{166966608033225} & \\frac{2698414167013008194396351845661}{2378909712906290782097399520000} & -\\frac{6547179721012391279445094414617879414083}{80600342041651069188267336588963932437500} & \\frac{136188563233554147383410992787463579982662498703390803287}{193202096915842645747135882032170443640532663891763200000000} & -\\frac{4660639790870904136358413203209654215671508090686639080430421297}{7784338510363090659308343591445037532102744496420964865113280000000000} & \\frac{135986028652491908407319133775476921570877909036725291441010891079116938893309}{3280532984622363015396784946531586854209609971525791357957425403731960804147200000000000} & -\\frac{640452791043036371530490632907720547485013148899721084537799027714320549383710634721}{3238324539598441515436416194848640381987303630285697476355292923645304450907798142658560000000000000} & \\frac{21859310988401900882689279488325485177261237480462035279480079431064745837802901094440094931}{394845254665116084179205470942552107270468664327053812205478562684014828760739053586666485643739136000000000000000} & -\\frac{139774200289019034257707169077960171333463042674664567930720148511714093237751791621283119788984289}{180071449543749300939396609196008972986142402526949054275336516993080813022835339307985815662589966509761993113600000000000000000} & \\frac{62431324070876064284826360370064857921270328888627942129816651601974431908798391957055772916398897437299}{134208810780996262015278360898603199487094854003210684172805439739612595657095714190472428144058578372444224791363595114905600000000000000000000} & -\\frac{1547342890189667820705829053119272229868471311462024612597978093115774315050562579959246432371821592361}{152629072473544194553515099856263838390663543824447169041175928365525413213065544766426359175537016464387526897803689922857275228160000000000000000000000} & \\frac{1023815049513870615809070225651935950581330197744218818807279637432320098657084591638706401755939509222917}{150628329264930206963976668743647748745185100152258685801073757866794317295492345816924073988469136334109341537320466972666809473075317787590656000000000000000000000000} & -\\frac{72150476899488220503693014196279636032513113523142362790445674599521218651730577970574909534696183}{613711356556746006476436434227956645351907841046760236972622044475840092342285368145232906135591190707750785463350884293936791217175412626949773721600000000000000000000000000} & \\frac{7034956005773420323036489072814258118149695232279266709705102572180648872902335012044621969710171}{161931668693138064419815571624525465595324742319096325136034027154562199245076287728638163614418169142655405403861072922899441782447285034311102814248637814538240000000000000000000000000000} & -\\frac{181726658664028044867399827378667307846749954915634787274093767484777161998685732620781}{651306503232716107529955662459241860115635613208731760475678573357618052099084778816003649860639231986426090370688867301362833929881257968975584129131108839588888576000000000000000000000000000000} & \\frac{13565846357702257272678409334245943448814724162077859661019957911157872316968721}{549375068843783395450576592432648600077557183377518443931509485106185002150717336702827748158108364983176639574367663466250956608750533141774842731766300712227464198415166996480000000000000000000000000000000} & -\\frac{20303383124382032696495889150313819635508779005504875175052026311}{883858130876013601077505349716008590572964817034665022605393277388661540005478628873486871049732756599310419997124474600096687861237669850687499222320078330580786640721315313274060800000000000000000000000000000000} & \\frac{52123903542185798578629518387349041347952431987}{323833321996367891071652533974558194422935032929264260247518978320041919923537728177452567126590085736156390959363838805133164217569847622233107541155853116626287796824419025527083368448000000000000000000000000000000000} & -\\frac{10068411192818585082271541}{1857386497475417585227847065177825343887046748244911322682176040026890436961441082177801380325448260500441999896301217946691905015399057268270767440742040032049651944661058373288777545154560000000000000000000000000000000000} & \\frac{1}{2377454716768534509091644243427616440175419837753486493033185331234419759310644585187585766816573773440565759867265558971765638419710793303386582324149811241023554489166154717809635257797836800000000000000000000000000000000000}\n\\end{array}\\right)"}}
%---
%[output:0bb530a1]
% data: {"dataType":"symbolic","outputData":{"name":"polyA","value":"x^3 -3\\,x^2 +3\\,x-1"}}
%---
%[output:6ab8f856]
% data: {"dataType":"symbolic","outputData":{"name":"polyH","value":"x^{20} -\\frac{414022624965424\\,x^{19} }{166966608033225}+\\frac{2698414167013008194396351845661\\,x^{18} }{2378909712906290782097399520000}-\\frac{6547179721012391279445094414617879414083\\,x^{17} }{80600342041651069188267336588963932437500}+\\frac{136188563233554147383410992787463579982662498703390803287\\,x^{16} }{193202096915842645747135882032170443640532663891763200000000}-\\frac{4660639790870904136358413203209654215671508090686639080430421297\\,x^{15} }{7784338510363090659308343591445037532102744496420964865113280000000000}+\\frac{135986028652491908407319133775476921570877909036725291441010891079116938893309\\,x^{14} }{3280532984622363015396784946531586854209609971525791357957425403731960804147200000000000}-\\frac{640452791043036371530490632907720547485013148899721084537799027714320549383710634721\\,x^{13} }{3238324539598441515436416194848640381987303630285697476355292923645304450907798142658560000000000000}+\\frac{21859310988401900882689279488325485177261237480462035279480079431064745837802901094440094931\\,x^{12} }{394845254665116084179205470942552107270468664327053812205478562684014828760739053586666485643739136000000000000000}-\\frac{139774200289019034257707169077960171333463042674664567930720148511714093237751791621283119788984289\\,x^{11} }{180071449543749300939396609196008972986142402526949054275336516993080813022835339307985815662589966509761993113600000000000000000}+\\frac{62431324070876064284826360370064857921270328888627942129816651601974431908798391957055772916398897437299\\,x^{10} }{134208810780996262015278360898603199487094854003210684172805439739612595657095714190472428144058578372444224791363595114905600000000000000000000}-\\frac{1547342890189667820705829053119272229868471311462024612597978093115774315050562579959246432371821592361\\,x^9 }{152629072473544194553515099856263838390663543824447169041175928365525413213065544766426359175537016464387526897803689922857275228160000000000000000000000}+\\frac{1023815049513870615809070225651935950581330197744218818807279637432320098657084591638706401755939509222917\\,x^8 }{150628329264930206963976668743647748745185100152258685801073757866794317295492345816924073988469136334109341537320466972666809473075317787590656000000000000000000000000}-\\frac{72150476899488220503693014196279636032513113523142362790445674599521218651730577970574909534696183\\,x^7 }{613711356556746006476436434227956645351907841046760236972622044475840092342285368145232906135591190707750785463350884293936791217175412626949773721600000000000000000000000000}+\\frac{7034956005773420323036489072814258118149695232279266709705102572180648872902335012044621969710171\\,x^6 }{161931668693138064419815571624525465595324742319096325136034027154562199245076287728638163614418169142655405403861072922899441782447285034311102814248637814538240000000000000000000000000000}-\\frac{181726658664028044867399827378667307846749954915634787274093767484777161998685732620781\\,x^5 }{651306503232716107529955662459241860115635613208731760475678573357618052099084778816003649860639231986426090370688867301362833929881257968975584129131108839588888576000000000000000000000000000000}+\\frac{13565846357702257272678409334245943448814724162077859661019957911157872316968721\\,x^4 }{549375068843783395450576592432648600077557183377518443931509485106185002150717336702827748158108364983176639574367663466250956608750533141774842731766300712227464198415166996480000000000000000000000000000000}-\\frac{20303383124382032696495889150313819635508779005504875175052026311\\,x^3 }{883858130876013601077505349716008590572964817034665022605393277388661540005478628873486871049732756599310419997124474600096687861237669850687499222320078330580786640721315313274060800000000000000000000000000000000}+\\frac{52123903542185798578629518387349041347952431987\\,x^2 }{323833321996367891071652533974558194422935032929264260247518978320041919923537728177452567126590085736156390959363838805133164217569847622233107541155853116626287796824419025527083368448000000000000000000000000000000000}-\\frac{10068411192818585082271541\\,x}{1857386497475417585227847065177825343887046748244911322682176040026890436961441082177801380325448260500441999896301217946691905015399057268270767440742040032049651944661058373288777545154560000000000000000000000000000000000}+\\frac{1}{2377454716768534509091644243427616440175419837753486493033185331234419759310644585187585766816573773440565759867265558971765638419710793303386582324149811241023554489166154717809635257797836800000000000000000000000000000000000}"}}
%---
%[output:14afdc8f]
% data: {"dataType":"symbolic","outputData":{"name":"lambda","value":"\\left(\\begin{array}{c}\n1\\\\\n1\\\\\n1\n\\end{array}\\right)"}}
%---
%[output:941c3111]
% data: {"dataType":"symbolic","outputData":{"name":"eigVect","value":"\\left(\\begin{array}{cc}\n1 & 0\\\\\n0 & 0\\\\\n0 & 1\n\\end{array}\\right)"}}
%---
%[output:83a393e6]
% data: {"dataType":"symbolic","outputData":{"name":"LambdaDiag","value":"\\left(\\begin{array}{ccc}\n1 & 0 & 0\\\\\n0 & 1 & 0\\\\\n0 & 0 & 1\n\\end{array}\\right)"}}
%---
%[output:1ce7fcf5]
% data: {"dataType":"symbolic","outputData":{"name":"eigVH","value":"\\begin{array}{l}\n\\left(\\begin{array}{cccc}\n\\frac{492931}{22050}-240\\,{\\sigma_3 }^3 -\\sigma_7 -\\frac{5617\\,\\sigma_{12} }{\\sigma_{10} }-\\frac{2760\\,{\\sigma_3 }^2 }{7} & \\frac{492931}{22050}+240\\,{\\sigma_4 }^3 -\\sigma_7 +\\frac{5617\\,\\sigma_{12} }{\\sigma_{10} }-\\frac{2760\\,{\\sigma_4 }^2 }{7} & \\frac{492931}{22050}+240\\,{\\sigma_1 }^3 +\\sigma_7 -\\frac{5617\\,\\sigma_{11} }{\\sigma_{10} }-\\frac{2760\\,{\\sigma_1 }^2 }{7} & \\frac{492931}{22050}+240\\,{\\sigma_2 }^3 +\\sigma_7 +\\frac{5617\\,\\sigma_{11} }{\\sigma_{10} }-\\frac{2760\\,{\\sigma_2 }^2 }{7}\\\\\n1870\\,{\\sigma_3 }^2 +1120\\,{\\sigma_3 }^3 +\\sigma_5 +\\frac{44719\\,\\sigma_{12} }{\\sigma_8 }-\\frac{31305881}{264600} & 1870\\,{\\sigma_4 }^2 -1120\\,{\\sigma_4 }^3 +\\sigma_5 -\\frac{44719\\,\\sigma_{12} }{\\sigma_8 }-\\frac{31305881}{264600} & 1870\\,{\\sigma_1 }^2 -1120\\,{\\sigma_1 }^3 -\\sigma_5 +\\frac{44719\\,\\sigma_{11} }{\\sigma_8 }-\\frac{31305881}{264600} & 1870\\,{\\sigma_2 }^2 -1120\\,{\\sigma_2 }^3 -\\sigma_5 -\\frac{44719\\,\\sigma_{11} }{\\sigma_8 }-\\frac{31305881}{264600}\\\\\n\\frac{867047}{7875}-984\\,{\\sigma_3 }^3 -\\sigma_6 -\\frac{39971\\,\\sigma_{12} }{\\sigma_9 }-\\frac{11568\\,{\\sigma_3 }^2 }{7} & \\frac{867047}{7875}+984\\,{\\sigma_4 }^3 -\\sigma_6 +\\frac{39971\\,\\sigma_{12} }{\\sigma_9 }-\\frac{11568\\,{\\sigma_4 }^2 }{7} & \\frac{867047}{7875}+984\\,{\\sigma_1 }^3 +\\sigma_6 -\\frac{39971\\,\\sigma_{11} }{\\sigma_9 }-\\frac{11568\\,{\\sigma_1 }^2 }{7} & \\frac{867047}{7875}+984\\,{\\sigma_2 }^3 +\\sigma_6 +\\frac{39971\\,\\sigma_{11} }{\\sigma_9 }-\\frac{11568\\,{\\sigma_2 }^2 }{7}\\\\\n1 & 1 & 1 & 1\n\\end{array}\\right)\\\\\n\\\\\n\\textrm{where}\\\\\n\\\\\n\\;\\;\\sigma_1 =\\sigma_{13} -\\frac{\\sigma_{11} }{\\sigma_{14} }+\\frac{44}{105}\\\\\n\\\\\n\\;\\;\\sigma_2 =\\sigma_{13} +\\frac{\\sigma_{11} }{\\sigma_{14} }+\\frac{44}{105}\\\\\n\\\\\n\\;\\;\\sigma_3 =\\sigma_{13} +\\frac{\\sigma_{12} }{\\sigma_{14} }-\\frac{44}{105}\\\\\n\\\\\n\\;\\;\\sigma_4 =\\frac{44}{105}+\\frac{\\sigma_{12} }{\\sigma_{14} }-\\sigma_{13} \\\\\n\\\\\n\\;\\;\\sigma_5 =\\frac{44719\\,\\sqrt{\\sigma_{19} }}{945\\,{\\sigma_{20} }^{1\/6} }\\\\\n\\\\\n\\;\\;\\sigma_6 =\\frac{39971\\,\\sqrt{\\sigma_{19} }}{900\\,{\\sigma_{20} }^{1\/6} }\\\\\n\\\\\n\\;\\;\\sigma_7 =\\frac{5617\\,\\sqrt{\\sigma_{19} }}{630\\,{\\sigma_{20} }^{1\/6} }\\\\\n\\\\\n\\;\\;\\sigma_8 =945\\,{\\sigma_{20} }^{1\/6} \\,{\\sigma_{19} }^{1\/4} \\\\\n\\\\\n\\;\\;\\sigma_9 =900\\,{\\sigma_{20} }^{1\/6} \\,{\\sigma_{19} }^{1\/4} \\\\\n\\\\\n\\;\\;\\sigma_{10} =630\\,{\\sigma_{20} }^{1\/6} \\,{\\sigma_{19} }^{1\/4} \\\\\n\\\\\n\\;\\;\\sigma_{11} =\\sqrt{\\sigma_{16} -\\sigma_{17} +\\sigma_{15} -\\sigma_{18} }\\\\\n\\\\\n\\;\\;\\sigma_{12} =\\sqrt{\\sigma_{16} -\\sigma_{17} -\\sigma_{15} -\\sigma_{18} }\\\\\n\\\\\n\\;\\;\\sigma_{13} =\\frac{\\sqrt{\\sigma_{19} }}{6\\,{\\sigma_{20} }^{1\/6} }\\\\\n\\\\\n\\;\\;\\sigma_{14} =6\\,{\\sigma_{20} }^{1\/6} \\,{\\sigma_{19} }^{1\/4} \\\\\n\\\\\n\\;\\;\\sigma_{15} =\\frac{426224\\,\\sqrt{6}\\,\\sqrt{\\frac{3805076179}{125023500000}+\\frac{\\sigma_{21} }{41674500}}}{385875}\\\\\n\\\\\n\\;\\;\\sigma_{16} =\\frac{69541\\,{\\sigma_{20} }^{1\/3} \\,\\sqrt{\\sigma_{19} }}{7350}\\\\\n\\\\\n\\;\\;\\sigma_{17} =9\\,{\\sigma_{20} }^{2\/3} \\,\\sqrt{\\sigma_{19} }\\\\\n\\\\\n\\;\\;\\sigma_{18} =\\frac{349183\\,\\sqrt{\\sigma_{19} }}{5670000}\\\\\n\\\\\n\\;\\;\\sigma_{19} =\\frac{69541\\,{\\sigma_{20} }^{1\/3} }{14700}+9\\,{\\sigma_{20} }^{2\/3} +\\frac{349183}{5670000}\\\\\n\\\\\n\\;\\;\\sigma_{20} =\\frac{3805076179}{6751269000000}+\\frac{\\sigma_{21} }{2250423000}\\\\\n\\\\\n\\;\\;\\sigma_{21} =\\sqrt{3}\\,\\sqrt{4621318097}\\,\\mathrm{i}\n\\end{array}"}}
%---
%[output:1e110b4d]
% data: {"dataType":"symbolic","outputData":{"name":"LambdaH","value":"\\begin{array}{l}\n\\left(\\begin{array}{cccc}\n\\frac{44}{105}-\\sigma_1 -\\sigma_3 & 0 & 0 & 0\\\\\n0 & \\frac{44}{105}+\\sigma_1 -\\sigma_3 & 0 & 0\\\\\n0 & 0 & \\sigma_3 -\\sigma_2 +\\frac{44}{105} & 0\\\\\n0 & 0 & 0 & \\sigma_3 +\\sigma_2 +\\frac{44}{105}\n\\end{array}\\right)\\\\\n\\\\\n\\textrm{where}\\\\\n\\\\\n\\;\\;\\sigma_1 =\\frac{\\sqrt{\\frac{69541\\,{\\sigma_5 }^{1\/3} \\,\\sqrt{\\sigma_4 }}{7350}-9\\,{\\sigma_5 }^{2\/3} \\,\\sqrt{\\sigma_4 }-\\frac{426224\\,\\sqrt{6}\\,\\sqrt{\\frac{3805076179}{125023500000}+\\frac{\\sqrt{3}\\,\\sqrt{4621318097}\\,\\mathrm{i}}{41674500}}}{385875}-\\frac{349183\\,\\sqrt{\\sigma_4 }}{5670000}}}{6\\,{\\sigma_5 }^{1\/6} \\,{\\sigma_4 }^{1\/4} }\\\\\n\\\\\n\\;\\;\\sigma_2 =\\frac{\\sqrt{\\frac{69541\\,{\\sigma_5 }^{1\/3} \\,\\sqrt{\\sigma_4 }}{7350}-9\\,{\\sigma_5 }^{2\/3} \\,\\sqrt{\\sigma_4 }+\\frac{426224\\,\\sqrt{6}\\,\\sqrt{\\frac{3805076179}{125023500000}+\\frac{\\sqrt{3}\\,\\sqrt{4621318097}\\,\\mathrm{i}}{41674500}}}{385875}-\\frac{349183\\,\\sqrt{\\sigma_4 }}{5670000}}}{6\\,{\\sigma_5 }^{1\/6} \\,{\\sigma_4 }^{1\/4} }\\\\\n\\\\\n\\;\\;\\sigma_3 =\\frac{\\sqrt{\\sigma_4 }}{6\\,{\\sigma_5 }^{1\/6} }\\\\\n\\\\\n\\;\\;\\sigma_4 =\\frac{69541\\,{\\sigma_5 }^{1\/3} }{14700}+9\\,{\\sigma_5 }^{2\/3} +\\frac{349183}{5670000}\\\\\n\\\\\n\\;\\;\\sigma_5 =\\frac{3805076179}{6751269000000}+\\frac{\\sqrt{3}\\,\\sqrt{4621318097}\\,\\mathrm{i}}{2250423000}\n\\end{array}"}}
%---
%[output:1cebc07a]
% data: {"dataType":"symbolic","outputData":{"name":"lambdaH_vpa","value":"\\left(\\begin{array}{c}\n0\\ldotp 000096702304022670099951236588609049\\\\\n0\\ldotp 0067382736057607093074772741658762\\\\\n0\\ldotp 16914122022144989498926292981196\\\\\n1\\ldotp 5002142800592430660344689385965\n\\end{array}\\right)"}}
%---
%[output:8afb4766]
% data: {"dataType":"symbolic","outputData":{"name":"lambda","value":"\\left(\\begin{array}{c}\n1\\\\\n1\\\\\n1\n\\end{array}\\right)"}}
%---
%[output:22ead94c]
% data: {"dataType":"symbolic","outputData":{"name":"eigVect","value":"\\left(\\begin{array}{cc}\n1 & 0\\\\\n0 & 0\\\\\n0 & 1\n\\end{array}\\right)"}}
%---
%[output:602841d7]
% data: {"dataType":"symbolic","outputData":{"name":"LambdaDiag","value":"\\left(\\begin{array}{ccc}\n1 & 0 & 0\\\\\n0 & 1 & 0\\\\\n0 & 0 & 1\n\\end{array}\\right)"}}
%---
%[output:92de10b3]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\left(\\begin{array}{ccc}\n\\mathrm{e} & \\mathrm{e} & 0\\\\\n0 & \\mathrm{e} & 0\\\\\n0 & 0 & \\mathrm{e}\n\\end{array}\\right)"}}
%---
%[output:938d07e1]
% data: {"dataType":"symbolic","outputData":{"name":"F","value":"\\frac{s+1}{{\\left(s+1\\right)}^2 +4}"}}
%---
%[output:71e1081c]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\cos \\left(2\\,t\\right)\\,{\\mathrm{e}}^{-t}"}}
%---
%[output:8158ccba]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\frac{1}{s}"}}
%---
%[output:4d87e3e3]
% data: {"dataType":"symbolic","outputData":{"name":"F","value":"\\frac{{\\mathrm{e}}^{-s} }{s+1}"}}
%---
%[output:836224fd]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\mathrm{h}\\mathrm{e}\\mathrm{a}\\mathrm{v}\\mathrm{i}\\mathrm{s}\\mathrm{i}\\mathrm{d}\\mathrm{e}\\left(t-1\\right)\\,{\\mathrm{e}}^{1-t}"}}
%---
%[output:6a02b0ea]
% data: {"dataType":"textualVariable","outputData":{"name":"num","value":"2"}}
%---
%[output:53bced9f]
% data: {"dataType":"matrix","outputData":{"columns":3,"name":"den","rows":1,"type":"double","value":[["1","2","2"]]}}
%---
%[output:0eb1563a]
% data: {"dataType":"matrix","outputData":{"columns":1,"name":"r","rows":2,"type":"complex","value":[["0.0000 - 1.0000i"],["0.0000 + 1.0000i"]]}}
%---
%[output:1cfe4c0a]
% data: {"dataType":"matrix","outputData":{"columns":1,"name":"p","rows":2,"type":"complex","value":[["-1.0000 + 1.0000i"],["-1.0000 - 1.0000i"]]}}
%---
%[output:6f176826]
% data: {"dataType":"text","outputData":{"text":"k =\n []\n","truncated":false}}
%---
%[output:844b67a2]
% data: {"dataType":"matrix","outputData":{"columns":2,"name":"num","rows":1,"type":"double","value":[["1","-1"]]}}
%---
%[output:4896e86a]
% data: {"dataType":"matrix","outputData":{"columns":2,"name":"den","rows":1,"type":"double","value":[["1","1"]]}}
%---
%[output:80e17e73]
% data: {"dataType":"textualVariable","outputData":{"name":"r","value":"-2"}}
%---
%[output:6fcc0e83]
% data: {"dataType":"textualVariable","outputData":{"name":"p","value":"-1"}}
%---
%[output:5a65fa2f]
% data: {"dataType":"textualVariable","outputData":{"name":"k","value":"1"}}
%---
%[output:1fa2ea6e]
% data: {"dataType":"symbolic","outputData":{"name":"A","value":"\\left(\\begin{array}{cc}\n0 & 1\\\\\n0 & -a\n\\end{array}\\right)"}}
%---
%[output:72327575]
% data: {"dataType":"symbolic","outputData":{"name":"B","value":"\\left(\\begin{array}{c}\n0\\\\\nK\n\\end{array}\\right)"}}
%---
%[output:0f716121]
% data: {"dataType":"symbolic","outputData":{"name":"sIA_inv","value":"\\left(\\begin{array}{cc}\n\\frac{1}{s} & \\frac{1}{s\\,\\left(a+s\\right)}\\\\\n0 & \\frac{1}{a+s}\n\\end{array}\\right)"}}
%---
%[output:3954a74b]
% data: {"dataType":"symbolic","outputData":{"name":"Us","value":"\\frac{2\\,\\left(\\frac{\\sqrt{3}\\,s}{2}+2\\right)}{s^2 +16}"}}
%---
%[output:5f26cfe0]
% data: {"dataType":"symbolic","outputData":{"name":"Xs","value":"\\left(\\begin{array}{c}\n\\frac{1}{s}+\\frac{2\\,K\\,\\left(\\frac{\\sqrt{3}\\,s}{2}+2\\right)}{s\\,\\left(s^2 +16\\right)\\,\\left(a+s\\right)}\\\\\n\\frac{2\\,K\\,\\left(\\frac{\\sqrt{3}\\,s}{2}+2\\right)}{\\left(s^2 +16\\right)\\,\\left(a+s\\right)}\n\\end{array}\\right)"}}
%---
%[output:58c6b503]
% data: {"dataType":"symbolic","outputData":{"name":"xt","value":"\\begin{array}{l}\n\\left(\\begin{array}{c}\n\\frac{K+4\\,a}{4\\,a}-\\frac{4\\,K\\,\\sin \\left(4\\,t\\right)+4\\,\\sqrt{3}\\,K\\,\\cos \\left(4\\,t\\right)+K\\,a\\,\\cos \\left(4\\,t\\right)-\\sqrt{3}\\,K\\,a\\,\\sin \\left(4\\,t\\right)}{4\\,a^2 +64}-\\frac{\\sigma_1 }{a\\,\\left(a^2 +16\\right)}\\\\\n\\frac{4\\,\\sqrt{3}\\,K\\,\\sin \\left(4\\,t\\right)-4\\,K\\,\\cos \\left(4\\,t\\right)+K\\,a\\,\\sin \\left(4\\,t\\right)+\\sqrt{3}\\,K\\,a\\,\\cos \\left(4\\,t\\right)}{a^2 +16}+\\frac{\\sigma_1 }{a^2 +16}\n\\end{array}\\right)\\\\\n\\\\\n\\textrm{where}\\\\\n\\\\\n\\;\\;\\sigma_1 ={\\mathrm{e}}^{-a\\,t} \\,\\left(4\\,K-\\sqrt{3}\\,K\\,a\\right)\n\\end{array}"}}
%---
%[output:50b5def5]
% data: {"dataType":"symbolic","outputData":{"name":"F","value":"\\frac{z\\,\\sin \\left(1\\right)}{z^2 -2\\,\\cos \\left(1\\right)\\,z+1}"}}
%---
%[output:0e441cf3]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\sin \\left(n\\right)"}}
%---
%[output:5de3e669]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\frac{z}{z-1}"}}
%---
%[output:7c9e1628]
% data: {"dataType":"symbolic","outputData":{"name":"f","value":"\\delta_{n,0}"}}
%---
%[output:093352a3]
% data: {"dataType":"symbolic","outputData":{"name":"F","value":"1"}}
%---
%[output:50bd94c4]
% data: {"dataType":"symbolic","outputData":{"name":"x","value":"\\mathrm{h}\\mathrm{e}\\mathrm{a}\\mathrm{v}\\mathrm{i}\\mathrm{s}\\mathrm{i}\\mathrm{d}\\mathrm{e}\\left(n-2\\right)\\,\\left({{n}\\atop{2}}\\right)"}}
%---
%[output:9a013868]
% data: {"dataType":"symbolic","outputData":{"name":"Xz","value":"\\frac{z}{{\\left(z-1\\right)}^3 }"}}
%---
%[output:9d57ec06]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\frac{\\delta_{n-1,0} }{a}"}}
%---
%[output:57999866]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\delta_{n-1,0}"}}
%---
%[output:4f756db7]
% data: {"dataType":"symbolic","outputData":{"name":"ans","value":"\\delta_{n-2,0} +3\\,\\delta_{n-3,0}"}}
%---