You are on page 1of 11

State-space systems

Solving the state-space dierential equation (Laplace approach)


Now consider the case where there is an input.
dx(t)
dt
= Ax(t) + B u(t).
Taking Laplace transforms gives,
sx(s) x(0) = Ax(s) + B u(s),
which means that,
x(s) = (sI A)
1
x(0) + (sI A)
1
B u(s).
Now the inverse Laplace gives (recall that (t) is dened as L
1
_
(sI A)
1
_
),
x(t) = (t) x(0)
. .
+
_
t
0
(t )Bu() d.
. .
zero-input solution convolution of (t) and B u(t)
We can also use this equation for an arbitrary initial time,
x(t) = (t t
0
) x(t
0
) +
_
t
t0
(t ) B u() d.
Roy Smith: ECE 147b 9: 2
State-space systems
Solving the state-space dierential equation (Laplace approach)
Consider a continuous time state-space representation.
dx(t)
dt
= Ax(t) + B u(t),
y(t) = C x(t) + Du(t).
To begin, look at the zero-input solution
dx(t)
dt
= Ax(t).
Taking unilateral Laplace transforms gives,
sx(s) x(0) = Ax(s) where x(0) = x(t) at t = 0.
This gives,
(sI A)x(s) = x(0), or x(s) = (sI A)
1
x(0).
Taking an inverse Laplace transform gives,
x(t) = L
1
_
(sI A)
1
_
x(0) = (t)x(0).
(t), is also known as the State Transition Matrix.
Roy Smith: ECE 147b 9: 1
State-space systems
Example (continued)
Now look at the State Transition Matrix,
(t) = L
1
_
(sI A)
1
_
= L
1
_
1
s +
_
= e
t
(this looks just like the impulse reponse)
So we can calculate ,
x(t) = e
t
x(0) +
_
t
0
e
(t)
u() d.
Step response: Zero initial condition (x(0) = 0).
As u(t) = 1 for t 0,
y(t) = x(t) = e
t
0 +
_
t
0
e
(t)
d, = e
t
_
t
0
e

d,
= e
t
[e

|
=t
e

|
=0
] = e
t
_
e
t
1
_
= 1 e
t
.
Roy Smith: ECE 147b 9: 4
State-space systems
A simple example: A rst order system ( > 0).

s +

u(s) y(s)
Take the initial conditions to be zero. The dierential equation is,
dy(t)
dt
+ y(t) = u(t).
Dene the state as, x(t) = y(t), then,
dx(t)
dt
= x(t) + u(t),
y(t) = x(t)
or
dx(t)
dt
=
_

_
x(t) +
_

_
u(t),
y(t) =
_
1
_
x(t) +
_
0
_
u(t).
So the state-space representation is: A = , B = , C = 1 and D = 0.
Roy Smith: ECE 147b 9: 3
Matrix exponentials
To get the next term dierentiate the expansion to give,
dx(t)
dt
= v
1
+ 2v
2
(t t
0
) + 3v
3
(t t
0
)
2
+
Again choosing t = t
0
gives,
dx(t
0
)
dt
= v
1
.
But we know that
dx(t)
dt
= Ax(t), so,
v
1
= Ax(t
0
).
Dierentiate again to get,
d
2
x(t)
dt
2
= 2v
2
+ 6v
3
(t t
0
) + 12v
4
(t t
0
)
2
+
Choosing t = t
0
gives, v
2
=
1
2
d
2
x(t
0
)
dt
2
.
But
d
2
x(t)
dt
2
=
dAx(t)
dt
= A
dx(t)
dt
= A
2
x(t), so
v
2
=
A
2
2
x(t
0
).
Roy Smith: ECE 147b 9: 6
Matrix exponentials
Matrix exponential approach
We will look at an alternative way of deriving (t) using the matrix exponential.
Consider the zero-input case,
dx(t)
dt
= Ax(t).
Assume that x(t) is smooth and look at an expansion of x(t) about a point t = t
0
.
x(t) = v
0
+ v
1
(t t
0
) + v
2
(t t
0
)
2
+
Here the v
i
are constant vectors of the same size as x(t).
Lets use the dierential equation to work out v
i
, i = 0, 1, . . .
As the above is supposed to hold for all t, choose t = t
0
to get,
x(t
0
) = v
0
This gives us the rst vector in the expansion.
Roy Smith: ECE 147b 9: 5
Solving state-space dierential equations
Matrix exponential approach to solving state-space dierential equations.
We can begin by guessing a solution of the form,
x(t) = e
At
v(t), where v(t) is a time-varying vector.
Dierentiate this to get,
dx(t)
dt
= Ae
At
v(t) + e
At
dv(t)
dt
= Ax(t) + B u(t). (from the dierential equation)
= Ae
At
v(t) + B u(t) (by substituting for x(t))
and by equating the rst & third lines,
e
At
dv(t)
dt
= B u(t)
dv(t)
dt
= e
At
Bu(t).
Solve this by integrating to get:
v(t) v(0) =
_
t
0
e
A
Bu() d.
Roy Smith: ECE 147b 9: 8
Matrix exponentials
We can keep dierentiating, substituting t = t
0
, and solving for the v
i
terms.
This eventually gives,
x(t) = x(t
0
) + A(t t
0
) x(t
0
) +
A
2
2
(t t
0
)
2
x(t
0
) +
A
3
3!
(t t
0
)
3
x(t
0
) +
=
_
I + A(t t
0
) +
A
2
2
(t t
0
)
2
+
A
3
3!
(t t
0
)
3
+
_
. .
x(t
0
).
dene this as e
A(tt0)
If t
0
= 0 (as is usually the case) we have,
x(t) = e
At
x(0) and so (t) = e
At
.
In Matlab the command expm calculates the matrix exponential.
Caveat emptor. This is not the same as the exponential of the individual elements of a
matrix (which is calculated by the Matlab command: exp).
Properties:
e
A0
= I, e
A(s+t)
= e
As
e
At
, e
At
e
At
= I,
d e
At
dt
= Ae
At
.
Roy Smith: ECE 147b 9: 7
State transition matrix
Example:
P(s) =
(s 1)
(s + 1)(s + 2)
.
This system has a state-space representation:
A =
_
3 2
1 0
_
, B =
_
1
0
_
, C =
_
1 1

, D = 0.
The state transition matrix is (t) = e
At
= L
1
_
(sI A)
1
_
.
In this example:
e
At
= L
1
_
__
s 0
0 s
_

_
3 2
1 0
__
1
_
= L
1
_
_
s + 3 2
1 s
_
1
_
= L
1
_
1
s(s + 3) + 2
_
s 2
1 s + 3
__
= L
1
_

_
_

_
2
s + 2
+
1
s + 1
2
s + 2
+
2
s + 1
1
s + 2
+
1
s + 1
1
s + 2
+
2
s + 1
_

_
_

_
=
_
_
2e
2t
e
t
2e
2t
2e
t
e
2t
+ e
t
e
2t
+ 2e
t
_
_
Roy Smith: ECE 147b 9: 10
Solving state-space dierential equations
From before,
v(t) v(0) =
_
t
0
e
A
Bu() d.
but,
x(t) = e
At
v(t) so v(t) = e
At
x(t) and v(0) = x(0).
Substituting these gives,
e
At
x(t) x(0) =
_
t
0
e
A
Bu() d.
or,
x(t) = e
At
x(0) + e
At
_
t
0
e
A
Bu() d,
= e
At
x(0) +
_
t
0
e
A(t)
Bu() d,
This is exactly the same solution as before where (t) = e
At
.
Roy Smith: ECE 147b 9: 9
Transfer functions
We also have,
y(s) = C x(s) + Du(s).
and substituting for x(s) gives,
y(s) =
_
C(sI A)
1
B + D

u(s).
So the transfer function is:
y(s)
u(s)
= P(s) = C(sI A)
1
B + D.
Example: (trivial)
A = , B = , C = 1, D = 0.
P(s) = C(sI A)
1
B + D = 1(s ())
1
+ 0 =

s +
.
Discrete time case:
Perform the same operations with Z-transforms to get,
P(z) = C(zI A)
1
B + D.
Roy Smith: ECE 147b 9: 12
Transfer functions
Transfer functions (continuous time)
Assume that x(0) = 0.
dx(t)
dt
= Ax(t) + B u(t),
y(t) = C x(t) + Du(t).
Turn this into a transfer function simply by taking Laplace transforms and solving for
y(s)/u(s).
Doing this gives,
s x(t) = Ax(s) + B u(s),
which implies that,
x(s) = (sI A)
1
B u(s).
Roy Smith: ECE 147b 9: 11
Poles and zeros
Poles and zeros
If a system, P(s), has a pole at s = p
i
, then its partial fraction expansion is,
P(s) =
a(s)
b(s)
=
(s z
1
) . . . (s z
m
)
(s p
1
) . . . (s p
i
) . . . (s p
n
)
=
E
1
(s p
1
)
+ +
E
i
(s p
i
)
+ +
E
n
(s p
n
)
.
For the moment assume that p
i
is not repeated.
The impulse response will be of the form,
p(t) = E
1
e
p1t
+ + E
i
e
pit
+ + E
n
e
pnt
.
The zero-input solutions of the corresponding dierential equation will have terms of the
form,
y(t) = k
i
e
pit
+ . . .
Look at this idea from a state-space point of view.
Roy Smith: ECE 147b 9: 14
Transfer functions
Example: (revisted)
P(s) =
(s 1)
(s + 1)(s + 2)
.
This system has a state-space representation:
A =
_
3 2
1 0
_
, B =
_
1
0
_
, C =
_
1 1

, D = 0.
From before we have,
(sI A)
1
=
1
s(s + 3) + 2
_
s 2
1 s + 3
_
,
so,
C(sI A)
1
B + D =
1
s(s + 3) + 2
_
1 1

_
s 2
1 s + 3
_ _
1
0
_
+ 0
=
1
s(s + 3) + 2
_
1 1

_
s
1
_
=
s 1
s
2
+ 3s + 2
.
Roy Smith: ECE 147b 9: 13
Poles and zeros
Example: (yet again)
P(s) =
(s 1)
(s + 1)(s + 2)
.
This system has a state-space representation:
A =
_
3 2
1 0
_
, B =
_
1
0
_
, C =
_
1 1

, D = 0.
We will sometimes abbreviate this to,
P(s) =
_
_
3 2
1 0
1
0
1 1 0
_
_
. Note that the dimensions always make this possible.
Eigenvalue equation:
The eigenvalues of A satisfy,
det(I A) = 0.
But here we see that this is simply the roots of the denominator,
det
_
+ 3 2
1
_
= ( + 3) + 2 =
2
+ 3 + 2 = ( + 1)( + 2) = 0.
Roy Smith: ECE 147b 9: 16
Poles and zeros
State-space point of view:
Consider the zero-input case,
dx(t)
dt
= Ax(t), and look at solutions of the form,
x(t) = e
pit
x(0).
Dierentiating this gives,
dx(t)
dt
= p
i
e
pit
x
0
= p
i
x(t).
As
dx(t)
dt
= Ax(t), we have,
Ax(t) = p
i
x(t),
and taking t = 0 gives,
Ax(0) = p
i
x(0) This is an eigenvalue equation.
The eigenvalues of A are the poles of P(s).
The poles (eigenvalues) are also called natural frequencies or modes of P(s).
Roy Smith: ECE 147b 9: 15
Similarity transforms
Similarity transforms
Dene a new state, (t), by the linear invertible transform,
(t) = V
1
x(t) or, equivalently, x(t) = V (t).
Recall the usual state-space equations,
dx(t)
dt
= Ax(t) + B u(t),
y(t) = C x(t) + Du(t),
and substitute for x(t).
V
d(t)
dt
= AV (t) + B u(t),
y(t) = C V (t) + Du(t),
or
d(t)
dt
= V
1
AV (t) + V
1
B u(t),
y(t) = C V (t) + Du(t).
Substituting V
1
AV = , gives,
d(t)
dt
= (t) + V
1
B u(t),
y(t) = C V (t) + Du(t).
This is a new (and completely equivalent) state-space description.
Roy Smith: ECE 147b 9: 18
Similarity transforms
Eigenvalues and similarity transforms
We can diagonalize most matrices by a transformation,
A = V V
1
, where =
_
_

1
0
.
.
.
0
n
_
_
is diagonal.
In the previous example,
_
3 2
1 0
_
. .
=
_
2

2/2
1

2/2
_
. .
_
2 0
0 1
_
. .
_

2/2

2/2
1 2
_
. .
A V V
1
The Matlab command eig does this eigenvalue decomposition.
Exercise:
1. Calculate this decomposition by hand.
Roy Smith: ECE 147b 9: 17
Poles and zeros
Zeros
If P(s) =
y(s)
u(s)
has a zero at s = s
0
, then for all inputs u(s
0
) the output y(s
0
) = 0.
This is equivalent to,
0 = C(s
0
I A)
1
B + D
Using a state-space Laplace domain form (at s = s
0
) we have,
s
0
x(s
0
) = Ax(s
0
) + B u(s
0
)
0 = C x(s
0
) + Du(s
0
)
This can be rearranged into matrix form,
_
(s
0
I A) B
C D
_ _
x(s
0
)
u(s
0
)
_
= 0.
This means that the matrix,
_
(s
0
I A) B
C D
_
is singular, or equivalently det
_
(s
0
I A) B
C D
_
= 0.
Roy Smith: ECE 147b 9: 20
Similarity transforms
Similarity transforms
Any invertible n n matrix, V , can be used to transform a matrix,

A = V AV
1
.
The matrix,

A is similar to (has the same eigenvalues as) A.
This is called a similarity transform.
Similarity transformed state-space representations
By dening a new state, (t) = V
1
x(t),
_
A B
C D
_
=
_
V
1
AV V
1
B
CV D
_
.
So there are obviously an innite number of equivalent state-space representations.
Exercises:
1. Show that the eigenvalues of A are unchanged by a similarity transform.
2. Show that the transfer function is unchanged by a similarity transform of A.
Roy Smith: ECE 147b 9: 19
Poles and zeros
Summary: Continuous time
Poles are given by: det(sI A) = 0
Zeros are given by: det
_
(sI A) B
C D
_
= 0.
Summary: Discrete time
Poles are given by: det(zI A) = 0
Zeros are given by: det
_
(zI A) B
C D
_
= 0.
Roy Smith: ECE 147b 9: 21

You might also like