You are on page 1of 23

State Space

Representation
Objectives
How to find mathematical model, called a
state-space representation, for a linear, time-
invariant system
How to convert between transfer function and
state space models
How to linearize a state space representation
Plant
Mathematical Model :
Differential equation
Linear, time invariant
Frequency Domain
Technique
Time Domain Technique
General State Representation
Bu Ax x + =

Du Cx y + =
x

x
y
u
A
B
C
D
= state vector
= derivative of the state vector with respect to time
= output vector
= input or control vector
= system matrix
= input matrix
= output matrix
= feedforward matrix
State equation
output equation
General State Dimensions
output equation
Block diagram of the continuous-time system
Bu Ax x + =

Du Cx y + =
State equation
output equation
Some definitions
System variable : any variable that responds to an input or initial
conditions in a system
State variables : the smallest set of linearly independent system
variables such that the values of the members of the set at time
t0 along with known forcing functions completely determine the
value of all system variables for all t t0
State vector : a vector whose elements are the state variables
State space : the n-dimensional space whose axes are the state
variables
State equations : a set of first-order differential equations with b
variables, where the n variables to be solved are the state
variables
Output equation : the algebraic equation that expresses the
output variables of a system as linear combination of the state
variables and the inputs.
Convert a transfer function
u b y a
dt
dy
a
dt
y d
a
dt
y d
n
n
n
n
n
0 0 1
1
1
1
= + + + +


y x =
1
dt
dy
x =
2
choose
2
2
3
dt
y d
x =
1
1

=
n
n
n
dt
y d
x

diferensiasikan
dt
dy
x =
1

2
2
2
dt
y d
x =
3
3
3
dt
y d
x =
n
n
n
dt
y d
x =

n n
x x
x x
x x
=
=
=
1
3 2
2 1

u b x a x a x a x
n n n 0 1 2 1 1 0
+ =


u
b x
x
x
x
x
a a a a a a a x
x
x
x
x
n
n
n n
n
(
(
(
(
(
(
(
(

+
(
(
(
(
(
(
(
(

(
(
(
(
(
(
(
(


=
(
(
(
(
(
(
(
(

0
1
3
2
1
1 5 4 3 2 1 0
1
3
2
1
0
0
0
0
1 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 1 0 0
0 0 0 0 0 1 0

| |
(
(
(
(
(
(
(
(

n
n
x
x
x
x
x
y
1
3
2
1
0 0 0 1

Example : TF to State Space


r c c c c 24 24 26 9 = + + +
c x =
1
c x =
2
1.
Inverse Laplace
c x =
3
2.
Select state variables
2 1
x x =
3 2
x x =
r x x x x 24 9 26 24
3 2 1 3
+ =
1
x c y = =
( )
( )
( ) s D
s N
s G =
( ) s N
( ) s D
numerator
denominator
r
x
x
x
x
x
x
(
(
(

+
(
(
(

(
(
(


=
(
(
(

24
0
0
9 26 24
1 0 0
0 1 0
3
2
1
3
2
1

| |
(
(
(

=
3
2
1
0 0 1
x
x
x
y

Decomposing a transfer function
( ) ( ) ( ) ( ) s X b s b s b s C s Y
1 0 1
2
2
+ + = =
( )
1 0
1
1
2
1
2
2
x b
dt
dx
b
dt
x d
b t y + + =
( )
3 2 2 1 1 0
x b x b x b t y + + =
Example
( )
3 2 1
7 2 x x x t y + + =
| |
(
(
(

=
3
2
1
1 7 2
x
x
x
y
State Space to TF
( ) ( ) ( ) s BU s AX s sX + =
( ) ( ) ( ) s DU s CX s Y + =
( ) ( ) ( ) s BU A sI s X
1
=
Bu Ax x + =

Du Cx y + =
Laplace Transform
( ) ( ) | | ( ) s U D B A sI C s Y + =
1
( )
( )
( )
( ) D B A sI C
s U
s Y
s T + = =
1
u x x
(
(
(

+
(
(
(


=
0
0
10
3 2 1
1 0 0
0 1 0

| |x y 0 0 1 =
( )
(
(
(

=
3 2 1
1 0
0 1
s
s
s
A sI
( )
) det(
) (
1
A sI
A sI adj
A sI

=

1 2 3
) 1 2 (
) 3 ( 1
1 3 ) 2 3 (
2 3
2
2
+ + +
(
(
(

+
+
+ + +
=
s s s
s s s
s s s
s s s
( ) ( ) D B A sI C s T + =
1
( )
1 2 3
) 2 3 ( 10
2 3
2
+ + +
+ +
=
s s s
s s
s T
HOW TO INPUT THE STATE SPACE
MODEL INTO MATLAB
In order to enter a state space model into MATLAB,
enter the coefficient matrices A, B, C, and D into
MATLAB. The syntax for defining a state space model in
MATLAB is:

statespace = ss(A, B, C, D)

where A, B, C, and D are from the standard vector-
matrix form of a state space model.

Example
For the sake of example, lets take m = 2, b = 5, and k = 3.
>> m = 2;
>> b = 5;
>> k = 3;
>> A = [ 0 1 ; -k/m -b/m ];
>> B = [ 0 ; 1/m ];
>> C = [ 1 0 ];
>> D = 0;
>> statespace_ss = ss(A, B, C, D)


EXTRACTING A, B, C, D MATRICES
FROM A STATE SPACE MODEL
In order to extract the A, B, C, and D
matrices from a previously defined state
space model, use MATLAB's ssdata
command.
[A, B, C, D] = ssdata(statespace)
where statespace is the name of the state
space system.

Example
>> [A, B, C, D] = ssdata(statespace_ss)
The MATLAB output will be:
A =

-2.5000 -0.3750
4.0000 0

Cont
B =

0.2500
0
C =

0 0.5000
D =

0