Page : 1 EE406 Control Systems Lecture 16 : State Space Analysis I
UCSI University Faculty of Engineering Kuala Lumpur, Malaysia Department of Mechatronics
Lecture 16
State Space Analysis I
Mohd Sulhi bin Azman Lecturer
Department of Mechatronics UCSI University
1 August 2011
Contents
• Review – eigenvalues and eigenvectors
• Classical vs modern control
• General definition of state space
• State variables
• Essential conversions
– Differential equation to state space – Transfer function to state space – State space to transfer function – State space to differential equations
Page : 3 EE406 Control Systems Lecture 16 : State Space Analysis I
Review : Eigenvalues
• Every square matrix has its eigenvalues and corresponding eigenvectors.
• The eigenvalues, usually denoted by the symbol λ, is found by forming the characteristic equation:
• Eigenvalues can tell us about the stability of a system. A system is stable if and only if the eigenvalues of A have negative real parts.
(
)
det λI −A = λI − =A 0
Classical vs Modern Control
• Classical control system
– Analysis is performed in frequency/s-domain – Example : root locus, bode diagram, nyquist plot
• Modern control system
– Introduced due to arrival of space exploration.
– Modeling using LTI system becomes inadequate. The effect of time must be taken into account.
– Applicable for all type of system: linear, non-linear, digital system and MIMO system.
Page : 5 EE406 Control Systems Lecture 16 : State Space Analysis I
Introduction
• In state space analysis, the dynamic of a control system is described by a set of first order differential
equations.
• The general format is written as follows:
• Where:
– x is (n x n) state vector – u is (m x n) input vector
x Ax Bu y Cx Du
= +
= +
ɺ
Introduction
• It is such that:
11 12 1
21 22 2
1 1
n n n n
n n nn
a a a
a a a
A
a a a
× = ⋯ ⋯ ⋮ ⋮ ⋱ ⋮ ⋯
11 12 1
21 22 2
1 1
n n n m
n n nm
b b b
b b b
B
b b b
× = ⋯ ⋯ ⋮ ⋮ ⋱ ⋮ ⋯
11 12 1
1 2
n p n
p p pn
c c c
C
c c c
× = ⋯ ⋮ ⋮ ⋱ ⋮ ⋯
11 12 1
1 2
n p m
p p pm
d d d
D
d d d
Page : 7 EE406 Control Systems Lecture 16 : State Space Analysis I
State Variables
• A state variable is one of the set of variables that describe the "state" of a dynamical system.
• Intuitively, the state of a system describes enough about the system to determine its future behaviour.
• Models that consist of coupled first-order differential equations are said to be in state-variable form.
• A state variable is a time-related quantity. For example, voltage and current is a state variable, but not
resistance or inductance.
Page : 9 EE406 Control Systems Lecture 16 : State Space Analysis I
Essential Conversion (2)
• Type 2 : Converting from TF to SS.
• Example : Convert the following transfer
function to state space.
Essential Conversion (2)
Page : 11 EE406 Control Systems Lecture 16 : State Space Analysis I
Essential Conversion (2)
Essential Conversion (3)
• Type 3 : SS to TF.
• Consider the following equation:
• Our main task is to convert the above state space
equation to transfer function.
• To do so, take the forward Laplace transform and
assume zero initial conditions.
x
Ax
Bu
y
Cx
Du
=
+
=
+
Page : 13 EE406 Control Systems Lecture 16 : State Space Analysis I
Essential Conversion (3)
• This will become:
• Rearranging the first equation gives:
• Substituting into the output equation gives:
( )
( )
( )
( )
( )
( )
sX s
AX s
BU s
Y s
CX s
DU s
=
+
=
+
(
)
1( )
( )
X s
= −
s
IA
−B U s
inverse of a matrix
(
)
1( )
( )
( )
Y s
=
C s
−
IA
−B U s
+
DU s
Essential Conversion (3)
• Simplifying (by factorizing U(s)) gives:
• And since U(s) is an input function, then the
transfer function is defined as the
output-over-input, which is:
(
)
1( )
( )
Y s
=
C sI
−
A
−B
+
D U s
(
)
1( )
( )
Y s
TF
C sI
A
B
D
U s
−
Page : 15 EE406 Control Systems Lecture 16 : State Space Analysis I
Various Representation of Transfer Functions in State Space
• We can represent a transfer function in various state space format. There are essentially four state space formats that will be of our main concern:
– Controllable canonical form – Observable canonical form – Diagonal canonical form – Jordan canonical form
• Let us look and study all of this form in the next slide. Now, the general format of transfer function is:
1
0 1 1
1 2
1 2 1
n n n
n n
n n n
n n
b s
b s
b s
b
TF
s
a s
a s
a
s
a
−
−
− −
−
+
+
+
=
+
+
+ +
+
⋯
⋯
Controllable Canonical Form
• The controllable canonical form (in state space, that is) is given as follows:
Page : 17 EE406 Control Systems Lecture 16 : State Space Analysis I
Controllable Canonical Form
• The output equation is given as:
Observable Canonical Form
Page : 19 EE406 Control Systems Lecture 16 : State Space Analysis I
Diagonal Canonical Form
• A diagonal canonical form is a little different.
To represent your transfer function in diagonal
canonical form, you must first sort your
transfer function in the following form (factor
the denominator):
Diagonal Canonical Form
Page : 21 EE406 Control Systems Lecture 16 : State Space Analysis I
Jordan Canonical Form
• Now, a Jordan canonical form can only be used
to represent a transfer function having multiple
poles, given as follows:
• On expansion, one obtains:
Jordan Canonical Form
Page : 23 EE406 Control Systems Lecture 16 : State Space Analysis I
Example 1
• Consider the following transfer function:
• Obtain a controllable, observable and diagonal
canonical forms.
2
3
( )
3
2
s
G s
s
s
+
=
+ +
Page : 25 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution of Homogenous State Equations
• We consider the following homogenous state equations:
• To solve this state equation, we do the following:
x
ɺ
=
Ax
(
)
( )
(
)
( )
(
) ( )
(
) ( )
(
) ( )
( )
1 1 1 1 1state transition matrix
( ) 0 ( )
( ) 0
( ) 0
( ) 0
( ) 0
( ) ( ) 0
x Ax
sX s x AX s
sI A X s x
X s sI A x
X s s IA x
x t sI A x
x t t x − − − − − = − = − = = − = − = − = Φ ɺ L L L
Take forward Laplace transform
Re-arrange
Take inverse Laplace transform
State Transition Matrix
• The state transition matrix maps the initial state to the state at some time, t.
• The state-transition matrix can be used to obtain the general solution of linear dynamical systems.
• And we note that:
• On expansion by using Taylor’s series, one obtains:
(
)
1 1( )t − s IA −
Φ =L −
(
)
1 22 3
At
I
A
A
s
IA
e
s
s
s
−
Page : 27 EE406 Control Systems Lecture 16 : State Space Analysis I
State Transition Matrix
• And thus, taking the inverse Laplace transform would result in:
• Here, we note that A is a matrix. Thus, the inverse Laplace transform of a matrix is the matrix consisting of the inverse Laplace transform of all elements.
• The expression eAt is called matrix exponential.
(
)
1 21 1
2 3
2 2 3 3
( )
2! 3!
At
I A A
s IA
s s s
A t A t
t I At e
−
− − = − + + +
Φ = + + + + =
⋯
⋯
L L
Example 1
• Obtain a state transition matrix for the
following system:
1 1
2 2
0
1
2
3
x
x
x
x
=
−
−
Page : 29 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution to Example 1
• We note that:
• The state transition matrix is given by:
• Let us first compute (sI-A)
-1, where I is an
identity matrix.
0
1
2
3
A
=
−
−
(
)
11
( )
t
−sI
A
−Φ =
L
−
Solution to Example 1
• We have:
• Taking the inverse Laplace transform, we obtain:
(
)
(
)
(
)(
)
(
)(
) (
)(
)
(
)(
) (
)(
)
1 1 1 2 3 3 12 1 2 1
1 1 3 1
2 3 2 1 2 2
2 1 2 1
s s IA
s
s
s s s s
s s
s IA
s s s s s
s s s s
− − − − = + + + + + + − + − = + = + + − = − + + + +
Expand each elements via partial fraction method!
2 2
2 2
2
( )
2
2
2
t t t t
t t t t
e
e
e
e
t
e
e
e
e
− − − −
− − − −
−
−
Φ =
−
+
−
+
Page : 31 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution of Non-homogenous State Equations
• Consider a non-homogenous state equations:
• The solution to the above equation is outlined as follows:
x
ɺ
=
Ax
+
Bu
(
)
( )
(
)
( )
(
)
( )
(
) ( ) (
)
(
) ( ) (
)
( )
( )1 1 1
1 1
1
use convolution theorem
0
( ) 0 ( ) ( )
( ) 0 ( )
( ) 0 ( ) 0 ( )
( ) 0 ( )
( ) At 0 t A t ( )
x Ax Bu
sX s x AX s BU s
s IA X s x BU s
X s s IA x BU s s IA x s IA BU s
X s s IA x s IA BU s
x t e x e τ Bu τ τd
− − − − − − − = + − = + − = + = − + = − + − = − + − = +
∫
ɺ L LExample 2
• Obtain a time response for the following system:
• Note that the input u(t)=1.
1 1
2 2
0
1
0
2
3
1
Page : 33 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution to Example 2
• The state transition matrix is obtained from the previous example:
• The response is given as:
2 2
2 2
2
( )
2
2
2
t t t t
At
t t t t
e
e
e
e
t
e
e
e
e
e
− − − −
− − − −
−
−
Φ =
=
−
+
− +
( )
( )
( ) ( ) ( ) ( ) ( ) ( ) ( ) 2 2 1 2 2 2τ 2 τ τ 2 τ τ 2 τ 2 τ
0
0
2
( )
0
2
2
2
2
0
[1]
1
2
2
2
t t t t
t t t t
t t t t
t
t t t t
x
e
e
e
e
x t
x
e
e
e
e
e
e
e
e
d
e
e
e
e
τ
− − − − − − − − − − − − − − − − − − − − − − −
−
−
=
−
+
− +
−
−
+
−
+
−
+
∫
Multiply the matrices first, then integrate!
Solution to Example 2
• The solution is:
• If the initial state is zero, that is x(0)=0, then
x(t) is equal to:
( )
( )
2 2 1 1 2
1 2 2
2 2 2
2
0
2
( )
0
2
2
2
t t t t t t
t t t t t t
x
e
e
e
e
e
e
x t
x
e
e
e
e
e
e
Page : 35 EE406 Control Systems Lecture 16 : State Space Analysis I
Cayley-Hamilton Theorem
• The Cayley-Hamilton Theorem can also be used to determine the matrix exponential eAt.
• The theorem states that every square matrix satisfies its characteristic equation.
• Definition: Consider a square matrix A and I (identity matrix) with an order (n x n). Then the characteristic polynomial of A is defined as:
• And hence, substituting the matrix A for λ results in p(A)=0.
( )
λ
det
(
λ
)
p
=
I
−
A
Cayley-Hamilton Theorem
• In another word, if A and I is of the order (n x n), then thecharacteristic equation is:
• And this satisfies:
• And this is what we call the Cayley-Hamilton Theorem. It is very useful method in computing the matrix exponential. Of course, there are many other methods that you can use, but that will not be discussed in this lecture. You can read the textbook for any other methods.
( )
(
)
1 2 2
1 2 2 1
λ
det
λ
λ
0
λ
nλ
nλ
nλ
+
λ
+
0
n n n
p
I
A
I
A
a
−a
−a
−a
−a
=
−
=
− =
=
+
+
+ +
⋯
=
( )
1 2 21 2 2 1
A
A
nA
nA
n nA
nA+
n0
Page : 37 EE406 Control Systems Lecture 16 : State Space Analysis I
Cayley-Hamilton Theorem
• Given an (n x n) matrix A with the following characteristic equation:
• And let λ1, λ2and λ3 be the eigenvalues of A. Hence the
matrix polynomial is:
• And if q(λ) is divided by the characteristic polynomial f(λ), we then have, by factor theorem:
( )
1 2 21 2 2 1
λ λn λn λn λ + λ+ 0
n n n
q = +a − +a − + +⋯ a − a − a =
( )
20 1 2
λ
λ
λ
λ
λ
nn
f
=
k
+
k
+
k
+ +
⋯
k
( )
( )
( )
( )
( )
λ λ
λ
λ λ
f R
Q
q = + q
Remainder
Cayley-Hamilton Theorem
• Rearranging gives:
• And the remainder is:
• And evaluating f(λ) at λ1, λ2and λ3, then q(λ)=0. Thus, we
have:
• Now, how do we obtain the coefficients α0, α1, …, αn?
– The answer is that we substitute the values of λ1, λ2and λ3, into:
( )
λ( ) ( ) ( )
λ λ λf =Q q +R
( )
20 1 2
λ α α λ α λ α λn
n
R = + + + +
⋯
( )
λ( )
λ,
1, 2,
,
i i
f = R i=
…
nPage : 39 EE406 Control Systems Lecture 16 : State Space Analysis I
Cayley-Hamilton Theorem
• Since we are dealing with a matrix, then by Cayley-Hamilton Theorem, we have:
• And since we know that q(A) is identically zero (from the previous slide), it essentially follows that:
• Which is our desired result.
( )
A
( ) ( ) ( )
A
A
A
f
=
Q
q
+
R
( )
( )
20 1 2
A A α αA α A α An
n
f =R = I+ + + +⋯
Cayley-Hamilton Theorem
• Now, the procedure for using the Cayley-Hamilton Theorem is as follows:
1. Find the eigenvalues of matrix A
2. If all the eigenvalues of A is distinct, then solve:
in order to obtain the coefficients α0, α1, …, αn.
( )
λ( )
λ , 1, 2, ,i i
Page : 41 EE406 Control Systems Lecture 16 : State Space Analysis I
Example 3
• Use Cayley-Hamilton Theorem to find f(A)=A
10for:
0 1
2 3
A=
− −
Solution to Example 3
• First, obtain the eigenvalues:• Since A is a 2-by-2 matrix, i.e. a second order matrix, then the remainder polynomial is of the following form:
• Now, how do we find α0and α1? Use substitution!
(
)(
)
{
}
λ 1
λ λ 1 λ 2 0
2 λ 3
λ 1, 2
I − =A − = + + =
+ = − −
( )
λ
α
0α λ
1R
=
+
( )
( )
10 10
0 1 0 1
1 0 1 1
10 10
1 α α α α 1
λ α α λ
α 2α 1024
− = − − =
= + ⇒ ⇒
− =
Page : 43 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution to Example 3
• Solving these two simultaneous equation (either by using Cramer’s Rule or calculator), you will get:
• Note : Another alternative method is to use long division. That is:
• Anyway, since we have found the values of α0and α1, the next thing
to do is to substitute these values into the remainder function, R(λ). And so we get:
0
1
α
1022
α
1023
= −
= −
(
)
10
2 10
2
λ
λ 3λ 2 λ try this out! - use long division
λ +3λ+2 = + + =
( )
( )
λ 1022 1023λ
1022 1023 R
R A A
= − −
= − − By virtue of Cayley-Hamilton Theorem
Solution to Example 3
• And so the solution is:
( )
( )
( )
10
10
10
1022
1023
1
0
0
1
1022
1023
0
1
2
3
1022
1023
2046
2047
f A
I
A
f A
f A
= −
−
= −
−
−
−
−
−
=
Page : 45 EE406 Control Systems Lecture 16 : State Space Analysis I
Example 4
• Calculate the matrix exponential i.e. f(A)=e
Atfor a system having:
0
1
1
2
A
=
−
−
Solution to Example 4
• The characteristic equation is given as:
• And upon solving, we observe that the eigenvalues are repeated, that is:
• Since this matrix is of a second order (i.e. 2-by-2), then the polynomial R(λ) is of the form:
( )
λ
1
(
)
2 2λ
λ
λ
1
λ
2
λ
1 0
1
λ
2
q
=
I
− =
A
−
= +
=
+
+ =
+
1,2
λ
= −
1
( )
λ
α
0α λ
1Page : 47 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution to Example 4
• Now:
• To evaluate for
α
0
and
α
1, we differentiate
equation (i) with respect to
λ
. That is:
( )
(
)
λ
0 1
1 0 1
λ
α
α λ
λ
1
α
α
t
t
f
e
f
e
−=
=
+
∴
= − =
=
−
(i) (ii)( )
(
)
λ 0 1 λ 1 λ1 λ 1 1
λ
α
α λ
λ
α
α
t t td
f
e
d
t e
t e
=− =− −
=
=
+
=
=
Solution to Example 4
• Therefore, since
, then, to find , we
simply make substitution. But before we do that,
it is wise to rearrange equation (i). And we have:
• Now, substitute the values of in the
equation above, not forgetting to also let :
1
α
=
t e
−tα
0λ
0 1 λ
0 1
α
α λ
α
α λ
t t
e
e
=
+
=
−
1α
=
t e
−t1
λ
= −
1
( )
( )
0
Page : 49 EE406 Control Systems Lecture 16 : State Space Analysis I
Solution to Example 4
• And hence, by Cayley-Hamilton Theorem, our remainder polynomial is also in fact equals to f(A), which is:
• And on substitution, we have:
( )
A
α
0α
1A
f
=
I
+
( ) ( )
( ) ( )
( )
1
0
0
1
A
1
0
1
1
2
1
A
1
t t
t t
t t
f
t e
t e
t e
te
f
te
t e
− −
− −
− −
= +
+
−
−
+
=
−
−
Next Step
• Textbook reference : Chapter 12.
• Homework 15 has been posted on the course
website. Attempt them. You do not have to