Sei sulla pagina 1di 39

CSE 590K: Analysis and Control of Computing

Systems Using Linear Discrete-Time System Theory:

State-Space Models
for LTI Systems
Joseph L. Hellerstein, Jie Liu
Microsoft

Feb. 4, 2008
Agenda
• State space Modeling
– States & state variables
– State space models
– State space and Transfer Function formats
– Realization Theory
• Model Analysis
– State trajectories
– Stability
– Steady state properties
– Transient properties
• Controllability & Observability
– State feedback control
– Observers

2
Motivation: why use State Space
models?
• High dimension systems
– Writing difference equations can become tedious
• MIMO (Multi-input, Multi-output) systems
• Realization ambiguity

• Vector-Matrix notation provides a uniform,


compact representation
• Easier to manipulate and represent
• Many concepts from transfer function analysis
can be applied

3
Realization of Transfer Functions
Recall from last lecture: Decompose into a sum of geometrics

U(z) 0.1z Y(z) 0.1z


G( z) 
z 2  0.5 z  0.06 z  0.5 z  0.06
2

z z
 
0.5 z  0.3 z  0.2
2
 1  0.3z 1  0.09z  2  ...  1  0.2 z 1  0.04z  2  ...
0.4  0.1z 1  0.05z  2  ...
1.5
0.3
 Partial fraction expansion allows
u(k)

y(k)

1
0.2 rational polynomials to be
decomposed into a sum of
0.5
0.1 geometrics
 Poles of the original polynomial
0
0 2 4
0
0 2 4
are the poles of the geometrics
k k

4
Realizations of TF
State Variables
u(k) y(k)
System
x(k)

• Variables that uniquely define the evolution of the system


• Used to express system dynamics
– May not even be measurable
• Similar to State in state automata, MDPs, etc
• Typically, multiple state variables will be used  x1 ( k ) 
– i.e., state  n-tuple <x1, x2, …, xn >  x (k )
– represented as a vector (boldface) x( k )   2 
  
 
 n
x ( k ) 
• State variables need NOT be completely independent or unrelated
– Common to have “history” terms: x2=x1 (k-1), etc

6
State Variables Example: Tandem
Queue

• Control Input: buffer size at Queue 1 (K)


• Output: End-to-end response time (R)

• Idea: Model each queue separately


• State variables: R1, R2
 x1 ( k )   R1 ( k )  R1 
x( k )    
 2
x ( k )   2
R ( k )  R2

7
State Variables Example: Apache
MIMO system
KA CPU

Apache u(k) y(k)


Apache
MC MEM x(k)

• MIMO System
• Control Inputs: KeepAlive (KA), MaxClients (MC)
• System Outputs: CPU, MEMory utilization
 x1 (k )   CPU(k )  CPU 
 x (k )  
• MEM(k )  MEM 
x( k )   2   
State variables:
–Current & Past values of CPU, MEM  x3 (k )   CPU(k  1)  CPU 
   
 x4 (k ) MEM(k  1)  MEM
8
State Space Models
• Canonical Representation consists of two
parts
1. State evolution dynamics
x(k  1)  f (x(k ), u(k ))

2. How state determines the system output


y (k )  g(x(k ))

– NOTE: x(k) encapsulates entire history required for the dynamics


• Do not need x(k-1), x(k-2), etc.

9
State Space Model: Example

 x1 ( k )   R1 ( k )  R1 
x( k )    
 2
x ( k )   2
R ( k )  R2

 a11 0   x1 (k )  b
x(k  1)     x ( k )   0  u ( k )
 21
a a 22   2   
 x (k ) 
y (k )  [1 1] 1 
 x2 ( k ) 

10
LTI State Space Model: General Form
x(k  1)  f (x(k ), u(k ))
 Ax (k )  Bu (k )

y (k )  g (x(k ))
 Cx (k )

Tandem Queue Example:


 a11 0 
 a11 0   x1 (k )  b A 
x(k  1)        u ( k )  21
a a 22 
a21 a22   x2 (k ) 0 b 
 x (k )  B 
y (k )  [1 1] 1  0 
 x2 ( k )  C  1 1

11
Comparing Scalar vs Matrix
Descriptions

• Advantages
– Compact notation
– Uniform format
– Analysis based on properties of A, B, and C

12
Realization Theory
• There are many ways to convert difference
equations to state space representations.
• The ones with minimum number of z-1 is
called minimum realizations.
– Control canonical form
– Observer canonical form
– Jordan canonical form
Example: Converting ARX models to
State Space

14
Controller Canonical Realization
Y ( z)

U ( z)

y
u xn x2 x1

 0 1 0 0 0  0 
 0 0 1 0 0  0 
  
A 0 0 0    B     C  [0,..., bm , bm 1 ,,b1 ]
   
     1  0 
 an  an 1 ...  a2  a1  1
Observer Canonical Realization

x1 xn-1 xn

0 0 ... 0  an   bn 
1 0 ... 0 a  b 
 n 1   n 1 
A  0 1 0 ...  an  2  B  bn  2  C  [0, 0,1]
   
        
0 0 ... 1  a1   b1 
Jordan Canonical Realization
Y ( z ) b0  b1 z 1  ...  bm z  m
 1 n
 K  H1 ( z )  H 2 ( z )  ...  H p ( z )
U ( z ) 1  a1 z  ...  an z
H’s are first or second order systems.

u y

 A1   B1 
What are the A, B, C, D?  A2  B 
A  B    C  [C1 , C2 ,...C p ] D  K
2

    
   
 Ap   B p 
State Space Analysis
• State trajectories
• Stability
• Poles

18
Linear Algebra Review
• Matrix 1 2 3
– rows, columns, left*, right* A  0 4 5
– Identity matrix, I
– transpose: AT 1 0 6
– complex conjugate: A*
– determinant 1 0 1 
– rank: The number of linearly A*  AT  2 4 0
independent rows (columns)
(how to check full rank?) 3 5 6
– singular matrix det( A)  22
– inverse (if not singular):
• AA-1=I, A-1A=I
 12 / 11  6 / 11  1 / 11 
A1   5 / 22 3 / 22  5 / 22
 2 / 11 1 / 11 2 / 11 
Eigenvalues
• For a square matrix A, there exist scalars l and
vectors v, such that
Av = lv, or (lI-A)v=0
– l is called an eigenvalue of A and v is the
corresponding eigenvector.
– If A is full rank, then there are n eigenvalues and n
linearly independent eigenvectors.
• Eigendecomposition:
A = PLP-1
State Trajectories

21
Vector/Matrix Z-Transform
• Straightforward extension of the scalar case:
  i 
 1 x (i ) z 
 Z [ x1 (k )]  i 0 
 Z [ x (k )]   i 
X( z )  Z [x(k )]   2    2 x ( i ) z

    i 0 
    
 Z [ xn (k )]
 xn (i ) z  i

 i 0 

22
Solving State Space Equations using Z-
Transform

Take the Z-transform:

Collect terms:

Output equation:

Final Step: Invert the (column of) Z-transforms

23
Exercise: Solving State Space Equations

0
x ( 0)    , U ( z )  0
0.2
Y( z )  C( zI  A) 1 ( zx(0)  BU( z))
Hint: A, B, C  ?
( zI  A) 1  ?
Y( z )  ?
y (k )  ?
24
State Space Transfer Function Matrix
System Model: Z-transform:
x(k  1)  Ax (k )  Bu (k ) Y( z )  C( zI  A) 1 ( zx(0)  BU( z))
y (k )  Cx (k )

If x(0)=0, then:
Y( z )  C( zI  A) 1 BU( z)

Define transfer function matrix:


G( z)  C( zI  A) 1 B

So that:
Y( z )  G ( z ) U( z )

NOTE: gij represents effect of jth input on ith output

25
Poles and Stability
System Model: Z-transform:
x(k  1)  Ax (k )  Bu (k ) Y( z )  C( zI  A) 1 ( zx(0)  BU( z))
y (k )  Cx (k )

Transfer Function: G( z)  C( zI  A) 1 B

Characteristic Equation: det( zI  A)  0

Characteristic Polynomial:

Poles of G(z) are solutions of Characteristic Equation


(aka. Eigenvalues of A)

BIBO Stability: All poles are inside unit circle [same as SISO systems]

26
Example: Apache Model

Poles at: 0.65, 0.52


Open-loop stable

27
Steady-State Gain
Recall: Final-value theorem: ySS  lim( z  1)Y ( z)
z 1

1 1
u (k )  , U( z )  
Unit Step:
z
z 1
1 1

Steady state gain  G(1)  C(I  A) 1 B

28
Controllability
• Idea: can we drive the system into any
(achievable) state?

[Assume x(0)=0]

Controllability matrix:

Controllability  C is invertible

29
Example
Notes with sensor:

1. Determine Controllability.
2. Can drive the system to x=[1 1]’ ?

0.47 0.2  1  1  0.03  0.2


C 
C  0.0019  0.08 0.47 
0.08 0.03

 u (k )  1  1  0.03  0.2 1  89.5 


u (k  1)  C x  0.0019  0.08 0.47  1   205.3
      
30
Controller Canonical Form
• Controller canonical system is controllable.
 0 1 0 0 0  0 
 0 0 1 0 0  0 
  
verify: A 0 0 0    B     C  [0,..., bm , bm 1 ,,b1 ]
   
     1  0 
 an  an 1 ...  a2  a1  1

• All controllable system can be transformed into the


controller canonical form
• Control by state feedback u  kn x1  kn1 x2  ...  k1 xn  v
 0 1 ... 0 
 0 0  
x(k  1)  ( A  bk ) x(k )  bv (k )    x(k )  bv (k )
 0 ...  1 
 
  an  k n  an 1  k n 1  a1  k1 

Recall: poles are defined by det( zI  A)  0


• But, how to obtain states if they are not
measurable?

u x(k  1)  Ax (k )  Bu (k ) y
y (k )  Cx (k )  Du (k )

Observer

x
Observability
• Idea: can we infer all states of system from
observing the output?
– Eg, consider Tandem Queue

Observability matrix:

Observability  O is invertible

33
Example
Tandem Queue:

1. Determine Observability
2. What initial conditions when y(0)=1.22, y(1)=2 ?

34
Observer Canonical Form
• Observer canonical system is observable.
0 0 ... 0  an   bn 
1 0 ... 0 a  b 
verify:  n 1   n 1 
A  0 1 0 ...  an  2  B  bn  2  C  [0, 0,1]
   
        
0 0 ... 1  a1   b1 

• All observerable systems can be transformed into the


observer canonical form
Observers (State Estimators)

u x y
B + z-1 C

A
H +
-
-
B + z-1 x̂ C
y

Let e  xˆ  x then e(k  1)  Ae (k )


What if A is not stable?
Error Dynamics
xˆ (k  1)  Axˆ (k )  Bu (k )  H ( yˆ (k )  y (k ))
yˆ (k )  Cxˆ (k )

since yˆ (k )  y (k )  Ce (k )

we get: e(k  1)  [ A  HC ]e(k )

note: C is a row vector, and H is column vector. Can we place the eigenvalues of
[A-HC] arbitrarily?

What if {A, C} is observable? (Hint: what does HC look like?)

0 0 ... 0  an   bn 
1 0 ... 0 a  b 
 n 1   n 1 
A  0 1 0 ...  an  2  B  bn  2  C  [0, 0,1]
   
        
0 0 ... 1  a1   b1 
Complete Picture

v u x y
+ B + z-1 C

A
H +
-
-
x
B + z-1 C
y

k
Next lecture: controller design

Potrebbero piacerti anche