Sunteți pe pagina 1din 104

CHE 576: I NTERMEDIATE

P ROCESS C ONTROL
Course notes v.1.2013
May 14, 2013

Chemical & Materials Engineering, University of Alberta

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

Discrete Time Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


2.1 Conversion of continuous to discrete system (Finite difference & exact discretization) . . . . . . .
2.1.1 Transformation of continuous system to discrete system representation . . . . . . . . . . . . . . . . .
2.1.2 Sampling of continuous state-space system s = (A, B,C, D) . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.3 Transformation of continuous to discrete system representation; Time-delay systems . . . . . .
2.1.4 Difference Equations, Shift operators - forward shift & backward shift (delay) operators . . .
2.1.5 Z -transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6 Response of discrete system, Inverse Z-transform, Solution to difference equation . . . . . . . .
2.1.7 Poles & zeros of pulse transfer function G(z), Filter design . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Stability, Controllability, Observability and system representation . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1 Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.2 Controllability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.3 Observability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.4 Controllable & Observable canonical state-space forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.5 State-space and Input-output system realization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

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

Introduction to Optimal and Model Predictive Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


4.1 Linear Quadratic Regulator-LQR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Finite Time Optimal Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 Introduction to Model Preditive Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

79
79
82
85

vii

viii

Contents

4.4

Dynamic Matrix Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


4.4.1 Regulator Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4.2 Multivariate DMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5 Model Predictive Control with Linear Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5.1 Regulator Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5.2 Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.5.3 Unstable Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

86
86
92
92
92
94
95

Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

Chapter 1

Introduction

1.1 Systems representation (State space & Input-output)


The real physical system which can be thought of as a chemical plant, see Fig.1.2, with inputs (fresh feeds), outputs
(production streams) and disturbances (weather conditions) is given in Fig.1.1(left figure) and a physical model (or
plant model) associated with it.
The physical plant model can be given as a generalized model plant given through the following representation
Fig.1.1(right figure). As it is given in Fig.1.2, the generalized plant model is represented as a feedback structure
with controller. The controller, therefore, makes the integral part of the generalized model plant, and to be able to
synthesize a digital controller, it is important to come up with a discrete representation of the physical plant, since
the controller will see the physical plant through its discretized version.
The generalized model representation is given, see Fig. 1.2 , where
ue (t) denotes vectors of exogenous signals, uc (t) - vectors of controlled
inputs, yc (t)- vectors of controlled outputs and ym (t)- vectors of measured outputs. This model representation can be also given in a classical control model representation form.
It is obvious that every physical system can be modelled in the form
given in Fig.1.2, where a generalized plant is given as a mathematical
system of differential and algebraic equations. However, this mathematFig. 1.1 Chemical Plant
ical model is not applicable for a wide range of operating parameters.
For example, the operating conditions of the distillation column at the
Edmontons refinery will vary in summer and winter season. In other words, the model description for two different
seasons will yield different model equations parameters. If the model for winter season is used in summer, it will
be inaccurate and will collapse.

inputs u
e
Gereralized Plant

Dynamical System

inputs

outputs

disturbances

differential equations

uc

yc

outputs
y
m

Ccontroller

Fig. 1.2 Physical system.

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)

y(t) = Cx(t) + Du(t)

(1.4)

We consider few illustrative examples.


Example 1.1. (Two tanks in series)
Let us consider the case of two tanks placed in the series connection, see Fig.1.4. The differential equation of the

1.1 Systems representation (State space & Input-output)

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)

Fig. 1.4 Two tanks physical plant.

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

1.1 Systems representation (State space & Input-output)

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.

Example 1.3. (Mass-spring-dash-pod mechanical system)


Let us consider a simple model of mechanical system which accounts for elastic force Fel = kx, friction Ff ric = cx
and force f (t) so that the second Newtons Law for the force balance can be written. see Fig.1.9: Writing the
expression for the force balance, one obtains:

1.1 Systems representation (State space & Input-output)


Cdx/dt

7
kx

f(t)

Fig. 1.9 Mass-spring system with friction.

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)

Having the following new states:

so finally the state space representation of the system is given as follows:


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)

and q = w/ is volumetric flow rate.


The reactor contains a cooling coil to maintain the reaction mixture at the desired temperature by removing heat
that is generated by the exothermic reaction. Therefore, the energy balance for the system becomes:
V C p

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

1.1.1 Linear system representation (Transfer functions& ODEs review-Che446)


Let us consider higher order linear differential equations which represent some of the transport-reaction conservation laws or momentum conservation laws; for example the Newtons law given in Example1.3 is given by Eq.1.14.
In the most general case, the order of the linear differential equation can be n, (for example in Example.1.3, the
conservation of the force provides a 2nd order differential equation with constant coefficients), so that the most
general expression for the system is given as:
an

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

taking the Laplace transformation of Eq.1.26, we obtain:

(1.26)

1.1 Systems representation (State space & Input-output)


 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)

= 0, . We can easily manipulate Eq.1.28 to obtain an expression which relates


the input u(t) to the output x(t):

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)

y(t) = Cx(t) + Du(t)

(1.34)

Taking the Laplace transform of above equations we obtain:


sx(s) x(0) = Ax(s) + Bu(s)

(1.35)

y(s) = Cx(s) + Du(s)

(1.36)

which leads to the following:


sx(s) Ax(s) = x(0) + Bu(s) (sI A)x(s) = x(0) + Bu(s)
1

x(s) = (sI A) x(0) + (sI A) Bu(s)

(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)

In the case of zero-initial conditions, that is x(0) = 0 and D = 0, we obtain:


y(s) = C(sI A)1 Bu(s) = G(s)u(s)

(1.40)

1.1.2 Transfer function algebra (review-Che 446)


Let us, for example, consider the following scenario. There are two subsystems with the same transfer function
g(s), the output of the system is y(s) = y1 (s) + y2 (s), so that the transfer function from the input u1 (s) to y1 (s) and
u2 (s) to y2 (s) are expressed:
y1 (s) = g(s)u1 (s)

(1.41)

y2 (s) = g(s)u2 (s)

(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)

Y2 (s) = G2 (s)U2 (s)

(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

1.1 Systems representation (State space & Input-output)

U(s) U1(s)

11

U2(s)

G (s)
1

Y(s)
G (s)
2

Y1(s)

Y2(s)

Fig. 1.11 Transfer function diagram.

Let us consider another systems configuration given in Fig.1.12,

U1(s)

G (s)
1

Y1(s)

Y(s)

U(s)
G (s)
2

U1(s)

Y2(s)

Fig. 1.12 Transfer function diagram.

Y1 (s) = G1 (s)U1 (s)

(1.45)

Y2 (s) = G2 (s)U2 (s)

(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)

Fig. 1.13 Transfer function diagram.

Y1 (s) = G1 (s)U1 (s)

(1.47)

Y2 (s) = G2 (s)U2 (s)

(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

Y (s) = (I + G1 (s)G2 (s))1 G1 (s)U(s)


.

1.2 Introduction in computer controlled systems (Astrom, 1877)

13

1.2 Introduction in computer controlled systems (Astrom, 1877)


Pioneering period 1955;
The computer systems used vacuum tubes. To calculate mathematical operation of addition time was 1ms,
multiplication time was 20ms.
Direct-digital period 1962;
Analog technology was replaced by digital technology. The name direct-digital control (DDC) was coined
to emphasize that the computer controlled the process directly. The programming was done by special DDC
language. It was major change of direction in the development of computer controlled systems.
Minicomputers 1967;
They came with the progress made in integrated-circuit technology. The operation of mathematical addition
time was 2sec, and multiplication was 7sec.
Microcomputers 1972;
Large industrial growth in different areas: distribution of electricity, process control, transportation, manufacturing, entertainment. Development of very large scale integration (VLSI) technology.
Digital control 1980;
The programmable logic controller (PLC) emerged with simple (AN/OR) statements. Data handling issue
emerged as an issue for large number of applications.
Distributed Computing 1990

1.2.1 Computer-Controlled Systems: Discrete-Time Systems


The phenomena that are controlled by computers are continuous in their nature. Transport-reaction processes in
chemical and petroleum industry are prime examples of these continuous systems. As, computers are used to control processes, the continuous process output y(t), for example temperature in the reactor, is continuously measured
and feed into the analog-to-digital converter (A/D) to obtain the digital form that can be used by computer. Therefore, a conversion of the signal is one of the most important aspects of digital control and this conversion is obtained
at some sampling rate ( which is defined by sampling time tk ). The computer algorithm admits the {yk } sequence

COMPUTER

A/D

Clock

y{t k}

Algorithm

u{tk}

y(t)
D/A

Process

Fig. 1.14 Computer-controlled systems (or sampled-data systems).

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

System representation (linear/nonlinear systems)


Differential equations & difference equations
State-space system & discrete state-space
Complex (Laplace) & complex discrete (Z-domain)

1.2.2 Sampling and signal reconstruction


When digital control is used, continuous measurements are converted into digital form by analog to digital converter, see Fig.1.14. This operation is required since digital computers can not directly process the analog signal,
therefore the signal must be sampled at discrete points in time, and then the samples must be digitalized. The time
interval between successive samples is referred to as the sampling period t (associated with this term are also
1
and sampling frequency s = 2
sampling rate fs = t
t ).
y(t)

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-

1.2 Introduction in computer controlled systems (Astrom, 1877)

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

Selection of sampling period


The major characteristic of dynamical system is its time constant, . For a first order system, the time elapsed
for process response to reach 63.2% of its final value is defined as time constant. The second or higher order
overdamped system can be approximated by a first order system with time delay.
There are following guidelines for selection of sampling period for the first, or higher order overdamped systems:
1. Practical experience suggests that a sampling period between 0.1 and 0.2 of one time constant yields satisfactory
results, that is 4t = 0.1. If there is time delay d , and the time delay has the same order of magnitude as the
time constant, select the sampling period equal to 0.1 0.2 or 0.1d 0.2d whichever is smaller. If d is
much smaller than , neglect the time delay and take the sampling period as 0.1 0.2
2. Oscillatory behaviour is exhibited by underdamped open or close-loop systems and by the steady-state response
of linear systems subject to periodic, sinusoidal input changes. To develop, a good sampled representation of
an oscillating signal, follow the rule: Sample an oscillating signal more than two times per cycle of oscillation,
otherwise it is impossible to reconstruct the original signal from its sampled values as discussed from the
Fig.1.17
Example 1.5. (Selection of sampling time))
y(s)
e2s
= s+0.01
, select the sampling time.
For the transfer function u(s)
We express the system in the form of combined first order system and delay system:
100e2s
y(s) Ked s
=
=
u(s)
s + 1
100s + 1
so the d = 2, = 100 and since d << , then sampling time is 4t 0.1 = 0.1 100 = 10. t
u

(1.50)

Chapter 2

Discrete Time Systems

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)
+

Fig. 2.1 Flow-tank system with additional flow in output.

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

2 Discrete Time Systems

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

so that the integral is evaluated between some t0 and given t;


x(t)eat x(t0 )eat0 =

Z t
t0

ea bu1 ()d x(t) = ea(tt0 ) x(t0 ) + eat

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

x(t) = ea(tt0 ) x(t0 ) + ea(t) bu1 ()d


t0


Z t
y(t) = c ea(tt0 ) x(t0 ) + ea(t) bu()d + du2 (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).

2.1.1.1 Exact discretization method


Question: How do we obtain the discretized version of the systems dynamics from the above expression?
If one discretizes a time interval [t0 ,t], as follows [t0 ,t1 ,t2 , ,tk ,tk+1 , t], so that the instances of two successive times are given as [tk ,tk+1 ] and bearing in mind that we can write the tk = kT and tk+1 = (k + 1)T which
implies constant sampling rate of some x(t) signal, that is x(t) = x(kT ) with the period T . We observe that we
can obtain evolution of the system state as x(t0 ) x(t1 ), and from x(t1 ) x(t2 ) and in the same manner we can
integrate from the initial to the final time providing that we know the function u() in each of the subintervals.
However, under an important and crucial assumption that the input signal (that is u(t) = u(T k)) is kept piecewise
constant between time instances when the sampling of the signal is done, we can obtain the following from Eq.2.5,
x(tk+1 ) = ea(tk+1 tk ) x(t0 ) +

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):

F(k) = cx(k) + d 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

x(k + 1) = eaT x(k) + [eaT 1]bu(k) = ax(k)

+ bu(k)
a
F(k) = cx(k) + d u(k)
= cx(k)

+ du(k)

(2.11)
(2.12)

which implies the following:


a = eaT
b =

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.1.1.2 Finite difference based discretization method


Another form of the discrete representation of Eq.2.3-2.4 comes from the numerical solution methods to solve the
differential equation by approximate difference equation. Namely, if we consider a nonlinear equation of the
form
dx
= f (x, u)
(2.17)
dt
where x- is the state variable and u-is the input, we can numerically integrate Eq.2.17 by introducing a finite
difference approximation for derivative expression. For example, the forward difference approximation to the
derivative at time t = kT is given as:
dx x(k + 1) x(k)

(2.18)
dt
T

20

2 Discrete Time Systems

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)

In the case of linear differential equation given by Eq.2.3, we have:


dx x((k + 1)T ) x(kT )

= ax(kT ) + bu(kT ) x((k + 1)T ) = x(kT ) + h [ax(kT ) + bu(kT )]


dt
h

(2.20)

which is obtained by fixing as a sampling period T . We obtain:


x((k + 1)T ) = x(kT ) + T [ax(kT ) + bu(kT )] x(k + 1) = [1 + aT ]x(k) + T bu(k)

(2.21)

so that the approximated expression for the sampled data system becomes:

x(k + 1) = [1 + aT ]x(k) + T bu(k) = ax(k)

+ 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.2 Sampling of continuous state-space system s = (A, B,C, D)


Let us consider a generalization of the system given by Eq.2.3-2.4. The state space representation is given in the
vector and matrix forms, where the state vector x(t) = [x1 (t), x2 (t), , xn (t)]0 is the 1 n vector, the output vector
y(t) = [y1 (t), y2 (t), , ym (t)]0 is the 1 m vector, and the matrices A, B,C, D are of appropriate dimensions, while
the input vector u(t) is a scalar. Therefore, we have:

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)

y(t) = Cx(t) + Du(t)

(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

y(t) = Cx(t) + Du(t)


By the same argument of having time instances of the sampling time within which the input is held constant, we
obtain:
x(t) = eA(ttk ) x(tk ) +

Z T
0

eA dBu(tk )d

x(tk+1 ) = (tk+1 ,tk )x(tk ) + (tk+1 ,tk )u(tk )


where the matrices and are given as:
(tk+1 ,tk ) = eA(tk+1 tk )
Z T

(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 Discrete Time Systems

It follows that the relation between the , , A and B is given as:





 
(t) (t)
AB
= exp
t
0
I
0 0

(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)

while the MATLAB command:


 exp(A)
ans =

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

2 Discrete Time Systems


 
 

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)

so that the discrete-time model is given as:


" 2#

T
1T
x(k + 1) =
x(k) + 2 u(k)
01
T


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)

so that exact model representation of the and are obtained. t


u

2.1.3 Transformation of continuous to discrete system representation; Time-delay systems


Time-delay systems are common in mathematical models of industrial processes. There is a significant complexity
in dealing with continuous time-delay problems, since their representation is infinite dimensional (recall Che 446
eas
, we observe that
and transfer function representation of the first order system with time-delay, that is G(s) = s+1
eas -exponential function if expanded by Eq.2.24 will contain an infinite number of terms). However, it is still easy
to sample systems with delays because the control signal is constant between sampling instances, which makes the
sampled data system finite-dimensional. In particular, a simple continuous representation of the time delay system
where the input function is delayed takes the following form:

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

eA(kh+ks) Bu(s )ds

(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

2 Discrete Time Systems

 

 " #
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)

by the above argument we obtain:


a = = eh

(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)

so that discrete representation is:


x(kh + h) = ax(kh) + b0 u(kh) + b1 u(kh h) x(k + 1) = ax(k) + b0 u(k) + b1 u(k 1)

(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)

so we obtain the difference equation in the form:


x(k + 1) = x(k) + 0 u(k) + 1 u(k 1)

(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)

If we write the above equation in another form:


x(k + 1) = x(k) + 0 u(k 2) + 1 u(k 3)
u(k 2) = u(k 3)
u(k 1) = u(k 2)
u(k) = u(k 1)
which shows that we need to store three inputs [u(k 3) u(k 2) u(k 1)] over time interval equal to the time
delay in order to obtain x(k + 1). t
u

28

2 Discrete Time Systems

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)

the back-shift (delay) operator

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.

Example 2.6. (Shift forward and back-shift operator)


Let us consider the signal Y representing the measurement of the tank height level given as sequence of numbers
obtained at discrete times:
{0, 1, 2, , k, k + 1, }
(2.63)
with measurements:
Y = {y(0), y(1), y(2), , y(k), y(k + 1), }

(2.64)

If the signal is applied to the shift operator, the sequence becomes:


Y (k)q = {y(1), y(2), y(3), , y(k + 1), y(k + 2), }

(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)

which also has the following representation:


y(k) =

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:

The pulse-transfer operator function is G1 (q) =

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

2 Discrete Time Systems

q1 y(p) = y(p 1)
q1 [q1 y(p)] = y(p 2)
1

q [q1 [q1 y(p)]] = y(p 3)


=
1

q [q [ [q y(p)] = qn y(p) = y(p n)


u(p n) = qn u(p)
we obtain the following,


an + an1 q1 + an2 q2 + + a1 qn+1 + a0 qn y(p) = qn u(p)

(2.76)

(2.77)

so that the corresponding representation takes the following form:


y(p) =

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)

Fig. 2.8 The construction of the input-output system realization.

Exercise 2.1. Realization of the pulse transfer function


Construct the input-output realization for:
1.)Discrete state space model given in Example.2.1 by using the back-shift (delay) operator.
2.)Discrete state space model given in Example.2.3 by using the back-shift (delay) operator.
3.)Discrete state space model given in Example.2.5 by using the back-shift (delay) operator.

32

2 Discrete Time Systems

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)

Z { (k)} = 1 + 0z1 + 0z2 + = 1

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)

Z { (k 5)} = 0 + 0z1 + 0z2 + 1z3 + 0z4 + 0z5 + = z3


0

u(k)

Z {u(k)} = 1 + 1z1 + 1z2 + 1z3 + 1z4 + 1z5 + 1z6 + 1z7 + =


0

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

2 Discrete Time Systems

4. taking that x =

1
z

we obtain an expression for Z {R(kh)}

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)

see the Lecture 7-II.


5.) Exponential function sampled at h, that is f (t) = f (nh) = Ceanh . Taking the Z -transform we obtain:
F ( f (kh)) =

k=0

k=0

f (kh)zk = Ceakh zk

(2.92)

and the above expression converges for |eah z1 | < 1 to


F ( f (kh)) = C

1
1 eah z1

(2.93)

6.) Sin function sin(wk).


i
i
Recall that the Euler identity gives ei = cos + isin , which yields sin = e +e
, therefore Z (sin(wk)) =
2i
1
iwk
iwk
)]. By using the expression Eq.2.88, we obtain:
2i [Z (e ) Z (e


1
z
z
zsin(w)
Z (sin(wk)) =

= 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)

see the Lecture 7-III.


Example 2.9. (Discrete system transfer function )
Example 2.8 revisited. Find the transfer function by using the Z -transform:
x(k + 1) = 2x(k) + 3u(k)

(2.100)

Z {x(k + 1)} = zx(z) zx0


Z {x(k)} = x(z)

(2.102)

we apply the above relation,


(2.101)

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.

2.1.6 Response of discrete system, Inverse Z-transform, Solution to difference equation


Find the response of the discrete system x(z) = G(z)u(z) given by the transfer function G(z) =
input u(k) = {1, 1, 1, }.

3
z2

to the unit step

36

2 Discrete Time Systems

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)

so that we obtain the following:


z
u(z)
z2
3
z
x(z)
3
=

=
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)

Three methods are available to obtain inverse Z 1 -transform:


1) Partial fraction expansion
This method is used when the x(z) is the rational function in z, such as
x(z) =

b0 zm + b1 zm1 + + bm1 z + bm
, n>m
zn + a1 zn1 + + an1 z + an

(2.111)

If the above function is expressed by partial fraction expression:


x(z) =

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)

into the sum of two fractions

yields

0.5z-1 difference & exact rl


2.1 Conversion of continuousFto discrete system (Finite
discretization) r2
(z)

= (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

for different locations

of the root of F(z).

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)

into partial fraction expression as follows:


z1
a1
a2
x(z)
=
=
+
z
(z + 1)(z + 2) z + 1 z + 2

(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

x(n) = 2(1)n + 3(2)n

(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)

we expand x(z)/z in the following partial fraction expression:


x(z)/z =

z1
b
a1
a2
a3
=
+
+
+
(z + 2)3 (z + 3) z + 3 (z + 2)3 (z + 2)2 z + 2

(2.119)

38

2 Discrete Time Systems

To find b we multiply Eq.2.119 by (z + 3) and then evaluate at z = 3. This gives:


b=

(z 1)
|z=3 = 4
(z + 2)3

(2.120)

To find a1 we multiply Eq.2.119 by (z + 2)3 to get:


z1
(z + 2)3
= a3 (z + 2)2 + a2 (z + 2) + a1 + 4
z+3
(z + 3)

(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)

and again evaluate at z = 2. This gives,


a2 =

d
dz


z1
|z=2 = 4
z+3

(2.124)

Finally, to find a3 we differentiate the above expression to obtain


d 2 (z + 2)3
8
=
2a
+
4
3
(z + 3)3
dz2 (z + 3)

(2.125)

and we let z = 2, so we have


a3 =
Hence,
x(z) =

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)

b. Dividing the numerator by the denominator, we have:


z1 + 2z2 3z3 : 1 4z1 + 5z2 6z3 = z1 + 6z2 + 16z3 +
(z1 + 2z2 3z3 )
6z2 8z3 + 6z4
(6z2 24z3 + 30z4 36z5 )
16z3 24z4 + 36z5
therefore,
x(z) = z1 + 6z2 + 16z3 + 40z4 +
which implies that x(0) = 0, x(1h) = 1, x(2h) = 6, x(3h) = 16, x(h4) = 40, . In general, we can not determine
an arbitrary instance x(nh) since we need to calculate all previous instances before the time instance nh t
u.

Finding solution to difference equation


We recall that for continuous systems described by differential equations the Laplace transform is a helpful tool to
obtain a solution of the differential equation. In the same way, for difference equations we can use the Z -transform
to obtain a solution of the difference equation.
Find a dynamic response of the discrete model given by Eq.2.131, by solving the following difference equation:
x(k + 2) + 0.6x(k + 1) + 0.05x(k) = u(k)

(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 Discrete Time Systems

1 0.2z1 + 0.2z2 : 1 0.4z1 0.55z2 0.05z3 = 1 + 0.2z1 + 0.83z2 + 0.492z3 +


(1 0.4z1 0.55z2 0.05z3 )
0.2z1 + 0.75z2 + 0.05z3
(0.2z1 0.08z2 0.11z3 0.01z4 )
0.83z2 + 0.16z3 + 0.012z4
(0.83z2 0.3320z3 0.4565z4 0.0415z5 )
0.492z3 + 0.4665z4 + 0.0415z4

(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

Exercise 2.2. Finding the inverse Z 1 transform of x(z):


Use the partial fraction method to find the inverse Z 1 transform of:
a)

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)

Solve the following difference equations by using Z and Z 1 transforms:


(e) x(n + 2) + 3x(n + 1) + 2x(n) = 0, x(0) = 1, x(1) = 4
( f ) x(n + 4) + 9x(n + 3) + 30x(n + 2) + 20x(n + 1) + 24x(n) = 0, x(0) = 0, x(1) = 0, x(2) = 1, x(3) = 10

----Jo(

582

DYNAMIC RESPONSE OF DISCRETE-TIME SYSTEMS

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

Effect of pole locations

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

2 Discrete Time Systems

The poles and zeros have good system theoretic properties.


Let us also show important characteristic of stable linear systems:
Claim: The linear system preserves the nature of the signal transferring through system

{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 ,

we obtain that the system output is given as:

z
z
z 0.2 z a

therefore, we want to express the above equation in the sequence form:






z
z
y(k) = Z 1 {y(z)} = Z 1 A
+ Z 1 B
z 0.2
za
we determine that 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).

Example 2.13. (Filter Design)


A motivating example for the filter design is given in the following Fig.2.14. The tank level control consists of the
measurement element (red dot), filter and controller in the closed-loop. We are interested in designing the filter to
block all signals with the high frequencies or known measurement disturbance signals, since we do not want these
z
signals to be transferred to the controller in the closed-loop. Therefore, the tank process is described as z0.2
and

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

MEASURUMENTS TAKEN OF THE TANK LEVEL

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

2 Discrete Time Systems

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

2.2 Stability, Controllability, Observability and system representation

45

2.2 Stability, Controllability, Observability and system representation


2.2.1 Stability
Question: What is a condition for stability of the linear system?
This question is one of the most important questions which needs to be answered for the understanding of a
qualitative system behaviour. Stability is fundamental system theoretic property. In general, there are several useful
criteria for determining stability of the linear time invariant discrete/continuous system. We will concentrate on the
following ones:
1.)Direct numerical evaluation of the eigenvalues of the matrix . The matrix represents the autonomous system
dynamics (that is u(z) = 0) and determines the response of the system without input being applied. Therefore,
we have:
x(k + 1) = x(k), x(0) = x0 x(k) = k x0
(2.146)
However, we do not know what is the expression for k (in the same way for continuous system we have that
zplane

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

2 Discrete Time Systems



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)

we form the table:


Row 0 1 2 n1 n
1
a0 a1 a2 an1 an
2
an an1 an2 a1 a0
3
b0 b1 b2 bn1
4
bn1 bn2 bn3 b0
5
c0 c1 cn2
6
cn2 cn3 c0


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 |

|s0 | > |s2 |


A quick method to determine the stability of the second order system, ( ) = a2 2 + a1 + a0 , is that the
following holds:
1. (1) > 0
2. (1) > 0
3. |a0 | < a2 .
Remark The alternative technique to the Yurys test that deals with the stability of the characteristic equation is
modified Routh stability test which is the stability test to analyze characteristic equation of the continuous time
system. Given the characteristic equation (z) = an zn + an1 zn1 + + a1 z + a0 from (z) = det(zI ),
1+w
one can substitute for z = 1w
and obtain the corresponding (w) which then can be used by standard Routh
array test which requires that for stability all coefficients in the Routh array must be positive.

2.2 Stability, Controllability, Observability and system representation

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 =

x(k + 1) = f (x(k)), x(0) = x0

(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)

y(k) = Cx(k) + Du(k)

(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

2 Discrete Time Systems

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 ,

2.2 Stability, Controllability, Observability and system representation

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)

x2 (k + 1) = cx1 (k) + dx2 (k) + u(k)

(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

so that the following claim is made:


The system is controllable if and only if rank Wn = n
Example 2.17. (Determining controllability example) For the two tanks system find the u(k) such that the initial
value of the tank heights h1 = 0 and h2 = 0 will reach h1 = 1.5 and h2 = 5, where A1 = 2, A2 = 1, K1 = K2 = 1
and = 1, and the sampling time T = 1.

50

2 Discrete Time Systems


U(t)

h
1(t)
A1

F 1(t)
k1

h2(t)

F2(t)
A2

k2

Fig. 2.18 Model of the two level tank.

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)

Calculation of the controllability matrix leads to the following expression:




0.3935 0.2387
Ctrb =
0.1548 0.2448
(2.167)
therefore rank(Ctrb ) = 2, and system is controllable, so that we can find a u(k) as:
x0 = x(0)
x(1) = Ax(0) + Bu(0)
x(2) = Ax(1) + [B AB][u(0) u(1)]0
which leads to [u(0) u(1)]0 = [B AB]1 (x(2) A2 x(0)) = [29.2318 13.9177]0 . Remark. One should notice that
the heights in both tanks become very large at first instance x(1) and surprisingly for this system, the path of the
state evolution does not take an intuitively straight line from the origin to the final state. t
u
Example 2.18. (Determining controllability example) For the two tank system in Fig.2.20 find the u(k) such that
the initial values of the tank heights h1 (0) = 0 and h2 (0) = 0 will reach h1 = 0.5 and h2 = 5, where A1 = 1, A2 = 1,
K1 = K2 = 1 and = 1, and sampling time T = 1. The state space realization of the two tank systems leads to the
following set of equations:

2.2 Stability, Controllability, Observability and system representation

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)

Fig. 2.19 The two tank trajectory evolution.


u (t)

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

2 Discrete Time Systems

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)

Fig. 2.21 Model of reactor.

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)

2.2 Stability, Controllability, Observability and system representation

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.

In the case of the discrete system, given by:


x(k + 1) = Ax(k) + Bu(k)
y(k) = Cx(k)
One can observe that for the case u = 0 construction of the initial state depends on the properties of the matrices A
and C. Namely, by constructing the time instances at which output is recorded one obtains,
y(0) = Cx(0)
y(1) = Cx(1) = CAx(0)
y(2) = Cx(2) = CA2 x(0)
y(3) = Cx(3) = CA3 x(0)
=
y(n) = CAn x(0)
or in the matrix form

54

2 Discrete Time Systems


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 =

(A0 ) j (C0 )CA j is observability Gramian

j=0

Example 2.19. (Determining observability example) Consider the following system


x1 (k + 1) = a1 x1 (k) + b1 u(k)
x2 (k + 1) = a2 x2 (k) + b2 u(k)
y(k) = x1 (k)
which is given in Fig.2.23. The system is not observable, since the first equation shows that x1 (k) is completely
determined by input u(k) and output y(k) = x1 (k), so the x1(0) is completely determined and that there is no way
to determine x2 (0) from the output y(k). In other words, x2 (0) never shows in the output as can be seen from the
block diaram in Fig.2.23. t
u
Example 2.20. (Determining observability example) Consider the linear system with u(k) = 0 given as,
x(k + 1) = Ax(k)
y(k) = Cx(k)



 

01
C
01
where A =
and C = [0 1]. Therefore, the O =
=
with rank n = 2. Therefore, the system is fully
11
CA
11
observable for the pair (A,C). This means that x(0) can be uniquely determined from 2 output measurements, in fact

2.2 Stability, Controllability, Observability and system representation


x (k+1)

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

 


y(0) y(1) y(2) y(3) u(0) u(1) u(2) 0 0 CB CAB = x00


CA2
0 0 0 CB
CA3

(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 Discrete Time Systems

2.2.4 Controllable & Observable canonical state-space forms


There are two basic motivations to introduce state-space representations of the dynamical system, that is, controllable and observable canonical state space forms. If the state-space is in a controllable canonical form, we know
that the system is fully controllable, and in the same way if the state-space is given in observable canonical form,
we know that all states are observable. Another important reason is that the full-state feedback controller design is
based on controllable canonical form, while the observer design is based on the observable canonical form.
Therefore, let us consider the difference equation:
y(k + 2) + a1 y(k + 1) + a0 y(k) = u(k)

(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)

which is equivalent to the system x(k + 1) = Ax(k) + Bu(k) where

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:

2.2 Stability, Controllability, Observability and system representation

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)

controllable canonical f orm

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

5.)Then Actrb = PAP1 and Bctrb = PB, Cctrb = P1C.


Again, an advantage of this form is that it is easy to compute the input-output model and to compute state-space
feedback control law u = Kx.
The observable canonical state space form can be obtained as a transpose of the controllable realization. In other
words:

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

(Actrb , Bctrb ,C, D) :=

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

2.)Find the observer subspace Obsv =


CA = 1 1 2

1 1 4
CAn1

58

2 Discrete Time Systems

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

1/2 1/2 1/2


P = q Aq A2 q = 1/6 1/6 1/6
1/3 2/3 4/3


5.)Then Aobsv = P1 AP and Cobsv = CP, Bobsv = P1 B


Finally, one can obtain the schematics of
canonical
state space realization 0 = (Aobsv , Bobsv ,Cobsv , D),
the observable


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.2.5 State-space and Input-output system realization


Control & system engineers are interested in the type of representation of their model which is given generally in
two distinct system representations:
Input - output system representation (external):
y(z) = G(z)u(z)
where G(z) is the pulse transfer function that relates input u(z) and output y(z)

(2.184)

2.2 Stability, Controllability, Observability and system representation

59

State-space system representation (internal):


x(k + 1) = Ax(k) + Bu(k)

(2.185)

y(k) = Cx(k) + Du(k)

(2.186)

where the matrices (A,


 B,C,
 D) represent the interconnections among the states and input in the system, so that
AB
one can define =
CD
Example 1: Find the state-space and input-output representation for the model of the two tanks system:

U(t)

h
1(t)
A1

F 1(t)
k1

h2(t)

F2(t)
A2

k2

Fig. 2.26 Model of the two level tank.

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

2 Discrete Time Systems


c 11

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

Fig. 2.27 State space realization of Eq.2.187-2.188.

x(k + 1) = Ax(k) + Bu(k)

zx(z) x(0) = Ax(z) + Bu(z)


x(z) = (zI A)1 x(0) + (zI A)1 Bu(z)
y(z) = C(zI A)1 x(0) +C(zI A)1 Bu(z) + Du(z)

(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

2.2 Stability, Controllability, Observability and system representation

61

Non uniqueness of state-space representation


To demonstrate the problem of obtaining the (A, B,C, D), let us assume that we have the state space realization of
the G(z) given as:
x(k + 1) = Ax(k) + Bu(k)

(2.192)

y(k) = Cx(k) + Du(k)

(2.193)

y(z) = C(zI A) Bu(z) + Du(z)

(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,

which represents some new state space representation A = T 1 AT , B = T 1 B, C = CT , D = D given as (A,


B,
D)
C,
yield the same transfer function G(z) that is associated with the
Will this new state space realization (A,
system Eqs.2.192-2.193. Let us find out what is the transfer function in this case,
Z

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(T [zT AT ]) T Bu(z) + Du(z)


(use (AB)1 = B1 A1 )
1

= C(zT
AT )1 (T 1 ) T 1 Bu(z) + Du(z)
1

= C[(zI A)T ] Bu(z) + Du(z)

(use (T 1 )1 = T )

= CT T 1 [(zI A)]1 Bu(z) + Du(z)


y(z) = C(zI A)1 Bu(z) + Du(z)

(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

2 Discrete Time Systems

x(k + 1) = ax(k) + u(k)


y(k) = x(k)

u(k)

x(k+1)

x(k)

Fig. 2.28 State space realization of G(z) =

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

Fig. 2.29 State space realization of G(z) =

1
.
z2 +a1 z+a0

For the higher order scalar function given as


G(z) =

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)

2.2 Stability, Controllability, Observability and system representation

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

2 Discrete Time Systems

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

Fig. 2.30 State space realization of Eq.2.204.

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

2.2 Stability, Controllability, Observability and system representation

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

however for the controllability condition we obtain:

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

3.1 Stabilization by feedback


Problem of regulator synthesis for an arbitrary plant (P(s) = n(s)/d(s)) in the classical control is realized by two
methods:
Constant Gain synthesis
Pole Placement synthesis
From the structure of the classical controller realization see Fig.3.1: it is naturally to motivate controller practitioner

outputs

e(s)
+

C(s)

u(s)
P(s)

y
m

Fig. 3.1 Closed-loop schematics.

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).

3.1.1 Constant Gain (C(s) = K)


The constant gain controller problem synthesis is formulated as finding a K such that the characteristic polynomial of the closed loop is stable, or in other words we consider the following two expressions for the closed-loop
67

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.1.2 State feedback design (Design via Pole Placement)


Let us look at the Fig.3.1 where C(s) = K and P(s) = s24s+1
. The answer if this system is open and closed loop
2s+3
stable is given by the Hurwitz criteria, so that for the characteristic polynomial we obtain:
(s) = s2 2s + 3 + K(4s + 1) = 0

(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:

(s) = (s2 8s + 2)(s + 0 ) + (1 s + 0 )(4s 1)


= s3 + (0 8 + 41 )s2 + (80 + 2 + 40 1 )s + (20 0 )
= s3 + a2 s2 + a1 s + a0 = 0

(3.4)

3.1 Stabilization by feedback

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)

and the controller is given as:

therefore the closed loop characteristic polynomial of the p + q order is given as


(s) = d(s) (s) + n(s)(s) = adp+q s p+q + adp+q1 s p+q1 + + ad1 + ad0

(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)

if we simplify above expression into the following polynomials:


P(sn+m1 ) = (an sn + an1 sn1 + + a1 s + a0 )(b m1 sm1 + + b 1 s + b 0 )
(bm sm + bm1 sm1 + + b1 s + b0 )(an1 sn1 + + a1 s + a0 ) = 0

(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) ,

the Sylvester matrix will admit the following form:

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.

Full state feedback (u(t) = Kx(t))


The main assumption associated with the state feedback controller realization is the all states are available and can
be measured exactly. This assumption is rarely met in the process industry but there are some cases when this can
be realized. In particular, as it is seen at Fig.3.3, one can notice that there are input channels from the controller
into the plant, Therefore, having this in mind the full state feedback control law u(t) = Kx(t) is given as a gain
matrix of appropriate dimensions,

3.1 Stabilization by feedback

71
outputs

u(s)
+

P:(A,B,C,D)

y
m
x
f0

f1

Fig. 3.3 The schematics of the full-state feedback.


f11
u1
u2

=


fr1
ur


x1
f1n


x2



xn
frn

(3.16)

which essentially becomes the following structure:


x(t)
= Ax(t) + Bu(t) = Ax(t) + BFx(t) + Bv(t) = (A + BF)x(t) + Bv

(3.17)

where eigenvalues of the closed-loop belong (A + BF) C (LHCP).


The question that one might ask is:
Can we chose F so that the A + BF has prespecified eigenvalues in the LHCP?
Answer: If (A, B) is controllable pair, then all n eigenvalues of A + BF can be freely assigned by choice of F.
We are free to chose any F if the system is controllable, we can freely assigned the closed-loop eigenvalues,
however if the (A, B) is not the controllable part, then the eigenvalues of the uncontrollable part are fixed for all F.
Moreover, if the uncontrollable part is stable then the A + BF can be stabilized by the choice of F. In particular, let
the controllable space be as:


rank B AB A2 B An1 B = p < n
(3.18)
and associated vectors of the controllable subspace are given as


B AB A2 B An1 B = [v1 v2 v p ]

(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)

such that the following holds


AT = TAnew
T Bnew = B
where the matrix Anew and Bnew are given as

Anew =

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


Anew + Bnew Fnew

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

= sn + (an1 fn1 )sn1 + + (a1 f1 )s + (a0 f0 )


so we observe that each term in the characteristic polynomial has an fi such that we can assign the coefficients
of the characteristic equation as desired.
If (A, B) is controllable then we can always find a transformation T such that (T 1 AT, T 1 B,CT ) are in controllable companion form.

Sylvester Equation
Let us look in the expression of the following type:
Ax xB = C

(3.24)

3.1 Stabilization by feedback

73
0

where A is n n, x is n k, B is k k, and C is n k which is obtained as C = CaCb . This is SYLVESTER MATRIX


EQUATION which has a solution x, given as:

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.

Pole Assigment Problem and solution by Sylvester Equation


Problem: Given (A, B) controllable and as a set of n complex numbers, find a F such that (A + BF) = .
(A + BF) = .
such that (A)
= , (cyclic matrix is a matrix that can be transformed in the controller
Chose a cyclic matrix A,
companion form or the matrix where minimal polynomial is of the saze of characteristic polynomial). In other
words, we choose an arbitrary matrix A which has eigenvalues.
For the equation,
Ax xA = BG

(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.1.3 Observers (Luenberger Observer(Estimator))


The system to consider is given as:
x(t)
= Ax(t) + Bu(t)

(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

Fig. 3.4 Observer (estimator) schematics.

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

3.1 Stabilization by feedback

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)

y(t) = Cx(t) + v(t)

(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.1.4 Regulator Design & Separation Theorem


The regulator design consists of two complementary parts:
pole placement by state feedback
state observer (estimator) design
which is applied for the given plant := (A, B,C),
x(t)
= Ax(t) + Bu(t)

(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)

Find L such that

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

closing the loop replace


u(t) = Fx(t)

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

Fig. 3.5 Closed-loop block scheme.

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)

u(s) = F[sI (A + BF LC)]1 Ly(s)

therefore we can freely assign the controller as well as observer poles.

(3.44)

3.1 Stabilization by feedback

77

Im

Re
observer poles

controller poles

Fig. 3.6 Observer and controller poles distribution in the regulator.

3.1.5 Design of reduced order estimator


The starting assumption is that the number of states is greater then number of the measurable outputs, in other
words we have that n > m, which brings us the following systems description:
x(t)
= Ax(t) + Bu(t)

(3.45)

y(t) = Cx(t) = x1 (t)

(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

x1 = A11 x1 + A12 x2 + B1 u y = A11 y + A12 x2 + B1 u


y A11 y B1 u = A12 x2

(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)

since we know that the estimated states plant dynamics is;


x2 = A21 x1 + A22 x2 + B2 u

(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)

w 2 = (A22 LA21 )w2 + (B2 LB1 )u + [A22 L + A21 LA11 LA21 L]

(3.55)

which becomes
Finally, we obtain the control law as follows:

u = [F1 F2 ]


x1
= F1 y + F2 x2
x2

(3.56)

since x2 is estimated we have


u = F1 y + F2 z = F1 y + F2 (w2 + L2 y) = (F1 + F2 L)y + F2 w2

(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

Introduction to Optimal and Model Predictive Control

4.1 Linear Quadratic Regulator-LQR


Linear time invariant system is a problem of interest which is give as:
x(t)
= Ax(t) + Bu(t)

(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

Fig. 4.1 Stabilization of the state by different feedback control law.

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()) =

(x(t)2 + u(t)2 )dt

(4.2)

79

80

4 Introduction to Optimal and Model Predictive Control

having the state vector x = [x1 x2 xn ] which is not the scalar quantity one obtains the
Z t

J(x(), u()) =

(xT (t)Qx(t) + u(t)T Ru(t))dt

(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

min J(x0 , u()) =


u

(xT (t)Qx(t) + u(t)T Ru(t))dt

(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

which leads to the following expression,


Z tf 

x0 (t)(A0 P + PA)x(t) + 2u0 (t)B0 Px(t) 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

min J(x0 , u()) =


u



(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)

4.1 Linear Quadratic Regulator-LQR

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)

The smallest cost J(x


, u()) will be obtained if the entire function in the integral is equal to zero. Therefore, in
R 0
order to make the 0 ([] = 0)dt, we claim that for any symmetric matrix P, and R being positive definite we can
obtain:
solution of the algebraic Riccati equation
Q + A0 P + PA P0 BR1 B0 P = 0

(4.9)

by determining the matrix P,


solution to the full state feedback control by solving
u + R1 B0 Px = 0 u(t) = R1 B0 Px(t) = Kx(t)

(4.10)

optimal cost is x0 (0)Px(0).


The optimal system trajectory for the system Eq.4.1 is given as follows:
x(t)
= Ax(t) + Bu(t)
= (A BR1 B0 P)x(t) x(t) = e(ABR

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)

A BK stable P positive de f inite

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

4 Introduction to Optimal and Model Predictive Control

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.

Take any stabilizing K0 , that is (A BK0 ) < 0


Solve the Riccati equation Eq.4.11 for P0
Calculate K1 = R1 B0 P0
Solve the Riccati equation Eq.4.11 for P1 using K1 in Eq.4.11

this iteration will lead to the following convergence of the minimal cost Pi P and Ki K.

4.2 Finite Time Optimal Control


Let us look in the case, when the finite time horizon is considered in the solution of the optimal control problem.
We again consider the system
x(t)
= Ax(t) + Bu(t)
(4.17)
and the cost functional given as
Z tf

J(x(), u()) =
t0

(x(t)2 + u(t)2 )dt + x0 (t f )Q f x(t f )

(4.18)

4.2 Finite Time Optimal Control

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)

The optimal cost is x0 (t0 )P(t0 )x(t0 )


One needs to notice that the solution to the time dependent Riccati equation needs to be calculated backwards in
time, see Fig.
P(t)
P(t 0)

t0

P(t f)

tf

Fig. 4.2 Solution trajectories of the Eq.4.20.

Finite time optimal control problem with cross product terms


We just extend the previously presented notion of the finite time optimal control problem to the case when the
cross product terms are present, so that the cost functional is given as:



Z tf 
 QS
x(t)
0
0
x (t) u (t)
dt + x0 (t f )Q f x(t f )
(4.22)
J(x(), u()) =
S0 R u(t)
t0
which leads to the following expression:

84

4 Introduction to Optimal and Model Predictive Control

Z tf

J(x(), u()) =
t0
Z tf

=
t0

(x(t)0 Qx(t) + u(t)0 Ru(t) + 2x0 Su(t))dt + x0 (t f )Q f x(t f )




(u + R1 S0 x)0 R(u + R1 S0 x) + x0 (Q SR1 S0 )x dt + x0 (t f )Q f x(t f )

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)

and transformed cost functional


Z tf

J(x(), u()) =

(x0 (Q SR1 S0 )x + u0 Ru)dt

(4.24)

t0

with the following Riccati equation:


= P(t)(A BR1 S0 )0 + (A BR1 S0 )P(t) + (Q SR1 S0 ) P(t)0 BR1 B0 P(t) = 0
P(t)

(4.25)

so that the optimal control law is given as


u(t) = R1 (B0 P(t) + S0 )x(t)

(4.26)

and the optimal cost is again x0 (t0 )P(t0 )x(t0 ).

Return difference relation


We are looking for the guaranteed stability margins obtained by the LQR (stability margins are useful characteristics of the closed loop stability since they provide the information how much we can increase the gain or phase
and still maintained stability in the closed-loop). Starting from the features of the infinite horizon LQR problem,
the algebraic Riccati equation is given as:
Q + A0 P + PA P0 BR1 B0 P = 0

(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

4.3 Introduction to Model Preditive Control

85

Discrete time LQR Optimal Control


The discrete time analogy to the continuous time optimal control problem is given as the following. Consider the
discrete time system
xk+1 = Axk + Buk
yk = Cxk

(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

min Jd (y, u; k) = min yT Qy + uT Ru

(4.32)

k=1

The linear optimal controller is given as uk = Kxk , where K is given by,


K = (BT SB + R)1 BT SA

(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.

4.3 Introduction to Model Preditive Control


Model predictive control (MPC) refers to a class of control algorithms that compute an input profile by utilizing a
linear process model to optimize an open loop quadratic objective function subject to constraints over a future time
horizon. This chapter discusses the general MPC theory for linear systems based on the stabilizing, infinite horizon,
linear quadratic regulator formulation of Muske and Rawlings (1993) for linear state space representations of the
the underlying plant model. Another formulation of the MPC algorithm using step response models is discussed

86

4 Introduction to Optimal and Model Predictive Control

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.4 Dynamic Matrix Control


The first MPC formulation considered is Dynamic Matrix Control (DMC) based on the methods developed in:
Ogunnaike, B.A., and W.H. Ray, Process Dynamics, Modelling, and Control, Oxford, 1994 and Seborg, D.E.,
T.F. Edgar, and D.E. Mellichamp, Process Dynamics and Control, Wiley, 1989.

4.4.1 Regulator Formulation


The objective of DMC is to calculate a set of future control actions, u, so as to drive the deviation of the controlled
output trajectory, y , as close as possible to the setpoint trajectory, ysp , within the prediction horizon of p sample
intervals. Again, it is worth noting that although we calculate the next m control actions, i.e. all elements of u),
only ut is implemented. At the next control interval the entire calculation is repeated to calculate the next control
action. Consider the single input, single output convolution model of a process. The impulse response model is
given in the form of:

yt = h1 ut1 + h2 ut2 + + et = hi uti + et

(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:

yt = a1 ut1 + a2 ut2 + + et = ai uti + et

(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:

4.4 Dynamic Matrix Control

87

yt = a1 ut1 + a2 ut2 + + an un1 + an+1 utn1 +

(4.42)

which can be compactly be written as


n

yt = ai uti +
i=1

ai uti

(4.43)

i=n+1

Let the second term in Eq.4.43 be denoted

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

yt+p = ai ut+pi + zt+p

(4.45)

i=1

This model can be separated into two parts:


1. Terms containing future control actions
p

ai ut+pi

(4.46)

i=1

2. Terms containing past control actions or output values

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

yt+p = ai ut+pi + yt+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

4 Introduction to Optimal and Model Predictive Control

Consider the vector form of Eq.4.49 by defining


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 ,

Denoting the error between the setpoint and output as =


the feedback input , written in standard form,
is given by
u = ( T Q )1 T QT (ysp y ) = Kc
(4.59)

4.4 Dynamic Matrix Control

89

4.4.1.1 Penalizing Control Actions


Generally, the unconstrained DMC regulator formulation processes aggressive control actions which may have
undesirable consequences. This problem can be alleviated with a minor modification to the DMC formulation.
That is, consider the following minimization problem
min J( u) = (ysp y)
T Q(ysp y)
+ uT R u

(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)

which can be simplified to the following form


dJ
= T QT (ysp y ) + ( T QT + RT ) u = 0
d u

(4.64)

u = ( T Q + R)1 T QT (ysp y )

(4.65)

Then, the controller becomes


Denoting the error between the setpoint and output as

= ysp y ,

the feedback input is given by

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.

4.4.1.2 Calculating predictions


The vector y of predicted values for the output, should no further control action be taken, has been used to
determine control actions over the prediction horizon. In this section, it will be shown how such predictions can be
calculated. Further, assume that constant step type disturbances et are present. In this case, the uncontrolled output
predictions have an additional term
p

=
yt+p

ai ut+pi + zt+p + et+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

4 Introduction to Optimal and Model Predictive Control

yt = ai uti

(4.69)

i=1

Therefore one has that

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

Then inserting these expressions yields

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

= yt (ai a p+i ) uti


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.4.1.3 DMC Tuning and Implementation Issues


A few notes on DMC tuning are provided below
1. The prediction horizon must be chosen so that the results of control actions can be seen within it, i.e.
p > +1

(4.75)

where is the dead time.


2. The number of control actions m calculated is dictated by the process dead-time and the prediction horizon
1 < m p
This ensures that the effects of all control actions will be seen within the prediction horizon.
3. Tuning parameters for a Dynamic Matrix Controller include
the setpoint filter
the prediction horizon, p
the number of control actions, m

(4.76)

4.4 Dynamic Matrix Control

91

the number and value of the step weights, n and ai


the weighting matrices, Q and R

4.4.1.4 DMC Implementation Procedure


The following list summarizes the principle steps in the DMC implementation procedure
1. Off-line: Calculate the controller gain matrix
Kc = ( T Q + R)1 T QT

(4.77)

2. On-line: Calculate the uncontrolled output predictions


n

yt+l
= yt (ai al+i ) uti ,

l = 1, 2, . . . , p

(4.78)

i=1

3. On-line: Calculate only the next control action


p

ut = kli (ysp yt+i


)

(4.79)

i=1

where kli are the elements of the first row of Kc given by

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

4 Introduction to Optimal and Model Predictive Control

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)

in order to guarantee feasibility at the origin.

4.4.2 Multivariate DMC


4.5 Model Predictive Control with Linear Models
The second MPC algorithm considered in this chapter is based on the article: Muske and Rawlings (1993), Model
Predictive Control with Linear Models, AIChE J., 39(2), 262-287. This article presents a MPC formulation that
addresses the serious limitation in the previous works mentioned which is the requirement to tune for nominal
stability. The stabilizing constrained regulator formulation presented by Muske and Rawlings eliminates the requirement to tune for nominal stability. Furthermore, the regulator is stabilizing for both stable and unstable plants
which are represented by discrete state-space models.

4.5.1 Regulator Formulation


Consider the discrete state-space representation of the plant model
xk+1 = Axk + Buk
(4.84)
yk = Cxk
where xk is the vector of states, uk is the vector of inputs and yk is the vector of outputs, each at time k = 0, 1, 2, . . . .
At time k, the input is determined from the minimization of the infinite horizon open-loop quadratic objective
function


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

4.5 Model Predictive Control with Linear Models

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

k+N + uTk+N S uk+N +


min k = xk+N Qx
uN

T
T
T
T
xk+
jC QCxk+ j + uk+ j Ruk+ j + uk+ j S uk+ j

(4.87)

j=0

The matrix Q is referred to as the terminal state penalty matrix.

4.5.1.1 Stable Systems


For stable systems, the terminal state penalty matrix Q in Eq.4.87 is given by

i
Q = AT CT QCAi

(4.88)

i=0

and is determined from the solution of the discrete Lyapunov equation

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

where Q is determined from solving Eq.4.89 and the matrices H, G and F

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 Introduction to Optimal and Model Predictive Control

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

ymin yk+ j ymax ,

j = j1 , j1 + 1, . . . , j2

umin uk+ j umax ,

(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)

4.5 Model Predictive Control with Linear Models

95

Feasibility of the origin is guaranteed by imposing the following restrictions on constraints


0
umax
umin 0

ymax 0

ymin > 0

umax 0
0
umin

(4.96)

4.5.3 Unstable Systems


The case of unstable systems differs from stable ones in that the unstable modes of the system are separated from
the stable modes. This is accomplished by transformation of A into its Jordan form and partitioning into stable and
unstable parts

 
 Ju 0
Vu
A = Vu Vs
= V JV 1
(4.97)
0 Js
Vs
whereby the stable eigenvalues of A are contained in Js and unstable eigenvalues are contained in Ju . The stable
modes zs and unstable modes zu satisfy the following
 u  
z
V
= u x
(4.98)
zs
Vs
such that the state evolution is given by
 u   
 u  
zk+1
Ju 0
zk
V
=
+ u Buk
zsk+1
0 Js
zsk
Vs

(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)

where is the infinite sum given by

= JsT VsT CT QCVs Jsi

(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

4 Introduction to Optimal and Model Predictive Control

1. Contribution from the finite horizon terms in Eq.4.87

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. Contribution from the terminal state penalty on stable modes in Eq.4.102

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

Fig. 4.3 The construction of the input-output system realization in Example.2.1 .

2.2 Problem solution


(a) 2/3[2n 1].
(b) 1/7(2)n + 1/7n(2)n + 6/7
(c) 0, 1, 4, 10, 28,
(d) x(n) = nena
(e) Solution in Example.2.10
(f) Solition in Example.2.11

97

98

Solutions
x(k+1)

x(k)

q1

y(k)

a
+
+

u(k)

b0

u(k1)

q1

b1

Fig. 4.4 The construction of the input-output system realization in Example.2.4 .

x(k+1)

u(k)
q

Fig. 4.5 The construction of the input-output system realization in Example.2.5 .

x(k)

S-ar putea să vă placă și