Professional Documents
Culture Documents
1.Introduction
A modern complex system may have many inputs, many outputs, and
these may be interrelated in a complicated manner. To analyze such a
system, it is important to reduce the complexity of the mathematical
expressions, as well as to resort to computers for most of the tedious
computations necessary in the analysis. The state-space approach to the
system analysis is best suited for this view point.
While conventional control theory is based on the input-output relationship
or transfer function. Modern control theory is based on the description of
system equations in terms of ‘n’ first order differential equation which may
be combined into first order vector matrix differential equation. The use of
vector matrix notation greatly simplifies the mathematical representation
of systems of equations.
• The increase in the number of state variables, the number of inputs,
or the number of outputs does not necessary increase the complexity
of the equation depending on the intended solution approach to be
used.
• State-space approach to control system analysis and design is the
time domain method.
Three types of variables are involved in modeling dynamic systems: input variables,
output variables and state variables.
1
The state space model is represented by,
𝒙̇ = 𝑨𝒙 + 𝑩𝒖
𝒚 = 𝑪𝒙 + 𝑫𝒖
Where
x is state vector
u is input vector
y is output vector
Example 1
Example 2
For example, suppose that the physical system being modelled can be
described by an nth – order differential equation:
𝑑𝑛 𝑐(𝑡) 𝑑𝑛−1 𝑐(𝑡) 𝑑𝑛−2 𝑐(𝑡) 𝑑𝑐(𝑡)
+ 𝑎1 + 𝑎2 + ⋯ + 𝑎𝑛−1 + 𝑎𝑛 𝑐(𝑡) = 𝑟(𝑡)
𝑑𝑡 𝑛 𝑑𝑡 𝑛−1 𝑑𝑡 𝑛−2 𝑑𝑡
(1)
2
The variables c(t) and r(t) are the output and input variables, respectively.
The above differential equation can be reduced to a set of first-order
differential equations by defining the state variables as follows:
𝑥1 (𝑡) = 𝑐(𝑡)
𝑑𝑐(𝑡)
𝑥1̇ (𝑡) = 𝑑𝑡
.
. (2)
.
𝑑𝑛−1 𝑐(𝑡)
𝑥𝑛̇ (𝑡) = 𝑑𝑡 𝑛−1
Steps in modelling
1. Understand the physical system and its components
3
2. Make appropriate simplifying assumptions
3. Use basic principles to formulate the mathematical model
4. Write differential and algebraic equations describing the model
5. Check the model for validity
Example
Consider a mass M, on a frictionless surface connected to a rigid wall by a spring with
stiffness K. Obtain the mathematical model for the system.
Spring
y (t)
Mass
M(kg)
K (N/m)
Solution:
1. Choose a sign convention for the position variable y (t). NB that the sign
convention for velocity and acceleration are the same as that for displacement.
2. Use fundamental physical principles to model the system (Newton’s law)
3. Draw free body diagrams of the system. In this example, the spring force is the
only force acting on the mass.
y (t)
Ky(t) M(kg
N )
𝑀 𝑑2𝑦
+ 𝑦(𝑡) = 0
𝐾 𝑑𝑡 2
1 𝑑2𝑦
+ 𝑦(𝑡) = 0
𝜔𝑛 2 𝑑𝑡 2
𝐾
where 𝜔𝑛 = √𝑀 , 𝜔𝑛 is the undamped natural frequency
1 𝑑2 𝑦
6. System characteristics + 𝑦(𝑡) = 0.
𝜔𝑛 2 𝑑𝑡 2
The system has no input. No external force acts on the mass. In the differential
equation, this is indicated by the zero on the right-hand side. The system has
no damping.
4
Similarly, consider the mechanical system with mass-spring-Damper configuration
with system equation of:
𝑚𝑦̈ + 𝑏𝑦̇ + 𝑘𝑦 = 𝑢
This system is second order therefore we need two state variables to describe the
system dynamics. As 𝑦̇ (0), 𝑦(0)𝑎𝑛𝑑 𝑢(𝑡) ≥ 0 completely determines the system
behavior for 𝑡 ≥ 0:
This is of the second order. This means that the system involves 2
integrators.
Step 1
Define the state variables as
𝑥1 (𝑡) = 𝑦(𝑡) (5)
𝑥2 (𝑡) = 𝑦̇ (𝑡) (6)
Then we obtain
𝑥̇ 1 = 𝑥2
1 1
𝑥̇ = 𝑚 (−𝑘𝑦 − 𝑏𝑦̇ ) + 𝑚 𝑢
Or
𝑥̇ = 𝑥2 (7)
𝑘 𝑏 1
𝑥2̇ = − 𝑚 𝑥1 − 𝑚 𝑥2 + 𝑚 𝑢 (8)
The output equation is
𝑦 = 𝑥1 (9)
In vector matrix equation (7) and (8) can be written as
𝑥̇ 0 1 𝑥1 0
[ 1 ] = [− 𝑘 − 𝑏 ] [𝑥 ] + [ 1 ] 𝑢
𝑥2̇ 𝑚 𝑚 2 𝑚
(10)
The output equation (9) can be written as
𝑥1
𝑦 = [1 0] [𝑥 ] (11)
2
Equation (10) is the state space equation and equation (11) is the output
equation for the system.
Equation (10) and (11) are in the standard form:
𝑥̇ = 𝐴𝑥 + 𝐵𝑢
𝑦 = 𝐶𝑥 + 𝐷𝑢
Where
0 1 0
𝐴 = [− 𝑘 − 𝑏 ] 𝐵 = [ 1 ] 𝐶 = [1 0] 𝐷 = 0
𝑚 𝑚 𝑚
Example 3
Obtain the state equation in phase variable form for the following
differential equation:
5
𝑑3 𝑦 𝑑2𝑦 𝑑𝑦
2 3 +4 2 +6 + 8𝑦 = 10𝑢(𝑡)
𝑑𝑡 𝑑𝑡 𝑑𝑡
Solution
The differential equation is third order, and thus there are three state
variables:
𝑥1 = 𝑦, 𝑥2 = 𝑦̇ , and 𝑥3 = 𝑦̈ .
The first derivatives are:
𝑥̇ 1 = 𝑥2
𝑥̇ 2 = 𝑥3
𝑥̇ 3 = −4𝑥1 − 3𝑥2 − 2𝑥3 + 5𝑢(𝑡)
Or, in matrix form:
𝑥̇ 1 0 1 0 𝑥1 0
[ 𝑥̇ 2 ] = [ 0 0 1 ] [ 𝑥 2 ] + [ 0] 𝑢(𝑡)
𝑥̇ 3 −4 −3 −2 𝑥3 5
𝑥1
𝑦 = [1 0 0] [ 𝑥2 ]
𝑥3
Example
Obtain the state equation for the circuit below, where i2 is considered to be the
output of the system with these state variables 𝑥1 = 𝑖1 , 𝑥2 = 𝑖2 and 𝑥3 = 𝑣𝑐
Expected Answer
𝑅 1
− 𝐿1 0 −𝐿 1
1 1
𝑅2 1 𝐿1
𝑥̇ = 0 −𝐿 x+ [ 0 ] 𝑢
2 𝐿2
1 −1 0
[ 0 ]
𝑐 𝑐
Y=[0 1 0]x
6
4 STATE TRANSITION MATRIX
The state transition matrix defined as a matrix that satisfies the linear homogeneous
state equation, i.e.
𝒙̇ = 𝑨𝒙 Homogeneous state equation
𝑥1 (0)
𝒙(0) = [ ⋮ ] Initial state at time t=0
𝑥𝑛 (0)
𝒙(𝑡) = 𝚽(𝑡)𝒙(0)
Where Φ(𝑡) is the state transition matrix.
Work Example
Find the state transition matrix of the system described by the following
equations:
𝑥̇ 0 1 𝑥1
[ 1] = [ ][ ]
𝑥2̇ −3 −4 𝑥2
Where
𝑥 (0) 0
[ 1 ] = [1]
𝑥2 (0)
𝑠 1 −1
ф(𝑠) = [𝑠𝐼 − 𝐴]−1 = [ ] (find adjoint and determinant)
3 𝑠+4
7
𝑠+4 1
2 𝑠2 +4𝑠+3
[𝑠 +4𝑠+3
−3 𝑠 ]
𝑠2 +4𝑠+3 𝑠2 +4𝑠+3
Using the partial fraction expansion, the elements of the transition matrix
can be written as
3 1 1 1
− 2(𝑠+3) − 2(𝑠+3)
2(𝑠+1) 2(𝑠+1)
ф(𝑠) = [ −3 3 −1 3 ]
+ +
2(𝑠+1) 2(𝑠+3) 2(𝑠+1) 2(𝑠+3)
the state transition matrix is determined by taking the inverse Laplace
transform of ф(s):
∴ф (t) =L-1(ф(s))
3 1 1 −𝑡 1
𝑒 −𝑡 − 2 𝑒 −3𝑡 𝑒 + 2 𝑒 −3𝑡
2 2
ф(𝑡) = [ 3 3 1 3 ]
− 2 𝑒 −𝑡 + 2 𝑒 −3𝑡 − 2 𝑒 −𝑡 + 2 𝑒 −3𝑡
The state transition matrix can also be found in the following manner
𝒙(𝑡) = 𝑒 𝑨𝑡 𝒙(0)
Where 𝑒 is a matrix exponential and𝑑𝑒 𝐴𝑡 ⁄𝑑𝑡 = 𝐴𝑒 𝐴𝑡 . Substituting the above
𝑨𝒕
Once the state transition matrix has been found, the solution to the
nonhomogeneous equation can be determined as follows:
𝒙̇ = 𝑨𝒙 + 𝑩𝜼
Taking the Laplace transform of the above equation yields
𝑠𝑥(𝑠) − 𝑥(0) = 𝐴𝑥(𝑠) + 𝐵𝜂(𝑠)
Solving for 𝑥(𝑠)
𝑥(𝑠) = [𝑠𝐼 − 𝐴]−1 𝑥(0) + [𝑠𝐼 − 𝐴]−1 𝐵𝜂(𝑠)
𝑥(𝑡) = ℒ −1 [𝑠𝐼 − 𝐴]−1 𝑥(0) + ℒ −1 [[𝑠𝐼 − 𝐴]−1 𝐵𝜂(𝑠)]
8
Or
1
Then we have
𝑠𝑥(𝑠) − 𝐴𝑥(𝑠) = 𝐵𝑢(𝑠)
(𝑠𝐼 − 𝐴)𝑥(𝑠) = 𝐵𝑢(𝑠)
−1
By pre multiplying (𝑠𝐼 − 𝐴) to both sides of this last equation we obtain
𝑥(𝑠) = (𝑠𝐼 − 𝐴)−1 𝐵𝑢(𝑠) (10)
By substituting equation (10) into equation (9) we get
𝑦(𝑠) = [𝐶 (𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷]𝑢(𝑠) (11)
By comparing equation (11) with equation (5) we see that
𝐺(𝑠) = 𝐶 (𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷 (12)
This is the transfer function expression in terms of A, B, C, and D.
9
𝑢1 𝑦1
𝑢2 𝑦2
𝑢 = [ ⋮ ]𝑦 = [ ⋮ ]
𝑢𝑟 𝑦𝑚
Now the transfer function matrix G(s) relates the output Y(s) to the input U(s), that is
𝑌(𝑠) = 𝐺(𝑠)𝑈(𝑠)
Given that:
𝒙̇ = 𝑨𝒙 + 𝑩𝒖
𝒚̇ = 𝑪𝒙 + 𝑫𝒖
Then; taking Laplace transforms gives:
𝑠𝑋(𝑠) − 𝑥(0) = 𝐴𝑋(𝑠) + 𝐵𝑈(𝑠)
𝑌(𝑠) = 𝐶𝑋(𝑠) + 𝐷𝑈(𝑠)
Assuming zero initial condition then:
𝑋(𝑠) = (𝑠𝐼 − 𝐴)−1 𝐵𝑈(𝑠)
And:
𝑌(𝑠) = [𝐶(𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷]𝑈(𝑠)
Therefore:
𝐺(𝑠) = 𝐶(𝑠𝐼 − 𝐴)−1 𝐵 + 𝐷
10
Note the importance of |𝑠𝐼 − 𝐴| in determining the dynamic response of the system.
The force individual step response curves can be plotted in MatLab by using the
command step(A,B,C,D) or step(sys) where 𝑠𝑦𝑠 = 𝑠𝑠(𝐴, 𝐵, 𝐶, 𝐷).
Example
Obtain the transfer function for the system described in the state space
model below.
𝑥̇ 0 1 𝑥1 0
[ 1] = [ ] [ ] + [ ] 𝑢(𝑡)
𝑥̇ 2 −6 −5 𝑥2 1
𝑥1
𝑦 = [8 1] [𝑥 ]
2
Solution
0 1 0
𝐴=[ ], 𝐵 = [ ], 𝐶 = [8 1], 𝐷=0
−6 −5 1
𝑠 −1
𝑠𝐼 − 𝐴 = [ ]
6 𝑠+5
𝑠+5 1
[ ]
Φ(𝑠) = (𝑠𝐼 − 𝐴) = 2−1 −6 𝑠
𝑠 + 5𝑠 + 6
𝑠+5 1 0
[ ][ ]
𝐺(𝑠) = 𝐶(𝑠𝐼 − 𝐴)−1 𝐵 = [8 1] −6 𝑠 1
𝑠 2 + 5𝑠 + 6
[8 1] [1]
= 2 𝑠
𝑠 + 5𝑠 + 6
11
Obtain the transfer function of the system given by
𝑥̇ 1 −1 1 0 𝑥1 0
[ 𝑥̇ 2 ] = [ 0 −1 1 ] [ 𝑥2 ] + [0] 𝑢
𝑥̇ 3 0 0 −2 𝑥3 1
𝑥1
𝑦 = [1 0 0] [ 𝑥2 ]
𝑥3
Solution
The transfer function G(s) is given by
𝐺(𝑠) = 𝑪(𝑠𝑰 − 𝑨)−1 𝑩 + 𝐷
In this problem, matrices A, B, C, and D are
−1 1 0 0
𝑨 = [ 0 −1 1 ] , 𝑩 = [0] , 𝑪 = [1 0 0], 𝐷=0
0 0 −2 1
Hence
𝑠 + 1 −1 0 −1 0
𝐺(𝑠) = [1 0 0] [ 0 𝑠 + 1 −1 ] [0]
0 0 𝑠+2 1
1 1 1
𝑠 + 1 (𝑠 + 1)2 (𝑠 + 1)2 (𝑠 + 2)
1 1 0
= [1 0 0] 0 [0]
𝑠+1 (𝑠 + 1)(𝑠 + 2) 1
1
[ 0 0 ]
𝑠+2
1 1
= =
(𝑠 + 1)2 (𝑠 + 2) 𝑠 3 + 4𝑠 2 + 5𝑠 + 2
Assignment
A state space model for the longitudinal motion of a helicopter near hover
is
𝑥1̇ −0.4 0 −0.01 𝑥1 6.3
[𝑥2̇ ] = [ 1 0 0 ] [𝑥2 ] + [ 0 ] 𝑢
𝑥3̇ −1.4 9.8 −0.02 𝑥3 9.8
𝑥1
𝑦 = [0 0 1] [𝑥2 ]
𝑥3
Determine the transfer function matrix, characteristic equation and state
whether the helicopter is stable.
12
in some finite time. If one or more of the states are unaffected by the
control, the system is not controllable. A mathematical definition of
controllability for a linear dynamical system can be expressed as follows. If
the dynamic system can be described by the state equation
𝑥1̇ = 𝐴𝑥 + 𝐵𝑢
where 𝑥 and 𝑢 are the state and control vectors of order ‘n’ and ‘m’
respectively, then the necessary and sufficient condition for the system to
be completely controllable is that the rank of the matrix P is equal to the
number of states. The matrix P is constructed from the A and B matrices in
the following way:
𝑃 = [𝐵, 𝐴𝐵, 𝐴2 𝐵, … , 𝐴𝑛−1 𝐵]
The rank of a matrix is defined as the largest non – zero determinant. The
mathematical test was developed by kalman in the 1960’s.
Consider the system given by
𝑥̇ 1 1 𝑥1 1
[ 1] = [ ] [𝑥 ] + [ ] [𝑢]
𝑥2̇ 0 −1 2 0
Solution
𝑃 = [𝐵, 𝐴𝐵, 𝐴2 𝐵, … , 𝐴𝑛−1 𝐵]
1 1 1
Matrix A =[ ] and B=[ ]
0 −1 0
1 1 1 1
AB=[ ][ ] = [ ]
0 −1 0 0
1 1
∴ P=[ ] =singular
0 0
Hence the system is not completely state controllable. Since the inverse
and the determinant are zero.
Example 2
Consider the system given by
𝑥̇ 1 1 𝑥1 0
[ 1] = [ ] [ ] + [ ] [𝑢]
𝑥2̇ 2 −1 𝑥2 1
is controllable.
OBSERVABILITY
It deals with whether the states of the system can be identified from the
output of the system. A system is said to be completely observable if every
state 𝑥 can be determined by the measurement of the output 𝑦(𝑡) over a
finite time interval. If one or more states cannot be identified from the
output of the system, then the system is not observable. A mathematical
test for observability of an nth-order dynamic system governed by the
equations.
𝑥̇ = 𝐴𝑥 + 𝐵𝑢
𝑦 = 𝐶𝑥 + 𝐷𝑢
is given as follows. The necessary and sufficient condition for a system to
be completely observable is that the matrix 𝑀𝑜 is defined as
𝑀𝑜 = [𝐶 𝑇 , A𝐶 𝑇 , … , (𝐴𝑇 )𝑛−1 𝐶 𝑇 ] is of the rank n.
Consider the system described by
𝑥̇ 1 1 𝑥1 0
[ 1] = [ ] [ ] + [ ] [𝑢]
𝑥2̇ −2 −1 𝑥2 1
13
𝑥1
[𝑦] = [1 0] [𝑥 ]
2
Is this system controllable and observable?
Try controllability.
Solution
1 1 0
Matrix A=[ ] B=[ ] C=[1 0]
−2 −1 1
𝑇 𝑇 1 −2 1 1
[𝐴 𝐶 ] = [ ] [ ]=[ ]
1 −1 0 1
Observability Matrix
𝑀𝑜 = [𝐶 𝑇 , A𝐶 𝑇 , … , (𝐴𝑇 )𝑛−1 𝐶 𝑇 ]
1 1
𝑀𝑜 = [ ]
0 1
The rank of [𝐴𝐶 𝑇 : 𝐴𝑇 𝐶 𝑇 ] is 2, hence the system is observable. The rank of a
matrix A is the order of the largest square array contained in A which has
a non-zero determinant.
Example
Exercise.
1. Which of the systems are fully controllable
1 4 0
a) 𝑥̇ = [ ]𝑥 + [ ]𝑢
−2 −5 1
0 4 1
b) 𝑥̇ = [ ]𝑥 + [ ]𝑢
−2 6 1
1 0 0
c) 𝑥̇ = [ ]𝑥 + [ ]𝑢
−8 −5 1
14
0 4 1
d) 𝑥̇ = [ ]𝑥 + [ ]𝑢
−2 −6 1
15