EE5103/ME5403 Lecture Three Analysis of Discrete-Time Systems
EE5103/ME5403 Lecture Three Analysis of Discrete-Time Systems
Xiang Cheng
Associate Professor
Department of Electrical & Computer Engineering
The National University of Singapore
2
State-space Model
Laplace Transform
sX ( s ) − x(0) = AX ( s ) + bU ( s )
X ( s ) = ( sI − A) −1 x(0) + ( sI − A) −1 bU ( s )
Inverse Laplace Transform
t
x(t ) = e x(0) + ∫ e A( t −τ ) bu (τ )dτ
At
0
Zero-order hold
x(k + 1) = Φx(k ) + Γu (k )
y (k ) = cx(k )
Φ = e Ah
h
Γ = ( ∫ e As ds )b
0
At
How to calculate e ?
There are many methods. The simplest way is by Laplace Transform.
( sI − A) −1 e At 3
Z-transform
x(0)=0
z{x(k + 1)} = z ( X ( z ) − x(0)) z{x(k + 1)} = zX ( z )
q ( forward − time − shift ) ⇔ z
q −1 (backward − time − shift ) ⇔ z −1
4
Let’s apply z-transform to the state-space equation
x(k + 1) = Φx(k ) + Γu (k ) z ( X ( z ) − x(0)) = ΦX ( z ) + ΓU ( z )
y (k ) = cx(k ) zX ( z ) − ΦX ( z ) = zx(0) + ΓU ( z )
X ( z ) = ( zI − Φ ) −1 zx(0) + ( zI − Φ ) −1 ΓU ( z )
What is the output?
Y ( z ) = cX ( z ) = c( zI − Φ ) −1 zx(0) + c( zI − Φ ) −1 ΓU ( z )
•If the initial conditions are zero, x(0)=0
Y ( z ) = c( zI − Φ ) −1 ΓU ( z ) = H ( z )U ( z )
•What is the transfer function?
U (z ) H(z) Y(z)
−1Q( z )
H ( z ) = c( zI − Φ ) Γ =
P( z )
P( z ) = det{zI − Φ} 5
U (z ) H(z) Y(z)
What can you do with the transfer functions?
•Given a transfer function, you can write down the difference equations, and vice versa
But in general,
Y ( z ) = c( zI − Φ ) −1 zx(0) + H ( z )U ( z )
zero-input response
zero-state response
It converges to zero!
6
•The stability can be determined by checking poles of the transfer function.
Continuous-time Discrete-time
λ = σ + jω λ = ρe jθ
σ >0 Unstable
ρ >1 Unstable
σ =0 ρ =1
Multiple Multiple
Single Single
Since marginally stable system is not considered as stable system, we conclude that
7
when ρ < 1, the system is stable.
•In this lecture we will discuss some key concepts for analyzing discrete-time systems.
First Concept: Stability. Why is stability so critical for the control system design?
• The fundamental question: what would happen if there is a small
disturbance to the system?
Stable: small deviation from the equilibrium position will remain small.
Asymptotic Stable: small deviation from the equilibrium position will not
only remain small, but also decrease to zero.
Unstable: small deviation from the equilibrium position will result in huge
deviation in the long run.
•Let’s try to define this concept using more precise mathematical language. 8
•Stability:
Consider a system described by
x(k + 1) = f(x(k),k)
•Where is the input u(k)?
•Stability is normally concerned with zero-input response: what would happen if there
is a disturbance in the initial condition while the inputs are zero?
•Therefore, we need to analyze the solution to the system with initial condition x(0),
which is different from the nominal one xo(0).
• Stable:
For any ε>0, |x(k)-xo(k) | < ε, if |x(0)-xo(0) |<δ(ε)
Asymptotic Stable:
The system is not only stable, the deviation will eventually go to zero,
|x(k)-xo(k) | 0
10
•Stability, in general, is a local concept.
Laminar Flow
Turbulent Flow
• Get the difference between the perturbed trajectory and the nominal one:
(x(k)-xo(k))
Note: x(k+1)=f(x(k)),
so x(1)=f(x(0)),
x(2)=f(x(1))=f(f(x(0)))
and
12
Linear Discrete-Time Systems
The nominal trajectory xo (k )
xo (k + 1) = Φxo (k ) xo (0) = ao
The trajectory with deviation in the initial position
x(k + 1) = Φx(k) x(0) = a
What is the difference between these two?
Easily we obtain
13
Linear Discrete-Time Systems
Does the difference depend upon the initial condition of the nominal solution, xo(0) ?
No. The difference only depends upon the difference in the initial condition!
So, if one solution xo (k ) is stable, then every other solution is also stable!
For linear, time-invariant systems, stability is thus a property of the system and
not of a special solution.
The stability of linear system is a global concept rather than a local one!
14
Does the deviation decrease to zero or blow up?
We can easily analyze this using Z-transform. Let’s take a different point of view.
Φ v = λv
If
For example: λ 1
Φ=
0 λ
λ 1 λ 1 λ2
2λ
Φ2 = = 2
0 λ 0 λ 0 λ
This corresponds to the case when the multiplicity of the pole is more than 1! 17
Stability criterion for Discrete-time System
λ = ρe jθ
ρ <1 Stable
ρ >1 Unstable
ρ =1
Multiple
Single
In summary,
18
Since stability is a global property for the linear system,
it is reasonable to state that a linear system is stable or unstable.
In general, it does not make sense to say that a nonlinear system is stable!
Rather, we should say a specific nominal operating point or trajectory in a
system is stable as the concept of stability is only local.
20
Relation between stability concepts for linear systems:
BIBO Stable
1
s2 +1
Resonant Oscillation
1
U (s) =
s2 +1
1
Y ( s ) = H ( s )U ( s ) = y (t ) = t sin t
( s 2 + 1) 2 21
Stable Asymptotic Stable
BIBO Stable
x1 (k + 1) = 0.5 x1 (k ) + u (k ) y (k + 1) = 0.5 y (k ) + u (k )
1
What is the transfer function? Is the system BIBO stable?
z − 0.5
It is BIBO stable. The unstable mode is not represented by the transfer
function! It means that the output you are observing is bounded while other 22
state variables (which you are not watching) might blow up.
Stability can be checked by looking at the poles of the transfer function.
1
•What are the poles of 3
z + 3z 2 + 5 z − 1 ?
•How to check the stability without solving the equation?
are positive! 23
Example 3.1 Stability of a second-order system
1
H ( z) = 2
z + a1 z + a2
Get the coefficients: 1 a1 a2
Reverse the order: a2 a1 1 × a2
Eliminate the last element a2 1 − a22 a1 (1 − a2 )
a1 (1 − a2 ) a1
Reverse the order: a1 (1 − a2 ) 1 − a22 × =
1 − a22 1 + a2
Beauty Robot
25
Now we will discuss another important concept: Controllability
Whenever we want to design a control system, we’d better first check whether the
system is controllable or not. Do not waste your time on uncontrollable systems.
What do we mean when we say a system is controllable?
Let’s take a look at an example of controllable systems in real world.
Is it possible to steer a system from any given initial state to any other
state in finite time?
u (1)
x(2)
x(1)
u (0)
x*
x(0)
Controllable: the system can be driven from any initial state to any other destination
in finite time! It does not matter how fast you can get there! 26
To check the controllability for nonlinear system is not easy!
Let’s check the controllability for linear system:
x(k + 1) = Φx(k ) + Γu (k ) x ∈ Rn n-th Order
y (k ) = cx(k ) y ∈ R, u ∈ R SISO
x(n) = Φx(n − 1) + Γu (n − 1)
27
Let’s re-write the equation into:
•Given any x(0) and any destination x*, is it possible to find control sequence
{u(0),u(1),..u(n-1)} such that the state at n-th step, x(n), reaches x*?
Take the problem as solved, and let
x ( n) → x *
What is the condition on the matrix W c for solving U for any x*?
28
The geometrical interpretation of the controllability condition
Assume the initial state x(0)=0, and the final state is x*, how to reach the final state?
uncontrollable!
The condition that W c= [Γ ΦΓ ] is non-singular, 30
is not only sufficient, but also necessary.
The general case: n-th order system
provide n directions the state can move in the state space!
If all the n directions are independent, of course, the state can go anywhere!
If the n directions are dependent, then there must be some directions where the
state can not go in n steps!
Then we have to apply more steps of control, hopefully to generate new directions!
No! we showed that in the second order system, how to prove it for the n-th order?
How is Φ n related to ?
One of the most important theorems in Linear Algebra
Then
provide all the possible independent directions that the state can move!
•Is it possible to transform the system into a form x(k + 1) = Φx(k ) + Γu (k )
which is easier to design the controller? y (k ) = cx(k )
•Controllable Canonical Form
•Assume that the system has the transfer function,
Once the initial state x(0) has been found out, can we compute other states? Yes.
Geometrical meaning of the Observability Matrix
Assume the inputs are zero, observe the output for the first step:
y (0) = cx(0)
y(0) is the dot product of state vector x(0) and the vector c.
Assume the inputs are zero, observe the output for n steps:
y (0) = cx(0)
y (1) = cx(1) = cΦx(0)
y (2) = cx(2) = cΦ 2 x(0)
y (n − 1) = cx(n − 1) = cΦ n−1 x(0)
The outputs are just projections of the initial state x(0) on different directions!
provides all the possible projection directions for the initial state vector!
For n-dimensional vector, if you know its
projections on n independent directions, can
you reconstruct the vector?
If the vectors in the observability matrix can span the whole space, the 37
information of the state can be completely recovered!
What would happen if the observability matrix Wo is singular?
Wo v = 0, v ≠ 0 Wo ( x(0) + v) = Wo ( x(0))
You cannot differentiate the initial state x(0) from x(0)+v by observing the outputs!
Can you figure out the simple relationship between these two?
•Given a state-space model, we can find out the transfer function using z-transform.
Many control methods are designed for state-space model. Sometimes we need to
convert the input-output model to state-space model.
•Realizbility: how to find out the state-space model from the input-output model?
x(k + 1) = Φx(k ) + Γu (k )
y (k ) = cx(k )
40
•Let’s start with the simplest case: y (k + 1) = −a1 y (k ) + b1u (k )
Trick #1: We can always choose the output y(k) as one state variable.
Trick #1: We can always choose the output y(k) as one state variable.
Trick #2: Add new state variable to summarize all the past information
whenever necessary!
•How to deal with the terms in the past ? y (k − 1), y (k − 2), u (k − 1), u (k − 2)
Apply trick #2: define a new state variable to take care of all the past information!
x2 (k ) = − a2 y (k − 1) − a3 y (k − 2) + b2u (k − 1) + b3u (k − 2)
x1 (k + 1) = −a1 x1 (k ) + b1u (k ) + x2 (k )
x 2 (k + 1) = −a 2 y (k ) − a3 y (k − 1) + b2 u (k ) + b3 u (k − 1)
= −a 2 x1 (k ) + b2 u (k ) − a3 y (k − 1) + b3 u (k − 1)
43
We still have some extra terms in the past. What should we do?
Apply trick #2 again: introduce another state variable!
x3 (k ) = −a3 y (k − 1) + b3u (k − 1)
x1 (k + 1) = −a1 x1 (k ) + x2 (k ) + b1u (k )
x2 (k + 1) = −a2 x1 (k ) + x3 (k ) + b2u (k )
x3 (k + 1) = −a3 y (k ) + b3 u (k ) = − a3 x1 ( k ) + b3 u (k )
− a1 1 0 b1
x( k + 1) = − a2 0 1 x(k ) + b2 u (k )
−a 0 0 b
3 3
y (k ) = (1 0 0 )x(k )
44
x(k + 1) = Φx(k ) + Γu (k )
y (k ) = cx(k )
There are other ways to realize the transfer function by a state space model.
The observable canonical form is the simplest one. 45
Q & A…
46
b1 z + b2
H ( z) = 2
z + a1 z + a2
return
47
b1 z + b2
H ( z) = 2
z + a1 z + a2
return
48
return
49