Introduction To State Space Methods: Dr. Ed. Palmer School of Electrical & Electronic Systems Engineering
Introduction To State Space Methods: Dr. Ed. Palmer School of Electrical & Electronic Systems Engineering
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 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 )
State Equations
Linear time invariant state equations
x (t ) Gx(t ) Hu(t ),
y (t ) Cx(t ) Du(t )
Example 1
Consider a mass on a spring. The equation
of motion is
k
Mx 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
diL diL 1
L v v
dt dt L
dv dv u iL
u iL C
dt dt C C
12
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
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) x1 1 x 2 x 2
2
x 2 x1
19
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
ˆ 1 ˆ
G T GT, H T H 1
ˆ 1 ˆ
G T GT, H T H 1
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
x1 (k )
x (k )
2
.
y (k ) 0 0 0 ... 0 1 b0u (k )
.
.
xn (k )
33
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 ) 1u (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 )
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
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
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
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
Matrix
Y( z ) C zI G H D U( z ) F ( z )U( z )
1
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
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
HD
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