AV355 - MCT - Lec3 - Transfer Function From State Equations
AV355 - MCT - Lec3 - Transfer Function From State Equations
1
System
Have memory
Modeling
Memory Less / Algebraic system 𝑑𝑦
Static =𝑥
𝑦 = 𝑚𝑥 + 𝑐 Dynamic 𝑑𝑡
𝑦 𝑛 = 𝑦(𝑛 − 1)
+u(n)+4y(n-1) Difference Eqs
Differential Eqs Transfer
Function
𝑑𝑦
𝑑𝑥 = 2𝑥 + 5 𝑦 𝑠 = 𝑔 𝑠 𝑢(𝑠)
= 𝐴𝑥 + 𝐵𝑢 𝑑𝑡
𝑑𝑡
ODE
PDE
Linear LTI (linear/Nonlinear)
Nonlinear
LTV
State Space
Transfer Function
2
𝑿ሶ = 𝑨𝑿 + 𝑩𝑼
Y = CX +DU
3
State Space to Transfer Function
• Consider a general state space form
𝑋ሶ = 𝐴𝑋 + 𝐵𝑈
Y = CX +DU
𝑌(𝑠) −1 𝐵
[num, den]=ss2tf(a,b,c,d) = C 𝑠𝐼 − 𝐴 +D
𝑈(𝑠)
T.f=tf[num,den] 4
Conversion between tf and ss
• TF (transfer function) can be converted to SS
(state space) and vice versa
𝑌(𝑠) −1 𝐵
T.F =𝑈(𝑠) = C 𝑠𝐼 − 𝐴 +D
where
𝐵 = 𝑀−1 B 𝐶መ = 𝐶𝑀 =D
𝐷
𝐴መ = 𝑀−1 𝐴𝑀
6
Transfer Function Form is Unique
• Given 𝑋ሶ = 𝐴𝑋 + 𝐵𝑈 𝑌 −1 𝐵
= C 𝑠𝐼 − 𝐴 +D
Y = CX +DU 𝑈
𝑌(𝑠) −1 =D
• Let's see the TF for = [𝐶መ 𝑠𝐼 − 𝐴መ 𝐷
𝐵+ a𝑠 𝐷
𝑈(𝑠)
𝑌(𝑠)
= [CM 𝑠𝐼 − 𝑀−1 𝐴𝑀 −1 𝑀 −1 𝐵+𝐷
𝑈(𝑠)
𝑌(𝑠)
= [CM 𝑠𝑀−1 𝑀 − 𝑀−1 𝐴𝑀 −1 𝑀 −1 𝐵+𝐷
𝑈(𝑠)
𝑌(𝑠)
𝑈(𝑠)
= [CM 𝑀−1 𝑠𝑀 − 𝑀−1 𝐴𝑀 −1 𝑀 −1 𝐵+𝐷
Same transfer function results regardless of the
𝑌(𝑠) choice of state equations.
= [CM [𝑀 −1 𝑠𝐼 − 𝐴 𝑀]−1 𝑀−1 𝐵+𝐷
𝑈(𝑠)
This result holds true for discrete-time systems
𝑌(𝑠)
= [CM[𝑀−1 𝑠𝐼 − 𝐴 −1 𝑀]𝑀 −1 𝐵+𝐷 in exactly the same form; simply replace the s
𝑈(𝑠)
operator in this section with the z operator.
𝑌(𝑠)
= [CM𝑀−1 𝑠𝐼 − 𝐴 −1 𝑀𝑀 −1 𝐵+𝐷 𝑌
= C 𝑠𝐼 − 𝐴 −1 𝐵
+D 7
𝑈(𝑠)
𝑈
Example 1 : State Space Representation
• Given the RLC Circuit
𝑑𝑣𝑐 𝑡 𝑑𝑖𝐿 𝑡
𝑢(𝑡) = 𝑐 + 𝑖𝐿 (𝑡) 𝑉𝑐 (𝑡) = 𝐿 + 𝑖𝐿 𝑡 𝑅
𝑑𝑡 𝑑𝑡
𝒅𝒗𝒄 (𝒕) 𝒅𝒊𝑳 𝒕
𝒄 = −𝒊𝑳 (𝒕) + 𝒖 𝒕 𝑳 = −𝑹𝒊𝑳 𝒕 +𝒗𝒄 (𝒕)
𝒅𝒕 𝒅𝒕 8
Example 1 : State Space Representation
Let 𝑥1 𝑡 = 𝑣𝑐 (𝑡) and 𝑥2 𝑡 = 𝑖𝐿 (𝑡) be the
state variables
𝒅𝒗𝒄 (𝒕) 𝒅𝒊𝑳 𝒕
𝒄 = −𝒊𝑳 (𝒕) + 𝒖 𝒕 𝑳 = −𝑹𝒊𝑳 𝒕 +𝒗𝒄 (𝒕)
𝒅𝒕 𝒅𝒕
−𝟏
𝟎 𝒙 𝟏
𝒙ሶ 𝟏 𝑪 𝟏
= + 𝑪 𝒖
ሶ𝒙𝟐 𝟏 −𝑹 𝒙𝟐
𝟎
𝑳 𝑳
𝑥ሶ = 𝐴𝑥 + 𝐵𝑢 9
Example 1 : State Space Representation
Now output is 𝑣0
• 𝑣0 = 𝑖0 𝑅 = 𝑖𝐿 𝑅
𝑥1
𝑦(𝑡) = 0 𝑅 𝑥
2
𝒚(𝒕) = 𝑪𝒙(𝒕)
10
Example 1 : State Space Representation
C
A B
• Where
𝑥1 (𝑡) 𝑣𝑐 (𝑡)
𝐱 𝑡 = = ,
𝑥2 (𝑡) 𝑖𝐿 (𝑡)
𝑢 𝑡 = 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 𝑠𝑜𝑢𝑟𝑐𝑒, 𝑦 𝑡 = 𝑅𝑖𝐿 (𝑡)
11
Example : TF from SS of RLC circuit
• Given the state space model
𝒀(𝒔) −𝟏 𝑩
T.F =𝑼(𝒔) = C 𝒔𝑰 − 𝑨 +D
• We obtain
12
Example : TF from SS of RLC circuit
• The TF thus becomes 𝒀(𝒔)
T.F =𝑼(𝒔) = C 𝒔𝑰 − 𝑨 −𝟏 𝑩 +D
𝑅 −1
1 𝑠+𝐿 1
𝐶
T.F = 0 𝑅 1 𝐶
𝛥
𝑠 0
𝐿
𝑠 𝑅
1
+ 𝐿𝐶 0
𝐶
T.F =𝛥 0 𝑅 1
0
𝐿𝐶
𝒔𝟐 + 𝒔 + 𝟏 𝒚 = 2u
𝑦(𝑡)
ሷ + 𝑦(𝑡)
ሶ + 𝑦(𝑡) = 2𝑢(t)
𝑥1 = 𝑦
𝒙ሶ 𝟐 + 𝒙𝟐 + 𝒙𝟏 = 𝟐𝒖
𝒙𝟐 = 𝒚ሶ = 𝒙ሶ 𝟏
𝒙ሶ 𝟐 = 𝒚ሷ 𝑥ሶ 1 0 1 𝑥1 0
= + u
𝑥ሶ 2 −1 −1 𝑥2 2
𝑥1 0
y= 1 0 𝑥 + u
2 2
14
Example : SS Form from TF
• Given Tf
Find SS Form with states as
• Solution
15
Example : SS Form from TF
• Taking state variables
output is c=x1
[A1,B1,C1,D1]=tf2ss(num,den)
ss_model1=ss(A1,B1,C1,D1)
17
Exercise using matlab
• Simulate a State Space Model in Matlab
R=3;L=1;C=1/2;%values of parameters
%make state space model of RLC Circuit
% x1=vC x2=iL
A=[0 -1/C;1/L -R/L];% A matrix
B=[1/C;0];% B matrix
C=[0 R];%C matrix
D=0;% D matrix
ss_model=ss(A,B,C,D);%state space model
x_init=[0 0.1];%initial values for states [vC and iL]
18
Exercise using SIMULINK
• Locate the “State Space” block in Simulink
Library
19
Exercise using SIMULINK
• Ensure that all parameter are available in
Matlab memory
• So, the following code must be “Run” before
using the Simulink Model
R=3;L=1;C=1/2;%values of parameters
21
Exercise using SIMULINK
R=3;L=1;C=1/2;%values of parameters
22
𝑒𝑖𝑔 𝐴 = [−1 − 2]
Exercise using SIMULINK
Lets make A unstable by putting 4
R=3;L=1;C=1/2;%values of parameters entry as R/L
%make state space model of RLC Circuit
% x1=vC x2=iL
A=[0 -1/C;1/L R/L];% A matrix
B=[1/C;0];% B matrix
C=[0 R];%C matrix
D=0;% D matrix
ss_model=ss(A,B,C,D);%state space model
x_init=[0 0.1];%initial values for states [vC and iL]
𝑒𝑖𝑔 𝐴 = [1 2]
23
Examples of A with different
Eigen Values : Regular &
Generalized Eigen Vectors
24
Algebraic multiplicity and Geometric
Multiplicity
Algebraic multiplicity (𝒎𝒊 )
• Algebraic multiplicity of an eigvalue is how many times an
eigvalue is repeated
– eg consider consider a 3x3 matrix A
• with spec (A)={3,3,4}, eigvalue 3 has algebraic multiplicity of 2. eigvalue 4 has
algebraic multiplicity of 1.
• With spec (A)={0,-1,0}, eigvalue 0 has algebraic multiplicity of 2. eigvalue -1
has algebraic multiplicity of 1.
g 𝑖 = dim 𝑁𝑖
1 1 0
• T= 0 −2 2
0 0 −3
• Since it’s a upper diagonal matrix , so Eig values are
lying on the diagonal
– 1 = 1, 2 = −2, 3 = −3
• Eig vector are
1 −0.3162 0.2182
𝑀 = 0 0.9487 − 0.8729
0 0 0.4364
1 0 0
𝑇 = 𝑀−1 𝑇𝑀= = 0 −2 0
0 0 −3
Case 2: Repeated Eigen values
– There exists a transformation which utilizes these regular eigen vectors to make
A diagonal
𝐴መ = 𝑀−1 𝐴𝑀, where 𝑀 = [𝑣1 𝑣2 𝑣3 … . 𝑣𝑛 ], 𝑣𝑠 are regular eigen vectors
Case 2: Repeated eigen values
Case B) : Algebraic Multiplicity (number of times a particular eigen value
is repeated) is greater then its geometric multiplicity ie 𝒈𝒊 < 𝒎𝒊
𝐸𝑖𝑔 𝑉𝑎𝑙𝑢𝑒 = 5; 1; 1
0 0.4 −0.3
𝐸𝑖𝑔 𝑉𝑒𝑐𝑡𝑜𝑟𝑠 = 0 , 0 , 0.4
1 0.3 −0.3
Regular Eigen Regular Eigen Generalized
vector vector Eigen vector
Example 4 : Repeated Eigen Values
Example 4 : Repeated Eigen Values
Ex 4.11
Ex 4.11
Lecture 3
End
THANK YOU