Documente Academic
Documente Profesional
Documente Cultură
P ROCESS C ONTROL
Course notes v.1.2013
May 14, 2013
These course notes are intended to provide a set of reference material supplementing the lectures in Intermediate
Process Control at the Department of Chemical & Materials Engineering Department, University of Alberta.
Department of Chemical & Materials Engineering, University of Alberta
Stevan Dubljevic
c
May
14, 2013
All rights reserved. This work may not be translated or copied in whole or in part without the written permission
of Stevan Dubljevic (Chemical and Materials Engineering Department, University of Alberta, Canada). The use
in connection with any form of information storage and retrieval, electronic adaptation, computer software, or by
similar or dissimilar methodology now known or hereafter developed is forbidden. The use in this publication of
trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken
as an expression of opinion as to whether or not they are subject to proprietary rights.
Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1 Systems representation (State space & Input-output) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.1.1 Linear system representation (Transfer functions& ODEs review-Che446) . . . . . . . . . . . . . .
1.1.2 Transfer function algebra (review-Che 446) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Introduction in computer controlled systems (Astrom, 1877) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.1 Computer-Controlled Systems: Discrete-Time Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2.2 Sampling and signal reconstruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1
1
8
10
13
13
14
17
17
17
20
24
28
32
35
41
45
45
47
52
56
58
Regulator synthesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 Stabilization by feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.1 Constant Gain (C(s) = K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.2 State feedback design (Design via Pole Placement) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.3 Observers (Luenberger Observer(Estimator)) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.4 Regulator Design & Separation Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.5 Design of reduced order estimator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
67
67
67
68
74
75
77
79
79
82
85
vii
viii
Contents
4.4
86
86
92
92
92
94
95
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Chapter 1
Introduction
inputs u
e
Gereralized Plant
Dynamical System
inputs
outputs
disturbances
differential equations
uc
yc
outputs
y
m
Ccontroller
1 Introduction
Namely, every model has some inherent limitations and therefore a model will be valid only in a particular
range of model parameters, and it will not serve for all possible ranges of operating parameters; as a result, we are
limited by some parameter ranges and therefore some signal ranges.
In the design of the mathematical model of the plant, we have to ask ourselves:
How much uncertainty do we have in the model?
In order to address this question, we usually assume that we have good knowledge of a nominal model (e.g.,
linear plant model obtained by linearization of nonlinear mass, energy and momentum equations), and we also
assume the amount of error that can be present due to unmodelled dynamics. Therefore, the model representation
takes the following representation: The concept of robust control provides an answer to this question. We conduct
Error
e(s)
+
C(s)
u(s)
Linear Model
+
y
m
Fig. 1.3 Generalized model represented as a combination of linear model and error.
linearization of nonlinear physical plant differential equations based model around some steady state operating
point of interest, and the linear model with an additional error is now the representation of the generalized model,
see Fig.1.3.
Linear models are frequently represented by the state-space models (that is the system of first order linear
differential equations with constant coefficients) written in the compact form state-space form as given by Eqs.1.11.2 s = (A, B,C, D), with matrix representation as follows:
b11 b1p
u1 (t)
a11 a12 a1n
x1 (t)
x1 (t)
x2 (t) a21 a22 a2n x2 (t) b21 b2p u2 (t)
(1.1)
= +
amn am2 amn
xn (t)
bm1 bmp
u p (t)
xm (t)
x1 (t)
d11 d1p
u1 (t)
y1 (t)
c11 c12 c1n
y2 (t) c21 c22 c2n x2 (t) d21 d2p u2 (t)
(1.2)
= +
dk1 dkp
u p (t)
yk (t)
ckn cm2 cmn
xn (t)
or in compact form:
x (t) = Ax(t) + Bu(t)
(1.3)
(1.4)
F 1(t)
111111111111111111
000000000000000000
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
F
2(t)
111111111111111111
000000000000000000
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
000000000000000000
111111111111111111
F 3(t)
conservation of the mass in the two-tanks system leads to the following set of ordinary differential equations of the
first order:
dh1
= F1 (t) F2 (t)
dt
dh2
= F2 (t) F3 (t)
A2
dt
A1
(1.5)
(1.6)
Taking into account the relation between the liquid level height in the tank and the characteristics of valves regulating the flow F2 (t) = h1k(t)
and F3 (t) = h2k(t)
, we obtain:
1
2
1
1
dh1
=
h1 + F1 (t)
dt
A1 k1
A1
dh2
1
1
=
h1
h2
dt
A2 k1
A2 k2
(1.7)
(1.8)
which can be written in the matrix compact form, state-space form s = (A, B,C, D), where A- is the matrix
associated with the system states, B- is associated with the system inputs, C-is associated with the system outputs,
and D is associated with the direct relation between inputs and outputs. Therefore, in the case of two flows being
outputs and F1 (t) as input, as it is given in Fig.1.4 the state-space realization becomes:
1
dh1
1
0
h1
A
k
dt 1 1
A1
+ F1 (t)
(1.9)
1
1
dh2
h
0
2
A2 k1 A2 k2
dt
1
0
F2 (t)
h1
k1 0
=
F1 (t)
(1.10)
+
0
F3 (t)
h2
0 k1
2
which is a general state-space representation of the model dynamics of the two-tanks system given as:
1 Introduction
AB
h(t)
h(t)
F(t)
CD
(1.11)
F1 (t)
where h(t) = [h1 (t) h2 (t)] and F(t) = [F2 (t) F3 (t)] are vectors of the states and outputs respectively. t
u
Fig. 1.5 Derivation of the state space model of two tank physical system.
Bearing in mind the uncertainty of such model description, we can discuss the level of uncertainty that is associated
with the two-tanks model. In general, the tank dimensions are fixed and can not vary arbitrarily, and the only one
feature that can change over time is the valve characteristic that relates to the height and the flow out of the tank.
In other words, this model can be represented with Eq.1.9-1.10.
Example 1.2. (Two tanks in series)
We want to build a model that we can use for the regulation purposes. This model can be easily realized with
simple elements used for the design of integrated circuit, where elements given by Eg.1.9-1.10 can be made by
F 1(t)/A 1
h1
1/k1 A1
F2 (t)
A1
A1 /A2
h2
h2
1/k2 A2
+
F 3(t)
1/k 2
Fig. 1.6 Two tanks physical plant represented in the block diagram where triangle represents
integrator.
a simple gain element (resistor) and integrator (summation element). In particular, this model representation can
be easily realized with the block diagram given in Fig.1.6. In this way we achieved the realization of the physical
system, and we can use this for the controller synthesis. t
u
For the general system, the representation of two states (x = [x1 (t) x2 (t)]T , T-denotes the vector transpose) and one
output y(t) is given by the following state space model:
#
"
b11
d x1 (t)
a11 a12
x1 (t)
+
u(t)
(1.12)
=
a21 a22
x2 (t)
dt x2 (t)
b21
x1 (t)
y(t) = [c11 c12 ]
+ Du(t)
(1.13)
x2 (t)
In the following Fig.1.7 the realization is provided for the computer controlled system with linear time invariant
system dynamics:
c 11
b
21
b 11
dx_1/dt
x_1
a 21
dx_2/dt
x_2
c
12
u(t)
integrator
integrator
summation
y(t)
a 22
11
a 12
Fig. 1.7 State space realization of Eq.1.12-1.13, with simple elements of gain (a11 , a12 , a21 , a22 , b11 , b21 , c11 , c12 , and two integrators
and two summation elements) and D = 0.
In general, for the large scale physical plant having a large number of states representing the temperatures and con-
1 Introduction
centrations in the chemical plant, one can ask the following question: What is the smallest number of integrators
we can use in order to realize a desired block diagram?
In the Chapter 2.2.5 we will provide an answer to this question, and we will introduce the concept of controllability and observability to determine a minimal realization as a representation with the smallest number of
applied integrators.
Fig. 1.8 State space two tanks model realization using the integrator, summation and gain elements as simple embedded system circuit
design.
7
kx
f(t)
M x(t)
+ cx(t)
+ kx(t) = f (t)
(1.14)
z1 (t) = x(t)
dx
z1 (t) = z2 (t) =
dt
M z2 + cz2 (t) + kz1 (t) = f (t)
(1.15)
0 1
0
z1 (t)
z1 (t)
+ f (t)
=
1
z2 (t)
z2 (t)
Mk Mc
M
z (t)
1
+ 0 f (t)
y(t) = 1 0
z2 (t)
(1.16)
(1.17)
(1.18)
(1.19)
where the output is mass-M position, that is y(t) = z1 (t), see the Example. t
u
Example 1.4. (Continuous stirred-tank reactor)
The continuous stirred tank reactor is one important process model since it embodies many of features encountered
Fig. 1.10 A nonisothermal continuous stirred tank reactor where A product takes place.
in reaction systems. Let us consider that the 1st order irreversible chemical reaction takes place A product and
that perfect mixing is achieved so that the reaction rate is r = kcA . With assumption that the mass density of the
feed and product streams are equal, the material balance for the species A becomes:
1 Introduction
dcA
= q(cAi cA ) V kcA
dt
(1.20)
dT
= wC p (Ti T ) + (4H)V kcA +UA(Tc T )
dt
(1.21)
where the 4H is the reaction heat, U is the overall heat transfer coefficient, see Fig.1.10.
For the case where the flow rate (q or w) and inlet concentration and temperature (cAi and Ti ) are assumed to be
constant one can linearized the system around steady state operating conditions. Therefore the input variables are
cAi , Ti and Ts , while the state variables are cA and T and since only Ts is considered in this particular case to be
varying input, we obtain:
dca
= a11 ca + a12 T
dt
dT
= a21 ca + a22 T + b2 Ts
dt
(1.22)
(1.23)
1
where a11 = Vq k0 eE/RT , a12 = k0 eE/RT cA (E/RT 2 ), a22 = V C
[(wC p +UA)+(4H)V cA k0 eE/RT (E/RT 2 )],
p
UA
a21 = C1 p (4H)k0 eE/RT , b2 = VC
. The measurable output of interest is T (t) so that the state space model bep
comes:
cA (t)
a11 a12
cA (t)
0
+ u(t)
(1.24)
T (t)
a21 a22
T (t)
b2
c (t)
A
+ 0 u(t)
y(t) = 0 1
(1.25)
T (t)
with u(t) being the coolant temperature in the coil. It is interesting to observe that the measurable output T (t) of the
tank fluid can be easily realized with the thermocouple placed in the reactor, while the concentration measurements
are impossible to realize and this issue will be in discussed in detail in Chapter2.2.3. t
u
dnx
d n1 x
d n2 x
dx
du(t)
dmu
+ an1 n1 + an2 n2 + + a1 + a0 x(t) = b0 u(t) + b1
+ + bm m1
n
dt
dt
dt
dt
dt
dt
(1.26)
n1
m
dnx
d x
dx
du(t)
d u
{x(t)}
{u(t)}+b
+a
L
+
+a
L
+a
L
=
b
L
L
+
+b
L
m
n1
1
0
0
1
dt n
dt n1
dt
dt
dt m1
(1.27)
We recall the following relations from the Laplace transformation table (see, Ch 446):
an L
L {x(t)} = x(s)
dx(t)
= sx(s) x(0)
L
dt
2
d x(t)
= s2 x(s) sx(0) x(0)
L
dt 2
3
d x(t)
L
= s3 x(s) s2 x(0) sx(0)
x(0)
dt 3
(1.28)
and if we assume that the inputs are initialized as u(t) = 0, for t = 0, so that all higher derivatives of the inputs are
also zero, that is u(0) = 0, u(0)
x(s) =
b0 + b1 s + b2 s2 + + bm sm
a1 x(0) + a2 sx(0) + + an d n1 x(0)
+
u(s)
a sn + an1 sn1 + + a1 s + a0
a sn + an1 sn1 + + a1 s + a0
| n
{z
} |n
{z
}
x0 (t)
(1.29)
xu (t)
Therefore, the time response of the linear time invariant (LTI) system x(t) = x0 (t) + xu (t) contains two terms,
a1 x(0) + a2 sx(0) + + an d n1 x(0)
(1.30)
zero input state response : x0 (t) = L 1
an sn + an1 sn1 + + a1 s + a0
where x0 (t) is the zero-input state response, while the following expression given by xu (t):
b0 + b1 s + b2 s2 + + bm sm
zero initial condition state response : xu (t) = L 1
u(s)
an sn + an1 sn1 + + a1 s + a0
(1.31)
is the zero-initial condition state response, where L 1 is the inverse Laplace transform.
It can be seen that in the zero-input state response case the response of the system depends only on initial
conditions, while in the zero-initial condition state response case the response is only due to the input signal. It
is obvious that the transient part of solution contains both the zero-initial condition and zero-input response.
Therefore, by picking appropriate initial conditions for the state, we can annihilate the transient part of the zeroinput response.
Finally, taking the zero-initial condition state response, we obtain the systems representation given by the
transfer function,
b0 + b1 s + b2 s2 + + bm sm
xu (s)
=
= G(s)
(1.32)
u(s)
an sn + an1 sn1 + + a1 s + a0
From Eq.1.32 we notice that the transfer function behaves as generalized gain G(s) which multiplies u(s) to get the
output xu (s). This representation of the systems dynamics given by the transfer function G(s) is an input-output
representation which relates the input-u(s) to the output-xu (s).
10
1 Introduction
Remark 1.1. The transfer function that we can realized are only proper transfer functions, which have n > m. In
other words, we can not physically make the transfer function in which the degree of polynomial in numerator is
2
can not be
higher than the denummerator polynomial degree. In other words, the transfer function G(s) = s +3s+1
s+1
realized.
If we consider the state-space model representation s = (A, B,C, D), we can easily obtained the transferfunction (input-output) representation by the following procedure:
x(t)
= Ax(t) + Bu(t)
(1.33)
(1.34)
(1.35)
(1.36)
(1.37)
(1.38)
where I is the identity matrix (matrix I is generated as matrix with ones on diagonal while all other elements are
zeros, and it is of the same dimension as matrix A), and finally to the input-output representation:
y(s) = C(sI A)1 x(0) +C(sI A)1 Bu(s) + Du(s)
(1.39)
(1.40)
(1.41)
(1.42)
and after simple manipulation one gets that the y(s) = y1 (s) + y2 (s) = g(s)[u1 (s) + u2 (s)], which implies that we
can sum the inputs and apply them to g(s).
Let us consider the series connection between the two systems,
Y1 (s) = G1 (s)U1 (s)
(1.43)
(1.44)
We assume that the desired output is Y2 (s) and that the input U2 (s) = Y1 (s), so the following holds Y (s) = Y2 (s) =
G2 (s)U2 (s) = G2 (s)Y1 (s) = G2 G1U1 (s) = G2 (s)G1 (s)U(s), see Fig.1.11
U(s) U1(s)
11
U2(s)
G (s)
1
Y(s)
G (s)
2
Y1(s)
Y2(s)
U1(s)
G (s)
1
Y1(s)
Y(s)
U(s)
G (s)
2
U1(s)
Y2(s)
(1.45)
(1.46)
which gives the following Y (s) = Y1 (s) +Y2 (s) = G1 (s)U1 (s) + G2 (s)U2 (s) = (G1 (s) + G2 (s))U(s).
Another example which includes negative feedback is given in Fig.1.13,
U(s)
Y1(s)
U1(s)
Y(s)
G (s)
1
G (s)
Y2(s)
U2(s)
(1.47)
(1.48)
which gives the following Y (s) = Y1 (s) = G1 (s)U1 (s) = G1 (s)(U(s)Y2 (s)) = G1 (s)U(s)G1 (s)Y2 (s) = G1 (s)U(s)
G1 (s)G2 (s)Y (s), so that finally:
12
1 Introduction
13
COMPUTER
A/D
Clock
y{t k}
Algorithm
u{tk}
y(t)
D/A
Process
and provides the sequence of input signals {uk }. This sequence is converted to analog signal by the D/A converter.
It is important to notice that the events in the computer box are synchronized by the computer clock (real time
clock-RTC). An example of typical computer-controlled system (or sampled-date system) is given in Fig.1.14. The
compute-controlled system deals with the sequence of numbers which are represented by the difference equations.
We will also look into different types of representations and we will refer to them in the ensuing sections in the
course.
14
1 Introduction
0 t1 t2
t k t k+1
t k t k+1
y*(t k)
0 t1 t2
Fig. 1.15 Continuous signal y(t) and sampled signal y (tk ).
Fig.1.15 shows an idealized periodic sampling operation in which the sampled signal y (tk ) is a series of impulses
representing the measurements y(0), y(t1 ), y(t2 ), ,y(tk ), , at the sampling instances 0, t1 ,t2 , ,tk , . In a similar way, the controller output signal must be converted from the digital into analog form before it is applied to
the final control element. This operation is the signal reconstruction, and it is performed by the digital to analog
converter which operates as a zero-order hold, as shown schematically in Fig.1.14. Note that the output signal from
the zero-order hold yh (t) is held constant for one sampling period until the next sample is received. The operation
of the zero-order hold can be expressed as:
yh (t) = y (tk1 ) = yk1 ,
f or tk1 t < tk
(1.49)
As one can see from Fig.1.15-1.16, the sampling rate must be large enough so that the significant process infor-
15
y*(t k)
yh (t)
t1
t2
tk
t k+1
Fig. 1.16 Comparison of original signal y(t) (red dotted line) and reconstructed signal yh (t) (solid blue line).
mation is not lost. According to the Shannons sampling theorem a sinusoidal signal must be sampled more than
twice per period to be able to recover the original signal.
This implies that the sampling period (4t) must be small enough so that the significant signal information is
not lost.
Fig. 1.17 Comparison of original signal (solid line) and reconstructed signal obtained by connecting sampled dots (Process Dynamics
and Control, D. Seaborg,T. Edgar, D. Mellichamp, John Willey & Sons, 1989).
For example, if we consider signal given in Fig.1.17, in which dots represent the instances of taking the sample. It
can be observed, that for two samples per cycle the original sampled signal is deteriorated in the low frequency
signal, and the information can not be recovered, see Fig.1.17 (c)-(d). Along the same line, the 4/3 samples per
cycle in the Fig.1.17 (a)-(b), is not a large sampling rate (or frequency) to completely recover the signal. This phenomena is called aliasing. It is observed that the sampling of the original signal always induces the reconstructed
signal with the lower frequency.
In order to prevent aliasing, it is recommended to apply the following rule: Sample an oscillating signal more
than two times per cycle of oscillation, or the sampling frequency must be more than twice the frequency of the
sine wave that is sampled.
16
1 Introduction
(1.50)
Chapter 2
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
2.1.1 Transformation of continuous system to discrete system representation
Let us consider a typical simple physical system that is frequently present in chemical engineering. The flow of the
tank F2 (t) is added to another flow Fu (t) to generate desired flow F(t), see Fig.2.1:
F 1(t)
F u(t)
F
2(t)
+
so that by the mass conservation law, the systems representation of this plant is given by the following expressions:
dh1
= F1 (t) F2 (t)
dt
F(t) = F2 (t) + Fu (t)
A1
(2.1)
(2.2)
Knowing that the linear characteristic of the valve is usually given as (F2 (t) = x(t)/K) at the tanks exit, one can
easily come to the following set of equations:
1
1
dx
=
x(t) + F1 (t) = ax(t) + bu1 (t)
dt
A1 K
A1
1
F = x(t) + Fu (t) = cx(t) + du2 (t)
K
(2.3)
(2.4)
Eq.2.3 is the first order differential equation and the output of interest is given as the sum of two flows, that is
F = F2 (t) + Fu (t). We observe that Eqs.2.3-2.4 are written in the state space form s = (a, b, c, d) = (A, B,C, D)
17
18
where (A = a = A11K , B = b = A11 , C = c = K1 , D = d = 1). We also recall that every first order differential equation
with constant coefficient can be solved by transforming it in its integral form.
The integral form of Eq.2.3 is calculated by the procedure of completing the total differential in the equation
Eq.2.3:
x(t)
= ax(t) + bu1 (t)
multiply by eat at
e [x(t)
ax(t)] = eat bu1 (t)
Z t
d
t0
dt
Z t
x(t)eat dt =
ea bu1 ()d
t0
Z t
t0
Z t
t0
ea bu1 ()d
The final integral form of the solution of the first order differential equation with constant coefficients is:
Z t
(2.5)
(2.6)
t0
These equations provide the response of the system Eq.2.1-2.2, given in Fig.2.2, for example if F1 (t) and F2 (t)
(that is u1 (t) = F1 (t), and u2 (t) = F2 (t)) are known functions, we can obtain the continuous time evolution of the
output flow F, see the lecture Lecture 3.
x(0)
u(t)
t0
t1
t2
tk
t k+1
Fig. 2.2 Evolution of the state x(t) from the given initial condition x(t0 ) (solid line) and input u(t) = u(T k) (dashed line).
Z tk+1
tk
ea(tk+1 ) bu()d
(2.7)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
since u() is constant over the k th sampling interval, in fact it equals u(k), thus:
Z (k+1)T
x((k + 1)T ) = eaT x(kT ) +
ea(T (k+1)) d bu(kT )
19
(2.8)
kT
where the integral expression can be simplified by standard change of variables in the integration:
Z (k+1)T
ea((k+1)T ) d =
Z 0
kT
eap d p =
Z T
ea d
Finally, the discrete-time state x(k) which is obtained from the sampled continuous time state x(t) = x(kT ) from
Eq.2.7 is given as:
x(k + 1) = eaT x(k) +
Z T
ea dbu(k)
(2.9)
In the same manner the output equation Eq.2.2 by the same arguments becomes (that is u(t)
= u(k):
(2.10)
Finally, having Eqs.2.9, we solve exactly for the discrete representation of Eq.2.3-2.4, and represent it in the
following form:
1
+ bu(k)
a
F(k) = cx(k) + d u(k)
= cx(k)
+ du(k)
(2.11)
(2.12)
Z T
0
(2.13)
1
ea d = [eaT 1]b
a
c = c
d = d
(2.14)
(2.15)
(2.16)
c,
is given by the above expressions, see the lecture
Therefore, the discrete state-space representation d = (a,
b,
d)
Lecture 4.
(2.18)
dt
T
20
where T is the integration time specified by the user, x(k) is the value of x(t) at t = kT and x(k + 1) is the value at
the next time instance t = T (k + 1). Therefore, we have:
x(k + 1) x(k)
= f (x(k), u(k)) x(k + 1) = x(k) + T [ f (x(k), u(k))]
T
(2.19)
(2.20)
(2.21)
so that the approximated expression for the sampled data system becomes:
+ bu(k)
F(k) = cx(k) + d u(k)
= cx(k)
+ du(k)
(2.22)
(2.23)
It is important to note that the continuous system dynamics Eq.2.7 has two different discrete time representations,
and these are Eq.2.11 and Eq.2.22. We note that there is aR relationship between these two. Namely, one can recall
the following series expression for the function eax and oT eax dx which relates the a and b in both Eq.2.11 and
Eq.2.22:
aT (aT )2
(aT )i
= 1+
+
+
1!
2!
i=0 i!
eaT =
(2.24)
and
Z T
0
eax dx = T +
T 2 a T 3 a2
+
+
2!
3!
(2.25)
Finally, the initial physical model given in Fig.2.1, with the continuous model description given in Eqs.2.5-2.6, is
represented as a discrete system by using an ideal sampler A/D convertor and zero-order hold D/A convertor,
which converts discrete into analog signals. In other words, the computer with monitor and controller sees a
discrete representation of the physical system, as a sampled-data system that imitates the continuous physical
system. This is interesting as the tank model in Fig.2.1 can be represented with few basic electronic elements, like
the integrator, gains and sums. One can easily conclude that the tank-model will be very accurate and robust due to
the quite invariable geometric characteristics of the tank. The valve characteristic represents a mechanical element
which is also highly certain and does not change over time, however one has to be careful about the valve sticking
or other problems that may be present and affect the model realization.
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
x(t)=ax(t)+bu1(t)
y(t)=cx(t)+du 2(t)
U(t)
u (t)
1
A/D
u (t)
2
A/D
x k+1=Ax k+Bu
y k=Cx k+Du
21
y(t)
1k
y(t)
D/A
2k
Fig. 2.3 Flow-tank model system given by the continuous model in Eq.2.3-2.4, and represented as discrete sampled data system in
2.11-2.12.
x(t)
= Ax(t) + Bu(t)
(2.26)
(2.27)
The integral expression for the solution of the system of first order differential equations is given as:
x(t) = eA(ttk ) x(tk ) +
Z t
eA(t) Bu()d
tk
Z T
0
eA dBu(tk )d
(tk+1 ,tk ) =
eA dB
(2.28)
(2.29)
Remark 2.1. : In the case when the matrix A is invertible one can exactly calculate the = [eAT 1]A1 B. Also,
we can recall the simple expression for the matrix inversion for the 2 2 system:
1
ab
d b
A=
A1 =
(2.30)
cd
ad bc c a
22
(2.31)
where the time t is taken to be the sampling time, that is t = t = T . This can be easily obtained by the MATLAB
function expm(A t), please note that expm(A t) is a matrix exponential, if one applies exp(A t) it will not obtain
correct expression since exp(A t) operates on scalar entries of the matrix A.
Remark
2.2. Matlab functions: The matlab expression for calculating the matrix exponential of the matrix A =
2 3
is:
1 2
expm(A)
ans =
1.1864 12.6322
4.2107 1.1864
(2.32)
7.3891 20.0855
0.3679 7.3891
(2.33)
Also, the useful MATLAB command to transform from continuous to discrete state space representation is c2d
which can be used for given s = (A, B,C, D):
2 3
2
A=
, B=
, C = 3 1 , D = 0
(2.34)
1 2
1
and sampling time 4t as follows:
sys = ss(A, B,C, D);
c2d(sys, 0.1)
a=
x1
x2
x1 1.203 0.3646
x2 0.1215 1.203
b=
u1
x1 0.2374
x2 0.09871
c=
x1 x2
y1 3 1
d=
u1
y1 0
(2.35)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
23
where (a, b, c, d) in MATLAB are d = (, ,C, D). Find out more about MATLAB function c2d in matlab
help.
Computation of and
In general, there are many ways to compute and . We can utilize the series expansion expression of the matrix
exponential integral given by the function and relate that expression to and . The simplest way is to compute
the infinite sum in the case when the matrix A has a certain structure. Therefore, the is given as:
Z T
=
0
eA d = IT +
(Ai T i+1 )
AT 2 (A2 T 3 )
+
++
+
2!
2!
(i + 1)!
(2.36)
If we multiply the above expression from the left with matrix A, and we add I matrix to both sides of the above
expression, we obtain the expression for the series expansion of eAT , see Eq.2.24. Along, the same line we can
construct the expression for , therefore:
= I + A
= B
(2.37)
(2.38)
In ensuing examples we will demonstrate two ways of calculating and , see the Lecture 5:
Direct calculation of and , see Example.2.1
Calculation of and by using Laplace transform, = eAT = L 1 (sI A)1 see Example.2.2
Example 2.1. (Moving Cart-double integrator system)
Consider a unidirectional moving cart frequently present in the process industry with mass M, and built-in motor
that moves the cart by force u(t). Under reasonable assumptions that elastic force is negligible and that the cart
is moving without friction along the track, the second Newtons law provides the expression M x = u(t), which is
double integrator system given by:
01
0
x(t)
=
x(t) +
u(t)
00
1
y(t) = [1 0] x(t)
where vector x(t) = [x1 (t) x2 (t)], with x1 (t) being position and x2 (t) being velocity. The output of interest is given
x(t)
u(t)
Fig. 2.4 The moving cart modelled with negligible friction and elasticity in the force balance.
as position since y(t) = x1 (t). The state space matrix and can be easily obtained from the following expression:
24
AT (A2 T 2 )
10
0T
1T
+
+ =
+
=
01
00
01
1!
2!
2
T
Z T
2
=
d =
1
0
T
= eAT = I +
(2.39)
y(k) = [1 0] x(k)
Remark: In general, if the matrix A is given as a full matrix, we must calculate the entire series expansion, which
is not feasible. Therefore, this procedure is applied only in the case when higher order terms in the expression
Eq.2.36 vanish. t
u
Example 2.2. (A model of the electrical DC motor)
The electric DC motor model admits the following continuous state-space description:
1 0
1
x(t)
=
x(t) +
u(t)
1 0
0
y(t) = [0 1] x(t)
The Laplace transform method gives,
(sI A)1 =
s+1 0
1 s
"
1
=
1
s+1
1
=
1
s(s + 1) 1 s + 1
s(s+1)
1
s
hence,
"
=e
AT
=L
Z T
=
0
(sI A)1 =
e
1 e
eT
1 eT 1
1 eT
d =
T 1 + eT
(2.40)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
25
dx
= Ax(t) + Bu(t )
dt
(2.41)
where is time delay which is assumed to be less or equal to the sampling time interval, ( h).
Integration over the interval of one sampling period (hk, hk + h) gives,
x(kh + h) = eAh x(kh) +
Z kh+k
(2.42)
kh
where the input is constant over the sampling interval, see Fig.1. It is convenient to split the integral in two parts,
U(t)
Delayed signal
U(t )
khh
kh
kh+h
kh+2h
kh+3h
Fig. 2.5 The relationship among u(t) and the delayed signal u(t ) .
so
Z kh+
eA(kh+ks) dsBu(kh h) +
kh
Z kh+h
eA(kh+ks) dsBu(kh) =
kh+
= 1 u(kh h) + 0 u(kh)
(2.43)
Therefore, sampling the continuous time system with time delays gives:
x(kh + h) = k(kh) + o u(kh) + 1 u(kh h)
= eAh
Z h
0 =
(2.44)
(2.45)
eAs dsB
(2.46)
1 = eA(h)
eAs dsB
(2.47)
We observe that in the above expression, the next time instance k + 1 is given as a function of states at k and k 1.
Therefore, the above expression becomes:
x(k + 1) = x(k) + o u(k) + 1 u(k 1)
which is augmented with the u(k) = u(k 1) expression, and the state space model is given as follows:
(2.48)
26
" #
0
x(k + 1)
1
x(k)
=
+
u(k)
u(k)
0 0
u(k 1)
I
Notice that we augmented Eq.2.48 with an extra state variable u(k 1), which represents the past value of the
control signal.
Example 2.3. (Level-tank model with the input delay)
Let us consider the following scalar differential equation which models the level-tank system with the delay in
the input, see Fig2.6. In particular, we can model transport delay which occurs in the fluid flow systems with the
signal Fi (t) = u(t ), where is delay time, so that the known tank model takes the following form:
U(t )
Fig. 2.6 The transport delay in the pipe flow coming in the tank, Fi (t) = u(t ).
x(t)
= x(t) + u(t )
(2.49)
(2.50)
Z h
i
h (h)
b0 = 0 =
e
1
es ds =
0
Z
i
h h
b1 = 1 = e(h)
es ds =
e e(h)
(2.51)
(2.52)
(2.53)
We obtain the difference equation and we notice that the future discrete value of x(k + 1) depends on current
x(k) and u(k) values and time delayed value of input, that is u(k 1) t
u.
Example 2.4. (The moving cart model) (revisited Example.2.1)
Let us consider the double integrator system from Example.2.1, x(t)
= u(t ):
" #
0
x1 (t)
0 1 x1 (t)
=
+
u(t )
x2 (t)
0 0 x2 (t)
1
" #
0
01
therefore, for the matrix A =
and B =
, we have:
00
1
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
= eAh =
1h
01
(2.54)
2
( h
2 )
h
0
2
Z
(h 2 )
1 h
2
=
b1 = 1 = eA(h)
eAs dsB =
0 1
0
Z h
b0 = 0 =
27
eAs dsB =
(2.55)
(2.56)
(2.57)
We observe that the state space representation of the above equation can easily be constructed as it is the case
of Eq.2.48 t
u. In the previous examples, we consider cases when time delay is smaller than the sampling time
( < h). However, we need to address the case when time delay is bigger thatn the sampling time. Therefore, for
> h, we have the same procedure in calculating 0 and 1 , where instead of we have 0 which is obtained by
the following expression:
= (d 1)h + 0 , and 0 < 0 < h
where d- is an integer, so that we obtain:
x(k + 1) = x(k) + 0 u(k (d 1)) + 1 u(k d)
(2.58)
and we use the same expressions for calculating 0 and 1 with 0 instead of .
Example 2.5. (The paper machine model(Astrom, 1997)):
The paper machine model is given as:
dx(t)
= x(t) + u(t 2.6)
(2.59)
dt
with sampling time h = 1sec. Therefore, we have that = 2.6 = (3 1) 1 + 0.6, so that d = 3 and 0 = 0.6. We
R
R
0
0 R 0
calculate = eh , 0 = 0h eas dsB = 010.6 es dsB = [1 e0.4 ], 1 = ea(h ) 0 eas dsB = [e0.4 e1 ]. The
final discrete form is therefore:
x(k + 1) = x(k) + 0 u(k 2) + 1 u(k 3)
(2.60)
28
2.1.4 Difference Equations, Shift operators - forward shift & backward shift (delay)
operators
A differential operator dtd is a convenient tool to describe continuous systems which take the form of linear differential equations with constant coefficients. Another convenient way is to introduce a similar operator for the
difference equations by introducing operator as simple mapping that relates two instances of any discrete signal.
In simple terms, we have two operators:
the forward-shift operator
y(k)q = y(k + 1)
(2.61)
y(k)q1 = y(k 1)
(2.62)
y(k)
y(k+1)
y(k)
q1
y(k1)
Fig. 2.7 The block diagram representation of shift and back shift operator given by Eqs.2.61-2.62.
(2.64)
(2.65)
while if the signal is applied to the back-shift operator, the sequence becomes:
Y (k)q1 = {y(1), y(0), y(1), , y(k 1), y(k), }
(2.66)
We note different consequence of applying the shift forward and backward shift operator to the signal Y . In particular, y(1) needs to be identified if known t
u.
These two operators given by Eqs.2.61-2.62 are equally used in the finite-difference equations with the constant
coefficients representation of the discrete systems dynamics. However, analysis of the order of the system and stability is usually realized with the forward operator, while the back-shift (delay) operator is more used in discussion
related to causality of the system realization.
The forward shift operator is used to simplify manipulation of higher-order difference equation:
an y(k + n) + an1 y(k + n 1) + an2 y(k + n 2) + + a1 y(k + 1) + a0 y(k) = u(k)
so by applying the forward shift operator (that is yk q = yk+1 ), we obtain:
(2.67)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
29
qy(k) = y(k + 1)
q[qy(k)] = y(k + 2)
q[q[qy(k)]] = y(k + 3)
=
q[q[ [qy(k)] = qn y(k) = y(k + n)
(2.68)
so that finally, we obtain the relation among input u(k) and output y(k):
n
an q + an1 qn1 + an2 qn2 + + a1 q + a0 y(k) = u(k)
(2.69)
B(q)
A (q) u(k)
(2.70)
where B(q) = 1 and A (q) = an qn + an1 qn1 + + a0 . We also note that input u(k) and output y(k) at discrete
B(q)
instance k are related with the block element given as G(q) = A
(q) which reminds us of the transfer function
description of continuous systems.
Example 2.7. (Discrete system transfer function (pulse-transfer function))
Find the input-output relation between input u(k) and output y(k) using the forward shift operator, if the state space
representation of the following discrete system is given as:
x(k + 1) = 2x(k) + 3u(k)
y(k) = x(k)
(2.71)
(2.72)
Let us consider forward shift operator, x(k) [q] x(k + 1), then we obtain:
qx(k) = 2x(k) + 3u(k)
(q 2)x(k) = 3u(k)
A x(k) = Bu(k)
(2.73)
3
y(k)
=
u(k) q 2
(2.74)
so that the:
3
q2 .
The Eq.2.67 can be expressed in the terms of back-shift operator, namely, we can take Eq.2.67, and let us
substitute k + n = p, so that we have:
an y(p) + an1 y(p 1) + an2 y(p 2) + + a1 y(p n + 1) + a0 y(p n) = u(p n)
now, if we apply the back-shift operator (delay),
(2.75)
30
q1 y(p) = y(p 1)
q1 [q1 y(p)] = y(p 2)
1
(2.76)
(2.77)
B(q1 )
u(p)
A (q1 )
(2.78)
where B (q1 ) = qn and A (q1 ) = an + an1 q1 + + a0 qn . If one relates the input-output expressions
given by Eg.2.70 and Eq.2.78, the following relationship among A and A is established:
A (q) = qn A (q1 )
(2.79)
The polynomial A that is obtained from the polynomial A by reversing the order of the coefficients is called a
reciprocal polynomial.
Example 2.8. (Discrete system transfer function (pulse-transfer operator function))
Find the input-output relation between input u(k) and output y(k) if the state space representation of the following
discrete system is given as:
x(k + 1) = 2x(k) + 3u(k)
y(k) = x(k)
(2.80)
(2.81)
Let us consider the back-shift (delay) operator, x(k) [q1 ] x(k 1), so that we have,
x(k) = 2x(k 1) + 3u(k 1)
x(k) = 2x(k)q1 + 3u(k 1)
(1 2q1 )x(k) = 3u(k 1)
A x(k) = B u(k 1)
(2.82)
We have that A = q 2 and A = q(1 2q1 ) = qA , which implies that from Eq.2.73:
A y(k) = Bq1 u(k) A y(k) = B u(k 1)
(2.83)
with B = B . Finally, we see that both input output representations in the case of zero initial conditions are given
as follows:
3
B
u(k) = u(k) = G1 u(k)
q2
A
3q1
B
=
u(k) = u(k 1) = G2 u(k 1)
1
1 2q
A
y(k) =
(2.84)
(2.85)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
31
B
operates on the same kth sampling instance while the
Interestingly enough, the pulse-transfer function G1 = A
B
pulse-transfer function G2 = A u(k 1) is applied with the one time instance delayed input, see the Lecture 6: t
u
Remark: The importance of forward and back shift operator is related to realizability of the system.
The construction of a simple input-output system with the pulse-transfer function operator, when back shift operator is used is given in the following Fig.2.8. In the first step, we write the relation among x(k + 1) and x(k) by using
q1 - back shift operator. The signals coming from x(k) and u(k) are amplified by the gains (2, 3) and sum up in the
signal that is fed to the x(k + 1), so that the final form (dashed-box) is given as input-output from u(k) to y(k).
x(k+1)
q 1
x(k+1)
q 1
x(k)
STEP 1
x(k)
STEP 2
2
u(k)
3
x(k+1)
q 1
x(k)
y(k)
STEP 3
2
u(k)
32
2.1.5 Z -transform
Let us recall that the dynamical system in the continuous domain can be represented by ordinary differential equations (state-space model, with matrices s = (A, B,C, D)), which is dynamical systems internal representation, and
complementary way by the transfer function representation (that is G(s) = C(sI A)1 B) which is the input-output
representation. Along the same line, discrete systems are represented by the difference equations (state-space
model, d = (, ,C, D)), while the input-output description is given by the pulse-transfer function (G(q1 )).
Therefore, in analogous way as in the continuous system we utilize the Laplace transform L {x(t)} = x(s) to
transform from time to complex domain system representation:
L
x(t)
= Ax(t) + Bu(t)
x(s)
= G(s)
u(s)
(2.86)
we introduce a Z -transform to relate difference equations and pulse-transfer function representation, see the lecture Lecture 7-I.
Z -transform simply transforms the sequence of numbers to the series, in particular, for any arbitrary sequence
of numbers:
{xk } = {x0 , x1 , x2 , x3 , x4 , , xk , }
we can construct the series by applying the Z -transform at the sequence Z {xk } = x(z) in the following way:
x(z) = Z {xk } = xi zi = x0 + x1 z1 + x2 z2 + + xk zk +
(2.87)
i=0
in other words, the Z -transform is constructed by taking the first number in the sequence and multiplied by z0 , and
adding the second number in the sequence multiplied by z1 , and adding the third number in sequence multiplied
by z2 , and so on. In other way, we work with the series instead of sequence. The variable z here is a complex
variable.
Let us consider, the class of standard discrete input functions:
1.)Impulse function - (k) = {1, 0, 0, }
(k)
2.)Impulse (k 3) = {0, 0, 0, 3, 0, 0, 0, 0, }
3.)Unit step applied at k = 0, u(k) = {1, 1, 1, 1, 1, 1, 1, 1, 1, }
Question 2.1. : How it is possible that adding a small but infinite number of terms which are not zero sums up
z
to the following polynomial analytic expression z1
?
In order to answer this question we invoke the definition of geometric series, which play the central role in the
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
33
(k3)
u(k)
z
z1
discrete systems analysis. The exponential function plays a similar role in the continuous system analysis, since
1
it relates polynomial factor s+
with et . We also recall that the geometric sequence has an expression given
as follows:
k
a = 1, a, a2 , a3 , , ak ,
a
1
z
Z ak = ( )i =
=
f or |z| > |a|
z
1
a/z
z
a
i=0
It can be inferred from the above that if a = 1 and Z -transform is applied, one obtains:
n o
Z ak = 1 + 1z1 + 1z2 + 1z3 + 1z4 + 1z5 + 1z6 + 1z7 + =
z
z1
(2.88)
(2.89)
for |z| > 1. This expression can be also written as x = 1z , so that the above becomes:
1
= 1 + x + x2 + x3 + x4 + x5 + x6 + x7 +
1x
which is obtained by long division, in other words we can divide 1 with 1 x:
1 : 1 x = 1 + x + x2 + x3 +
1x
+
x
and this will gradually build all terms in the infinite series.
4.) Ramp function R(hk) = {0, 1h, 2h, 3h, 4h, 5h, }
Z {R(kh)} = 0 + hz1 + 2hz2 + 3hz3 + 4hz4 + 5hz5 + 6hz6 + 7hz7 + +
= h z1 + 2hz2 + 3hz3 + 4hz4 +
= hz1 1 + 2z1 + 3z2 + 4z3 + 5z4 +
knowing that
1.
2.
3.
1
2
3
4
1x = 1+ x + x + x + x + +
d
1
2
3
dx 1x = 1 + 2x + 3x + 4x + +
1
= 1 + 2x + 3x2 + 4x3 + + kxk1 +
(1x)2
(2.90)
34
4. taking that x =
1
z
so that finally,
Z {R(kh)} = 0 + hz1 + 2hz2 + 3hz3 + 4hz4 + 5hz5 + 6hz6 + 7hz7 + +
1
z
= hz1
=h
1
2
(1 z )
(z 1)2
(2.91)
k=0
k=0
f (kh)zk = Ceakh zk
(2.92)
1
1 eah z1
(2.93)
= 2
(2.94)
iw
iw
2i z e
ze
z 2zcos(w) + 1
Therefore, we summarize several characteristic Z -transforms of several most common input functions:
{xk }
impulse (k)
Unit step
ramp R(hk)
Z {xk } = x(z)
1
z
z1
z
h (z1)
2
Ceakh
1
C 1eah
z1
sin(wk)
zsin(w)
z2 2zcos(w)+1
cos(wk)
z(zcos(w))
z2 2zcos(w)+1
kak
az
(za)2
We also consider to take the Z transform of the signal x(k + 1), x(k + 2) and/or u(k). In the same way, we consider
the sequence constructed of sampled signals by taking the Z -transform.
x(z) = Z {x(k)} = Z {x0 , x1 , x2 , x3 , x4 , x5 , } = x0 + x1 z1 + x2 z2 + x3 z3 +
Z {x(k + 1)} = Z {x1 , x2 , x3 , x4 , x5 , x6 , } = x1 + x2 z1 + x3 z2 + x4 z3 +
Z {x(k + 2)} = Z {x2 , x3 , x4 , x5 , x6 , x7 , } = x2 + x3 z1 + x4 z2 + x5 z3 +
Z {x(k + p)} = Z x p , x p+1 , x p+2 , x p+3 , = x p + x p+1 z1 + x p+2 z2 +
(2.95)
(2.96)
(2.97)
(2.98)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
35
Also notice that, the first equation Eq.2.95 can be rewritten as follows,
x(z) = x0 + x1 z1 + x2 z2 + x3 z3 + = x0 + z1 x1 + x2 z1 + x3 z2 + x4 z3 + =
= x0 + z1 Z {x(k + 1)} Z {x(k + 1)} = zx(z) zx0
in the same way for Z {x(k + 2)}
x(z) = x0 + x1 z1 + x2 z2 + x3 z3 + x4 z1
= x0 + x1 z1 + z2 x2 + x3 z1 + x4 z2 + x5 z3 + =
= x0 + x1 z1 + z2 Z {x(k + 2)} Z {x(k + 2)} = z2 x(z) z2 x0 zx1
The most commonly used cases are:
Z {x(k + 1)} = zx(z) zx(0), Z {x(k + 2)} = z2 x(z) z2 x(0) zx(1)
(2.99)
(2.100)
(2.102)
Z {u(k)} = u(z)
(2.103)
(2.104)
which gives
3
z
x0 +
u(z)
z2
z2
in the case of zero initial conditions x0 = 0, the above expression becomes
x(z) =
x(z) =
(2.105)
3
u(z) = G(z)u(z)
z2
(2.106)
3
where we observe that the transfer function G(z) = z2
is identical to the one obtained by considering pulse
operators (shift-operation) given in Eq.2.74. t
u
In addition to these expressions of the Z -transform
of the signals and functions, we can find that Z -transform
of the zero-hold element or backshift operator is Z q1 = 1z , see the Lecture 7-IV.
3
z2
36
We look for the expression of the Z -transform for the step input:
n o
z
z
Z ak =
u(z) =
za
z1
(2.107)
=
z2 z1
z
(z 2)(z 1)
Z {x(k)} = x(z) =
which becomes
x(z)
A0
A1
A0 z A0 + A1 z 2A1
3
=
+
=
z
z2 z1
(z 2)(z 1)
(z 2)(z 1)
A1 z
3z
3z
A0 z
+
=
x(z) =
z2 z1 z2 z1
Z 1 {x(z)} = x(k) = 3 2k 3 1k
(2.108)
x(k) = 3(2k 1)
(2.109)
R(z) =
so finally we obtain
see the Lecture 8.
Once the Z -transform is obtained we want to transform x(z) to the corresponding discrete time function (that
is from x(z) x(nh), so we define the inverse z-transform operator denoted as Z 1 as follows:
{ f (nh)} = Z 1 [ f (z)]
(2.110)
b0 zm + b1 zm1 + + bm1 z + bm
, n>m
zn + a1 zn1 + + an1 z + an
(2.111)
r1
r1
r1
+
++
1 p1 z1 1 p2 z1
1 pn z1
(2.112)
where the denominator can be factored into n-distinct real roots (that is, the poles of x(z), denoted by
p1 , p2 , , pn ), thus an inverse Z 1 -transform is used to find:
r1
r1
r1
1
1
1
+Z
++Z
(2.113)
x(ih) = Z
1 p1 z1
1 p2 z1
1 pn z1
which leads to
x(kh) = r1 (p1 )k + r2 (p2 )k + + rn (pn )k
(2.114)
EXAMPLE
24.5
Using
partial
F(z)
= 0.5z-I/[(1
fraction
z-I)(l
expansion,
find the
inverse
z-transform
0.5z-I)] for a sampling period 6.t = 1.
of
Solution
Expanding
F(z)
yields
= (1 _ z-I)(l
0.5z-1)
= 1 - Z-I + 1 - 0.5z-1
Imaginary
z-plane
(24-54)
37
bmrr
/;b1ill
(1)
Real
trrn-m,
Figure 24.2
Time-domain
responses
Fig. 2.9 Time-domain response for different locations of the roots of denominator polynomial of x(z) in Eq.2.111.
Remark 2.3. (Poles and zeros) The zeros of the numerator of Eq.2.111 are called the zeros of x(z), and the zeros
of the denominator of expansion are called the poles of x(z). Since the function x(z) is often not strictly proper
function (that is n > m), it is more convenient to expand x(z)
z into sum of partial fractions.
Example 2.10. (Simple Poles) Find the inverse Z 1 -transform of the following x(z):
x(z) =
We expand
x(z)
z
z(z 1)
(z + 1)(z + 2)
(2.115)
(2.116)
which leads to factoring and comparing coefficients of like power of z, and we get:
a1 + a2 = 1
2a1 + a2 = 1
Consequently,
x(z) =
2z
3z
+
z+1 z+2
(2.117)
Example 2.11. (Repeated poles) Find the inverse Z 1 -transform of the following x(z):
x(z) =
z(z 1)
(z + 3)(z + 2)3
(2.118)
z1
b
a1
a2
a3
=
+
+
+
(z + 2)3 (z + 3) z + 3 (z + 2)3 (z + 2)2 z + 2
(2.119)
38
(z 1)
|z=3 = 4
(z + 2)3
(2.120)
(2.121)
and evaluate at z = 2,
z1
|z=2 = 3
z3
To find a2 we differentiate Eq.2.121 with respect to z to get
a1 =
4
3(z + 2)2 (z + 3) (z + 2)3
= 2a3 (z + 2) + a2 + 4
2
(z + 3)
(z + 3)2
(2.122)
(2.123)
d
dz
z1
|z=2 = 4
z+3
(2.124)
(2.125)
1 d2
2 dz2
z1
|z=2 = 4
z+3
4z
3z
4z
4z
+
+
2
3
z + 2 (z + 2)
(z + 2)
z+3
(2.126)
(2.127)
which leads to
3
(2.128)
x(n) = 4(2)n 2n(2)n + n(n 1)(2)n + 4(3)n
4
az
n
Remark: The following useful relation can be use for upper expression Z {nan } = (za)
2 and Z {n(n 1)a } =
a2 z
(za)3
t
u.
2) Long division method
If the x(z) is given as rational function, where x(z) = g(z)/h(z), then we simply divide g(z) by h(z) to obtain
a power series expression x(z) in z1 . The obvious possible drawback is that this method does not provide a
closed form expression of x(n).
Example 2.12. (Long division method) Obtain the inverse Z 1 -transform of:
x(z) =
z2 + 2z 3
z3 4z2 + 5z 6
a. Transform the x(z) in the form of z1 , so that no positive powers appear in the expression for x(z)
(2.129)
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
x(z) =
z2 + 2z 3
z3 4z2 + 5z 6
x(z) =
z2 (1 + 2z1 3z2 )
z3 (1 4z1 + 5z2 6z3 )
z1 + 2z2 3z3
1 4z1 + 5z2 6z3
39
(2.130)
(2.131)
where the input function is given as a sequence u(k) = {1, 1, 1, }, that is the step function applied at k = 0, and
x(0) = 1, and x(1) = 0.2.
We apply Z -transform to obtain the following:
Z {x(k + 2)} = z2 x(z) z2 x(0) zx(1)
Z {x(k + 1)} = zx(z) zx(0)
Z {x(k)} = x(z)
Z {u(k)} = u(z)
so that the above equations become an algebraic expression:
x(z) =
z2 x(1) + 0.8zx(0)
1
+ 2
u(z)
2
z + 0.6z + 0.05
z + 0.6z + 0.05
(2.132)
we observe there are two contributions to the solution, one from the initial conditions and another one from the
input (same as in the continuous case, see Eq.1.30-1.31).
z
, we obtain:
Since the Z {u(k)} = u(z) = z1
x(z) =
z(z + 0.8)
z
z3 0.2z2 + 0.2z
+
=
z2 + 0.6z + 0.05 (z2 + 0.6z + 0.05)(z 1) z3 0.4z2 0.55z 0.05
(2.133)
We can use either the partial fraction or power series method to solve the above equation. If we use the power
series method, we obtain the following:
40
(2.134)
Therefore, the solution to Eq.2.131 is given as instances x(0) = 1, x(1) = 0.2, x(2) = 0.83, x(3) = 0.492, .
Obviously, the drawback is that for any further instance k, we need to calculate all previous instances. Also, we can
obtain solution to Eq.2.131 with the power series method. We rewrite the expression Eq.2.133, in the following
form:
A
B
C
x(z)
=
+
+
(2.135)
z
z + 0.5 z + 0.1 z 1
so that the coefficients A, B and C are calculated as follows:
z2 0.2z + 0.2
A=
(z + 0.5) |z=.5 = 0.9167
(z + 0.5)(z + 0.1)(z 1)
z2 0.2z + 0.2
(z + 0.1) |z=.1 = 0.5227
B=
(z + 0.5)(z + 0.1)(z 1)
z2 0.2z + 0.2
C=
(z 1) |z=1 = 0.6061
(z + 0.5)(z + 0.1)(z 1)
therefore, we obtain an expression that can be easily utilized by the inverse Z -transform:
z
z
1
1
z
0.5227
+ 0.6061
x(n) = 0.9167( )n 0.5227( )n + 0.6061
z (0.5)
z (0.1)
z1
2
10
(2.136)
Evaluating the above expression for n = 0, 1, 2, 3, we obtain x(0) = 1, x(1) = 0.2, x(2) = 0.83, x(3) = 0.492,
, see another example at Lecture 8-I.
x(z) = 0.9167
z
(z + 1)(z + 21 )
b)
z(z + 1)
(z + 2)2 (z 1)
(2.137)
Use the power series method to find the inverse Z 1 transform of:
c)
z2
(z 1)(z + 3)
d)
ea z
(z ea )2
(2.138)
----Jo(
582
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
b,
c,
-$
W'
-$W'
-+
=t
:f'
s-plane
First-order
(a)
-+
=t
z-plane
y*(t)
-ws/2
systems
(s-domain)
- wsl2
-ws/2
-wsl2
-wsl2
y(t)
41
iT
lllilL
~,
~,
~,
~, ~,
(b)
Second-order
systems
(s-domain)
(c)
(d)
(e)
(f)
(g)
(h)
Figure
24.6
on impulse
response.
Fig. 2.10 Complex continuous and discrete poles distribution and effect in continuous and in discrete time domain.
2.1.7 Poles & zeros of pulse transfer function G(z), Filter design
For a single-input-single-output finite dimensional system, the poles and zeros can be obtained from the numerator
and denummerator of the pulse transfer function G(z). We recall that the expression of the pulse transfer function
G(z) is obtained by taking the Z -transform of the difference equation describing the discrete model of the plant
(z)
(process) dynamics. Therefore, we have for the input-output description with y(z) = G(z)u(z) = N
P(z) :
N (z)-zeros (or roots) of polynomial N (z) are the solutions of N (z) = 0
P(z)-poles (or roots) of polynomial P(z) are the solutions of P(z) = 0
42
{a }
g(z)
{an} g(a)
Fig. 2.11 The linear system preserves the input signal type and outputs the same signal amplified with the plant transfer function
evaluated as g(a).
Let us consider an arbitrary input signal sequence {an }, and let assume a stable arbitrary plant with the following
pulse transfer function:
z
y(z) =
u(z) = g(z)u(z)
(2.139)
z 0.2
Since the Z -transform of the {an } is given as Z {an } =
y(z) =
z
za ,
z
z
z 0.2 z a
0.2
0.2a
and B =
a
a0.2 ,
(2.140)
(2.141)
so that finally:
y(k) =
0.2
a
(0.2)k +
(a)k
0.2 a
a + 0.2
we observe that if the system is stable, 0.2k 0 as k , so the remaining part is,
n o
a
y(k) =
ak = g(a) ak
a 0.2
(2.142)
(2.143)
see at Lecture 9.
The consequence of Eq.2.143 is that if a is pole or zero of the transfer function, we have two cases:
1. If the applied input is the pole of g(z), that is u(k) = {i }, the free modes of system will be excited.
2. If the applied input signal contains zero of the pulse transfer function g(z), that input signal will be blocked
(zero output).
There are many reasons to use the property of the transfer function to block certain signals:
To extract from the signal some known component for the monitoring purposes. Any signal in general can be
decomposed by Fourrier series as a linear combination of sin(t), cos(t), impulse, step, ramp function. Therefore,
we can translate all these sampled functions as sequences of numbers, and filter, for example, high frequencies
so that monitoring of the noisy measured signal becomes (through the filter) a smooth function of temperature,
level, concentration.
To remove certain signal from the closed-loop dynamics.
2.1 Conversion of continuous to discrete system (Finite difference & exact discretization)
43
F 1(t)
1111111111111111111111111
0000000000000000000000000
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
FILTER
TANK LEVEL MEASUREMENTS
F
2(t)
Fig. 2.12 Tank model with filter of measured tank level height.
In general, whenever we know the nature of the signal that we want to filter, we can write a dynamical system
representation of the signal in the form of transfer function g f (z), and invert that transfer function g1
f (z) which
will filter the desired signal.
WILL NOT SHOW IN OUTPUT
{an} g(a)
n
{a }
g(z)
g (z)
f
Fig. 2.13 Filtering of the sequence {an } from the output by applying filter g1
f (z).
CONTROLLER
y(z)
r(z) +
g(z)
r(z) +
g(z)
FILTER
F 1(t)
1111111111111111111111111
0000000000000000000000000
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
0000000000000000000000000
1111111111111111111111111
FILTER
y(z)
F
2(t)
Fig. 2.14 Tank model with filter of measured tank level height.
z
we use a simple unit gain controller, so that the direct transfer function is given g(z) = z0.2
. The filter transfer
function can be easily obtained by inverting the transfer function
of
the
signal
that
we
want
to
block.
Therefore, for
z
example, if we want to block the signal input sequence 0.5k . The Z 0.5k = z0.5
, so that the filter transfer
function g f (z) is given as:
1
z 0.5
g f (z) =
=
(2.144)
u(z)
z
44
Therefore, we added one element in the already existing closed-loop, so that the new closed-loop transfer function
from r(z) to y(z) is given as:
g(z)g f (z)
(z 0.5)
Gcl (z) =
=
(2.145)
1 + g(z)g f (z)
2z 0.7
We observe that adding one element in the closed-loop will change the roots of the closed-loop characteristic
polynomial, and we want to ensure that we do not lose stability, see at Lecture 10.
t
u
45
splane
Im
1111111
0000000
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
STABLE
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
Im
UNSTABLE
Re
UNSTABLE
0000000
1111111
1111111
0000000
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
STABLE
0000000
1111111
0000000
1111111
0000000
1111111
0000000
1111111
Re
Fig. 2.15 Stability regions in s and z-plane. The simple relation among continuous and discrete system representation is given as
z = est . Since s is complex variable one can write s = + j which implies that z = et e j t = et (cos( (t) + jsin( t). Thus
for real values of s, the magnitude of z is |z| = et , and implies that et > 1 for > 0, et = 1 for = 0 and et < 1 for < 0.
x(t) = eAt x(0) = [?] x(0)). Therefore, we can find the state transformation z(k) = T x(k), so that D = T T 1
such that the Eq.2.146 becomes:
k
1 0 0
0 k 0
2
(2.147)
z(k) = T T 1 z(0) z(k) = Dk z(0) =
z(0)
k
0 0 0 n
In order to determine the systems stability (if the state x(k) diverges or converges for x0 6= 0, as k ), we
have the following criteria:
If is diagonalizable, the necessary condition for the Eq.2.146 stability is that all eigenvalues of ,
k {i } k < 1.
The eigenvalues of are calculated numerically from the characteristic polynomial of , that is ( ) =
det(A I)) = 0,
( ) = n p1 n1 + + pn1 + pn
(2.148)
The Eq.2.146 is stable if and only if k k < 1 for every characteristic root, (that is for every zero of the characteristic polynomial Eq.2.148), see the Lecture 11 .
46
1 1
Example 2.14. (Determining stability) Determine stability of x(k + 1) = Ax(k), where A =
. Easily
0.25 1
2 2
1.5 0
we find P =
, so that P1 AP =
, thus the system is unstable, see the example in the Lecture 11
1 1
0 0.5
how to calculate matrix P. t
u
2.) Algebraic criteria relate to the properties of the characteristic polynomial (Yuri criteria). Given the characteristic equation Eq.2.148 in the following form:
( ) = an n + an1 n1 + + a1 + a0
(2.149)
2n 5 r0 r1 r2 r3
2n 4 r3 r2 r1 r0
2n 3 s0 s1 s2
a a
b0 bn1k
c0 cn2k
r r
r r
r r
where bk = 0 n1 , ck =
, dk =
, s0 = 0 3 , s1 = 0 2 , s2 = 0 1 . The
an ak
bn1 bk
cn2 ck
r3 r0
r3 r1
r3 r2
Yuri stability test requires that the following conditions are satisfied in order to guarantee stability:
(1) > 0
(1)n (1) > 0 for n even
(1)n (1) < 0 for n odd
and
|a0 | < an
|b0 | > |bn1 |
|c0 | > |cn2 |
47
1 3
. Easily we
1 1
find the characteristic polynomial ( ) = det( I A) = 2 2 + 4. Therefore, (1) > 0, (1) > 0, 1 < 4,
thus the system is unstable. t
u
3.) Lyapunov Method is associated with determination of stability of a nonlinear system:
Example 2.15. (Determining stability) Determine stability of x(k + 1) = Ax(k), where A =
(2.150)
In general, the Lyapunov method is based on the notion of the existence of an energy function (Lyapunov
function) associated with the dynamics Eq.2.150. The energy of chemical process and mechanical system is
always positive (V (x) > 0), and it attenuates as the time goes to , that is 4V < 0 . Therefore, we define for
the linearized Eq.2.150, x(k + 1) = x(k), the following quadratic Lyapunov function candidate V (x(k)) =
x0 (k)Px(k), where P is an arbitrary matrix. Therefore, we have:
4V = V (x(k + 1)) V (x(k)) < 0
= x0 (k + 1)Px(k + 1) x(k)Px(k)
= (x(k))0 P(x(k)) x(k)Px(k)
= x0 (k) 0 P P x(k) = x0 (k)Qx(k)
(2.151)
(2.152)
where Q is a positive definite matrix. The system is stable if and only if the Lyapunov equation 0 P P = Q
has positive definite solution matrix P (that is, the eigenvalues of matrix P are strictly positive), see the Lecture
12 .
2.2.2 Controllability
Motivating Example: Can we use the input u(t) to fill the tanker in the figure ?
In the oil industry large interconnections of the tank and vessel systems are used for the storage and inventory
management. We are interested if we can use input u(t) to drive oil to the tanker. The answer is given by answering
whether the system (tanks and vessels) is controllable from the input u(t), or in other words, is there any input that
can drive the system state to a desired point in the finite time. Practically, we want to provide an input u(t) such
that the tank height (T9) is at a certain level which will provide the pressure gradient based force for filling the
tanker.
Controllability is an important systems theoretic property. The controllability in laymans language answers
as to whether the system can be controlled. Let us look at the discrete state space description, given as:
x(k + 1) = Ax(k) + Bu(k)
(2.153)
(2.154)
the system is controllable if x(0) can be transferred to a final state x in the finite time t = nT regardless of
x(0). Therefore, if the system is controllable, there exists some u(t) = u(nT ) = u(n) such that the system will be
transfered from some arbitrary initial state by the input u(k) to some final state in the finite time.
Therefore, we want to transfer x(0) x = x(N) by the application of the set of inputs given as:
{u(0), u(1), u(2), u(3), , u(k), , u(N 1)}
(2.155)
48
u(t)
T3
T1
T2
T4
T5
V1
T6
T7
T8
V2
T9
Fig. 2.16 Process plant with tanks and vessels used for storage and filling the tanker.
x3
x3
x (0)
x (t)
x2
x2
x1
x1
CONTROLLABILITY
REACHABILITY
Fig. 2.17 The controllability (to the origin) and reachability (from the origin).
Hence, we are interested in the existence of the u(t) or u(k) that will transfer the system and we provide a definition
to check controllability (Pontrygin).
Controllability (Def. by Pontrygin): The system is controllable if and only if the rank of matrix
rank B AB A2 B AN1 B = n
(2.156)
where n is the size of matrix A.
Let us construct the sequence of control moves {u(0), u(1), u(2), u(3), , u(k), , u(N 1)} which transfer the
system from x(0) x(N) = x ,
49
x(0)
x(1) = Ax(0) + Bu(0)
x(2) = A2 x(0) + ABu(0) + Bu(1)
x(3) = A3 x(0) + A2 Bu(0) + ABu(1) + Bu(2)
=
x = x(N) = AN x(0) + AN1 Bu(0) + AN2 Bu(1) + + ABu(N 2) + Bu(N 1)
(2.157)
Now, let us rewrite the last expression given by Eq.2.157 such that the initial condition contribution is on the left
side of the equation, therefore we get
u(N 1)
u(N 2)
u(N 3)
(2.158)
x AN x(0) = B AB A2 B AN1 B
|
{z
} |
{z
}
x
u(1)
Ctrb
u(0)
Given the vector x , A and x(0), these are two vectors in R n , and An n n, so the result of x = x AN x(0)
must be in the range of matrix Ctrb . We know that the system of equations Ctrb u = x has a solution only if Ctrb is
invertible, which implies that the columns of Ctrb must have n-independent vectors. Therefore,
rank B AB A2 B AN1 B = n
(2.159)
The range of matrix Ctrb = B AB A2 B AN1 B is called controllable subspace. Naturally, from the above equation we observe that small increments of state trajectories must be independent, otherwise the path is the function
of direction, see the Lecture 13.
Example 2.16. (Determining controllability) Determine controllability of the following discrete system:
x1 (k + 1) = ax1 (k) + bx2 (k)
(2.160)
(2.161)
(2.162)
ab
0
with ab cd 6= 0. Therefore, we have A =
and B =
, so that the condition for controllability is:
cd
1
0b
Cctrb = B AB =
(2.163)
1d
which has rank 2 only iff b 6= 0. t
u
Another way to check controllability for the discrete systems given by Eqs.2.153-2.154 is to check controllability
Gramian (Wronskian), which is given as:
n
Wn = Ai BB0 A0i
(2.164)
i=0
50
h
1(t)
A1
F 1(t)
k1
h2(t)
F2(t)
A2
k2
The state space realization or modeling of the two tank systems lead to the following set of equations:
#
" K1
1
A1 0
d h1 (t)
h1 (t)
=
+ A1 u(t)
K2
K1
h
(t)
dt h2 (t)
0
2
A2
A2
We obtain discrete representation which leads to:
h1 (k + 1)
0.6065 0
h1 (k)
0.3935
=
+
u(k)
h2 (k + 1)
0.4773 0.3679 h2 (k)
0.1548
(2.165)
(2.166)
51
5
4.5
4
3.5
x2(k)
3
2.5
2
1.5
1
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 1010.51111.512
x1(k)
h2
h1
F1 (t)
K1
K2
F2 (t)
Fig. 2.20 Model of the two level tank controlled from the same input.
#
" K1
" 1 #
A1 0
d h1 (t)
h1 (t)
=
+ A1 1 u(t)
K2
h2 (t)
dt h2 (t)
0 A
A1
2
(2.168)
Calculation of the controllability matrix can be done easily and leads to the following expression for the given
values of parameters:
0.3679 0
0.6321
0.6321 0.3235
A=
, B=
Ctrb =
(2.169)
0 0.3679
0.6321
0.6321 0.3235
which implies that under the condition that A1 = A2 the controllability subspace becomes rank deficient. In other
words, we will not be able to drive two identical tanks to two different heights from the single input. Therefore,
one needs just to destroy this system resonance by designing the tanks of different sizes or different input and output
characteristics in order to enrich the controllability space that can be reached with the appropriate input. t
u
Finally, we list the following three useful complementary criteria for checking controllability of the system.
Controllability conditions: The system is controllable if one of these three equivalent conditions holds:
1. rank [B AB A2 B An1 B] = n where n is the size of A-matrix
2. rank [ I A|B] = n, eigenvalue of matrix A, C -complex plane
3. rank Wn = n
52
We notice in the second condition when the is eigenvalue of the matrix A the rank will be less than n. In general,
for less difficult computation of controlability condition tests 2 and 3 are better than 1 and test 2 is useful in the
case when we have a diagonal form of the matrix A.
Also, one can ask oneself How much is the system controllable? - The answer to that question is coming from
the properties of the controllability Gramian, since if Wn is close to drop the rank, then the inverse is large and
therefore it requires high efforts to control the system.
It is important to remember that controllability guarantees ability to transfer the initial state to the final one
by some control input action over a finite time. Another notion that is used beside controllability is reachability.
The reachability is defined as an ability of the system to be transfered from the origin to some desired state,
while controllability as ability to transfer system from some arbitrary state to the origin. Reachability implies
controllability, while controllability implies reachability when the state transition matrix An is nonsingular.
2.2.3 Observability
The concept of state observability is the central in the study of state observes. State observability refers to the
ability to determine the initial state vector of the system from the knowledge of the input and the corresponding
output over time.
v(t)
Temperature sensor
u(t)
Motivating Example: In applications, the state of the system is frequently required but it is not accessible. The
chemical reactor model yields two equations which relate the concentration and temperature in the reactor. In
general, the temperature measurements are available on-line and can be realized with reliable elements. However,
the concentration on-line measurements are almost impossible to realize in practise as concentration samples have
to be taken from the reactor and then post-process in order to differentiate among the species of very similar
chemical composition (for example, different orientations of the alcohol molecule of the same composition produce
a L or R structure). Finally, the model yields two equations, one for each concentration, and another for the heat
exchange in the system, that is:
dCa (t)
= a1Ca (t) + a2 T (t) + v(t)
dt
dCb (t)
= a3Cb (t) + a4 T (t) + v(t)
dt
dT (t)
= a5 T + a6Ca(t) + a7Cb (t) + u(t)
dt
y(t) = a8 T (t)
(2.170)
(2.171)
(2.172)
(2.173)
53
Question: Can we determine the initial concentrations Ca and Cb states of the system from the measurements
of the present and future inputs and outputs. (In other words, can we reconstruct the initial condition from the
recorded inputs and outputs measurements?).
The answer to this question is in the observable property of the system.
If the system state is state observable, then its initial state can be determined from the knowledge of present and
future outputs and inputs.
y(k)
x(0)
u(k)
y(k)
Fig. 2.22 Reconstruction of the x(0) from the measurements taken in [0; nT ] time.
54
C
y(0)
y(1) CA
y(2) CA2
=
y(3) CA3 x0 = Ox(0)
y(n 1)
CAn1
(2.174)
One can check from Eq.2.174, that the system is observable if the solution x(0) is unique, i.e., if it is the only initial
condition that, together with the given input sequence, can generate the observed output sequence. From the theory
of linear systems of equations, Eq.2.174 has a unique solution if and only if the null space of the matrix O consists
of only the zero vector, i.e. null(O) = N (O) = {0}. Or in other words, the matrix (O) must have n independent
rows, see the Lecture 14.
Note that, to determine the x(0) from Eq.2.174 it is not necessary to use more than n 1 values for y(k),
k = 0, 1, , n 1 or to observe y(k) for more than n 1 steps in the future, where n is a size of matrix A, or order
of the system.
Finally, the three complementary criteria for observability lead to the following condition: Observability condition: The system is observable if one of these three equivalent conditions holds:
C
CA
CA2
1. rank
3 = n where n is the size of A-matrix
CA
n1
CA
I A
2. rank
= n, eigenvalue of matrix A, C -complex plane
C
p
3. rank W0 = n, where Wo =
j=0
u(k)
b1
55
x (k)
Z 1
y(k)
a1
x (k)
x (k+1)
b2
a2
Fig. 2.23 A nonobservable system.
y(0)
0 1 x(0)
x1 (0)
1 1 y(0)
y(1) y(0)
=
or
=
=
. One can also see that 2 measurements
y(1)
1 1 x(0)
x2 (0)
1 0 y(1)
y(0)
C
are required in order to provide an invertability of the matrix
. t
u
CA
Example 2.21. (Determining observability example) As we pointed out in the case of Eq.2.174, the appropriate
expression to determine the initial condition from the obtained input and output data can be determined, for the
SISO discrete system x(n + 1) = Ax(n) + Bu(n), y(n) = Cx(n), where C is 1 4 matrix, A is 4 4 matrix and B is
4 1 matrix, by the following procedure,
C
0
0 0
y(0)
CB 0 0 u(0)
y(1) CA
(2.175)
y(2) = CA2 x0 + CAB CB 0 u(1)
u(2)
y(3)
CA2 B CAB CB
CA3
taking the transpose of the above expression one gets
0
C
2B
0
CB
CAB
CA
CA
(2.176)
1
Multiplying the above expression from the right with the = C0 A0C0 (A2 )0C0 (A3 )0C0
one obtains the form
which expresses the initial condition in the form of future input and output measurements,
2
1
0 CB CAB CA B
y(0) y(1) y(2) y(3) u(0) u(1) u(2) 0 0 CB CAB 1 = x00
(2.177)
0 0 0 CB
One recognizes the 4 measurements of the output, 3 measurements of the input and invertibility of the matrix
are needed for successful x0 reconstruction. t
u
56
(2.178)
y(k)
0 1
which is equivalent to the state space system x(k + 1) = Ax(k) + Bu(k), where: x =
,A=
,
y(k + 1)
a0 a1
0
B=
, so that clearly,
1
0 1
Cctrb =
(2.179)
1 a1
has rank 2 for all values of a0 and a1 . So the Eq.2.178 yields that system is always controllable.
If we generalize, the preceding example to the n-order difference equation:
y(k + n) + an1 y(k + n 1) + an2 y(k + n 2) + + a1 y(k + 1) + a0 y(k) = u(k)
(2.180)
0
0
A=
0
a0
1
0
0
a1
0
1
0
a2
0
0
0
0
, B = 0
1
an1
1
(2.181)
so we note that each state can be controlled from the input u(k). The block diagram of the controllable canonical
form representation in the case of the third order system n = 3 is given as follows, see Fig.2.24. For the general case,
u(k)
x (k) x (k+1)
x (k+1)
zx 3(z)
x (k)
x (k) x (k+1)
x (z)
y(k)
a 2
a 1
a 0
Fig. 2.24 A controllable canonical form for the 3rd order system and C = [1 0 0].
the output matrix (that is C-matrix) is given in the most general form (in the Fig.2.24 is given as C = [c0 c1 cn1 ]
so that the controllable canonical state-space form is:
0
(Actrb , Bctrb ,C, D) :=
a0
|
57
0
0
0
0
0
an1
1
c0 c1 c2 cn1
[D]
{z
}
1
0
0
a1
0
1
0
a2
(2.182)
The question to ask is how do we get an arbitrary controllable state space system to the controllable form . There
is a procedure to obtain the state transformation matrix P such that Actrb = PAP1 and Bctrb = PB, Cctrb = P1C
Dctrb = D.
One can construct the controller form by the following procedure:
0
1.)Given the matrices (A, B,C, D), let A = [1 0 0; 0 1 0; 0 0 2],
C = [0 0 1],B = [1 1 1] ;
1 1 1
2.)Find the controllable subspace Cctrb = B AB An1 B = 1 1 1
1 2 4
1 1/3 1/3
1
3.)Take inverse Cctrb
= 1/2 1/2 0
1/2 1/6
1/3
4.)Take the last row of Cctrb as q = 1/2 1/6 1/3 and construct
q
1/2 1/6 1/3
P = qA = 1/2 1/6 2/3
1/2 1/6 4/3
qA2
0 0 0 0
a0
0
c0
1 0 0 0
0 1 0 0
a1
0
c1
0 0 1 0
0 1 0 0
a2
c2
0 0 0 1 0 0 := 0 0 1 0
a0 a1 a2 an1
0 0 0 0 an2
cn1
1
0 0 1 an1
c0 c1 c2 cn1
[D]
0
0
0
1
[D]
|
{z
}
|
{z
}
controllable canonical f orm
observable canonical f orm
(2.183)
One can also construct the observer canonical state space form by the following procedure:
0
1.)Given the matrices (A, B,C, D), let A
= [1 0 0; 0 1 0; 0 0 2], C = [1 1 1], B = [0 0 1] ;
C
CA
1 1 1
58
1 1/2 1/2
3.)Take inverse Obsv = 1/3 1/2 1/6
1/3 0
1/3
1/2
4.)Take the last column of Qbsv as q = 1/6 and construct
1/3
0 0 a0
c0
for the third order system, where A = 1 0 a1 , B = c1 , C = [0 0 1] is given in the Fig.2.25.
0 1 a2
c2
a 0
x (k+1)
u(k)
x (k)
Z 1
a1
x (k)
x (k+1)
Z 1
x (k)
x (k+1)
3
c2
+
Z 1
y(k)
Fig. 2.25 State space realization of Eq.2.183 for 3rd order system with B = [c0 c1 c2 ]0 .
(2.184)
59
(2.185)
(2.186)
U(t)
h
1(t)
A1
F 1(t)
k1
h2(t)
F2(t)
A2
k2
The state space representation for the two states that represent tank heights x = [x1 (t) x2 (t)]T = [h1 (t) h2 (t)]T ,
is given as follows:
#
" 0 #
" K1
A1 0
d x1 (t)
x1 (t)
+ 1 u(t)
=
K2
K1
x2 (t)
dt x2 (t)
A2 A2
A
2
so depending on whether we are interested in ones tank height or in both heights the matrix C will be is
appropriately constructed and D = 0. Finally, for the case of the SISO system, one can write the overall discrete
model in the following form:
#
"
b11
x1 (k + 1)
a11 a12
x1 (k)
=
+
u(k)
(2.187)
x2 (k + 1)
a21 a22
x2 (k)
b21
x (k)
y(k) = [c11 c12 ] 1
+ Du(k)
(2.188)
x2 (k)
Since the state space representation is given in the time domain, it can be realized in the form of linear combination of integrators, summations, gains and therefore the superposition of all these elements which represent
real-time signals is physically realizable.
The input-output representation can be obtained by using the Z -transform so that one obtains
60
b
21
b 11
x (k+1)
1
x 1(k)
u(t)
x (k+1)
2
a 21
x (k)
2 c
12
Z
a
summation
y(t)
a 22
11
a 12
(2.189)
where matrix (zI A)1 is strictly proper transfer function, with the characteristic polynomial of degree n
(z) = det(zI A) = zn + an1 zn1 + a2 zn2 + + a1 z + a0 . Finally, by neglecting initial conditions in
Eq.2.189, the input-output representation is given by the G(z) as
y(z) = G(z)u(z) = C(zI A)1 Bu(z) + Du(z)
(2.190)
Remark: All physical systems are causal and therefore realizable. In the case of non proper transfer function,
for example g(z) = z + 2, the state space realization is given in the following form x(k) = 2u(k) + u(k + 1).
However, we see that the future u(k + 1) is required to construct the current x(k) in the system realization,
which implies that g(z) can not be constructed for this input-output relation.
MOTIVATING EXAMPLE: You are given the transfer function G(z) from your manager that relates the input
to the tank 1 and output at the tanker given in Fig.2.16. Given the G(z) which is proper transfer function, find the
matrices (A, B,C, D), such that the following holds G(z) = C(zI A)1 Bu(z) + Du(z).
In other words if we have an input-output representation, how we can construct the state space representation.
In general, we know that the order of the characteristic polynomial has to be the number of integrators in the state
space realization, or it has to be the size of the state matrix A.
AB
Given trans f er f unction y(z) = G(z)u(z) ?
(2.191)
= C D
61
(2.192)
(2.193)
(2.194)
If one takes an invertible linear transformation x = T x and applies to Egs.2.192-2.193, one will obtain the following:
z(k + 1) = T 1 AT z(k) + T 1 Bu(k)
y(k) = CT z(k) + Du(k)
(2.195)
(2.196)
B,
D).
C,
x(k
+ 1) = A x(k)
+ Bu(k)
A)
1 Bu(z)
y(z) = C(zI
+ Du(z)
1
1
1
T AT ) T Bu(z) + Du(z)
= C(zI
1
= C(zT
T T 1 AT )1 T 1 Bu(z) + Du(z)
1
1 1
= C(zT
AT )1 (T 1 ) T 1 Bu(z) + Du(z)
1
(use (T 1 )1 = T )
(2.197)
which yields the same expression as Eq.2.194. One can, therefore, conclude that different state space realizations
will yield the same transfer function G(z). In other words, the input-output representation of the system is
unique while the state space representation is not unique. Due to this, we conclude a non uniqueness of the
state-space representation (that is, everyone can come with a different state space representation). Due to this non
uniqueness, we need to introduce a notion of minimal realization.
MOTIVATING EXAMPLE: The given the G(z) which is proper transfer function what is the minimal number
of back shifh operators (zero-hold elements) or (integrators for continuous) to realize the transfer function
G(z)?
Answer: The given state space realization is minimal if and only if it is controllable and observable
In the scalar case (when we deal with the SISO system), that is the power of the characteristic polynomial. In
the MIMO case, we need to check controllability and observability of the state space realization.
Let us just realize few scalar transfer functions:
(z)
1
=N
G(z) = z+a
P(z) , the order of the characteristic polynomial is order of denumerator P(z) which is 1, therefore only one zero order hold or delay element is needed to make this transfer function:
62
u(k)
x(k+1)
x(k)
1
z+a .
(z)
G(z) = z2 +a1z+a = N
P(z) , the order of the characteristic polynomial is 2 and the degree of P(z) = 2, therefore
1
0
two delay elements are required.
0 1
0
AB
a
a
1
=
(2.198)
0 1
CD
01
[D]
u(k)
x (k+1)
x2 (k)
Z 1
x1 (k+1)
x 1(k)
Z 1
y(k)
a 0
1
.
z2 +a1 z+a0
c0 + c1 z + c2 z + + cn1 zn1
+D
zn + an1 zn1 + an2 zn2 + a1 z + a0
the controllable canonical state-space realization = (A, B,C, D) can be easily obtained as:
(2.199)
63
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
a4 a5 an3 an2 an1
(2.200)
0
0
0
0
B=
0
0
0
1
(2.201)
C = c0 c1 c2 c3 c4 c5 cn3 cn2 cn1
(2.202)
0
0
A=
0
0
a0
1
0
0
0
0
a1
0
1
0
0
0
a2
0
0
1
0
0
a3
Example 2.22. (Given the transfer function G(z) find state-space (A, B,C, D)) The operational manager hands
you the transfer function and one is asked to construct the minimal state space realization associated with this
transfer function. Also, once the state space is proposed, find the properties of that state space realization (is it
controllable and observable?).
z+1
G(z) = 3
(2.203)
z + 3z2 + 4z + 2
The first choice is to build controller form state space realization:
0 1 0
0
0 1 0
0
0 0 1 0 0 0 1 0
=
(2.204)
:=
a0 a1 a2
1 2
1
4 3
c0 c1 0
110
[0]
[0]
|
{z
}
controllable canonical f orm
The controllability of the controller form can be easily checked by the controllability condition, therefore,
0 0 1
Ctrb = B AB A2 B = 0 1 3 rank[Ctrb] = 3
(2.205)
1 3 5
also we find that the observability subspace is given as:
C
1 1 0
Obsv = CA = 0 1 1 rank[Obsv] = 2
2 4 2
CA2
(2.206)
Therefore, one can find that the realization given in Eq.2.204 is controllable but not observable, which implies that
it is not minimal realization.
64
y(k)
u(k)
x (k+1)
3
x (k)
3
x (k+1)
2
x (k)
2
x (k)
1
x (k+1)
1
a 2
a 1
a 0
Therefore, let us construct the observable realization, which can be obtained as a transpose of the controllability
realization, in the following form:
0 0 a0
c1
0 0 2
1
1
0
a
c
1
0
4
1
Aobsv Bobsv
1
2
0
:=
=
=
(2.207)
0 1 a2
0 0 1 3
0
Cobsv Dobsv
001
001
[0]
[0]
|
{z
}
observable canonical f orm
Hence, if we check the controllability and observability of the state space realization given as in Eq.2.207, we
2
x (k+1)
u(k)
x (k)
Z 1
1
+
41
x (k)
x (k+1)
Z 1
x (k)
x (k+1)
3
Z 1
y(k)
Fig. 2.31 State space realization of Eq.2.207 with (Aobsv , Bobsv ,Cobsv , Dobsv ).
obtain
Co
0 0 1
0
Obsv = Co Ao = B (AB)0 (A2 B)0 = 0 1 3 rank[Obsv] = 3
1 3 5
Co A2o
65
C0
1 0 2
Ctrb = Bo Ao Bo A2o Bo = (CA)0 = 1 1 4 rank[Ctrb] = 2
0 1 2
(CA2 )0
(2.208)
(2.209)
Obviously, we can not realize from the given transfer function minimal state space realization, which implies that
there is some redundancy in the transfer function representation.
In other words, we need to reexamine the transfer function if we have a redundant state in the expression for the
G(z), therefore:
G(z) =
z+1
z+1
1
z+1
=
=
=
z3 + 3z2 + 4z + 2 z3 + 2z2 + 2z + z2 + 2z + 2 (z + 1)(z2 + 2z + 2) z2 + 2z + 2
(2.210)
which implies that the zero-pole cancellation is done in the transfer function description, which is always desirable,
providing that the pole is stable. In this case, the realization of the G(z) in Eq.2.210 is minimal, since it is observable
and controllable at the same time.
Chapter 3
Regulator synthesis
outputs
e(s)
+
C(s)
u(s)
P(s)
y
m
to design simple gain based controller (that is amplifier for the voltage realized circuits) and incorporate that with
the plant dynamics in order to ensure a closed-loop stability. On the other side, one can intuitively feel that just
gain based controller will not be able to guarantee stability of the arbitrary plant since it might happen that there is
no gain C(s) = K such that the closed-loop characteristic equation will have all negative roots (that is closed-loop
poles will belong to the left complex plain).
68
3 Regulator synthesis
characteristic polynomial:
(s) = d(s) + Kn(s)
(3.1)
(s) = 1 + KP(s)
(3.2)
or
which have common zeros providing that n(s) and d(s) are coprime polynomials (for the discrete system representation this is called monic. Coprime polynomial are two polynomials who do not have common factors. In
other words, if n(s) and d(s) do not have common factors than the (s) and (s) have same zeros.
Having this in mind, we can inspect the closed-loop characteristic polynomial and find how the closed-loop eigenvalues change as we explore the wide range of gains, in other words we anticipate that for some value of the gain
the closed-loop characteristic roots are going to migrate from the stable into unstable part of the complex plain,
see Fg.3.2:
Im
K
1
K
2
Re
K
2
K 1
Fig. 3.2 The crossing of the closed-loop characteristic equation roots for the different range of gain K values (note that for K2 characteristic closed-loop poles become unstable).
(3.3)
Therefore, the system is stable if all coefficients of the characteristic polynomial are positive so that the set of
stabilizing gains is K = [1/2, ).
One can observe, that the simila plant, which is given by P(s) = s24s1
(the plant with the RHP zero) is difficult
8s+2
to stabilize, in other words in this case there is no gain that can stabilize the plant. Therefore, plant can not be
stabilized with the K, and K is the zero order controller (no dynamics, it is just a gain).
1 s+0
, we can find controller parameters, that is
However, if we introduce the 1-st order controller C(s) = s+
0
0 , 1 , 0 such that, closed loop system is stable, in order words we have:
(3.4)
69
Since, the Hurwitz criteria requires ai > 0 and a1 a2 > a0 , one can easily generate the matrix A such that
0
a0
A 0 = a1
1
a2
(3.5)
and if A is invertible (A-full rank), one can chose a2 , a1 , a0 such that the closed loop is stable with desired pole
places.
It can be shown, that:
any n th order plant can be stabilize with the n 1 order controller providing that P(s) must have n(s) and d(s)
coprimes.
If the plant is given as
P(s) =
n(s) n p s p + + n1 s + p0
=
d(s) d p s p + + d1 s + d0
(3.6)
C(s) =
(s) q sq + + 1 s + 0
=
(s)
q sq + + 1 s + 0
(3.7)
(3.8)
where adp+q , adp+q1 , , ad1 , ad0 are desired coefficients of the closed loop characteristic polynomial.
Let us now assume that two polynomials, a(s) and b(s) are coprimes (that is, they have a common factor (s+),
a(s) = an sn + an1 sn1 + + a1 s + a0 = (s + )(an1 sn1 + + a1 s + a0 )
b(s) = bm sm + bm1 sm1 + + b1 s + b0 = (s + )(b m1 sm1 + + b 1 s + b 0 )
(3.9)
(3.10)
then we have
(s + ) =
bm sm + bm1 sm1 + + b1 s + b0
an sn + an1 sn1 + + a1 s + a0
=
an1 sn1 + + a1 s + a0
b m1 sm1 + + b 1 s + b 0
(3.11)
(3.12)
so if we want to find a coefficients for which the polynomial P(sn+m1 ) = 0, we obtain the following Sylvester
eliminant matrix:
70
3 Regulator synthesis
an
an
1
a1
a0
0
0
0
an
a2
a1
a0
0
0
0
a1
a0
| bm
| bm1
|
| b1
| b0
|
| 0
| 0
|
| 0
| 0
0
bm
b2
b1
b0
0
0
0
0
b m1
bm2 0
b1
0
bm b0
0
bm1
an1 0
b1 a1 0
a0
b0
0
(3.13)
therefore this matrix having a full rank is equal to have n(s) and d(s) coprimes, which means there will be no
n(s)
dependent rows or columns. In the same way if we recall our characteristic polynomial structure where P(s) = d(s)
,
and controller C(s) =
(s)
(s) ,
dp
dp
1
d1
d0
0
0
0
dp
d p1
d1
d0
0
0
0
d1
d0
| np
| n p1
|
| n1
| n0
|
| 0
| 0
|
| 0
| 0
0
np
n2
n1
n0
0
0
0
a p+q
m1
m2 a p+q1
1 0
0 0
np
=
n1 0
n p1
n1 1 ad1
0
n0
ad0
(3.14)
which can be written in the following form Mx = with being Hurwitz (stable) polynomial.
If we get -Hurwits vector, we are interested is this vector in the range of matrix M, therefore, we observe that
dimension of the matrix M is p + q + 1 2(q + 1) (that is vertical dimension horizontal), so in order to have the
matrix M full rank, the following condition must be satisfied:
2(q + 1) p + q + 1 q p 1
(3.15)
which implies that the controller of the p 1 order can freely assign dynamics of the plant of order q.
71
outputs
u(s)
+
P:(A,B,C,D)
y
m
x
f0
f1
f11
u1
u2
=
fr1
ur
x1
f1n
x2
xn
frn
(3.16)
(3.17)
(3.19)
so that dimension of the uncontrollable subspace is m = n p. One can find the invertible transformation T
T = [v1 v2 v p w p+1 w0 ]
(3.20)
A1 A3
0 A2
Bnew =
B1
0
(3.21)
72
3 Regulator synthesis
where zero entries of the Anew matrix correspond to dimensions of the uncontrollable subspace: In other words,
having the system:
x = Ax + Bu
z = Anew z + Bnew u
(3.22)
x = Tz
so that the full state feedback u = Fnew z = Fnew T 1 x with Fnew = [F1 F2 ] provides the closed-loop feedback
Anew + Bnew Fnew = T 1 AT + T 1 BFT = T 1 (A + BF)T
A1 + B1 F1 A3 + B1 F2
=
0
A2
which shows that the eigenvalues of the (Anew +Bnew Fnew ) are eigenvalues, (Anew +Bnew Fnew ) = (A1 +B1 F1 )
(A2 ). This structure demonstrates that controllable pair (A1 , B1 ) is the part which is controllable and assignment
of the poles can be done in the arbitrary way. On the other side, we note that dynamics associated with the A2 is
uncontrollable part since the corresponding input injection is zero (see matrix Bnew ), so this fixed part must be stable by itself (that is (A2 ) < 0). Finally, we conclude that uncontrollable and controllable subspaces are invariant
with respect to coordinate transformation.
Finally, in the single input case (A, b) we consider two possibilities:
The case of single input system which is already in the controllable companion form:
0
0 1 0 0
0
0 0 1 0
b = F = [ f0 f1 fn1 ]
A=
0
1
1
a0 a1 a2 an1
so that the characteristic polynomial of the A + bF becomes
s
1
0
0
s
1
(s) = |sI A + bF| =
a0 f0 a1 f1 a2 f2
(3.23)
0
=
0
1
an1 fn1
Sylvester Equation
Let us look in the expression of the following type:
Ax xB = C
(3.24)
73
0
0
Cb
0
CB
b
x = [Ca ACa An1Ca ][ I I ]
0
Cb Bn1
(3.25)
If (A,Ca ) is controllable pair then [Ca ACa An1Ca ] has a full rank, and in the same time if (B,Cb ) is obsevable
0
Cb
C0 B
b
then
has a full rank. The matrix is nonsingular if (A) (B) 6= 0. We will not study this equation
0
Cb Bn1
we just recall the source of the solution for the pole placment problem. This equation can be easily found in many
matrix related references and books. The most important point is that there is an analytic solution for x and we we
use matlab to solve this equation by using appropriate command (x = lyap(A, Q) solves the AX + XAT + Q = 0,
while x = lyap(A, B,C) solves the Ax + xB +C = 0).
This brings us to the following proposition that if the pair (A, B) is controllable then we can find F such that
(A + BF) = , where desired set of eigenvalues is given by , in other words:
x1 (A + BF)x = Ad , (Ad ) =
Ax xAd = BFx
Fx = G
so that (A, B) is controllable and G is chosen such that (Ad , G) is observable pair, therefore one can obtain desired
F.
(3.26)
Fx = G
(3.27)
is an observable pair.
choose your favorite matrix G such that (G, A)
Solve Eq.3.26 for x and according to the theorem x is not singular almost always. If x is singular then perturb
G, such that new arbitrary G is used.
With obtained x which is nonsingular solve Eq.3.27 for F.
74
3 Regulator synthesis
(3.28)
y(t) = Cx(t)
(3.29)
and starting assumption is that the number of states x(t), (that is x(t) = [x1 (t) x2 (t) xn (t)]) is n m, where m is
the number of measurements outputs y(t) = [y1 (t) y2 (t) ym (t)], see Fig.3.4.
x1
x
y
1
yi
ui
ur
xn
y
m
OBSERVER
The idea behind the observer problem formulation is to build device which will produce the state estimate
from the input and output measurements. In other words one can generate the observer model from the following,
z(t) = Mz(t) + Ly(t) + Gu(t)
(3.30)
where M is the matrix associated with the observer state z(t), the L is the gain matrix which is associated with
y and G is associated with the input u. It is desired to obtain the state estimate z(t) = y(t) + e(t), such that the
state estimate error e(t) 0 as t which implies that the state estimate converges to the real state z(t) x(t).
Having this in mind, the state estimate error dynamics takes the following form:
e(t)
= z(t) x(t)
=
= Mz(t) + Ly(t) + Gu(t) (Ax(t) + Bu(t)) =
= M(x(t) + e(t)) + Ly(t) + Gu(t) (Ax(t) + Bu(t)) =
= Me(t) + (M + LC A)x(t) + (G B)u(t)
From the above expression we obtain the conditions for the error convergences:
1. G B = 0
2. M (A LC) = 0 M = A LC
3. M - is stable
We observe that the transpose of the (ALC) = (A0 C0 L0 ) = (A0 +C0 (L)0 ) so that eigenvalues are invariant,
and this is similar structure that we had for the pole placement problem, meaning that if (A0 ,C0 ) pair is controllable
then we find L for the observer. Also one can note that if pair (A,C) is observable then there exists L such that
75
(A LC) = , and (A,C) is detectable providing that the unobservable part is stable. The form of the observer
equation can be written as Eq.3.30 or in the other form as
z(t) = Az(t) + Bu(t) + L(y(t) Cz(t))
(3.31)
which is celebrated Kalman Filter form. One can observe that Eq.3.31 is the same as the systems dynamics
equation extended for the measurable error term. Since, in the practice the system is exposed to the noise arising
from the input and output measurements, one can extend the systems description given by Eq.3.28-3.29 to the case
when the disturbances w are present in the state and output:
x(t)
= Ax(t) + Bu(t) + w(t)
(3.32)
(3.33)
where w ad v are random variables with = 0 mean. The observer in the presence of disturbances becomes a
famous Kalman filter which minimizes the expected value of Ekx zk. In the case of Kalman filter the observer
gain L is obtained as a solution of the Riccati matrix equation.
Remark: Finally we observe that control problem of finding F such that A + BF is stable and observer problem of
finding L such that A LC is stable leads to the complete output feedback controller realization.
(3.34)
y(t) = Cx(t)
(3.35)
which has controllability and observability conditions satisfied, in other words the pair (A, B) spans the entire space
and the observable pair (A,C) is such that each state can be reconstructed. Therefore we have the following three
steps:
Find F such that
(A + BF) = 1
(3.36)
where 1 is the set of n-complex numbers and the requested control law to achieve desired 1 is given as
u(t) = Fx(t)
(3.37)
(A LC) = 2
(3.38)
where 2 is the set of n-complex numbers such that the observer dynamics
z(t) = Az(t) + Bu(t) + L(y(t) Cz(t))
is stable one
(3.39)
76
3 Regulator synthesis
u(t) = Fz(t)
(3.40)
The interesting part of the regulator synthesis is the issue of the characterization of the closed-loop stability property under the regulator. In other words what are the closed-loop eigenvalues of the the overal system when the
regulator is applied to the Eq.3.34-3.35. The answer to this is given by the separation principle which shows that
there is a separation of the poles in the closed loop assigned by the state feedback and the observer poles. For the
closed loop system we have:
x(t)
= Ax(t) + Bu(t) = Ax(t) + BFz(t)
z(t) = (A + BF LC)z(t) + Ly(t)
y(t) = Cx(t)
so that
x(t)
A
BF
x(t)
=
z(t)
LC A + BF LC
z(t)
(3.41)
which implies that stability of the closed loop system can be determined by the stability of the (Acl ) = 1 2 .
outputs
y
ESTIMATOR
PLANT
By applying the coordinate transformation e(t) = z(t) x(t) one obtains the following matrix:
x
I0 x
=
z
I I
e
so that applying this transformation we obtain
x
A
BF
x
A + BF BF
x
= T 1
T
=
e
LC A + BF LC
e
0
A LC e
(3.42)
(3.43)
Finally, we observe that above matrix eigenvalues are union of eigenvalues from the diagonal terms, which implies
that one can freely assigned the poles of 1 ( (A + BF) = 1 ) and 2 ( (A LC) = 2 to achieve closed loop
stability.
Therefore, in this controller realization we have 2n poles, which are from the plant (n-order of plant) and from the
controller (n-order of the controller), so the order of the closed loop is 2n. Last but not least, we are looking in the
regulator transfer function representation which is given n the following form:
u(s) = Fz(s)
(3.44)
77
Im
Re
observer poles
controller poles
(3.45)
(3.46)
such that the following holds x = [x1 x2 ], where x1 is vector of m components, while x2 is a vector of n components.
We are interested in design of the state estimator of the n m states, so the system is:
x1
A11 A12
x1
B
=
+ 1 u
(3.47)
x2
A21 A22
x2
B2
and
y = x1
(3.48)
Let us form the dynamics equation in the same way as we constructed the full order observer, and let us use the
relation y(t) = x1 so that,
x2 = A21 x1 + A22 x2 + B2 u x2 = A21 y + A22 x2 + B2 u
(3.49)
also we need a error measurement equation which in this case (assuming the analogy from the full order observer)
becomes as follows:
78
3 Regulator synthesis
(3.50)
therefore, we can easily build observer knowing the original system given by Eqs.3.45-3.46 so that observer is
build as copy of the original systems dynamics and the forced term coming from the measurement error, so that
we introduce a state estimate z2 which is associated with x2 :
z2 = A21 x1 + A22 z2 + B2 u + L(y A11 y B1 u A12 z2 )
(3.51)
(3.52)
we can easily generate an error term e(t) = z2 (t) x2 (t) by subtracting equations Eq.3.51-3.52 which leads to the
following expression after rearranging terms and using the relation y = A11 y + A12 x2 + B1 u:
e = (A22 LA12 )e
(3.53)
which implies that the error dynamics must be a stable, that is (A22 LA12 ) < 0. If (A,C) is observable pair then
A22 and A12 are stable, and we can choose L such that an eigenvalues can be assigned i the closed loop. Although
this implies that error of the estimated and real states will converge to zero after some initial time, additional
problem of interest is how to realize the Eq.3.51 since the expression for the observer state z2 has a derivative in its
formulation (that is y).
Since we wish to avoid taking derivative of the y(t) signal, we apply the change of variables
w2 = z2 Ly, such that the following holds:
w 2 Ly = A21 y + A22 (w2 + Ly) + B2 u + L(y A11 y B1 u A12 (w2 + Ly))
(3.54)
(3.55)
which becomes
Finally, we obtain the control law as follows:
u = [F1 F2 ]
x1
= F1 y + F2 x2
x2
(3.56)
(3.57)
The closed loop poles of the regulator which is build with reduced order observer becomes (Acl ) = (A + BF)
(A22 LA12 ).
F +F L
1
nm
u
y
PLANT
REDUCED
ORDER
OBSERVER
F
w
Fig. 3.7 Reduced observer and controller schematic in the regulator design.
Chapter 4
(4.1)
and we assume that desired state of the system is zero. Given that the system can be moved from the steady state
conditions by disturbances, the controller task is to regulate the state back to the origin, In general, one can observe
1
0.5
-0.5
-1
-1.5
-2
0
from the Fig.4.1 that all trajectories are possible. In order to differentiate among trajectories, we want to penalize
deviation of the state trajectory from the zero (reference value) by accounting for positive and negative deflections
from the zero state. One possibility is to consider quadratic form x(t)2 which will always provide a positive value
for all times. Also, we want to penalize input in the system for all times, in order to prevent excessive control
action, therefore expression for the quadratic form of state and input evolution can be looked as a cost function,
Z t
J(x(), u()) =
(4.2)
79
80
having the state vector x = [x1 x2 xn ] which is not the scalar quantity one obtains the
Z t
J(x(), u()) =
(4.3)
where weights on state evolution are given b the matrix Q = QT 0 while the input evolution is given by R = RT >
0. We ensure that x will not blow up because of observability assumption that holds, and x might be different then
zero, so due to the Q = QT 0, x will show up in the output. On the other hand by observability assumption we
can always prevent x to diverge. The matrix R = RT > 0 symmetric positive definite, because if it is semidefinite it
might happen that u will multiply with zero and it will not show up in the output.
Therefore, objective is
Find a u(t) if possible such that for all t 0 the function J(x0 , u()) is minimized
Z
(4.4)
Let us suppose that exists a positive definite P = P0 such that the following holds,
d 0
x (t)Px(t) = x0 (t)Px(t) + x0 (t)Px(t)
dt
= x0 (t)A0 Px(t) + u0 (t)B0 Px(t) + x0 (t)PAx(t) + x0 (t)PBu(t)
so that if one integrates the above expression within the time interval t [0,t f ],
Z tf
Z tf
d 0
x0 (t)(A0 P + PA)x(t) + 2u0 (t)B0 Px(t) dt
x (t)Px(t) dt =
0
dt
x0 (t f )Px(t f ) x0 (0)Px(0) =
we assume that input u(t) which stabilizes a system is such that x(t f ) 0 as t f , which implies that above
expression admits the following form:
0 = x0 (0)Px(0) +
Z
x0 (t)(A0 P + PA)x(t) + 2u0 (t)B0 Px(t) dt
(4.5)
Finally, we can add the expression Eq.4.5 to the cost given in Eq.4.4 so that the overall cost becomes,
Z
(x0 (t) A0 P + PA + Q x(t) + 2u0 (t)B0 Px + u(t)0 Ru(t))dt + x0 (0)Px(0)
(4.6)
Looking at the above expression, one can conclude that if the integral function is zero the cost function will attain
the smallest value, in other words, let us construct under which conditions the function below the integral will
vanish. We add and subtract the term the term x0 P0 BR1 B0 Px in the Eq.4.6, and RR1 = I is injected in uB0 Px such
that the following holds,
Z
min
u
(x0 (t) A0 P + PA + Q P0 BR1 B0 P x(t) + u0 (t)R(R1 B0 Px(t))0 +
(R1 B0 Px(t)R0 u(t) + u(t)0 Ru(t) + (R1 B0 Px(t))0 R0 (R1 B0 Px(t)))dt + x0 (0)Px(0)
so that the final expression takes the following form
(4.7)
81
Z
min J(x0 , u()) =
(x0 (t) A0 P + PA + Q P0 BR1 B0 P x(t) +
u
0
0
u (t) + (R1 B0 Px(t))0 R u(t) + (R1 B0 Px(t)) )dt + x0 (0)Px(0)
(4.8)
(4.9)
(4.10)
1 B0 P)t
x(0)
Question: Is the system stable under the u(t) = Kx(t) obtained from the solution of the LQR problem?
Suppose that Q, R, K, S are real positive matrix with R being positive definite and S being positive semidefinite,
and suppose that they satisfy the following Riccati equation,
P(A BK) + (A BK)0 P = K 0 RK Q S
then,
(4.11)
Let us first show that the Eq.4.11 is the form of the Riccati equation with K being optimal state feedback gain
and S = 0, so that we have,
Q + A0 P + PA PBR1 B0 P = 0
K = R1 B0 P
After we combine above expressions one obtains,
Q + A0 P + PA PBK = 0
Q + A0 P + P(A BK) = 0
Q + A0 P + P(A BK) + K 0 B0 P K 0 B0 P = 0
Q + (K 0 B0 P + A0 )P + P(A BK) + K 0 B0 P = 0
P(A BK) + (A BK)0 P = Q K 0 RK
(4.12)
therefore if (A BK) = (A0 K 0 B0 ) < 0, then the P must be a positive definite since it will satisfy the Lyapunov
+ PA 0 = Q.
Also if P is a positive definite then this implies that the matrix A = A BK must be
equation AP
stable.
82
One can see, that optimal cost is given by the J(x0 , u()) = x00 Px0 0 which implies that P must be a positive
definite and unique. Solution to the Riccati equation has to be unique since the minimum cost is unique,
x00 P1 x0 = x00 P2 x0 P1 = P2 = P
(4.13)
In order to show properties of P, one needs assumption on x0 Qx which implies that (Q1/2 , A) is observable. Namely,
x0 Qx = x0C0Cx = y0 y is condition which implies that the output or state will show up in the cost functional. It might
happen that state will undergo high value change, and the way to prevent that does not exist in the cost functional,
in other words we ensure by having (C, A) observable which is the same as the (Q1/2 , A) observable.
Positive definitness of P matrix can be demonstrated as follows:
Suppose that Pz = 0, and also z0 P0 = 00 so that the following holds:
z0 (Q + A0 P + PA PBR1 B0 P)z = 0 z0 Qz = 0 Cz = 0
(4.14)
we repeat the procedure from the Eq.4.14 with the PAz = 0 which leads to the following:
(Az)0 (Q + A0 P + PA PBR1 B0 P)(Az) = 0
(Az)0 (Q + A0 PAz + PAAz PBR1 B0 PAz) = 0
z0 A0 QAz = z0 (A0C0CA)z = 0
and repeat again with the P(A2 z) = 0, and so on, which leads to the following expression:
z0 C0 A0C0 A02C0 A0n1C0 = 0 z = 0
(4.15)
(4.16)
Last equation demonstrates that above expression can be zero only if z = 0, since the matrix is observability matrix
which by assumption has full rank, which therefore implies that in expression Pz = 0 P can not be zero but must
be a positive definite.
Kleimans Iteration
1.
2.
3.
4.
this iteration will lead to the following convergence of the minimal cost Pi P and Ki K.
J(x(), u()) =
t0
(4.18)
83
where the weights associated with the state and input evolution are given as Q = Q0 0 and R = R0 > 0. In the
same manner as it is given in the infinite horizon optimal control setting, we consider the V = x0 (t)P(t)x(t) as a
Lyapunov function that describes a state evolution and we integrate over the finite time interval from t0 to t f . In
this case the cost functional is given as:
Z tf
min
u
+ A0 P(t) + P(t)A + Q P(t)0 BR1 B0 P(t) x(t) +
(x0 (t) P(t)
t
00
u (t) + (R1 B0 P(t)x(t))0 R u(t) + (R1 B0 P(t)x(t)) )dt +
+x0 (t0 )P(t0 )x(t0 ) + x0 (t f )Q f x(t f ) x0 (t f )P(t f )x(t f )
(4.19)
One can easily notice the difference among the Eq.4.19 and the expression Eq.4.8, which implies that the finite time
optimal control problem by the same virtue of forcing the integral function to become zero yields the following:
The solution of the time varying Riccati eguation
+ Q + A0 P(t) + P(t)A P(t)0 BR1 B0 P(t) = 0
P(t)
(4.20)
by solving the time dependent matrix P(t), with the initial condition given as P(t f ) = Q f .
The solution to the full state feedback control by solving
u + R1 B0 P(t)x(t) = 0 u(t) = R1 B0 P(t)x(t) = K(t)x(t)
(4.21)
t0
P(t f)
tf
84
Z tf
J(x(), u()) =
t0
Z tf
=
t0
so that the control law is given as u = u + R1 S0 x(t), and the following holds:
x = Ax + Bu x(t)
= Ax(t) + B(u R1 S0 x) = (A BR1 S0 )x + Bu
(4.23)
J(x(), u()) =
(4.24)
t0
(4.25)
(4.26)
(4.27)
We add and subtract the expression PI j in the Eq.4.27 and we multiply the equation from left with B0 ( jI
A0 )1 and right with ( jI A0 )B, and using RK = B0 P expression, after some rearrangement the Eq.4.27 becomes,
I + B0 ( j A0 )1 K 0 R I + K( j A)1 B = R + B0 ( j A0 )1 Q( jI A)1 B
(4.28)
By the inspection of the expression at the left of Eq.4.28 one can notice that the term L = K( j A)1 B in the
brackets is a forward loop transfer function. One can speculate that the term on the left side under the condition
that Q is semidefinite 0, that the term on the left is always bigger (since it is quadratic) than term on the right,
that is,
(4.29)
I + B0 ( j A0 )1 K 0 R I + K( j A)1 B R
which leads to the following expression for the return difference identity, by having R = I which gives:
[I + L0 ( j)] I [I + L( j)] I
85
(4.30)
(4.31)
To obtain the optimal control law for the infinite time interval t [0, ] we look at the minimization problem of
the cost functional associated with the discrete system system given as
(4.32)
k=1
(4.33)
where S is the unique, positive semi-definite, symmetric solution to the discrete Riccati equation,
S = AT SA +CT QC AT SB(BT SB + R)1 BT SA
(4.34)
Application: Consider a simple inventory control problem with y(k) be inventory level at time k, u(k) be the orders
for day k. Ordered gods are not delivered for two time periods. Sales for day, v(k) are stochastic. The inventory
level then varies as,
y(k) = y(k 1) + u(k 2) v(k 1)
(4.35)
We would like to consider the inventory level for the present time k and the previous days orders since they are
undelivered. Letting the state vector be,
y(k)
x(k) =
(4.36)
v(k 1)
the state space model is then,
x(k + 1) =
11
0
1
x(k) +
u(k) +
v(k)
00
1
0
y(k) = 1 0 x(k)
(4.37)
(4.38)
For Gaussian white noise, the controller that minimizes the cost-functional J(y, u; k) among all possible causal
controllers can be shown to be linear and utilizes Kalman filtering. However, this is beyond the scope of the
course.
86
within the framework of Dynamic Matrix Control (DMC) developed by Cutler and Ramaker (1980). The general
formulations of these two particular approaches to MPC presented here are intended emphasize the basic concepts
of the wide and continually developing class of MPC algorithms.
The development of linear MPC has been motivated by the need for robust, constrained, optimal control algorithms for use in industrial applications which could be implemented online. Initial attempts in designing such
controllers produced results which were adequate for specific types of plants but were not satisfactory in a wider
range of applications. The theoretical framework which unified application and development began the work on
Model Algorithmic Control (MAC) by Richalet et al. (1978) also referred to as IDCOM. Later on Cutler and Ramaker (1980) developed Dynamic Matrix Control (DMC) which was extended by Garcia and Morshedi (1986)
who utilized a quadratic performance function and directly incorporated constraints in their version referred to as
Quadratic Dynamic Matrix Control (QDMC). Further efforts by Marquis and Broustail (1988) resulted in Shell
Multivariate Optimizing Control (SMOC). Notable alternative implementations of linear MPC include the work of
Ricker (1985) on constrained multivariate algorithms, Clarke et al. (1987) on Generalized Predictive Control, and
Kwon and Byun (1989) on Receding Horizon Tracking Control (RHTC), which are commonly cited in literature.
(4.39)
i=1
where yt is the process output response at time t as a function of the inputs uti with corresponding coefficients hi
and disturbance term et . The equivalent step response model is given by:
(4.40)
i=0
The impulse and step response coefficients hi and ai are related by:
i
ai =
hj
(4.41)
j=1
a1 = h1 ,
hi = ai ai1
The following DMC formulation adopts the step response model. Consider the infinite series model in Eq.4.40 in
the absence of disturbances et . Expansion of terms yields:
87
(4.42)
yt = ai uti +
i=1
ai uti
(4.43)
i=n+1
zt =
ai uti
(4.44)
i=n+1
which is the sum of all control moves made up to and including time t n 1. The term zt in Eq.4.44 may
be interpreted as the output response if there were no control moves for the past n time intervals. Consider the
prediction model of the response at time t + p given by
n
(4.45)
i=1
ai ut+pi
(4.46)
i=1
yt+p
=
ai ut+pi + zt+p
(4.47)
i=p+1
Then, the finite step response model used in DMC expresses predicted future values of the output in terms of future
control actions and the value of the output if no further control actions were taken, i.e.
p
(4.48)
i=1
The Eq.4.48 contains a finite number of step coefficients ai with which one can predict how the output will evolve
given a set of control actions. For the present case, in the absence of disturbances, the coefficients ai can be obtained
directly from a step response test.
The objective is to optimize performance over some prediction horizon of p sampling intervals. The set of
predicted output values over the prediction horizon is expressed as
+a u
yt+1 = yt+1
t
1
+a u +a u
yt+2 = yt+2
t
2
1
t+1
+a u +a u
yt+3 = yt+3
t
3
2
t+1 + a1 ut+2
..
.
yt+m =
..
.
..
.
yt+m
+ am ut
(4.49)
+ am1 ut+1 + + a1 ut+m1
..
.
+a u +a
yt+p = yt+p
p
t
p1 ut+1 + + a pm+1 ut+p1
88
yt+1
yt+1
yt+2
yt+2
y = . ,
y = . ,
..
..
yt+p
yt+p
ut
ut+1
..
.
u =
(4.50)
ut+m1
The predicted outputs y can be calculated in terms of the predicted outputs without further control y , the dynamic
matrix , and calculated inputs u, each related by the equation
y = y + u
where is defined as
a1
a2
..
.
=
am
.
..
ap
(4.51)
0
a1
..
.
0
0
..
.
..
.
0
0
..
.
am1
..
.
am2
..
.
..
.
a1
..
.
a p1 a p2
(4.52)
a pm+1
Consider the problem of setpoint tracking problem for the prediction horizon. The desired setpoint trajectory vector
is given by
sp
yt+1
..
sp
y = .
(4.53)
sp
yt+p
The set of control actions can be calculated to minimize the error between the measured output and this desired
setpoint by determination of u from the solution of the following minimization problem
min J( u) = (ysp y)
T Q(ysp y)
(4.54)
y = y + u
(4.55)
subject to
where Q is positive definite. Substitution of y in Eq.4.54 yields the modified minimization problem
min J( u) = (ysp y u)T Q(ysp y u)T
u
(4.56)
The minimizing solution u is a stationary point of the cost function J( u), i.e. solution of
dJ
= 2 T QT (ysp y u) = 0
d u
(4.57)
u = ( T Q )1 T QT (ysp y )
(4.58)
such that
ysp y ,
89
(4.60)
y = y + u
(4.61)
subject to
The matrices Q and R are chosen to be positive definite. The controller can be determined in a similar way as the
unconstrained regulator
min J( u) = (ysp y u)T Q(ysp y u)T
(4.62)
u
The minimizing solution u is a stationary point of the cost function J( u), i.e. solution of
dJ
= 2 T QT (ysp y u) + 2RT u = 0
d u
(4.63)
(4.64)
u = ( T Q + R)1 T QT (ysp y )
(4.65)
= ysp y ,
u = ( T Q + R)1 T QT (ysp y ) = Kc
(4.66)
Note the effect of the penalizing term on inputs R has on the controller Kc . As the magnitude of R is increased, it
tends to dominate the ( T Q + R) term and as a result, decreases the effect of the controller. Generally, both Q
and R are chosen to be diagonal which simplifies the design procedure.
=
yt+p
(4.67)
i=p+1
The disturbances have been assumed to be of constant step type such that et may be calculated from
et+p = et = yt yt
where yt is the prediction according to the step response model
(4.68)
90
yt = ai uti
(4.69)
i=1
et+p = yt ai uti
(4.70)
i=1
Since
zt =
ai uti ,
and
zt+p =
i=n+1
ai ut+pi
(4.71)
i=n+1
yt+p
=
ai ut+pi + zt+p +
i=p+1
i=n+1
n
= yt +
i=1
ai ut+pi + zt+p +
i=p+1
np
= yt +
ai ut+pi + yt ai uti
i=n+1
ai ut+pi ai uti
a p+i ut j +
j=1
j=np+1
i=1
a p+ j ut j ai uti
(4.72)
i=1
= yt + a p+ j ut j ai uti
j=1
i=1
Now suppose that the steady-state is reached by n sample intervals after a step change which implies that
an+1 = an+2 = = a
Then
(4.73)
yt+p
= yt (ai a p+i ) uti
(4.74)
i=1
(4.75)
(4.76)
91
(4.77)
yt+l
= yt (ai al+i ) uti ,
l = 1, 2, . . . , p
(4.78)
i=1
(4.79)
i=1
k11
..
..
.
Kc =
.
..
kml
.
k1p
..
.
kmp
(4.80)
4.4.1.5 Constraints
The DMC regulator formulation can be considered in the presence of constraints. That is, the dynamic matrix
can be modified. If an input move u j is infeasible, it is set at its limit and the column in which corresponds to
this move is removed from the matrix. If an output prediction yi is infeasible, the prediction is set at its limit. The
major problem with this approach is that it is iterative and convergence to a solution is not guaranteed. These result
because the process constraints are not considered explicitly in the conventional DMC problem. A more natural
formulation is the Quadratic Dynamic Matrix Control (QDMC) problem
min J( u) = (ysp y)
T Q(ysp y)
+ uT R u
u
(4.81)
subject to
y = y + u
uL u uH
uL u uH
(4.82)
yL y yH
The optimal, feasible manipulated variable moves during the prediction horizon is calculated from this constrained
minimization problem. However, there is no analytical solution for this problem and as a result, the optimization
problem must be solved at each control interval. The major advantage of the QDMC approach is that any con-
92
straint can be explicitly represented in the control calculations. In the basic QDMC formulation only bounds were
considered in the problem formulation. Such constraints usually describe fundamental inter-relationships among
the problem variables which must not be violated. For example, one can also include the constraint
g(y,
u, u) > 0
(4.83)
min yTk+ j Qyk+ j + uTk+ j Ruk+ j + uTk+ j S uk+ j
(4.85)
uN j=0
where Q is a symmetric positive semidefinite weight matrix on output yk+ j and R is the a symmetric positive
definite penalty matrix on the input where uk+ j is the input vector at time j. The term uk+ j = uk+ j uk+ j1 is
the change in input vector at time j and the matrix S is the symmetric positive semidefinite penalty on the rate of
change of inputs. The vector uN computed from (4.85) contains the N future open-loop control moves
uk
uk+1
uN = .
(4.86)
..
uk+N1
93
Algorithm:
The MPC formulation presently considered is often referred to as a receding horizon regulator. The following
steps in calculating uN illustrate this concept:
1. At time k + N the input vector uk+ j = (0, 0, . . . , 0)T for all j N.
2. The vector uN is calculated from the open-loop objective function in Eq.4.85.
3. The first input value in uN is injected into the plant.
4. This procedure is repeated at each control interval with feedback from plant measurements which update the
state vector at each time k.
In order to compute uN the Eq.4.85, note that Eq.4.85 can be expressed as the following finite horizon open-loop
objective function
N1
T
T
T
T
xk+
jC QCxk+ j + uk+ j Ruk+ j + uk+ j S uk+ j
(4.87)
j=0
i
Q = AT CT QCAi
(4.88)
i=0
Q = CT QC + AT QA
(4.89)
which can be solved by various conventional methods. With this, the following result holds.
Theorem 4.1. For stable systems, the input vector uN is determined from the solution to the following quadratic
program
min k = (uN )T HuN + 2(uN )T (Gxk Fuk1 )
(4.90)
uN
2
+ R + 2S BT AT QB
S
BT QB
BT AT QB
T
T
T
T
S
+ R + 2S
B QB
B A QB
B QAB
T
2
T
T
B QAB
B QB + R + 2S
H = B QA B
..
..
..
.
.
.
N1 B
N2 B
N3 B
BT QA
BT QA
BT QA
BT QA
2
BT QA
T 3
G = B QA ,
..
.
T
N
B QA
Proof. asdfasdf
are computed as
S
0
F = 0
..
.
0
N1
BT AT QB
N2
BT AT QB
N3
T
T
B A
QB
..
.
+ R + 2S
BT QB
..
.
(4.91)
(4.92)
94
4.5.2 Constraints
Among the most important features of the present MPC synthesis is the ability to incorporate constraints in the
regulator formulation. Constraints represent physical limitations of the plant, specifically limitations on the available inputs and/or desired states and outputs. The ability to include constraints provides obvious advantages over
unconstrained optimal control procedures in that one can tightly control the input, output and states of the system,
which become useful methods in optimizing operational performance and also safety in many industrial processes.
The question becomes whether there exists such an optimal input uN which guarantees nominal stability subject to
the imposed constraints on input, output and states: That is, is the control objective feasible.
The constraints on input and outputs can be considered in the following representation
umin uk+ j umax ,
j = 0, 1, . . . , N 1
j = j1 , j1 + 1, . . . , j2
(4.93)
j = 0, 1, . . . , N 1
where constraints on output are applied from time k + j + 1 to time k + j2 , where j1 1 and j2 j1 . The value of
j1 is chosen such that the output constraints are feasible at time k. The value j2 is chosen to ensure the feasibility of
the output constraints up to time k + j2 gives the feasibility of these constraints on the infinite time horizon. Note
that in order to obtain feasible constraints and a solution to the quadratic program, the constrained regulator will
remove the output constraints at the beginning of the horizon up to time k + j1 .
The constraints in Eq.4.93 may be expressed in terms of uN as follows
i1
I
i2
I
D N d1
u
(4.94)
d2
D
w1
W
w2
W
where D and W are defined as
A j1 1 B
..
D= .
A j2 1 B
...
A j1 N B
..
A j2 N B
with A ji = 0 for all j < i. Moreover, the vectors i1 , i2 , d1 , d2 , w1 and w2 are given by
umax
umin
i1 = ... , i2 = ...
umax
ymax CA j1 xk
..
d1 =
,
.
ymax CA j2 xk
umax + uk1
umax
w1 =
,
..
.
umax
umin
ymax CA j1 xk
..
d2 =
ymax CA j2 xk
umax uk1
umax
w1 =
..
.
umax
(4.95)
95
0
umax
umin 0
ymax 0
ymin > 0
umax 0
0
umin
(4.96)
(4.99)
Further, the following equality constraint on the unstable modes at time k + N is imposed on the finite horizon
open loop objective function in Eq.4.87
(4.100)
zuk+N = Vu xk+N = 0
which can be expressed in terms of uN as
Vu AN xk = Vu AN1 B AN2 B B uN
(4.101)
The reason behind the above equality constraint is that the unstable modes will evolve uncontrolled if they do not
converge to zero or are not driven to zero at time k + N. If this equality constraint holds, after time k + N 1, only
the stable modes will contribute to k and the terminal state penalty matrix Q can be then computed from
Q = VsT Vs
(4.102)
(4.103)
i=0
The Eq.4.103 can be obtained from the solution of the discrete Lyapunov equation
= VsT CT QCVs + JsT Js
The matrices H and G in Eq.4.90 consists of the sum two parts:
(4.104)
96
2
N1
BT KN1 B + R + 2S BT AT KN2 B S
BT AT KN3 B
BT AT K0 B
N2
BT KN2 B + R + 2S
BT AT KN3 B
BT AT K0 B
BT KN2 AB S
N3
T
2
BT KN3 AB
BT KN3 B + R + 2S
BT AT K0 B
H1 =
B KN3 A B
..
..
..
..
..
.
.
.
.
.
BT K0 AN1 B
BT K0 AN2 B
BT K0 AN3 B
BT K0 B + R + 2S
BT KN1 A
BT KN2 A2
G1 =
,
..
(4.105)
KN = AT QAi
(4.106)
i=0
BT K0 AN
2
N1
BT LN1 B
BT AT LN2 BT AT LN3 BT AT L0 B
N2
T
BT LN2 B
BT AT LN2 BT AT L0 B
B LN2 AB
T
N3
2
T
BT LN3 B BT AT L0 B
H2 =
B LN3 A B B ALN3 B
..
..
..
..
..
.
.
.
.
.
T
N1
T
N2
T
N3
T
B L0 A
B B L0 A
B B L0 A
B
B L0 B
BT LN1 A
BT LN2 A2
G2 =
,
..
(4.107)
N
N
LN = AT QA
(4.108)
BT L0 AN
where Q is the terminal state penalty matrix in Eq.4.102 and the matrix F is the same as in the Eq.4.92.
Important Remarks:
The feasibility of the equality constraint in Eq.4.101 is required for an optimal stabilizing solution to Eq.4.90 to
exist. For an unstable system with r unstable modes, the state space system must be stabilizable with N r in order
for the equality constraint to be feasible. That is, if the system is not stabilizable, then there exists uncontrollable
unstable modes that cannot be brought to zero. If the number of control moves is less than the number of unstable
modes, then the unstable modes cannot all be brought to zero from an arbitrary initial condition.
Solutions
Problems of Chapter 2
2.1 The solution is revealed in figures.
x 1(k+1)
q1
y(k)
x 1(k)
+
x 2(k+1)
q1
x (k)
+
+
u(k)
T/2
97
98
Solutions
x(k+1)
x(k)
q1
y(k)
a
+
+
u(k)
b0
u(k1)
q1
b1
x(k+1)
u(k)
q
x(k)