0% found this document useful (0 votes)
4 views45 pages

AV355 - MCT - Lec3 - Transfer Function From State Equations

Uploaded by

Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views45 pages

AV355 - MCT - Lec3 - Transfer Function From State Equations

Uploaded by

Abdullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

AV-355

MODERN CONTROL SYSTEM


Lecture 3

Transfer Function from State Equations

Dr Muhammad Taimoor (Spring 2024)


Total Slides = 44

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

• Lets take Laplace


𝑠𝑋 𝑠 = 𝐴𝑋(𝑠) + 𝐵𝑈(s) Y = CX +DU
𝑠𝑋 𝑠 − 𝐴𝑋 𝑠 = 𝐵𝑈(𝑠) Y(s) = CX(s) +DU(s)
(𝑠𝐼 − 𝐴)𝑋(𝑠) = 𝐵𝑈(𝑠) −1 𝐵𝑈 (s)
𝑋(𝑠) = 𝑠𝐼 − 𝐴 −1 𝐵𝑈(s) Y(s) = C 𝑠𝐼 − 𝐴 +DU(s)
𝑌(𝑠) −1 𝐵
• MATLAB Command 𝑈(𝑠)
= [C 𝑠𝐼 − 𝐴 +D]U(s)

𝑌(𝑠) −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

• This conversion is most suitable for Single Input


Single Output (SISO) Systems
• Initial conditions are assumed to be zero
5
Changing State Variables
• So now the state relationship between old states (𝑋) and new
෠ is established by finding the Modal Matrix (M) ie
states (𝑋)
𝑋 = 𝑀𝑋෠
• So for the earlier system
State Eq Output Eq
𝑋ሶ = 𝐴𝑋 + 𝐵𝑈
Y=CX+DU Put 𝑋 = 𝑀𝑋෠
𝑀𝑋෠ሶ = 𝐴𝑀𝑋෠ + 𝐵𝑈 ෠
Y=C𝑀𝑋+DU
𝑋෠ሶ = 𝑀−1 𝐴𝑀𝑋෠ + 𝑀−1 𝐵𝑈
M = [Eigen Vectors]
Y=𝐶መ 𝑋+
෠ 𝐷𝑈

𝑋෠ሶ = 𝐴መ 𝑋෠ + 𝐵𝑈

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

• Differential equations interms of states 𝑣𝑐 and 𝑖𝐿 and output 𝑣0

Using Kirchoff’s Current law Using Kirchoff’s Voltage law


𝑢(𝑡) = 𝑖𝑐 (𝑡) + 𝑖𝐿 (t) 𝑉𝑐 (𝑡) = 𝑉𝐿 (𝑡) + 𝑉0 (t)

𝑑𝑣𝑐 𝑡 𝑑𝑖𝐿 𝑡
𝑢(𝑡) = 𝑐 + 𝑖𝐿 (𝑡) 𝑉𝑐 (𝑡) = 𝐿 + 𝑖𝐿 𝑡 𝑅
𝑑𝑡 𝑑𝑡
𝒅𝒗𝒄 (𝒕) 𝒅𝒊𝑳 𝒕
𝒄 = −𝒊𝑳 (𝒕) + 𝒖 𝒕 𝑳 = −𝑹𝒊𝑳 𝒕 +𝒗𝒄 (𝒕)
𝒅𝒕 𝒅𝒕 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
𝒚(𝒕) = 𝑪𝒙(𝒕)

• The equations can be written in matrix form

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
𝐿𝐶

𝑅ൗ 𝑅ൗ Eg. Take R=2;L=2;C=1/2


𝐿𝐶 𝐿𝐶
T.F = = 𝑅 1
𝛥 𝑠 2 + 𝐿 𝑠+𝐿𝐶 2
T.F =
𝑠 2 +𝑠+1
Matlab command to generate TF from SS
[num,den]=ss2tf(A,B,C,D)
Trf1=tf(num,den) 13
Lets calculate SS from TF for RLC
circuit
𝒚 𝟐
=
𝒖 𝒔𝟐 +𝒔+𝟏

𝒔𝟐 + 𝒔 + 𝟏 𝒚 = 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

• Take inverse Laplace

15
Example : SS Form from TF
• Taking state variables

• State Space Form

output is c=x1

Matlab command to generate SS from TF


[num,den]=ss2tf(A,B,C,D)
Trf1=tf(num,den) 16
Matlab Codes
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]
[num,den]=ss2tf(A,B,C,D)
trf=tf(num,den)

[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

• Enter the A, B , C , D matrices in Simulink Block


20
Exercise using SIMULINK

Warning will appear if the


parameters are not available
in Matlab workspace
memory

Error will appear if matrix


dimensions do not agree

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.

• Every eig value with algebraic multiplicity of 1 (ie distant


eig value (positive , negative, zero)) has exactly 1
associated eigvector. And this is the normal eigvector
Algebraic multiplicity and Geometric
Multiplicity
Geometric Multiplicity (𝒈𝒊 )
• Geometric multiplicity of an eigvalue (𝑖 ) is the dimension
of the null space of 𝐴 − 𝑖 𝐼
𝑁𝑖 =N(𝐴 − 𝑖 𝐼 )

g 𝑖 = dim 𝑁𝑖

• Every eigvalue with algebraic multiplicity of 1 (ie distant


eigvalue (positive , negative, zero)) has exactly 1
associated eigvector. And this is the normal eigvector
Cases based upon Eigen Values
• Case 1 : Distinct Eigen Values (This includes eig
value =0, and complex conjugate pair of eigen values)
e.g {1,-2,3}, {0,2,-3}, {-1±2i, -2} ….

• Case 2: Repeated Eigen Value(s) When there are


some eigen values which are repeated e.g {1,-2,-2},
{0,0,3}, {-1±2i, -1±2i} ….
– Two Scenarios
(a) Geometric Multiplicity is equal to Algebraic
Multiplicity : A perfectly diagonalizable
(b) Geometric Multiplicity is less than Algebraic
Multiplicity : A not perfectly diagonalizable (Jordan
Blocks) 27
Example 1 : Distant Eigen Values
0 2
• A=
−2 0
• Eig values 1 = 2𝑖, 2 = −2𝑖

• Eig vector against 1 = 2𝑖 (Solve 𝐴 − 𝜆1 𝐼 𝑥 = 0)


−0.707𝑖
– 𝑣ො1 =
0.7071
• Eig vector against 2 = −2𝑖 (Solve 𝐴 − 𝜆2 𝐼 𝑥 = 0)
0.707𝑖
– 𝑣ො2 =
0.7071
• Now lets see how A gets diagonalized using eigen vectors
−0.707𝑖 0.707𝑖
– 𝑀 = [𝑣ො1 𝑣ො2 ] =
0.7071 0.7071
0.707𝑖 0.7071 0 2 −0.707𝑖 0.707𝑖
𝐴መ = 𝑀−1 𝐴𝑀= =
−0.707𝑖 0.7071 −2 0 0.7071 0.7071
2𝑖 0
=
0 −2𝑖
• Both eigen vectors will satisfy the characteristic eq 𝐴𝑥 = 𝜆𝑥
Example 2 :Distinct Eigen Values
1 2
• A=
3 6
• Eig values 1 = 0, 2 = 7
• Eig vector against 1 = 0(Solve (𝐴 − 𝜆1 𝐼)𝑥 = 0)
−0.8944
– 𝑣ො1 =
0.4472
• Eig vector against 2 =7 (Solve (𝐴 − 𝜆2 𝐼)𝑥 = 0)
−0.3162
– 𝑣ො2 =
−0.9487
• Now lets see how A gets diagonalized using eigen vectors
−0.8944 −0.3162
– 𝑀 = [𝑣ො1 𝑣ො2 ] =
0.4472 −0.9487
𝐴መ =
−0.9583 0.3194 1 2 −0.8944 −0.3162
𝑀−1 𝐴𝑀= =
−0.4518 −0.9035 3 6 0.4472 −0.9487
0 0
=
0 7
• Both eigen vectors will satisfy the characteristic eq 𝐴𝑥 = 𝜆𝑥
Example 3 : Distinct Eigen Values

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

For repeated eigen value there ae two possibilities

Case A) : Algebraic Multiplicity (number of times a particular eigen value


is repeated) is equal to its geometric multiplicity ie 𝒎𝒊 =𝒈𝒊
• Repeated eigen value 𝑖 having algebraic multiplicity 𝑚𝑖 has corresponding
geometric multiplicity 𝑔𝑖 such that 𝑔𝑖 =𝑚𝑖
Recall 𝑔𝑖 =dim(q(𝐴 − 𝑖 𝐼)=n-rank(𝐴 − 𝑖 𝐼)
• The dimension of the Null space corresponding to (𝐴 − 𝑖 𝐼) is exactly equal
to the number of times the particular eigen value is repeated
• Every repeated eigen value with multiplicity 𝑚𝑖 will give exactly 𝑚𝑖 regular
eigen vectors.
• If all repeated eigen values fulfill this criteria , then A will have a complete
set of n regular eigen vectors
• Procedure same as that performed in the earlier case of distant eigen value
case
Case 2: Repeated Eigen values

Case A) : Algebraic Multiplicity (number of times a particular eigen value


is repeated) is equal to its geometric multiplicity ie 𝒎𝒊 =𝒈𝒊
• Characteristics

– It has complete set of n eigen vectors (all regular eigen vectors)

– 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 𝒈𝒊 < 𝒎𝒊

• Repeated eigen value 𝑖 having algebraic multiplicity 𝑚𝑖 has corresponding


geometric multiplicity 𝑔𝑖 such that 𝑔𝑖 < 𝑚𝑖
Recall 𝑔𝑖 =dim(q(𝐴 − 𝑖 𝐼)=n-rank(𝐴 − 𝑖 𝐼)
• There will be exactly 𝑔𝑖 regular eigen vectors corresponding to that eigen
value 𝑖
• Best thing we can do is to complete the set of basis is utilizing closest thing
to eigen vector ie the generalized eigen vector.
• In this case A will be not exactly diagonal, but of a special form known as
Jordan Canonical Form
– Recall canonical forms such as diagonal form are special cases of Jordan
canonical form
• In this case, the modal matrix will have some regular eigen vectors
and some generalized eigen vectors
– 𝑀 = 𝑣1 𝑣2 𝑣3 𝑣4 𝑣5

Regular Eigen Generalized Eigen


vectors vectors
Generalized Eigen Vectors
Two approaches to find generalized eigen vector

• Bottom Up Approach (normally followed)


– Utilize the last calculated regular eigen vector which satisfies the criteria
𝐴𝑣1 = 1 𝑣1

– Now to compute the remaining generalized eigen vectors (equal to 𝑚𝑖 −


𝑚𝑖 ), which is linearly independent from normal eigen vector use the
following chain to compute the non trivial solution 𝒗𝟐 (particular solution)
to the eq
– Unlike regular eigen vectors, generalized eigen vectors are particular
solution to the algebraic eq and therefore cannot be multiplied by any
arbitrarily constants (like we can do for regular eigen vectors which are
homogeneous sol to the algebraic eq (𝐴𝑣 = 𝜆𝑣 𝑜𝑟 𝐴 − 𝜆 𝐼 𝑣 = 0)) nor
are they unique
Generalized Eigen Vectors
• Bottom Up Approach (normally followed)
• 𝐴𝑣2 =  𝑣2 + 𝑣1
(𝐴- 𝐼) 𝑣2 = 𝑣1 find generalized eigen vector 𝑣2 , given A, 
and regular eigen vector 𝑣1

Similarly use the chain to complete the generalized


eigen vectors (𝑣3 , 𝑣4 ,…)
• 𝐴𝒗𝟑 =  𝒗𝟑 + 𝒗𝟐
• 𝐴𝑣4 =  𝒗𝟒 + 𝒗𝟑 and so on..
Generalized Eigen Vector Calculation
1 −1
Example . 𝐴 =
1 −1
Eigen Values
• Its eigen values are =0,0
So algebraic multiplicity of =0 ie 𝑚=0 =2
To find Eigen Vectors
1 −1 1 0 1 −1
• A- I= -0 =
1 −1 0 1 1 −1
• rank(A- I)=1
• So dim of q(A- I)=n-r(A- I)=2-1=1=𝑔=0
Since 𝑚=0 ≠𝑔=0 . So the system has not a complete set of regular eigen
vectors
• So at max one regular eig vector (𝑣1 ) can be calculated and second vector
(𝑣2 ) needs to be added as a generalized eigen vector through relation
𝐴𝑣2 = 𝑣2 +𝑣1
Ex 4.7
Ex 4.7
Ex 4.7
Ex 4.7

𝐸𝑖𝑔 𝑉𝑎𝑙𝑢𝑒 = 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

You might also like