0% found this document useful (0 votes)
28 views70 pages

Introduction To State Space Methods: Dr. Ed. Palmer School of Electrical & Electronic Systems Engineering

This document introduces state space methods for modeling dynamic systems. It defines the state vector that provides a complete description of the system's behavior. It presents the general continuous and discrete time state equations and gives examples of modeling a spring mass system and LC circuit in state space form. It discusses converting models to canonical forms, simulating systems in MATLAB, and the different canonical forms for discrete time systems.

Uploaded by

adithya_hasibuan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views70 pages

Introduction To State Space Methods: Dr. Ed. Palmer School of Electrical & Electronic Systems Engineering

This document introduces state space methods for modeling dynamic systems. It defines the state vector that provides a complete description of the system's behavior. It presents the general continuous and discrete time state equations and gives examples of modeling a spring mass system and LC circuit in state space form. It discusses converting models to canonical forms, simulating systems in MATLAB, and the different canonical forms for discrete time systems.

Uploaded by

adithya_hasibuan
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 70

1

Introduction to State Space


Methods
Dr. Ed. Palmer
School of Electrical & Electronic Systems
Engineering
2

Contents
 What is a state?
 State space representation
– The state equations - continuous time
 examples
 Matlab simulation
 Discrete time state equations
 Canonical forms
3

Contents
 Solution of the State Equations
 Pulse transfer function matrix
– eigenvalues
4

What is a State?
 A variable which is a member of a set of
states which provide a complete description
of system behaviour
 may or may not have physical significance
 organised into a state vector x
 Provided the value of x at t=0 is known the
state vector completely describes the system
5

State Space Representations


 If the state vector is n dimensional then the
states are described in an n dimensional
space called the state space
 There also exists a vector of output
variables y which may be m dimensional
 Define an r dimensional vector u called the
input vector
6

State Equations
 General state equations
x (t )  f  x(t ), u(t ), t  , y (t )  g(x(t ), u(t ), t )
f and g are vector functions which may be nonlinear
and time varying
7

State Equations
 Linear time varying state equations

x (t )  G (t )x(t )  H (t )u(t ),
y (t )  C(t )x(t )  D(t )u(t )

The matrices G,H,C,D are in general time varying


8

State Equations
 Linear time invariant state equations

x (t )  Gx(t )  Hu(t ),
y (t )  Cx(t )  Du(t )

The matrices G,H,C,D are in general time varying


9

Example 1
 Consider a mass on a spring. The equation
of motion is
k
Mx   kx  x  x
M
Define state vector x   x x 
T

 0 1
 x  Gx, G    k 
 m 0 
Define output
y  x  Cx, C  [1 0]
Example 2 - Parallel LC 10

Circuit
 Consider parallel LC circuit supplied by
variable current source

iL v
u L C
11

Example 2 Parallel LC Circuit


Define state vector
x   iL v 
T

diL diL 1
L v  v
dt dt L
dv dv u iL
u  iL  C   
dt dt C C
12

Example 2 Parallel LC Circuit

diL 1 dv u iL
 v  
dt L dt C C
 diL   1 0 
 dt   0  
L i L  1 u
       
dv 1 v
   0   C 

 dt   C 
13

Matlab Simulation
 Simple technique based on ode23.m routine
 example to say illustrate motion of spring
mass system
MATLAB Simulation using 14

ode23.m
Define state vector
 x
x 
 x 
x(1)  position, x(2)  velocity
x (1)  x(2)
k
x (2)   x(1)
m
MATLAB Simulation using 15

ode23.m
Define MATLAB function to compute state
derivatives deriv.m

function xdot  deriv(t, x)


xdot  [x(2);-k * x(1)/m];
MATLAB Simulation using 16

ode23.m
Define MATLAB program to simulate
system over finite time
% define times
tinit  0;
tfinal  20;
%Define initial conditions
x0  [1;0]; % give x and initial extension of 1.0
MATLAB Simulation using 17

ode23.m
Define MATLAB program to simulate
system over finite time
% Now perform simulation
[t, x]  ode23(' deriv' , tinit, tfinal, x0);
%output is anN by 2 array of position and
velocity values
18

MATLAB Exercise
 Try to simulate the Van Der Pol Oscillator
 
x  x  1 x  x  0
2

 x
Take as a state vector x   
 x 
 
x (1)  x1 1  x 2   x 2 
2

x  2   x1
19

Discrete State Space Equations

x(k  1 )  Gx(k)  Hu(k)


y (k )  Cx(k )  Du(k )

Note that if the system is time-varying then


these matrices may be functions of sample times.
20

Block Diagrams
D

x(k) +
x(k+1) y(k)
u(k) +
H z-1I C
+
+
Heavy lines represent
G
vector flows
21

Canonical Forms
 Any state space representation is not unique
– for example one can re-arrange states to get a
different set of state equations
» a different canonical form
22

Canonical Form Example


 Consider the spring-mass example - Form
another canonical form by re-arranging
states
original state equations
d  x  x
x   , x   
dt  x   x 
 x 
Define a new state vector x1   
 x
23

Canonical Form Example


 x  x 
x   , x1   
 x   x
0 1 
x  Tx1 , T   
1 0
d
x  Gx  Hu   Tx1   GTx1  Hu
dt
24

Canonical Form Example


d
x  Gx  Hu   Tx1   GTx1  Hu
dt
Tx 1  GTx1  Hu
x1  T 1GTx1  T 1 Hu
25

Canonical Form Example


1 1
x 1  T GTx 1  T Hu
 x  G ˆx Hˆu
1 1

ˆ 1 ˆ
G  T GT, H  T H 1

Similarly the output equation


y  Cx  CTx  C ˆx , Cˆ  CT
1 1
26

Canonical Form Example


1 1
x 1  T GTx 1  T Hu
 x  G ˆx Hˆu
1 1

ˆ 1 ˆ
G  T GT, H  T H 1

Similarly the output equation


y  Cx  CTx  C ˆx , Cˆ  CT
1 1

Similar derivation for discrete time systems


Canonical Forms for Discrete 27

Time Systems
 Four main forms
– Controllable Canonical Form
– Observable Canonical Form
– Diagonal Canonical Form
– Jordan Canonical Form
Canonical Forms for Discrete 28

Time Systems
 Based on basic difference equation for
discrete time system
y (k )  a1 y (k  1)  a2 y (k  2)  ...  an y (k  n)
 b0u (k )  b1u (k  1)  ...  bnu (k  n)
29

Controllable Canonical Form


 x1 (k  1)   x1 (k ) 
 x (k  1)   0 1 0 ... 0 
x ( k ) 
 2   0 0 1 ... 0  
2 
.   . 
  .  
.   0 0 0 ... 1 
 . 
 xn 1 (k  1)   xn 1 (k )
   an  an 1  an  2 ...  a1   
 xn (k  1)   xn (k ) 
0 
0 
 
. 
  u (k )
. 
0 
 
1 
30

Controllable Canonical Form


 x1 (k ) 
 x (k ) 
 2 
. 
y (k )   bn  anb0 bn 1  an 1b0 ...b1  a1b0   
. 
 xn 1 (k )
 
 xn (k ) 
 b0u (k )
See Problem A-5-1 for derivation
31

Observable Canonical Form


 x1 (k  1)   x1 (k ) 
 x (k  1)  0 0 ..0 0  an   
 1 0 x ( k )
 2  an 1   
2
..0 0
.   . 
   . . ... . .  
.  0 0 ..1 0  a2  
 . 
 xn 1 (k  1)   xn 1 (k )
  0 0 ..0 1  a1   
 xn (k  1)   xn (k ) 
bn  anb0 
b  a b 
 n 1 n 1 0 
. 
 u (k )
. 
b2  a2b0 
 
b1  a1b0 
32

Observable Canonical Form

 x1 (k ) 
 x (k ) 
 2 
. 
y (k )   0 0 0 ... 0 1    b0u (k )
. 
. 
 
 xn (k )
33

Diagonal Canonical Form


 Where system has distinct poles
 x1 (k  1)   x1 (k )  1
 x (k  1)   p1 0 ... 0 0 
x ( k )  1
 2  0 p2 ... 0 0  
2  
.   .  . 
  . . . . .     u (k )
.  .  .  .
. . . . 
.   .  . 
   0 0 ... 0 pn    
 xn (k  1)  xn (k ) 1
34

Diagonal Canonical Form


 Where system has distinct poles
 x1 (k ) 
 x (k ) 
 2 
. 
y (k )   c1 c2 ... cn     b0u (k )
. 
. 
 
 xn (k )
35

Jordan Canonical Form


 Assume a multiple pole of order m exists at
z = p1
0 
 x (k  1)   x1 (k )   
  .  0 
.    . 
 xm (k  1)   J 012   xm (k )   
      1 u (k )
 xm 1 (k  1) 0 21 D   xm 1 (k )
1 
.  .   
    . 
 xn (k  1)   xn (k )   
1 
36

Jordan Canonical Form


 p` 1 0 ... 0 
 0 p 1 ... 0 
 1 
J. . . . .
 
. . . ... . 
 0 0 0 0 p1 
J : M  M  mth order Jordan block
D : ( N  M )  ( N  M )  diag pm 1... pn 
37

Jordan Canonical Form


O12  M  ( N  M ) matrix of zeros
O 21  ( N  M )  M matrix of zeros
38

Jordan Canonical Form

y (k )   c1 c2 ... cn  x(k)  b0u (k )


39

Example
 Represent the following system in the
controllable, observable and diagonal
canonical forms
Y ( z) z 1
 2
U ( z ) z  1.3 z  0.4
40

Example
Controllable Canonical Form
 x1 (k  1)   0 1   x1 (k )  0
 x (k  1)   0.4  1.3  x (k )  1 u (k )
 2    2   
 x1 (k ) 
y (k )  [1 1] 
 x2 ( k ) 
41

Example
Observable Canonical Form
 x1 (k  1)  0  0.4  x1 (k )  1
 x (k  1)  1  1.3   x (k )  1u (k )
 2    2   
 x1 (k ) 
y (k )  [0 1] 
 x2 ( k ) 
42

Example
Diagonal Canonical Form
 x1 (k  1)   0.5 0   x1 (k )  1
 x (k  1)   0      u (k )
 0.8  x2 (k ) 1
 2  
5  2  x1 (k ) 
y (k )  [ ] 
3 3  x2 ( k ) 
43

Example
Diagonal Canonical Form
This arises since the transfer function can be expanded
as a sum of partial fractions as
5 2
Y(z)
 3  3
U(z) z  0.5 z  0.8
Solving Discrete Time State 44

Space Equations
 Consider the following set of state space
equations
x(k  1)  Gx(k )  Hu(k )
y (k )  Cx(k )  Du(k )

x(1)  Gx(0)  Hu(0)


x(2)  Gx(1)  Hu(1)  G 2 x(0)  GHu(0)  Hu(1)
Solving Discrete Time State 45

Space Equations
x(2)  Gx(1)  Hu (1)  G 2 x(0)  GHu (0)  Hu(1)
x(3)  Gx(2)  Hu (2)  G x(0)  G Hu (0)  GHu (1)
3 2

 Hu (2)
In general k 1
x(k )  G k x(0)   G k  j 1Hu ( j ) k  1,2,3...
j 0

&
k 1
y (k )  CG x(0)  C G k  j 1Hu ( j )  Du(k )
k

j 0
46

State Transition Matrix


 Note that it is possible to write x(k+1) in
the form:
x(k  1)  Ψ (k )x(0)
Ψ (k  1)  GΨ (k ), Ψ(0)  I N
I N  N  N identity matrix
47

State Transition Matrix


 The free motion of the system is defined by
the state transition matrix
k 1
x(k )  Ψ (k )x(0)   Ψ (k  j  1)Hu ( j )
j 0
k 1
x(k )  Ψ (k )x(0)   Ψ ( j )Hu(k  j  1)
j 0
48

State Transition Matrix


 Output Equation
k 1
y (k )  CΨ (k )x(0)  C Ψ (k  j  1)Hu( j )  Du(k )
j 0
k 1
 CΨ (k )x(0)  C Ψ ( j )Hu(k  j  1)  Du(k )
j 0
Z Transform Approach to 49

Solution of State Equations


State equations
x(k  1 )  Gx(k)  Hu(k)
zX( z )  zx(0)  GX( z )  HU ( z )
 zI  G  X( z )  zx(0)  HU( z )
Z Transform Approach to 50

Solution of State Equations


 zI  G  X( z )  zx(0)  HU( z )
 X( z )   zI  G   zx(0)  HU ( z ) 
1

X( z )   zI  G  zx(0)   zI  G  HU ( z )
1 1

x(k )  Z  zI  G  zx(0)   zI  G  HU ( z )
1 1 1
Z Transform Approach to 51

Solution of State Equations


x( k )  Z zI  G  zx(0)   zI  G  HU( z)
1 1 1

x(k )  Z  zI  G  zx(0)  Z  zI  G  HU( z )


1 1 1 1

 G  Z  zI  G  z 
k 1 1

 G HU( j ) Z  zI  G  HU( z )
k 1
k  j 1 1 1

j 0
52

Example
 Obtain the state transition matrix if

 0 1 1
G  , H   , C  [1 0]
 0.16  1 1
u (k )  1 k  0
1 
x ( 0)    For all k...
 1
53

Example
Ψ(k )  G  Z k 1
 zI  G  z
1

1
 z 1 
 zI  G   
1

0.16 z  1
 z 1 1 
  z  0.2 z  0.8  z  0.2 z  0.8 
 
  0.16 z 
  z  0.2 z  0.8  z  0.2 z  0.8 
54

Example

 4 1 5 5 
 3  3 3  3 
 zI  G    z 0.08.2
1 z  0.8
0.8
z  0.2 z  0.8 
1 4 
 3 3 3  3 
 z  0.2 z  0.8 z  0.2 z  0.8 
55

Example

Ψ ( k )  G k  Z 1  z I  G  z
1

 4 1 5 5 k 
 3   0.2   3   0.8   0.2    0.8 
k k k

 3 3
 0.8 0.8 1 4 
   0.2    0.8 k
k
  0.2    0.8 
k k

 3 3 3 3 
56

Example

To obtain x(k ) we compute X( z ) and then take


the inverse z - transform
See Example 5 - 2 Ogata
Pulse Transfer Function 57

Matrix
 Consider the state space representation of
a system with n states, r inputs, and m
outputs.
x(k  1)  Gx(k )  Hu(k )
y (k )  Cx(k )  Du(k )
Pulse Transfer Function 58

Matrix
x(k  1)  Gx(k )  Hu (k )
y (k )  Cx(k )  Du(k )
Taking z - transforms
zX( z )  zx(0)  GX( z )  HU ( z )
Y( z )  CX( z )  DU( z )
Pulse Transfer Function 59

Matrix
zX( z )  zx(0)  GX( z )  HU( z )
Y( z )  CX( z )  DU( z )

X( z )   zI  G  HU( z )
1

 
Y( z )  C zI  G  H  D U( z )  F( z )U( z )
1
Pulse Transfer Function 60

Matrix

 
Y( z )  C zI  G  H  D U( z )  F( z )U( z )
1

F( z )  C zI  G  H  D
1

 pulse transfer function matrix


Pulse Transfer Function 61

Matrix
 
Y( z )  C zI  G  H  D U( z )  F ( z )U( z )
1

Now for any matrix A


1 adj  A 
A  ,
det  A 
adj  A   adjoint of A
det  A   determinant of A
Pulse Transfer Function 62

Matrix
Cadj zI  G  H
 F( z )  D
det  zI  G 
 Poles of system are given as roots of
det  zI  G   0
i.e. characteristic equation is det zI  G   0
Pulse Transfer Function 63

Matrix
The roots of
det  zI  G   0
are the eigenvalues of G
i.e. the poles of a system are the eigenvalues of the
state matrix G
64

Similarity Transformations
 If a new state vector is defined by a
similarity transform such that
x  Px̂, P non - singular, M  M

then the eigenvalues of the new system


are unchanged
65

Similarity Transformations
Under such a transformation
ˆ  P -1GP
G
ˆ  P 1H
H
ˆ  CP
C
ˆ D
D
66

Similarity Transformations

ˆ zI  G
Fˆ ( z )  C ˆ  1
ˆ D
H ˆ

 CP zI  P GP  P H  D
1 1 1
67

Similarity Transformations
ˆF( z )  CP zP  GP  1 H  D

 1
 C zPP  GPP 
1 1
HD
 C zI  G  H  D
1

 F( z )
Note that the characteristic equation is unchanged
68

Next Week
 Review of Matrix Theory - ref.:Appendix A
Ogata
 Definitions
 Determinants
 Inversion
 Multiplication
 Matrix Calculus
69

Next Week
 Vectors - linear dependence and
independence
 Vector spaces, basis vectors
 Orthogonal and Unitary transformations
 Matrix and vector norms
 Eigenvalues and Eigenvectors
 Quadratic forms
70

Next Week
 Pseudoinverses

You might also like