0% found this document useful (0 votes)
78 views

State Space Representation Part-1

- The document summarizes a lecture on state-space representation of dynamic systems. - It introduces state-space analysis which represents higher order differential equations as sets of first order equations using state variables. - The key aspects covered are defining state variables, writing the system in matrix state-space form using state, input, output and system matrices, and obtaining the state transition matrix. - An example of converting a transfer function to state-space form using phase variables is presented.

Uploaded by

Singappuli
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

State Space Representation Part-1

- The document summarizes a lecture on state-space representation of dynamic systems. - It introduces state-space analysis which represents higher order differential equations as sets of first order equations using state variables. - The key aspects covered are defining state variables, writing the system in matrix state-space form using state, input, output and system matrices, and obtaining the state transition matrix. - An example of converting a transfer function to state-space form using phase variables is presented.

Uploaded by

Singappuli
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 47

Lecture -6: State-space Representation -2

hours

By Mr S Wijewardana
PhD student QMUL 21-04-
2013

Learning Objectives:
1. Reduction of higher order equations to first-
order.
2. State Equations and Stare Variables.
3. State-space Analysis & State-space Model.
4. From State-space to Transfer Functions.

Solution of higher order differential equations are
much more difficult to handle than first order
differential equations.
It is easy to handle mathematically when the order
of the differential equation is of first order.

include


Consider the differential equation given below:


The easiest way to solve the
above equation is to do a
substitution:

Now we can write the equation:
x y y = +
. ..
w y =
.
x w w = +
.
This equation is much
easier to handle than the
second derivative equation -
1
--------eq1
From our Maths knowledge we can see that we have to use an integral factor to
solve the equation now:
Where p is the coefficient in front of the independent variable x:
Nothing will happen to the equation if we multiply each term by an
integrating factor:
x
dx pdx
e e e =
}
=
}
=
x e w e w e
x x x
= +
.
2 1
2
1
1
1
.
2
1
) 1 (
1
) (
) (
c e c x x
dx e c x w y
e c x w
c e xe
dx e xe
dx xe w e
xe w e
dx
d
x
x
x
x x
x x
x x
x x
+ + =
= =
=
+ =
=
=
=

} }
}
}
Consider two differential equations as shown below:
Reduce them to first order differential equations:
0 3 3
0 3 4 3
. ... . ..
. ... . ..
= + + +
= + + + +
v v v u u
v v v u u u
-----------eq- 1


------------eq-2
Assume:
5
4
.
4
3
.
2
.
1
.
..
5
.
4 3
.
2 1
:
; ; ; ;
x x
x x
x u x
Hence
v x v x v x u x u x
=
=
= =
= = = = =
Eq-1 &2 can now be
written:
0 3 3
0 3 4 3
3 4
5
.
2
2
.
3 4
5
.
1 2
.
2
= + + +
= + + + +
x x x x x
x x x x x x
By adding and subtracting the last two equations:
4 0 2
3 0 2 2 2 3
4 3 1
5
.
3 4 1 2
2
.
eq x x x x
eq x x x x x
= +
= + + +
We can write all equations as shown below:
4 3 1
.
5
.
4
.
4 3 2 1
.
.
2 5
4
3
2 2 3 2 2
2 1
x x x x
x x
x x
x x x x x
x x
+ =
=
=
=
=
We can write the above
equations in Matrix form:
(
(
(
(
(
(

(
(
(
(
(
(


=
(
(
(
(
(
(
(

5
4
3
2
1
5
.
4
.
3
.
2
.
1
.
0 1 1 0 2
1 0 0 0 0
0 1 0 0 0
0 2 2 3 2
0 0 0 1 0
x
x
x
x
x
x
x
x
x
x
State Equations and State Variables
) ( ) (
) ( ) (
.
) (
1
1
1
1
t f t y a
dt
t dy
a
dt
t y d
a
dt
t y d
o
n
n
n
n
n
= + + + +


______________________________________________________________________
_
Consider a differential equation as shown
below:
---Eq-1
If we substitute:
1
1
2
1
) (
) (
.
.
) (
) (
) ( ) (

=
=
=
n
n
n
dt
t y d
t x
dt
t dy
t x
t y t x
Then we can get:

) (
) (
) (
) (
3
2
2
1
t x
dt
t dx
t x
dt
t dx
=
=
Hence we can write:
) ( ) ( ) ( ) ( ) (
) (
1 1 2 2 1 1 0
t f t x a t x a t x a t x a
dt
t dx
n n n n
n
+ =

) ( ) (
) ( ) (
.
) (
1
1
1
1
t f t y a
dt
t dy
a
dt
t y d
a
dt
t y d
o
n
n
n
n
n
= + + + +


Eq-2:
State
equations
Eq-2: as you can see clearly now a first order
differential equation with different set of variables.
(However, original equation is the nth order
equation.)
The variables x
1
, x
2
, x
3
are called state
variables
State-space method is a generalized mathematical modelling technique
which can be used to analyse control systems.(also called time-domain
approach)

This has become more popular as it provides more flexibility of modelling
simple to complex nonlinear systems.

State space model can also be applied to other areas like economics,
agriculture, weather etc.

The model is simply a set of first order differential equations written in
Matrix form.
The normal classical frequency domain method is limited only to linear,
time invariant systems(LTI systems)(But, this method gives the stability and
transient response information very rapidly)

However, state-space method can be applied to time varying systems like
missiles etc.
Other advantage of the state-space model is the flexibility of choosing
state variables.
Consider a system described by an nth order
differential equation:
r a
dt
d
a
dt
d
a
dt
d
n
n
n
n
n
= + + + +

e
e e e
1 2
1
1
.
We are free to choose our own state variable in order to bring the differential
equation into first order that we can handle easily.
Convenient way to select state variables is to choose the output, (t), and its
n-1 derivatives as state variables: this choice is normally called the Phase variable
choice.
Let us now select the state variables:
) )( 1 ( ...
4
..
3
.
2
1
,
,
dots n
n
x x
x x
x

= =
= =
=
e e
e e
e
------------------eq1




------------------eq2
A dot above omega signifies
differentiation w.r.t. time.
From equations 1 to 3 we can get
n
n
x x x x
x x
= =
=
1
.
3
2
.
2
.
,
1

Substituting the above relationship to our original nth order


differential equation: ( for convenience look at from left to right)
) )( 1 ( ...
4
..
3
.
2
1
,
,
dots n
n
x x
x x
x

= =
= =
=
e e
e e
e
n n n n
n
n n n n
n
x a x a x a x a r x
r x a x a x a x a x
=
= + + +


1 1 2 2 1 1
.
1 1 2 2 1 1
.
...

Last equation in the previous slide is a set of first order differential


equations what we want:
Whole set of equations can now be represented in Matrix form as
shown below:
| |
(
(
(
(

=
(
(
(
(
(
(

+
(
(
(
(
(
(

(
(
(
(
(
(


=
(
(
(
(
(
(
(

n
n
n
x
x
x
r
x
x
x
a a a
x
x
x
x

2
1
2
1
2 2 1
.
3
.
2
.
1
.
0 0 1
1
.
0
.
. . . . .
. . . . .
0 1 0 0
0 0 1 0
e
These two equations represent the state-space model for the dynamic
system of nth order differential equations. However, the standard
notation used in control systems is shown in the next slide:
Du Cx y
Bu Ax x
+ =
+ =
.
State-space Model
-----------State equation

-----------Output equation
X is the state vector:
) : 1 ( ,
) (
) (
) (
) (
2
1
vector matrix n
t x
t x
t x
t x
n

(
(
(
(

) : 1 ( ,
) (
) (
) (
) (
2
1
vector matrix q
t y
t y
t y
t y
q

(
(
(
(
(

Y is the output vector:


U is the input control vector:
) : 1 ( ,
) (
) (
) (
) (
2
1
vector matrix p
t u
t u
t u
t u
p

(
(
(
(
(

A is the system matrix:


) : ( ,
2 1
2 22 21
1 12 11
vector matrix n n
a a a
a a a
a a a
A
nn n n
n
n

(
(
(
(

B is the input matrix:


) : ( ,
2 1
2 22 21
1 12 11
vector matrix p n
b b b
b b b
b b b
B
np n n
p
p

(
(
(
(
(

C = output matrix:
D = feed forward matrix:
) : ( ,
2 1
2 22 21
1 12 11
vector matrix n q
c c c
c c c
c c c
C
qn q q
n
n

(
(
(
(
(

) : ( ,
2 1
2 22 21
1 12 11
vector matrix p q
d d d
d d d
d d d
D
qp q q
p
p

(
(
(
(
(

State Variables:
A set of user defined minimum number of linearly independent variables which
are used to define the system variables such that the knowledge of these
variables at any time t
0
, and information on the input excitation subsequently
applied, are sufficient to determine the state of the system at any time t t
0
.

State Vector:
A vector whose elements are the state variables

State Space:

The n-dimensional space whose axes are the state variables.

State Equation:
A set of n simultaneous, first order differential equations with n variables, where
the n variables to be solved are the state variables.

Output Equation:
Output equation is an algebraic equation, which signifies the output variables of
a system as a linear combination of the state variables and the inputs.
Note here, the number of state variables we define is equal to the order of the
differential equation.
We cannot select a variable which is linearly combined with another state
variable.( V and I in an LRC circuit as V= Ri)
State Transition
Matrix
The solution to the homogeneous(In the matrix equation
AX=B if B =0 then we call homogeneous) state equation
what we described earlier:
Ax x =
.
Can be represented in the form of
) 0 ( ). ( ) ( x t t x u =
) (t u
Where is an n x n matrix and is the unique solution of
. ) 0 ( ), (
.
I t A = u u = u
) (t u
is called the state transition matrix.
Also note
At
e t = u ) (
Example:
In a normal LRC circuit if V
R
(t) is chosen as state variable, then i(t)
cannot be written as a state variable because V
R
(t)= R.i(t)( one variable
is a linear combination of the other)
Example:
Find the state-space representation in Phase-variable form for the
transfer function
6 5
5
) 3 )( 2 (
5
) (
) (
:
) 3 )( 2 (
5
) (
) (
2
+ +
=
+ +
=
+ +
=
s s s s s R
s C
Solution
s s s R
s C
State space model in phase-variable presentation is:
equation Output Du Cx y
Equation S Bu Ax x
+ =
+ = .
.
-----eq1

------eq2
Equation-1 and 2 can also be written in the form:
| |
(
(
(
(

=
+
(
(
(
(

(
(
(
(

=
(
(
(
(
(

n
n
n
x
x
x
C y
Br
x
x
x
A
x
x
x

2
1
2
1
.
2
.
.
1
Cross multiplication of the TF yields:

(s
2
+5s+6) C(s) = 5 R(s)
Taking the s operator as: d/dt = s; d
2
/dt
2
=
s
2
r c c c 5 6 5
. ..
= + +
r c c c 5 6 5
. ..
= + +
Now we have to select the state variables:
..
2
.
3
..
3
.
1
.
2
.
2
1 1 1
c x x c x
c x x c x
x x c x
= = =
= = =
= =
Now I can write:
r x x x
x x
5 6 5
1 2
2
.
2
1
.
+ =
=
In matrix form:
| |
(

=
(

+
(


=
(
(

2
1
2
1
2
.
1
.
0 1
5
0
5 6
1 0
x
x
y
r
x
x
x
x
5


x2
1
.
x

2
.
x

-5
r x x x
x x
5 6 5
1 2
2
.
2
1
.
+ =
=
x
1
-6
r
Y(t) or
c(t)
Block diagram for the
computer simulation
Example:
Find the state-space representation in phase-variable form for the transfer
function:
6 5
) 1 ( 5
) (
) (
2
+ +
+
=
s s
s
s R
s C
Solution:
Cross multiplication of the TF yields the derivative of R(which is
the input variable).
C(s)[s
2
+5s+6] = (5s+5)R(s)
For convenience let us eliminate R(s).
To eliminate R(s) let us introduce a dummy variable called U:
Then:
) 6 5 (
) 1 ( 5
.
2
+ +
+
=
s s
s
R
U
U
C
Now we can
write:
) 1 ( 5
) (
) (
+ = s
s U
s C
and
) 6 5 (
1
) (
) (
2
+ +
=
s s s R
s U
Defining the state variables as before:
C(s) = 5s.U(s) +5u(s)
R(s) = s2.U(s) +5s.U(s) +U(s).6
u u c
r u u u
5 5
6 5
.
. ..
+ =
= + +
..
2
.
2
.
1
.
1
;
u x
x u x u x
=
= = =
1 2
1 2
2
.
2
1
.
5 5
5
x x c y
r x x x
x x
+ = =
+ =
=
| |
(

=
(

+
(


=
(
(

2
1
5 5
1
0
2
1
5 6
1 0
2
1
.
.
x
x
y
r
x
x
x
x
Y(t) or
c(t)
r(t)
1


x2
1
.
x

2
.
x

-5
x
1
-6
5
5

Block diagram for the state space model in
phase variable form(Computer simulation
diagram)
22 18 7
2 3
) (
) (
2 3
2
+ + +
+ +
=
s s S
s s
s R
s C
Question:
Stability
we say system x = Ax is stable if etA 0 as t
meaning:
state x(t) converges to 0, as t , no matter what x(0) is
all trajectories of x = Ax converge to 0 as t
fact: x = Ax is stable if and only if all eigenvalues of A have negative real
part:
i < 0, i = 1, . . . , n
From State Space to Transfer Function
When analysing control systems more often we have
to learn how to transfer the systems from state
space to TF and vise-versa.
Assume the standard state-space model:
Du Cx y
Bu Ax x
+ =
+ =
.
2 ) ( ) ( ) (
1 ) ( ) ( ) (
eq s DU s CX s Y
eq s BU s AX s sX
+ =
+ =
In Laplace-
domain:
From equation-1:
[sI-A] X(s) = B U(s)

X(s) = [sI-A]
-1
BU(s)
Substituting in equation 2 we get:

Y(s) = C[sI A]
-1
BU(s) + DU(s)

Y(s) = [C(sI A)
-1
B +D] .U(s)
The matrix [C(sI-A)
-1
B +D] is called the transfer
function matrix because it relates the output
vector Y(s) to the input vector U(s). {if U(s) and
Y(s) are scalars} Then we can write:
D B A sI C
s U
s Y
s G + = =
1
) (
) (
) (
) (
2
] ( [
) (
.
) (
) (
eq
A sI
D A sI B A sI adj C
s G
D B
A sI
A sI adj
C s G

+
=
+

=
From equation-2, we can see that the dynamic characteristics and stability are
determined by poles of the closed-loop transfer function, that is , the roots of sI-A=0
This equation is called the characteristic equation in state space model.
0 = A sI
If the coefficients of matrix A are real
then are also
real.
0 = A sI
Example: A control system is defined by the state space model by the following
equations. Find the transfer function of the system.
| |
(

=
(

+
(


=
(
(

2
1
2
1
2
.
1
.
0 1
0
1
3 2
1 0
x
x
y
u
x
x
x
x
By comparison with the state space model:
] 0 1 [ ,
0
1
,
3 2
1 0
=
(

=
(


= C B A
We have already derived the transfer function
matrix as shown below:
D B A sI C
s U
s Y
s G + = =
1
) (
) (
) (
) (
| |
( )( )
( )
( )( ) 2 1
3
) (
0
1
2
1 3
2 1
1
) ( ) (
2
1 3
2 3
1
) (
1
2
1
+ +
+
=
(

+
+ +
= =

+
+ +
=

s s
s
s G
s
s
s s
o
B A sI C s G
s
s
s s
A sI
Using Matlab:
A=[0 1;-2 -3];
>> B=[1;0];
>> C=[1 0];
>> D=0;
>> [num,den]=ss2tf(A,B,C,D)
num =
0 1 3
den =
1 3 2
Use Matlab to find the transfer function of the state-space model:
| | 0 1 ,
2
0
,
3 2
1 0
=
(

=
(


= C B A
Answer:
num =

0 0 2.0000


den =

1 3 2
Solution of State Variables

How to obtain a general solution to the linear time-invariant state equation.
(space vehicle: mass will change after some time: time variant systems)
Solution of scalar differential equations.
Consider a system with only initial conditions without any forcing function:
) ( ) (
.
t ax t x =
Assume a solution of x(t) is in the form of power series:
x(t)= b
0
+b
1
t + b
2
t + b
3
t + ---------eq2
... 3 2 ) (
2
3 2 1
.
+ + + = t b t b b t x
By substituting the assumed solution to the first equation:

b
1
+ 2b
2
t + 3b
3
t
2
+ = a [b
0
+ b
1
t + b
2
t
2
+]


Equating the coefficients of equal powers of t:
b
1
= a b
0

b
2
= a b
1
/

2 = a
2
b
0
= (1/2!) a
2
b
0

b
3
= (1/3!)a
3
.b
0

.
--------------------eq1
Substituting in equation 2 : When t = 0,
x(0) = b
0
.
Therefore the solution x(t) can be written as:
) 0 ( ) (
) 0 ( ...
! 3 ! 2
1 ) (
3 3 2 2
x e t x
x
t a t a
at t x
at
=
|
|
.
|

\
|
+ + + + =
... ) 0 (
! 2
1
) 0 ( ) 0 ( ) (
2
+ + + = x a ax x t x
x(0) is the initial condition of state variable
Combining equation 2
Laplace Transform Method to the solution of Homogeneous State Equations

Our system is:
) ( ) (
.
t Ax t x = ---------eq1
Taking Laplace transform of equation-1:
Laplace transform of x: (x)= X(s)

Hence s X(s) X(0) = AX(s): Note the theorem
) 0 ( ) (

=
(

f s sF
dt
df
s X(s)- A X(s) = X(0)

(s I - A) X(s) = X(0)

X(s)= (sI A)
-1
X(0)
Hence: x(t) =
-1
(s I A)
-1
x(0)



( ) ...
3
2
2
1
+ + + =

s
A
s
A
s
I
A sI

-1
(s I A)
-1

) 0 ( ) (
) (
! 3 ! 2
1
3 3 2 2
x e t x
e A sI
e
t A t A
At I
At
At
At
=
=
= + + + + =

we can write
Hence the
solution is:
(


=
(
(

) (
) (
3 2
1 0
2
1
2
.
1
.
t x
t x
x
x
Example:
Find x
1
(t) and x
2
(t) given initial conditions:
(

=
(

2
1
) 0 (
) 0 (
2
1
x
x
Using Laplace
transform
method.
We have shown that given the initial conditions the solution to the above
state equation can be represented in the form of x(t) = e
At
x(0).
This solution is for the state equation that can be represented as follows:
) ( ) (
.
t Ax t x =
Taking Laplace transform of both side of the equation we can write:

sX(s) -X(0) = A X(s)

(sI A)X(s) =X(0)

X(s) = (sI -A)
-1
X(0)
(

=
(


=
2
1
) 0 ( ,
3 2
1 0
X A
We were given
that
Hence we can
write:
| |
(

=
(

=
3 2
1
3 2
1 0
0
0
s
s
s
s
A sI
| |
(


=
(

(
(
(
(

+ +

+ +
+
=
+ +
(

+
=

t t
t t
e e
e e
t x
t x
s s
s
s s
s
s s
s
s
X A sI
2
2
2
1
2
1
6 4
3 4
) (
) (
) 2 )( 1 (
2 2
) 2 )( 1 (
5
2 3
2
1
2
1 3
) 0 (
We can check the solution whether it is correct by applying the initial
conditions: x
1
(0) =1, x
2
(0) =2, 1 = 1 and 2 =2: which implies as correct.
(


=
3 2
1 0
A
In the same example if initial conditions are not given:
The state transition matrix is defined as:
= = u
At
e t) (

-1
(s I A)
-1

(

=
(

=
3 2
1
3 2
1 0
0
0
] [
s
s
s
s
A sI
The inverse of (sI A) is given by:
(
(
(
(

+ + + +

+ + + +
+
=
(

+
+ +
=

) 2 )( 1 ( ) 2 )( 1 (
2
) 2 )( 1 (
1
) 2 )( 1 (
3
2
1 3
) 2 )( 1 (
1
] [
1
s s
s
s s
s s s s
s
s
s
s s
A sI
= = u
At
e t) (
-1
(s I A)
-1

Since:
= u ) (t
We can get the
state transition
matrix:
(

+ +



t t t t
t t t
e e e e
e e e e
2 2
2 2 1
2 2 2
2
We have learned how to construct signal flow graphs (SFG) for simultaneous
equations in lecture -5: The signal flow graphs which represent the state
equations or differential equations are called state diagrams. State diagram is an
extension of SFG to portray state equations and differential equations.

Given the state diagram it is much easier to construct state equations or TF than
from SFG. Construction procedures and rules are same for SFG and State
diagrams but, state diagram is in Laplace domain.
State Diagram
State Diagram for State Equations:
Consider the control system:
4 9 5 4
3 8 5 3
2 6 2 3 7
1 2 3 5 2
3 2 1
3 2 1
3
.
3 2 1
2
.
3 2 1
1
.
eq x x x y
eq r x x x x
eq r x x x x
eq r x x x x
+ + =
+ =
+ + =
+ + =
R(s) sX
3
(s) X
3
(s) sX
2
(s) X
2
(s) sX
1
(s) X
1
(s)
Y(s)
Initially let us define three state variable x1, x2, x3 and let these three state
variables are represented as nodes and to the left of each node, respective
derivatives of them are also shown as below:
Let us define the input as r and the output as y.
In Laplace domain we can show the derivatives and nodes as shown below:
In the next step, we interconnect the state variables and their derivatives
with the definition of integration (1/s):
sX
3
(s) X
3
(s)
1/s
Integratio
n
1 2 3 5 2
3 2 1
1
.
eq r x x x x + + =
State diagram for equation -1:
R(s) sX
3
(s) X
3
(s) sX
2
(s) X
2
(s) sX
1
(s) X
1
(s) Y(s)
-5
1/s
2
1/s
1/s
2
3
R(s) sX
3
(s) X
3
(s) sX
2
(s) X
2
(s) sX
1
(s) X
1
(s) Y(s)
R(s) sX
3
(s) X
3
(s) sX
2
(s) X
2
(s) sX
1
(s) X
1
(s) Y(s)
6
1/s
2
1/s
1/s
-7
-3
2 6 2 3 7
3 2 1
2
.
eq r x x x x + + =
1/s
8
1
1/s
-5
-3
1/s
3 8 5 3
3 2 1
3
.
eq r x x x x + =
R(s) sX
3
(s) X
3
(s) sX
2
(s) X
2
(s) sX
1
(s) X
1
(s) Y(s)
3 2 1
9 5 4 x x x y + + =
State diagram for equation -1:
5
1/s
9
1/s
1/s
-4
R(s) sX
3
(s) X
3
(s) sX
2
(s) X
2
(s) sX
1
(s) X
1
(s) Y(s)
Now we have to combine all figures to get one state diagram for all equations:
3
1
8
5
1/s
9
1/s
1/s
-4
6
2
-3
-5
2
-5
2
-7
-3
Homework: check the numbers and the branches
End
Characteristic Equation From State-Space Representation:

The roots of the characteristic equation are the same as the eigenvalues of
matrix A. The characteristic equation of matrix A can simply be computed
with Matlab by using the command :
p = poly(A);
or p = poly(A,v); %retun as a variable v

You might also like