Solution of Linear State-Space Equations: M. Sami Fadali Professor of Electrical Engineering UNR
Solution of Linear State-Space Equations: M. Sami Fadali Professor of Electrical Engineering UNR
Space Equations
M. Sami Fadali
Professor of Electrical Engineering
UNR
1
Outline
• Laplace solution of linear state-space
equations.
• Leverrier algorithm.
• Systematic manipulation of matrices to
obtain the solution.
2
First Order Equation
𝑥ሶ = 𝑎𝑥 + 𝑏𝑢
• Laplace transform to solve for x
𝑋 𝑠 − 𝑥 0 = 𝑎𝑋 𝑠 + 𝑏𝑈 𝑠
𝑥 0 𝑏𝑈 𝑠
𝑋 𝑠 = +
𝑠−𝑎 𝑠−𝑎
• Inverse Laplace transform
𝑡
𝑥 𝑡 = 𝑒 𝑎𝑡 𝑥 0 + න 𝑒 𝑎 𝑡−𝜏
𝑏𝑢 𝜏 𝑑𝜏
0
3
Linear State-Space Equations
𝒙ሶ 𝑡 = 𝐴𝒙 𝑡 + 𝐵𝒖 𝑡
𝒚 𝑡 = 𝐶𝒙 𝑡 + 𝐷𝒖 𝑡
1. Laplace transform to obtain their
solution 𝒙 𝑡 .
2. Substitute in the output equation to
obtain the output 𝒚 𝑡 .
4
Laplace Transformation
• Multiplication by a scalar (each matrix entry).
• Integration (each matrix entry).
• Use Laplace transform of derivative
L 𝑥ሶ 𝑡 = 𝑠𝑋 𝑠 − 𝑥 0
L 𝒙ሶ 𝑡 = 𝑠𝑋𝑖 𝑠 − 𝑥𝑖 0
= 𝑠 𝑋𝑖 𝑠 − 𝑥𝑖 0
= 𝑠𝑿 𝑠 − 𝒙(0)
= 𝐴𝑿 𝑠 + 𝐵𝑼 𝑠
5
State Equation
𝒙ሶ 𝑡 = 𝐴𝒙 𝑡 + 𝐵𝒖 𝑡 , 𝒙 0
• Laplace Transform & solve for 𝑋 𝑠
𝑠𝐼𝑛 − 𝐴 𝑿 𝑠 = 𝒙(0) + 𝐵𝑼 𝑠
−1
𝑿 𝑠 = 𝑠𝐼𝑛 − 𝐴 𝒙 0 + 𝐵𝑼 𝑠
−1
Resolvent Matrix: 𝑠𝐼𝑛 − 𝐴
• We need to inverse Laplace transform the
resolvent matrix to obtain the solution.
6
Matrix Exponential
• Expand resolvent
−1
−1
1 1
𝑠𝐼𝑛 − 𝐴 = 𝐼𝑛 − 𝐴
𝑠 𝑠
1 1 1 2 1 𝑖
= 𝐼𝑛 + 𝐴 + 2 𝐴 + ⋯ + 𝑖 𝐴 + ⋯
𝑠 𝑠 𝑠 𝑠
• Inverse Laplace transform
−1 −1
𝐴𝑡 2 𝐴𝑡 𝑖
L 𝑠𝐼𝑛 − 𝐴 = 𝐼𝑛 + 𝐴𝑡 + + ⋯+ +⋯
2! 𝑖!
𝑎𝑡 𝑖
• Scalar Exponential 𝑒 𝑎𝑡 = 1 + 𝑎𝑡 + ⋯ + +⋯
𝑖!
𝑖
∞ 𝐴𝑡
• Matrix Exponential 𝑒 𝐴𝑡
= σ𝑖=0
𝑖!
=L −1
𝑠𝐼𝑛 − 𝐴 −1
7
Zero-input Response
Due to initial conditions (input zero)
−1
𝑿𝑍𝐼 𝑠 = 𝑠𝐼𝑛 − 𝐴 𝒙 0
𝒙𝑍𝐼 𝑡 = 𝑒 𝐴𝑡 𝒙 0
∞ 𝑖
𝐴𝑡
𝑒 𝐴𝑡 =
𝑖!
𝑖=0
8
Zero-state Response
• Due to input (zero initial conditions)
• Use the convolution theorem.
−1
𝑿𝑍𝑆 𝑠 = 𝑠𝐼𝑛 − 𝐴 𝐵𝑼 𝑠
𝑡
𝒙𝑍𝑆 𝑡 = න 𝑒 𝐴 𝑡−𝜏
𝐵𝒖 𝜏 𝑑𝜏
0
9
Solution of State Equation
• Total Response (linear system)
𝒙 𝑡 = 𝒙𝑍𝐼 𝑡 +𝒙𝑍𝑆 𝑡
𝑡
𝒙 𝑡 = 𝑒 𝐴𝑡 𝒙 0 + න 𝑒 𝐴 𝑡−𝜏
𝐵𝒖 𝜏 𝑑𝜏
zero−input 0
response zero−state response
• Solution for nonzero initial time (shift time)
𝑡
𝒙 𝑡 = 𝑒𝐴 𝑡−𝑡0
𝒙 𝑡0 + න 𝑒 𝐴 𝑡−𝜏
𝐵𝒖 𝜏 𝑑𝜏
𝑡0
10
State-transition Matrix
• LTI case 𝜙 𝑡 − 𝑡0 = matrix exponential
• Zero-input response: multiply by state
transition matrix to change the system
state from 𝒙 0 to 𝒙 𝑡 .
• State-transition matrix for time-varying
systems 𝜙 𝑡, 𝑡0
• Not a matrix exponential (in general).
– Depends on initial & final time (not
difference between them).
11
Output
• Substitute the solution in the output equation
𝒚 𝑡 = 𝐶𝒙 𝑡 + 𝐷𝒖 𝑡
• Output Response
• zero-input response + zero-sate response
𝒚 𝑡
𝑡
= 𝐶 𝑒𝐴 𝑡−𝑡0
𝒙 𝑡0 + න 𝑒 𝐴 𝑡−𝜏
𝐵𝒖 𝜏 𝑑𝜏 + 𝐷𝒖 𝑡
𝑡0
12
Example: Matrix Exponential
0 1
𝒙ሶ 𝑡 = 𝒙 𝑡
−8 −6
• 𝐴 is in companion form
det 𝑠𝐼2 − 𝐴 = 𝑠 2 + 6𝑠 + 8 = 𝑠 + 2 𝑠 + 4
−1
𝑠 −1
𝑠𝐼2 − 𝐴 −1 =
8 𝑠+6
𝑠+6 1 6 1
𝑠𝐼2 +
= −8 𝑠 = −8 0
𝑠+2 𝑠+4 𝑠+2 𝑠+4
13
Partial Fractions: Matrix Coeffts.
−1 6 1 1/2 −1/2
𝑠𝐼2 − 𝐴 = +
−8 0 𝑠 + 2 𝑠 + 4
1 0 −1 2
+ +
0 1 𝑠+2 𝑠+4
3 − 1 0.5 2 − 3 −0.5
= −4 −1 + 4 2
𝑠+2 𝑠+4
• Inverse Laplace transform
𝐴𝑡 2 0.5 −2𝑡 −1 −0.5 −4𝑡
𝑒 = 𝑒 + 𝑒
−4 −1 4 2
14
Example: Zero-input Response
𝒙 0 = 1 −1 𝑇
𝐴𝑡 2 0.5 −2𝑡 −1 −0.5 −4𝑡
𝑒 = 𝑒 + 𝑒
−4 −1 4 2
𝒙𝑍𝐼 𝑡 = 𝑒 𝐴𝑡 𝒙 0
2 0.5 −2𝑡
=ቄ 𝑒
−4 −1
15
Example 7.7
𝑥ሶ 1 0 1 0 𝑥1 0
𝑥ሶ 2 = 0 0 1 𝑥2 + 0 𝑢
𝑥ሶ 3 0 −10 −11 𝑥3 10
𝑥1 = angular position, 𝑥2 = angular velocity
𝑥3 = armature current. Find:
a)The state transition matrix.
b)The response due to an initial current of 10 mA.
c) The response due to a unit step input.
d)The response due to the initial condition of (b)
together with the input of (c)
16
a) The State-transition Matrix
−1
𝑠 −1 0
𝑠𝐼3 − 𝐴 −1 = 0 𝑠 −1
0 10 𝑠 + 11
𝑠 + 1 𝑠 + 10 𝑠 + 11 1
0 𝑠 𝑠 + 11 𝑠
0 −10𝑠 𝑠2
=
𝑠 𝑠 + 1 𝑠 + 10
1 𝑠 + 11 1
𝑠 𝑠 𝑠 + 1 𝑠 + 10 𝑠 𝑠 + 1 𝑠 + 10
𝑠 + 11 1
= 0
𝑠 + 1 𝑠 + 10 𝑠 + 1 𝑠 + 10
10 𝑠
0 −
𝑠 + 1 𝑠 + 10 𝑠 + 1 𝑠 + 10
17
State-transition Matrix
1 1 99 100 1 1 9 10 1
− + − +
𝑠 90 𝑠 𝑠 + 1 𝑠 + 10 90 𝑠 𝑠 + 1 𝑠 + 10
−1
1 10 1 1 1 1
𝑠𝐼3 − 𝐴 = 0 − −
9 𝑠 + 1 𝑠 + 10 9 𝑠 + 1 𝑠 + 10
10 1 1 1 10 1
0 − − −
9 𝑠 + 1 𝑠 + 10 9 𝑠 + 1 𝑠 + 10
1 −𝑡 −10𝑡
1
1 99 − 100𝑒 + 𝑒 9 − 10𝑒 −𝑡 + 𝑒 −10𝑡
90 90
1 1 −𝑡
𝑒 𝐴𝑡 = 0 −𝑡
10𝑒 − 𝑒 −10𝑡 𝑒 − 𝑒 −10𝑡
9 9
10 −𝑡 −10𝑡
1
0 − 𝑒 −𝑒 10𝑒 −𝑡 − 𝑒 −10𝑡
9 9
18
Matrix Exponential
• The state-transition matrix
10 11 1 𝑒0 0 −10 −1 𝑒 −𝑡 0 1 1 𝑒 −10𝑡
𝑒 𝐴𝑡 = 0 0 0 + 0 10 1 + 0 −10 −10
10 9 90
0 0 0 0 −10 −1 0 100 100
• Matrix exponential = matrix-weighted sum of
scalar exponentials.
• System Modes: Scalar exponentials involve the
eigenvalues of state matrix 𝐴 = 0, −1, −10 .
• The matrix weights have rank one.
• Use this property to check the matrix
exponential.
19
b) Response: initial current =10 mA.
Zero-input response for I.C. vector
𝒙 0 = 0 0 0.01 𝑇
𝒙𝑍𝐼 𝑡 = 𝑒 𝐴𝑡 𝒙 0
1 10 11 1 0 1 0 −10 −1
=൝ 0 0 0 𝑒 + 0 10 1 𝑒 −𝑡
10 9
0 0 0 0 −10 −1
20
c) Unit Step Response
𝑿𝑍𝑆 𝑠 = 𝑠𝐼3 − 𝐴 −1 𝐵𝑼 𝑠
10 11 1 0 −10 −1
0 0 0 0 10 1 0
0 0 0 + 0 −10 −1 0
10𝑠 9 𝑠+1 10
=
0 1 1 𝑠
0 −10 −10
+ 0 100 100
90 𝑠 + 10
1 1 −1 10Τ9 1 1Τ9
= 0 2+ 1 + −10
𝑠 𝑠 𝑠+1 𝑠 𝑠 + 10
0 −1 100
21
Zero-state Response
𝑿𝑍𝑆 𝑠
1 1 −1 10 1 1 1 1 1 1
= 0 2+ 1 − + −10 −
𝑠 9 𝑠 𝑠+1 90 𝑠 𝑠 + 10
0 −1 100
• Inverse Laplace Transform
𝑿𝑍𝑆 𝑡
1 −1 10 1 1
= 0 𝑡+ 1 1− 𝑒 −𝑡 + −10 1 − 𝑒 −10𝑡
9 90
0 −1 100
−11 1 1 1 10 −𝑡 −1 1
= 0 + 0 𝑡 + −1 𝑒 + 10 𝑒 −10𝑡
10 9 90
0 0 1 −100
22
d) Complete Solution
𝑿 𝑡 = 𝑿𝑍𝐼 𝑡 + 𝑿𝑍𝑆 𝑡
1 1 −1 𝑒 −𝑡 1 𝑒 −10𝑡
= 0 + 1 + −10
1000 900 9000
0 −1 100
−11 1 1 1 10 −𝑡 −1 1
+ 0 + 0 𝑡 + −1 𝑒 + 10 𝑒 −10𝑡
10 9 90
0 0 1 −100
−1.10 1 1 −1
= 0 + 0 𝑡 + −1 1.11𝑒 −𝑡 + 10 1.12 × 10−2 𝑒 −10𝑡
0 0 1 −100
23
The Leverrier Algorithm
• Algorithm to calculate the resolvent matrix
𝑠𝐼𝑛 − 𝐴 −1
• Resolvent matrix
𝑎𝑑𝑗 𝑠𝐼𝑛 − 𝐴
𝑠𝐼𝑛 − 𝐴 −1 =
det 𝑠𝐼𝑛 − 𝐴
𝑛−1
−1
𝑃0 + 𝑃 1 𝑠 + ⋯ + 𝑃𝑛−1 𝑠
𝑠𝐼𝑛 − 𝐴 =
𝑎0 + 𝑎1 𝑠 + ⋯ + 𝑎𝑛−1 𝑠 𝑛−1 + 𝑠 𝑛
24
Algorithm
1. Initialization: 𝑘 = 𝑛 − 1
𝑛
26
Partial Fraction Expansion
• Assume distinct 𝐴 eigenvalues (i.e. 𝜆𝑖 ≠ 𝜆𝑗 , 𝑖 ≠ 𝑗)
det 𝑠𝐼𝑛 − 𝐴 = 𝑠 𝑛 + 𝑎𝑛−1 𝑠 𝑛−1 + ⋯ + 𝑎1 𝑠 + 𝑎0
= 𝑠 − 𝜆1 𝑠 − 𝜆2 … 𝑠 − 𝜆𝑛
𝑛
𝑠 𝑛−1 𝑞𝑖,𝑛−1
𝑛 = ,
ς𝑖=1 𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖
𝑖=1
𝑛
𝑠 𝑛−2 𝑞𝑖,𝑛−2
𝑛 = ,…,
ς𝑖=1 𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖
𝑖=1
𝑛
1 𝑞𝑖,0
=
ς𝑛𝑖=1 𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖
𝑖=1
27
Resolvent Matrix
𝑛−1 𝑛
−1
𝑞𝑖,𝑗
𝑠𝐼𝑛 − 𝐴 = 𝑃𝑗
𝑠 − 𝜆𝑖
𝑗=0 𝑖=1
𝑛 𝑛
σ𝑛−1
𝑗=0 𝑞𝑖,𝑗 𝑃𝑗 𝑍𝑖
= =
𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖
𝑖=1 𝑖=1
𝑛 𝑛−1
𝑒 𝐴𝑡 = 𝑍𝑖 𝑒 𝜆𝑖𝑡 , 𝑍𝑖 = 𝑞𝑖,𝑗 𝑃𝑗
𝑖=1 𝑗=0
28
Example 7.8
Calculate the matrix exponential for the
state matrix of Example 7.7 using the
Leverrier algorithm.
0 1 0
𝐴= 0 0 1
0 −10 −11
• Trace
𝑡𝑟 𝐴 = −11
29
Solution
1.Initialization
𝑃2 = 𝐼3 , 𝑎2 = −𝑡𝑟 𝐴 = 11
2.Backward Iteration: 𝑘 = 1, 0
(i) 𝑘 = 1
11 1 0
𝑃1 = 𝐴 + 𝑎2 𝐼3 = 𝐴 + 11𝐼3 = 0 11 1
0 −10 0
1 1
𝑎1 = − 𝑡𝑟 𝑃1 𝐴 = − 𝑡𝑟 𝑃1 𝐴 = 10
3−1 2
30
(ii) 𝑘 = 0
𝑃0 = 𝑃1 𝐴 + 𝑎1 𝐼3
11 1 0 0 1 0 10 0 0
= 0 11 1 0 0 1 + 0 10 0
0 −10 0 0 −10 −11 0 0 10
10 11 1
= 0 0 0
0 0 0
1 10 11 1 0 1 0
𝑎0 = − 𝑡𝑟 0 0 0 0 0 1
3
0 0 0 0 −10 −11
1
= − 𝑡𝑟 𝟎3×3 = 0
3 31
Check and Results
3. Check
10 11 1 0 1 0
𝑃0 𝐴 + 𝑎0 𝐼3 = 0 0 0 0 0 1
0 0 0 0 −10 −11
= 𝟎3×3
• Characteristic Polynomial
𝑠 3 + 11𝑠 2 + 10𝑠 = 𝑠 𝑠 + 1 𝑠 + 10
• System Eigenvalues: 0, −1, −10
32
Partial Fraction Expansion
3
𝑠2 𝑞𝑖,2 0 −1Τ9 10Τ9 × 𝐼3
= = + +
ς3𝑖=1 𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖 𝑠 𝑠 + 1 𝑠 + 10
𝑖=1
3
𝑠 𝑞𝑖,1 0 1Τ9 −1Τ9
= = + + × 𝑃1
ς3𝑖=1 𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖 𝑠 𝑠 + 1 𝑠 + 10
𝑖=1
3
1 𝑞𝑖,0 1Τ10 −1Τ9 1Τ90 × 𝑃0
= = + +
ς3𝑖=1 𝑠 − 𝜆𝑖 𝑠 − 𝜆𝑖 𝑠 𝑠 + 1 𝑠 + 10
𝑖=1
33
Constituent Matrices
1 10 11 1
𝑍1 = 0 0 0
10
0 0 0
1 10 11 1 1 11 1 0 1 1 0 0
𝑍2 = − 0 0 0 + 0 11 1 − 0 1 0
9 9 9
0 0 0 0 −10 0 0 0 1
1 0 −10 −1
= 0 10 1
9
0 −10 −1
1 10 11 1 1 11 1 0 10 1 0 0
𝑍3 = 0 0 0 − 0 11 1 + 0 1 0
90 9 9
0 0 0 0 −10 0 0 0 1
1 0 1 1
= 0 −10 −10
90
0 100 100 34
Matrix Exponential
10 11 1 𝑒 0 0 −10 −1 𝑒 −𝑡
𝑒 𝐴𝑡 = 0 0 0 + 0 10 1
10 9
0 0 0 0 −10 −1
0 1 1 𝑒 −10𝑡
+ 0 −10 −10
90
0 100 100
• Obtain answer of Example 7.7 with far
fewer partial fraction expansions
• Some additional matrix operations.
• Operations easily performed using a
calculator.
35
Properties of Constituent Matrices
1.Constituent matrices have rank 1.
2.The product of two constituent matrices
𝑍𝑖 , 𝑖=𝑗
𝑍𝑖 𝑍𝑗 = ቊ
𝟎, 𝑖≠𝑗
𝑍𝑖𝑙 , = 𝑍𝑖 , ∀𝑙 integer, i.e. 𝑍𝑖 is idempotent.
3.The sum of the 𝑛 constituent matrices of a 𝑛 ×
𝑛 matrix is equal to the identity matrix
𝑛
𝑍𝑖 = 𝐼𝑛
𝑖=1
36