Solution of Discrete Time State Equations: EE-601: Linear System Theory

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

Solution of Discrete Time State Equations

EE-601: Linear System Theory

Prof. Bidyadhar Subudhi


School of Electrical Sciences
Indian Institute of Technology Goa
Discretisation
The operation by which a continuous-time model is converted into a discrete-
time one is called discretisation. A discrete-time model is needed, for example
to simulate it with a digital computer; or to design a discrete-time controller,
which is also implemented in some kind of digital computer. The Parameter
Variation Formula(PVF: sol of CT state eq) yields a direct method for
discretisation of a continuous-time system state space model.

2
Solution of LTI Equations
x(t )  Ax(t )  Bu (t )
y (t )  Cx(t )  Du (t )
Assume: plant has ZOH at its input and a sampler at its output (two methods):
1. Simple (but approximate) discretisation
2. Exact discretisation

1. Simple (but approximate) discretisation


This is the most intuitive approach. The simplest way to obtain a discrete model from a
continuous-time system regularly sampled with period T is by using Euler’s approximation

x(t  T )  x(t )
x(t )  lim
T 0 T
x((k  1)T )  ( I  TA) x(kT )  TBu (kT )
y (kT )  Cx(kT )  Du (kT )

3
Exact Discretisation
An exact discrete model of CTS may be obtained by using the solution of state equation.
Note that the output of the ZOH (D/A) is kept constant during each sampling period T
until the new sample arrives, i.e. u(t) is generated by computer followed by a DAC. u(t) is
held piecewise constant.

u (t )  u ( kT ) : u[ k ] for kT  t  (k  1)T
For k=01,2. The input changes only at discrete time instants. Solution of x(t )  Ax(t )  Bu (t )
Computing solution at t  kT and t  ( k  1)T
kT
x[k ] : x(kT )  e AkT x(0)   e A( kT t ) Bu ( )d
0

( k 1)T
x[k  1] : x((k  1)T )  e A ( k 1)T
x(0)   e A(( k 1)T  ) Bu ( )d
0

x  k  1  e e AkT x(0)  kT e A( kT  ) Bu ( )d   ( k 1)T e A( kT T  ) Bu ( )d


0  kT
AT


4
Contd.,
kT
x[k ]: x(kT )  e AkT
x(0)   e A( kT t ) Bu ( )d
0

u (t )  u ( kT ) : u[ k ] kT  t  ( k  1)T

x  k  1  e e AkT x(0)  kT e A( kT  ) Bu ( )d   ( k 1)T e A( kT T  ) Bu ( )d


0  kT
AT


x  k  1  e x  k  
AT
 0
T

e A d Bu  k 

x  k  1  Ad x  k   Bd u  k 

y  k   Cd x  k   Dd u  k 

Bd    e A d  B
 T
Ad  e AT
Cd  C Dd  D
 0 

5
Contd.,
Computation of Bd  2
2

 I  A  A  ...d
T
 2! 
0 T2 T3 2 T4 3
 TI  A A  A  ...
2! 3! 4!

If A is nonsingular
 

1
A  TA 
T2 2 T3 3
A  
A  ...  I  I   A1 e AT  I 
 2! 3! 

Bd  A1  Ad  I B

6
Example(Comparison of Discretization Methods)

7
8
9
Discretization

If the system is under a sampling process with period T, derive the discrete
state model of the system.
To derive the discrete state space model, let us first compute the state
transition matrix of the continuous time system using Caley Hamilton Theorem
T = 1 , the state equations become
Example (Discretization)
Obtain the discrete-time state and output equations when T=1 sec of the
continuous system:
Y (s) 1
G(s)  
U ( s) s( s  2)
which may be represented in state space by the equations

 x1  0 1   x1  0
 x   0 2  x   1  u
 2   2  

 x1 
y  1 0 
 x2 

12
 1 2T 
 1 (1  e )
Ad (T )  e 
AT
2
 2T 
0 e 
 1  e2T  1  
  1 2T     T 
  
Bd (T )   e At dt B     2
T

0
T

0 
 0
1 (1  e )   0 
 dt    2 
 
1  
 
2 

 1  e  
2 T 1
 e   2T

 2 
Thus,  1  e 2T  1 
 
 x1 ((k  1)T )  1 (1  e 2T )  x1 (kT )   2  T  2 
1
 x ((k  1)T )   2     u (kT )
 2  0 e 2T   x2 (kT )  1 1  e 2T 
 
 2 

Output equation becomes


 x1 (kT ) 
y(kT )  1 0 
2 
x ( kT )
MATLAB Command
 Ad , Bd   c2d ( A, B, T )
x  Ax  Bu x(k  1)  Ad x(k )  Bd u (k )

Example:

 x1   0 1   x1  0 A  0 1; 25 4 ;


 x    25 4  x   1  u B  0;1 ;
 2   2  
 Ad , Bd   c2d ( A, B,0.05)
 0.9709 0.0448
Ad   
 1.1212 0.7915 
Eigenvalues and Eigen Vectors

If A has distinct eigenvalues 1 , 2 and 𝑛 it can be diagonalized using


similarity transformation.
Consider a square matrix A which has distinct eigenvalues . It is required
to find a transformation matrix P that converts A into a diagonal form

through similarity transformation AP = P∧

where eigenvectors of matrix A

corresponding to eigenvalues

Thus
Similarity Transformation

Consider the following state model x(k  1)  Ax(k )  Bu (k )


If P transforms the state vector 𝑥(𝑘) to 𝑧(𝑘) through the relation
𝑥 𝑘 = 𝑃𝑧(𝑘) or 𝑧 𝑘 = 𝑃−1 𝑥(𝑘)

modified state space model 𝑧 𝑘 + 1 = 𝑃−1 𝐴 𝑃 𝑧 𝑘 + 𝑃−1 𝐵𝑢(𝑘)


𝑃−1 𝐴 𝑃 = 
Characteristic Equation, eigenvalues and eigen vectors
Discrete state space model, the characteristic equation 𝑧𝐼 −  =0

Roots of the characteristic equation are the eigenvalues of matrix A

Eigen vector of A associated with eigenvalue 𝑖 : 𝐴𝑣𝑖 = 𝑖 𝑣𝑖

When A has an eigenvalue  of multiplicity m a full set of linearly independent


may not exist. The number of linearly independent eigen vectors is equal to the
degeneracy d of 𝐼 − A
𝑑 = 𝑛 − 𝑟 where n = dim of A and r = rank of 𝐼 − A

1≤𝑑≤𝑚
STM using Caley Hamilton Theorem
If A has distinct eigenvalues

Example
STM: Laplace Transform
For the system 𝑥 = 𝐴𝑥 + 𝐵𝑢
1 1
𝐴=
−1 1

Compute e A t using 3 different techniques


Solution: Eigenvalues of A: 1 ± 𝑗1
STM by Similarity Transformation

Take 𝑣1 =1 then 𝑣2 =j 1 1
For eigenvalue 1 + 𝑗: For eigenvalue 1 − 𝑗:
𝑗 −𝑗
Caley Hamilton Theorem
Solution of LTI Discrete-Time State Equations

x(k  1)  A x(k )  Bu (k )
y (k )  C x(k )  D u (k )

x(k) or any positive integer k may be obtined directly by recursion:

x(1)  Ax(0)  Bu (0)


x(2)  Ax(1)  Bu (1)  A2 x(0)  ABu (0)  Au (1)
x(3)  Ax(2)  Au (2)  A3 x(0)  A2 Bu (0)  ABu (1)  Bu (2)


k 1
x(k )  A x(0)   Ak  j 1Bu ( j ),
k
k  1,2,3....
j 0
k 1
y (k )  CA x(0)  C  Ak  j 1Bu ( j )  Du (k )
k

j 0
Discrete-time State Transition Matrix
It is possible to write the solution of the homogeneous state equation as
x(k  1)  Ax(k )

where x(k )   (k ) x(0) is a unique n x n matrix satisfying the condition

state transition matrix(fundamental matrix) :  (k )

 (k  1)  A (k ),  (0)  I ,

 ( k )  Ak
Output Equation
k 1
x(k )  A x(0)   Ak  j 1Bu ( j ),
k k  1,2,3....
j 0
k 1
x(k )   (k ) x(0)    (k  j  1) Bu ( j )
j 0
k 1
  (k ) x(0)    ( j ) Bu (k  j  1)
j 0

k 1
y (k )  CAk x(0)  C  Ak  j 1Bu ( j )  Du (k )
j 0
k 1
y (k )  C (k ) x(0)  C   (k  j  1) Bu ( j )  Du (k )
j 0
k 1
 C (k ) x(0)  C   ( j ) Bu (k  j  1)  Du (k )
j 0
Diagonalization/Jordan Form

x(k  1)  Ax(k )  Bu (k )
y(k )  Cx(k )  Du (k )
 
Define a new state vector x(k ) by x(k )  P x(k ) P: nonsingular matrix

   
P x(k  1)  AP x(k )  Bu (k ) x(k  1)  P AP x(k )  P 1Bu (k )
1


y (k )  CP x(k )  Du (k )
 

P AP  Aˆ ,
1 1
P BB CP  C DD
   
x(k  1)  A x(k )  Bu (k )
  
y (k )  C x(k )  D u (k )
Jordan Form

   
x(k  1)  Ax(k )  Bu (k ) x(k  1)  A x(k )  Bu (k )

y(k )  Cx(k )  Du (k )
   
y (k )  C x(k )  D u (k )
by properly choosing a matrix P such that P 1 AP = diagonal matrix

In the case where diagonalization is not possible, P 1 AP may be transformed


into a Jordan canonical form:
Jordan canonical form P 1 AP  J
Solution of Discrete Time State space Equations
Consider x(k  1)  Ax(k )  Bu (k )
y (k )  Cx(k )  Du (k )
Compute
x1  Ax 0  Bu0
x2  Ax 1  Bu1  A2 x0  ABu 0  Bu1

Proceeding forward, for kk 1> 0,


xk   Ak x0   Ak 1 m Bum
m 0
k 1
yk   CA x0   CA k 1 m Bum  Du k 
k

m 0

Key computation Ak = QÂkQ-1


Suppose the Jordan form of A is
λ1 with multiplicity 4 and eigenvalue  k k  1  k 2

1 k1
k k 1 1 0 0
2
λ2 with multiplicity 1 and suppose its 0 1k
k1 k 1
0 0
Jordan form 
A Q 0
k  1
0  k 1 0 0 Q
0 0 0 1k 0
 
 0 0 0 0 2  27
k
Solution of Discrete Time (LTI) State Equation
Evaluation of STM
1. Inverse Z-transform:

2. Similarity Transformation

3. Using Caley Hamilton Theorem


Example

Eigen values

#Method :1
Method 2

Eigen vectors
Method 3: Caley Hamilton Theorem
Eigen values
Solution: x(k)
LTV Discrete-Time State Equation
 Consider discrete-time state equation
xk 1  Ak xk   Bk uk  (1)
yk   Ck xk   Dk uk  (2)

 Solution of 1 (by Recursion) : given initial sate 𝑥[𝑘0 ]and input 𝑢[𝑘] for
𝑘≥0

 Define Discrete State Transition matrix of (1)  k  1, k0   Ak  k , k0 


with  k0 , k0   I
for 𝑘 = 𝑘0, 𝑘0 + 1
Solution:  k , k0   Ak  1Ak  2... Ak0  𝑘 > 0  k0 , k0   I

  k , k0  is defined 𝑘≥0
  k , k0     k0 , k   k0 , k 

35
LTV Discrete-Time State Equation

Using STM solution of xk 1  Ak xk   Bk uk 


𝑘≥0
yk   Ck xk   Dk uk 
k 1
xk    k , k0 x0    k , m  1Bmum
m  k0
k 1
yk   C k  k , k0 x0  C k    k , m  1Bmum  Dk uk 
m  k0

k 1
y  k   C  k     k , m  1 B  m  u  m   D  k  u  k 
If initial state is zero
m  k0

If  k , m  0 for k m ,then
k
yk    Ck  k , m  1Bm  Dm k  mum
m  k0

36
• Solution of Homogenous equation x  k  1  A  k  x  k 

x  k     k , k0  x0

 k, k   I
  k , k0     k0 , k   1  k , k0  exists for all k
  k2 , k0   [k2 , k1 ][k1 , k0 ]

37
Example
x  k  1  A  k  x  k 
• Consider the homogenous state equation x(0)  x 0
1 k 
  x(k )
x1  k  1  x1  k   k x2 (k ) 0 1
z
x2 ( z )  x20 x2 (k )  (1) k x20
x2  k  1   x2 (k ) z x2 ( z )  z x20   x2 ( z ) z 1
x1  k  1  x1  k   k x2 (k )
Take z transform and inverse z transform
 1 1 1 
x1 (k )  x10     (1) k  (1) k  x20
 1 4 2 
 1 1 1 
 x1 (k )  1   (1) k  (1) k   x10 
 x (k )    1 4 2
  0
 2   k  x2 
 0 ( 1) 
x1 (k )   (k , 0) x 0 38
k , k0   Ak 1Ak  2...Ak0 
  k0 , k0   I  k  1, k0   Ak  k , k0 
  k0  1, k0   A[k0 ]
  k0  2, k0   A[k0  1] A[k0 ]
k0
  k0 , k0   I

  k0  3, k0   A[k0  2] A[k0  1] A[k0 ]


.
.
.
  k , k0   A[k  1] A[k  2] A[k0 ]

39
Solution of LTV dıscrete tıme State-space equatıons
Consider x [k  1]  A[k ] x [k ]  B [k ] u [k ] (1)
y (k )  C x(k )  D u (k ) (2)

Solution of (1) may be found by recursion


x(k0  1)  A(k0 ) x(k0 )  B(k0 )u (k0 )
x(k0  2)  A(k0  1) x(k0  1)  B(k0  1)u (k0  1)
x(k0  2)  A(k0  1) A(k 0 ) x(k0 )  A(k0  1) B(k0 )u (k0 )  B(k 0  1)u (k 0  1)
…..
…..

State transition matrix of (1)  (k  1, k0 )  A (k )  (k , k0 )  ( k0 , k0 )  I

k  k0 , k0  1, k0  2...
STM   k , k0  is given by
  k , k0   A(k  1) A(k  2) A(k0 ) k  k0

Using   k , k0  Sol of (1) becomes: k 1


x  k     k , k0  x[k0 ]     k , m  1 B[m]u[m]; k  k0
m  k0

  k , k0   A(k  1) A(k  2) A(k0 )   k  1, k0   A(k )  k , k0 

Substitute above eq into


k
x  k  1    k  1, k0  x[k0 ]     k  1, m  1 B(m)u (m)
m  k0

k 1
We obtain x  k  1  A[k ]  k , k0  x[k] ]     k  1, m  1 B[m]u[m]
m  k0

   k  1, k  1 B[k ]u[k ]
  k  1, k0   A[k ]  k , k0 

 k 1 
x  k  1  A[k ]   k , k0  x[k0 ]   A[k ]  k , k0  B[m]u[m]  I B (k )u (k )
 m  k0 

 k 1 
x  k  1  A[k ]   k , k0  x0 (k0 )   [k , k0 ]B[m]u[m]  I B[k ]u[k ]
 m  k0 

x  k  1  A[k ]x[k ]  B[k ]u[k ]

You might also like