Mathematical Modeling
of Dynamic Systems in State Space II
Transfer Function and State Equation
( )( 2) 3 ( ) z s s u s
( ) 2 ( ) 3 ( ) z t z t u t
1 1
1 1
1
( ), 2 ( )
2 3 ( )
x z t x z z t
x x u t
y x
1.
2.
( ) 3
( ) 2
z s u s s
1 1 1
1 1
1
1 1
1
( ) 5 3 5( 2) 7 7
( ) 2 2 5 2
( ) 5 ( ) 7 ( ) 2
( ) 7 ( ), 2 7
2
2 7
, 5
5
z s s s
u s s s s
z s u s u s
s
let z s u s z z u
s
x x u
y z u
let x z
x u
Another way,
( ) 5 3
( ) 2
z s s u s s
1 1
1
1
( ) ( ) 5 3 2 ( )
2 ( )
( ) 5 3
5( 2 ) 3
5 7
, 2
7 5
z s u s s s Q s
q q u t
z t q q
q u q
u q
x x u
let x q
y x u
2
ndorder systems
ex1) Consider a system defined by
y 6 y 11 y 6 y 6 u
1 2 3
x y
x y
x y
Choose state variables,
Then we obtain, 1 2
2 3
3 1 2 3
,
6 11 6 6
x x
x x
x y x x x u
1 1 1
2 2 2
3 3 3
0 1 0 0
0 0 1 0 , 1 0 0
6 11 6 6
x x x
x x u y x
x x x
State Equation and Transfer Function
Phase variables (each subsequent state variable is defined to be the derivative of the previous state variable.)
( ), k b b
my ky b y u y y y u
m m m
1 2
,
2k
1b
2b
x x x x x u
m m m
The right side includes term. To explain the reason we should not include differentiation of u, assume
u
1
,
2x y x y
Choose state variables,
( ) ( )
u t unit impulse function
2
k b k ( )
x y dt y t
m m m
ex2) Consider a mechanical system,
includes term. It means and cannot be accepted as a state variable.
x
2( / ) ( ) k m t x
2(0)
That’s why the standard form is
x Ax Bu y Cx Du
State Equation and Transfer Function
x Ax Bu
"udisplacement"
2 1 2
2
1 2
b k b b b k b b
x y u y y u u x x u
m m m m m m m m
k b b
x x u
m m m
1 1
2
2 2
0 1 b
x x m
k b u
x x b
m m
m
term has been eliminated.
u
To eliminate term,
1
,
2b
x y x y u
m
u
2
k b b b k b
y y y u y u y y
m m m m m m
d b k b b b
y u y y u u
dt m m m m m
So we choose state variables as,
Method 1: Choose a state variable that includes
u
State Equation and Transfer Function
1 2 0 1 2
y a y a y b u b u b u
Consider a second-order system,
2
0 1 2
2
1 2
( ) ( )
Y s b s b s b
U s s a s a
2
0 1 2
2
1 2
( ) 1 ( )
( ) , ( )
Z s Y s
b s b s b U s s a s a Z s
1 2
0 1 2
z a z a z u y b z b z b z
1 2
, ,
let x z x z
0 1 2 0
(
2 1 1 2)
1 2 2 1b z b z b z b a x a x u b x b x y
1 2
,
2 2 1 1 2x x x a x a x u
Method 2: Include the input derivates in the output equation
2
1 2
1
s a s a b s
0 2 b s b
1
2( )
U s Z s ( ) Y s ( )
2 2 0 1 1 1 0 2 0
( ) ( )
y b a b x b a b x b u
1 2
2 2 1 1 2
x x
x a x a x u
State Equation and Transfer Function
1 1 1
2 2 0 1 1 0 0
2 2 1 2 2
0 1 0
1 ,
x x x
u y b a b b a b b u
x a a x x
( ) ( 1)
1 1
( ) ( 1)
0 1 1
n n
n n
n n
n n
y a y a y a y
b u b u b u b u
1 1
2 2
1 1
1 2 1
0 1 0 0 0
0 0 1 0 0
,
0 0 0 1 0
1
n n
n n n n n
x x
x x
u
x x
x a a a a x
1 2
0 1 1 0 1 1 0 0
n n n n
n
x
y b a b b a b b a b x b u
x
N-th order differential equation,
Method 2: Include the input derivates in the output equation
State Equation and Transfer Function
( ),
my ky b y u my by ky bu
2 2
( ) ( ) 1 ( )
, ,
( ) ( ) ( )
Y s b s Z s Y s
U s ms bs k U s ms bs k Z s bs
( ms
2 bs k Z s ) ( ) U s ( ), bs Z s ( ) Y s ( )
ex2) Consider this mechanical system again,
2
1
( ) ( ) b ( ) k ( )
s Z s U s s Z s Z s
m m m
1 22 1 2
2
1 x x
k b
x x x u
m m m
y b x
State variables,
1
,
2x z x z
0 1
k b
m m
A
0 1 m
B
0 b
C
0
D
Draw Block Diagram,
System Matrices:
State Equation and Transfer Function
2 2
( ) ( ) ( )
, ( )
( ) ( )
Y s bs Y s u s
cU s ms bs k b s ms Q s
ex) Consider a spring-mass-damper system
2 2
2 2
( )
d y dy du
m b k y u
dt dt dt
d y dy du
or m b ky b ku
dt dt dt
2
( ) ( )
Y s bs k
Transfer Function
U s ms bs k
1 1 1
2 2 2
0 1
0 u, 1
x x k b x
k b y
x x m m x
m m
2 2 0
1 1 0
0 0
k k k
b a b
m m m
b b b
b a b
m m m
m
0 1 2
1 2
0, ,
,
b b b b k
b k
a a
m m
State variables:
State Eq:
Output Eq:
Rewrite equations:
State Equation and Transfer Function
0 1 2 3 4 5 6 7 8 0
0.5 1 1.5
Unit-Step Response (Method 2)
t(sec)
Output y(m)
t=0:0.02:8;
A=[0 1;-10 -2];
B=[0;1];
C=[10 2];
D=[0];
sys=ss(A,B,C,D);
[y,t]=step(sys,t);
plot(t,y) grid
title('Unit-Step Response (Method 2)','Fontsize',15) xlabel('t(sec)','Fontsize',15)
ylabel('Output y(m)','Fontsize',15)
If, m=10kg, b=20N-s/m, k=100N/m
1 1 1
2 2 2
0 1 0
u, 10 2
10 2 1
x x x
x x y x
Matlab Example
Transformation of Mathematical Models with MATLAB
( ) ( )
Y s numerator polynomial in s num U s denominator polynomial in s den
MATLAB command, [A, B, C, D] = tf2ss(num,den) ex) Consider,
3 2
( )
( ) 14 56 160
Y s s
U s s s s
1 1
2 2
3 3
1 2 3
14 56 160 1
1 0 0 0
0 1 0 0
0 1 0 [0]
x x
x x u
x x
x
y x u
x
One of many possible state-space representations is,
gives a state space representation.
>> num=[0 0 1 0];
>> den=[1 14 56 160];
>> [A,B,C,D]=tf2ss(num,den) A =-14 -56 -160
1 0 0 0 1 0 B =1
00
C =0 1 0 D =0
x = Ax+ Bu y = Cx+ Du
can be written as,ˆ ˆ
Px = AP x+ Bu y = CP x+ Du ˆ
orx = P A P x+ P Bu ˆ
-1ˆ
-1y = CP x+ D u ˆ
- Since infinitely many n x n matrices can be a transformation matrix P, there are infinitely many state-space models for a given system.
I A 0
Eigenvalues of an n x n matrix A are the roots of the characteristic equation.
The eigenvalues are also called the characteristic roots.
ex)
0 1 0
A 0 0 1 ,
6 11 6
3 2
1 0
I A 0 1 6 11 6
6 11 6
( 1)( 2)( 3) 0
Transformation of a State-Space Models into Another One
1 2 1
0 1 0 0
0 0 1 0
A
0 0 0 1
n n n
a a a a
Diagonalization of State Matrix A
Consider an n x n state matrix A :
1 2
2 2 2
1 2
1 1 1
2 2
1 1 1
x = Pz, P
n n
n n n
n
where
If matrix A has distinct eigenvalues and the state vector x is transformed into another state vector z by use of a transformation matrix P ,
1 1 2
0 P AP
0
n
is a canonical matrix and each column of P is an eigenvector of matrix A
P AP
1Jordan Canonical Form
3 2 1
0 1 0
A 0 0 1
a a a
If matrix A involves multiple eigenvalues, diagonalization is not possible but matrix A can be transformed into a Jordan Canonical Form.
Consider the 3 x 3 matrix A :
1
,
2,
3where
1 2 3
Assume that matrix A has eigenvalues
1 1 2 3 1 2 3
( I A) v 0 A : 3 3 matrix , , , v v v , ,
1 1 1
,
2 1 2,
3 3 3Av v Av v Av v
1I A 1 rank
1 2 3
1 2 3
1 1 -1 1 13 3
0 0 0 0
A 0 0 , P AP 0 0
0 0 0 0
v v v v v v
can determine two eigenvectors .
v v
1,
2Case 1.
Jordan Canonical Form
1 3
2 2
1 1 3
1 0 1
x S z S 1
2
where
will yield
1 1
1 3
1 0
S AS 0 0 J
0 0
This is in the Jordan Canonical Form.
1I A 2 rank
1 1 1 3 3 3
A v v , A v v
1 2 1
A I v v
1 2 3
1 2 3
1 1 31 0
A 0 0
0 0
v v v v v v
can determine one eigenvector .
v
1Case 2.
2 1 1 2
A v v v
Find such that
v
2Canonical Forms
Case 3. Complex Roots
• Diagonal (or Jordan) Canonical Form
(Partial Fraction Expansion)
Complex case의 diagonalization
방법 이용 x x buy Cx
0 0
j
j
1
2 2
1
2 2
j
K j
1 2 2 2
1 1 2 2 j j
K j
K KJ
J
Note : Complex Roots, Complex State x
J K
1 K
1 1
K P APK
AP P
Canonical Forms
Case 3. Complex Roots
• Diagonal (or Jordan) Canonical Form
(Partial Fraction Expansion)
1 2
1 0
z z b u
b
y z
Ex)
( ) Y s
1 / s
1 / s b
1( ) u s
b
2( )
u s
Canonical Forms
Case 3. Complex Roots
• Diagonal (or Jordan) Canonical Form
(Partial Fraction Expansion)x Ax Bu
let
: diagonal
1 1
x P
P AP P Bu
let
1 1 1
J
Kz
z K K z K P Bu
1 2
z b u b
1 1 1
J
x P PKz
z K K z K P bu y CPKz
Step 1 Step 2
Step 3
End of Lecture 5(II)