100% found this document useful (1 vote)
234 views

Signals Systems and Control

This document provides an overview of lecture notes on signals, systems and control. It contains 8 sections that cover topics such as modelling mechanical, electrical, fluidic and thermal systems; systems theory; sensors and actuators; control systems; and practical implementation of control systems. The notes were produced by Duarte Valério and contain examples, glossaries and exercises for each topic. They acknowledge contributions from other professors who provided exercises and material.

Uploaded by

PALANCHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
234 views

Signals Systems and Control

This document provides an overview of lecture notes on signals, systems and control. It contains 8 sections that cover topics such as modelling mechanical, electrical, fluidic and thermal systems; systems theory; sensors and actuators; control systems; and practical implementation of control systems. The notes were produced by Duarte Valério and contain examples, glossaries and exercises for each topic. They acknowledge contributions from other professors who provided exercises and material.

Uploaded by

PALANCHA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 581

Lecture Notes of

Signals, Systems and Control


Duarte Valério

October 31, 2022


Overview of contents
I Modelling 3

II Systems theory 105

III Sensors and actuators 209

IV Control systems 265

V Practical implementation of control systems 355

VI System identication 405

VII Fractional order systems 447

VIII Stochastic systems 493

Epilogue 571
Acknowledgements
Some of the exercises in these lecture notes have been taken or adapted from
collections of exercises or exams conceived by colleagues to whom I am in-
debted for authorising their reproduction here. In particular, I thank profes-
sors Alexandra Moutinho, Carlos Cardeira, Jorge Martins, José Raul Azinheira,
Mário Ramalho, Miguel Ayala Botto, Paulo Oliveira, Pedro Lourtie and Rodrigo
Bernardo for this.

i
ii OVERVIEW OF CONTENTS
Contents

1 The name of the game 1

I Modelling 3
2 The Laplace transform 7
2.1. Denition, 7. 2.2. Finding Laplace transforms, 8. 2.3. Finding
inverse Laplace transforms, 10. 2.4. Important properties: derivatives
and integrals, 14. 2.5. What do we need this for?, 15. 2.6. More
important properties: initial and nal values, convolution, 17. 2.7. The
Fourier transform, 19. Glossary, 21. Exercises, 22.
3 Examples of mechatronic systems and signals 23
3.1. Systems, 23. 3.2. Signals, 28. 3.3. Models, 35. Glossary,
36. Exercises, 38.
4 Modelling mechanical systems 41
4.1. Modelling the translation movement, 41. 4.2. Simulating transfer
functions in Matlab, 47. 4.3. Modelling the rotational movement, 49.
4.4. Energy, eort and ow, 50. 4.5. Other components, 51. Glossary,
56. Exercises, 56.
5 Modelling electrical systems 61
5.1. Passive components, 61. 5.2. Energy, eort and ow, 64. 5.3. The
operational amplier (OpAmp), an active component, 68. 5.4. Other
components, 73. Glossary, 74. Exercises, 75.
6 Modelling uidic systems 79
6.1. Energy, eort and ow, 79. 6.2. Basic components of a uidic system,
80. 6.3. Other components, 83. Glossary, 83. Exercises, 85.
7 Modelling thermal systems 87
7.1. Energy, eort and ow, 87. 7.2. Basic components of a thermal
system, 87. Glossary, 91. Exercises, 91.
8 Modelling interconnected and non-linear systems 93
8.1. Energy, eort and ow, 93. 8.2. System interconnection, 95. 8.3.
Dealing with non-linearities, 97. Glossary, 99. Exercises, 100.

II Systems theory 105


9 Transfer functions and block diagrams 109
9.1. More on transfer functions, 109. 9.2. Block diagrams, 113. 9.3.
Control in open-loop and in closed-loop, 122. Glossary, 124. Exercises,
125.
10 Time and frequency responses 129
10.1. Time responses: steps and impulses as inputs, 129. 10.2. Steady-
state response and transient response, 134. 10.3. Stability, 138. 10.4.
Time responses: periodic inputs, 143. 10.5. Frequency responses and the
Bode diagram, 146. Glossary, 155. Exercises, 156.
iii
iv CONTENTS

11 Finding time and frequency responses 161


11.1. Time and frequency responses of a pole at the origin, 161. 11.2.
Time and frequency responses of a rst-order system without zeros, 163.
11.3. Time and frequency responses of a second-order system without zeros,
168. 11.4. Systems with more zeros and poles: frequency responses,
181. 11.5. Systems with more zeros and poles: stability, 190. 11.6.
Systems with more zeros and poles: time responses, 194. Glossary, 200.
Exercises, 201.
III Sensors and actuators 209
12 Measuring chains and actuation chains 213
12.1. What are measuring chains and actuation chains, 213. 12.2. Filters,
215. 12.3. Bandwidth, 220. 12.4. Signal characteristics, 222. 12.5.
Op-amp implementation of signal conditioning, 231. Glossary, 233.
Exercises, 234.
13 Sensors 239
13.1. Position, proximity, velocity and acceleration sensors, 240. 13.2.
Working principles of position sensors, 242. 13.3. Working principles of
velocity and acceleration sensors, 252. 13.4. Sensors for force, binary,
pressure and level, 254. 13.5. Sensors for ow and pressure in ows,
254. 13.6. Sensors for temperature and luminosity, 254. 13.7. Sensors
for pH and concentration, 254. Glossary, 254 . Exercises, 254.
14 Actuators 259
14.1. Generalities about electric motors, 259. 14.2. DC motors, 259.
14.3. AC motors, 259. 14.4. Generalities about pneumatic and hydraulic
actuators, 259. 14.5. Pneumatic and hydraulic compressors and motors,
259. 14.6. Cylinders and valves, 259. 14.7. Dimensioning of pneumatic
and hydraulic circuits, 260. Glossary, 260. Exercises, 260.
IV Control systems 265
15 Control strategies and controller structures 269
15.1. Open loop control, 269. 15.2. Closed loop control, 272. 15.3.
Design of open loop controllers, 276. 15.4. Closed loop controllers, 276.
Glossary, 281. Exercises, 282.
16 Root locus 283
16.1. Simple examples, 283. 16.2. Rules for the root locus, 288. 16.3.
Proofs of rules for the root locus, 294. 16.4. Finding desired poles from
specications, 299. Glossary, 302. Exercises, 302.
17 The Nyquist stability criterion 305
17.1. The polar diagram, 305. 17.2. The Nyquist diagram when there
are no poles on the imaginary axis, 307. 17.3. The Nyquist criterion,
309. 17.4. The Nyquist diagram when there are poles on the imaginary
axis, 314. Glossary, 317. Exercises, 318.
18 Stability margins 321
18.1. Stability margins for stable, minimum phase systems, 321. 18.2.
Stability margins in the general case, 325. Glossary, 325. Exercises, 326.
19 The Nichols diagram 327
Glossary, 327. Exercises, 328.
20 Steady-state errors 329
Glossary, 329. Exercises, 330.
21 Design of PID controllers 333
Glossary, 335. Exercises, 335.
22 Design of lead-lag controllers 339
Glossary, 339 . Exercises, 339.
CONTENTS v

23 Internal Model Control 343


23.1. IMC as a variation of closed-loop control, 343. 23.2. IMC as a design
method for closed-loop controllers, 346. Glossary, 346. Exercises, 347.
24 Delay systems 349
24.1. Pure delays, 349. 24.2. Padé approximations, 350. 24.3. Smith
predictor, 350. 24.4. Control of systems similar to delay sistems, 350.
Glossary, 351. Exercises, 351.
V Practical implementation of control systems 355
25 Digital signals and systems 359
25.1. The Z transform, 361. 25.2. Discrete transfer functions, 364.
25.3. Zero order hold, 365. 25.4. Choosing the sampling time, 366.
25.5. Stability and causality of discrete transfer functions, 369. 25.6.
Primary and complementary strips in s, 371. Glossary, 372. Exercises,
372.
26 Digital approximations of continuous systems 375
26.1. Using the Z transform, 375. 26.2. Mapping poles and zeros, 375.
26.3. Backward rst order approximation, 375. 26.4. Forward rst order
approximation, 375. 26.5. The Tustin approximation, 375. 26.6. Ap-
proximating controllers, 375. Glossary, 376. Exercises, 376.
27 Study and control of digital systems 377
27.1. Block diagrams, 377. 27.2. Pole placement, 377. 27.3. Steady
state errors, 377. 27.4. Root locus, 378. 27.5. Jury and Routh-Hurwitz
criteria, 378. 27.6. Frequency responses, 378. 27.7. Studying stability
from frequency responses, 378. Glossary, 378. Exercises, 379.
28 Non-linearities in control systems 383
28.1. Non-linearities and responses in time, 383. 28.2. Describing func-
tion, 388. 28.3. Predicting limit cycles, 394. Glossary, 399. Exercises,
399.
29 Other aspects of controller design and implementation 403
Glossary, 403. Exercises, 404.
VI System identication 405
30 Overview and general issues 409
30.1. Types of data, types of identication methods, and types of models,
409. 30.2. Comparing model performance, 411. 30.3. Noise, 414.
30.4. Pseudo-inverse of a matrix, 416. Glossary, 419. Exercises, 419.
31 Identication from time responses 421
31.1. Identication of the order of the model, 421. 31.2. Identication
from analytical characteristics of the response, 422. 31.3. Identication
by minimisation of error, 423. 31.4. Deconvolution, 426. Glossary,
429. Exercises, 429.
32 Identication from frequency responses 431
32.1. Finding frequency response data, 431. 32.2. Identication from
the Bode diagram, 433. 32.3. Levy's method, 433. 32.4. Matsuda's
method, 437. 32.5. Oustaloup's method, 439. Glossary, 440. Exercises,
440.
33 Identication of non-linearities 443
33.1. Identication from a time response, 443. 33.2. Identication from
a limit cycle, 443. 33.3. Identication of a pure delay, 444. Exercises,
444.
VII Fractional order systems 447
34 Fractional order systems and their frequency responses 451
vi CONTENTS

34.1. Frequency responses that require fractional order systems, 451. 34.2.
Frequency responses of fractional order systems, 453. 34.3. Identication
from the Bode diagram, 458. 34.4. Levy's method extended, 459.
Glossary, 462. Exercises, 462.
35 Fractional order derivatives 467
35.1. Gamma function, 467. 35.2. Two apparently simple examples,
471. 35.3. The Grünwald-Letniko denition of fractional derivatives,
473. 35.4. The Riemann-Liouville denition of fractional derivatives,
475. 35.5. Properties of fractional derivatives, 478. 35.6. Applications
of fractional derivatives, 479. Glossary, 480. Exercises, 480 .
36 Time responses of fractional order systems 483
36.1. The Mittag-Leer function, 483. 36.2. Time responses of simple
fractional order transfer functions, 485. 36.3. Stability of fractional sys-
tems, 486. 36.4. Identication from time responses, 488. 36.5. Final
comments about models of fractional order, 491. Exercises, 491.
VIII Stochastic systems 493
37 Stochastic processes and systems 497
37.1. Stochastic processes, 497. 37.2. Characterisation of stochastic pro-
cesses, 500. 37.3. Relations between stochastic processes, 510. 37.4.
Operations with stochastic processes, 515. Glossary, 517. Exercises, 518.
38 Spectral density 519
38.1. The bilateral Fourier transform, 519. 38.2. Denition and properties
of the spectral density, 522. 38.3. Numerical computation of the PSD and
CSD, 527. 38.4. White noise, 531. Glossary, 532. Exercises, 532.
39 Identication of continuous stochastic models 533
39.1. Identication in time, 533. 39.2. Identication in frequency, 537.
Glossary, 541. Exercises, 542.
40 Filter design 543
40.1. Wiener lters, 543. 40.2. Whitening lters, 546. Glossary, 547.
Exercises, 547.
41 Digital stochastic models 549
41.1. Types of digital stochastic models, 549. 41.2. Autocorrelation
of a MA, 552. 41.3. Partial autocorrelation of an AR, 554. 41.4.
Identication, 555. Glossary, 556. Exercises, 556.
42 Control of stochastic systems 557
42.1. Minimum variance control, 557. 42.2. Pole-assignment control,
564. 42.3. Control design for time-varying references, 566. 42.4. Adap-
tive control, 567. Glossary, 568. Exercises, 568.
Epilogue 571
43 What next? 571
43.1. Discrete events and automation, 571. 43.2. State-space representa-
tions of systems continuous in time, 571. 43.3. State-space representations
of systems discrete in time, 571. 43.4. MIMO systems and MIMO con-
trol, 571. 43.5. Optimal control, 572. 43.6. Fractional order control,
572. 43.7. Other areas, 572. Glossary, 572.
Chapter 1

The name of the game


Signum est quod et se ipsum sensui et praeter se aliquid animo os-
tendit.

Saint Augustine of Hippo (354 „430), De dialectica, V

System is the part of the Universe we want to study. System


A signal is a function of time or space that conveys information about a Signal
system.
A control system is, in simple terms, a system designed to behave as the Control system
designer desires.
There are systems of many types: biological systems, economic systems,
chemical systems, social systems. . . These lecture notes are concerned in par-
ticular with mechatronic systems, i.e. those combining both mechanical and Mechatronic system
electronic components.

Example 1.1. A Wave Energy Converter (WEC) is a mechatronic system that


extracts the energy of sea waves, usually to produce electricity. The power
injected to the electric grid is a signal that depends on time. The elevation
of the sea waves is a signal that depends on both time and space. Figure 1.1
illustrates these signals.

We will study the following subjects:

Part I addresses the development of mathematical models to describe the be-


haviour of mechatronic systems.

Part II uses the models from Part I to study how systems behave.

Part III presents the technology used to measure signals and to control mechatronic
systems.

Part IV shows how controllers can be designed to make control systems behave as
desired.

2
wave elevation [m]

5
x 10
7
Uncontrolled 1
6 Controlled

5 0
Energy [J]

3 −1

2
−2
1

0
−3
0 100 200 300 400 500 600 700 800 900
−1
0 50 100 150 200 250 300 350 400 time [s]
Time [s]

Figure 1.1: Left: electrical energy produced by a WEC as a function of time.


Right: wave elevation as a function of time at a given point; at a dierent
location, the wave elevation will be dierent.

1
2 CHAPTER 1. THE NAME OF THE GAME

Part V is about practical aspects of the implementation of control systems.

Part VI explores system identication, i.e. ways of nding models from experimen-
tal data.

Part VII studies systems described by models with derivatives and integrals with
orders that are not integer numbers.

Part VIII covers systems with outputs that are not deterministic.

Chapter 43 concludes these lecture notes with an overview of related subjects.

At IST, ULisboa, these subjects are covered in the following courses:

ˆ Signals and Mechatronic Systems covers Parts I, II and III.


ˆ Control Systems covers Parts IV and V.
ˆ System Identication covers Parts VI, VII and VIII.
Matlab We will often use a software called Matlab, as well as Matlab's graphical
Simulink environment for working with block diagrams Simulink. Matlab is not a free
software. On the other hand, some of the functionalities of Matlab can be
Octave supplied by free software such as Octave (which you can install from https://
www.gnu.org/software/octave or run online from https://octave-online.
Scilab net/) or Scilab (which you can install from https://www.scilab.org/). Notice
that several functionalities of Matlab we will need are missing from Octave,
which also lacks anything parallel to Simulink. Scilab is more complete, and
has Xcos, which is similar to Simulink; but is slightly less compatible with
Matlab.
In what follows it is presumed that you are acquainted with the most ba-
sic features of Matlab (or Octave, or Scilab), which you can learn with the
Getting started with MATLAB tutorials in the program's Documentation
Center.
Part I

Modelling

3
5

La ciencia jamás podrá descubrir todos los secretos de la naturaleza,


ya que la ciencia la hacen los hombres y éstos son parte de ella.

J. Juan Rosales García (1967 . . . ), pers. comm., Saint Petersburg, 2001,


qtd. in Ecuaciones diferenciales ordinarias (auth. Juan Rosales, Manuel Guía
Calderón)

In this part of the lecture notes:

Chapter 2 presents very handy mathematical tools for the resolution of dierential
equations, which we will need repeatedly in subsequent chapters.

Chapter 3 gives examples of mechatronic systems and signals, and the basic notions
related thereto.

Chapter 4 addresses the modelling of mechanical systems.

Chapter 5 addresses the modelling of electrical systems.

Chapter 6 addresses the modelling of uidic systems, a particular type of mechanical


systems.

Chapter 7 addresses the modelling of thermal systems.

Chapter 8 addresses the modelling of systems combining several of the components


studied in chapters 4 to 7, as well as of systems with nonlinear models.

Here is what you need to know beforehand to follow these chapters:

ˆ Dierential and integral calculus, up to the usual level of freshman courses


on Calculus;

ˆ Kinematics, dynamics, electrical circuits, uid mechanics, and heat trans-


fer, up to the usual level of freshman courses on Physics, or at least the
level of secondary education.
6
Chapter 2

The Laplace transform


And, if we transmit through a wormhole, the person is always re-
constituted at the other end. We can count on that happening, too.
There was a pause.
Stern frowned.
Wait a minute, he said. Are you saying that when you transmit,
the person is being reconstituted by another universe?
In eect, yes. I mean, it has to be. We can't very well reconstitute
them, because we're not there. We're in this universe.

Michael Crichton (1942 „2008), Timeline, Black rock

The Laplace transform is a very important tool for the resolution of dif- Laplace transform
ferential equations. In this chapter we will study its denition, its properties,
its application to dierential equations (which is the reason we are studying this
subject), and the related Fourier transform, that we will also need.

2.1 Denition
Denition 2.1. Let t ∈ R be a real variable, and f (t) ∈ R a real-valued
function. The Laplace transform of function f , denoted by L [f (t)] or by F (s),
is a complex-valued function F (s) ∈ C of complex variable s ∈ C, given by
Z +∞
L [f (t)] = f (t)e−st dt (2.1)
0

Remark 2.1. Strictly speaking, operation L is the Laplace transformation,


and the result of applying L to a function gives us its Laplace transform. But
it is common to call the operation itself Laplace transform as well.
Remark 2.2. In (2.1), function f (t) only has to be dened for t ≥ 0. This
would not be so if we were using the bilateral Laplace transform, which is Bilateral Laplace trans-
an alternative denition given by form

Z +∞
L [f (t)] = f (t)e−st dt (2.2)
−∞

This bilateral Laplace transform is seldom used; we will use (2.1) instead, as is
common, and will need (2.2) only in Chapter 37. The price to pay for being
able to work with functions dened in R+ only will be addressed below in
section 2.4.
Remark 2.3. The Laplace transform is part of a group of transforms known
as integral transforms, given by
Z +∞
T [f (t)] = f (t)K(s, t) dt (2.3)
0

where T is a generic transform and K(s, t) is a function called kernel. In the


case of the Laplace transform, the kernel is K(s, t) = e−st .

7
8 CHAPTER 2. THE LAPLACE TRANSFORM

The Laplace transform of function f (t) will only exist if the improper integral Existence of the Lap
in (2.1) converges. This will happen in one of two cases: transform

ˆ If f (t) is bounded in its domain R , the integrand f (t)e+ −st


will obviously
tend to 0 as t → +∞.
ˆ If f (t) tends to innity as t → +∞, but does so slower than e−st tends
to 0, the integrand will still tend to 0. More rigorously, f (t) must be of
exponential order, i.e. there must be positive real constants M, c ∈ R such
that
|f (t)| ≤ M ect , 0 ≤ t ≤ ∞. (2.4)

Otherwise, the integrand of (2.1) does not tend to 0 and it is obvious that the
improper integral will be innite. For complete rigour we also have to require
f (t) to be piecewise continuous for F (s) to exist, otherwise the Riemann integral
would not exist.
Remark 2.4. In fact (2.1) may converge only for some values of s, and thus have
a region of convergence which is smaller than C; but then it can be analytically
extended to the rest of the complex plane. This is a question we will not worry
about.

2.2 Finding Laplace transforms


Heaviside function Example 2.1. Let f (t) be function
(
1, if t ≥ 0
H(t) = , (2.5)
0, if t < 0

L [H(t)] known as the Heaviside function. Then


Z +∞ −st +∞
e e−∞ e0 1
L [H(t)] = 1×e −st
dt = = − = . (2.6)
0 −s 0 −s −s s

L [e−at ] Example 2.2. Let f (t) be a negative exponential, f (t) = e−at . Then
Z +∞
L e −at
e−at e−st dt

=
0
+∞
e−(a+s)t e−∞ e0

1
= =− − − = . (2.7)
−a − s 0 s+a s+a s+a
While Laplace transforms can be found from denition as in the two exam-
ples above, in practice they are found from tables, such as the one in Table 2.1.
To use with prot Laplace transform tables, it is necessary to prove rst the
following result.
L is linear Theorem 2.1. The Laplace transform is a linear operator:
L [k f (t)] = k F (s), k∈R (2.8)
L [f (t) + g(t)] = F (s) + G(s) (2.9)

Proof. Both (2.8) and (2.9) are proved from the linearity of the integration
operator:
Z +∞ Z +∞
L [k f (t)] = k f (t)e −st
dt = k f (t)e−st dt = k F (s) (2.10)
0 0
Z +∞
L [f (t) + g(t)] = (f (t) + g(t)) e−st dt (2.11)
0
Z +∞ Z +∞
= f (t)e−st dt + g(t)e−st dt = F (s) + G(s)
0 0

Example 2.3. The Laplace transform of f (t) = 5t is obtained from line 3 of


Table 2.1 together with (2.8):
5
L [5t] = 5L [t] = (2.12)
s2
2.2. FINDING LAPLACE TRANSFORMS 9

Table 2.1: Table of Laplace transforms

x (t) X (s)

1 δ (t) 1

1
2 H (t)
s
1
3 t
s2
2
4 t2
s3
1
5 e−at
s+a
a
6 1 − e−at
s (s + a)
1
7 te−at 2
(s + a)
n!
8 tn e−at , n ∈ N n+1
(s + a)
ω
9 sin (ωt)
s2 + ω 2
s
10 cos (ωt)
s2 + ω 2
ω
11 e−at sin (ωt)
(s + a)2 + ω 2
s+a
12 e−at cos (ωt) 2
(s + a) + ω 2
1 1
13 e−at − e−bt

b−a (s + a)(s + b)

1 1 1
14 b e−at − a e−bt

1+
ab a−b s(s + a)(s + b)
ωn −ξωn t ωn2
15 e sin (ωn Ξt)
Ξ s2 + 2ξωn s + ωn2
1 s
16 − e−ξωn t sin (ωn Ξt − φ)
Ξ s + 2ξωn s + ωn2
2

1 −ξωn t ωn2
17 1− e sin (ωn Ξt + φ)
Ξ 2
s (s + 2ξωn s + ωn2 )
p Ξ
In this table: Ξ = 1 − ξ 2 ; φ = arctan
ξ
10 CHAPTER 2. THE LAPLACE TRANSFORM

Example 2.4. The Laplace transform of f (t) = 1 − (1 + t)e−3t is obtained from


lines 6 and 7 of Table 2.1 together with (2.9):

L [f (t)] = L 1 − e−3t − te−3t = L 1 − e−3t − L te−3t


3 1 3s + 32 − s 2s + 9
= − 2 = 2 = 3 (2.13)
s (s + 3) (s + 3) s (s + 3) s + 6s2 + 9s

2.3 Finding inverse Laplace transforms


Inverse Laplace transform Laplace transform tables can also be used to nd inverse Laplace transforms,
i.e. nding the f (t) corresponding to a given F (s) = L [f (t)]. This operation
is denoted by f (t) = L −1 [F (s)].

Example 2.5. The inverse Laplace transform of F (s) = 10


s+10 is obtained from
line 5 of Table 2.1 together with (2.8):

10 1
L −1 = 10 L −1 = 10 e−10t (2.14)
s + 10 s + 10

Partial fraction expansion Example 2.6. The inverse Laplace transform of F (s) = s2 +13s+30 s+2
is obtained
from line 5 of Table 2.1 together with (2.8). But for that it is necessary to develop
F (s) in a partial fraction expansion. First we nd the roots of the polynomial
in the denominator, which are −3 and −10. So s2 + 13s + 30 = (s + 3)(s + 10),
and we can write
s+2 A B
= + (2.15)
s2 + 13s + 30 s + 3 s + 10
where A and B still have to determined:
A B As + 10A + Bs + 3B s(A + B) + (10A + 3B)
+ = = (2.16)
s + 3 s + 10 (s + 3)(s + 10) s2 + 13s + 30

Obviously we want that


( ( (
A+B =1 B =1−A B = 78
⇔ ⇔ (2.17)
10A + 3B = 2 10A + 3 − 3A = 2 A = − 17

s+2 − 17 8
So = + 7
, and nally
s2 + 13s + 30 s + 3 s + 10
1 8
−7

s+2
L −1
=L −1
+ 7
(2.18)
s2 + 13s + 30 s + 3 s + 10
1 8
−7 1 8
= L −1 + L −1 7
= − e−3t + e−10t
s+3 s + 10 7 7

Remark 2.5. Notice that the result in line 13 of Table 2.1 can be obtained
from line 5 also using a partial fraction expansion:

1 A B As + Ab + Bs + aB s(A + B) + (Ab + aB)


= + = =
(s + a)(s + b) s+a s+b (s + a)(s + b) (s + a)(s + b)
(2.19)

We want
( ( (
−1
A+B =0 B = −A B=
⇔ ⇔ b−a
1
(2.20)
Ab + aB = 1 Ab − aA = 1 A= b−a

and thus
" 1 # " −1 #
1 b−a b−a
L −1 =L −1
+L −1
(2.21)
(s + a)(s + b) s+a s+b
1 −at −1 −bt 1
e−at − e−bt

= e + e =
b−a b−a b−a
2.3. FINDING INVERSE LAPLACE TRANSFORMS 11

ial fraction expansion Example 2.7. The inverse Laplace transform of F (s) = 4s2 +13s−2
(s2 +2s+2)(s+4) is ob-
complex roots tained from lines 5, 15 and 16 of Table 2.1 together with 2.8 and 2.9. The
transforms in lines 14 and 15 are used because the roots of 4s2 + 13s − 2 are
complex and not real (−1 ± j , to be precise). So we will leave that second order
term intact and we make
4s2 + 13s − 2 As + B C As2 + 4As + Bs + 4B + Cs2 + 2Cs + 2C
2
= 2 + =
(s + 2s + 2)(s + 4) s + 2s + 2 s + 4 (s2 + 2s + 2)(s + 4)
s2 (A + C) + s(4A + B + 2C) + (4B + 2C)
= (2.22)
(s2 + 2s + 2)(s + 4)
Hence
   
A + C = 4
 C = 4 − A
 C = 4 − A
 C = 1

4A + B + 2C = 13 ⇔ 4A + B + 8 − 2A = 13 ⇔ 2A + B = 5 ⇔ A=3
   
4B + 2C = −2 4A − 3B = 15 4A − 3B = 15 B = −1
   
(2.23)
Finally,
4s2 + 13s − 2

3s − 1 1
L −1
=L −1
+ (2.24)
(s2 + 2s + 2)(s + 4) s2 + 2s + 2 s + 4

s 1 2 1
= 3L −1 2 − L −1 2 + L −1
s + 2s + 2 2 s + 2s + 2 s+4
and since for the rst two terms we have

ω= 2 (2.25)
ξω = 1 (2.26)
1
ξ=√ (2.27)
2
r
1 1
Ξ= 1− =√ (2.28)
2 2
ωΞ = 1 (2.29)
√1
2 π
ϕ = arctan = (2.30)
√1 4
2
we arrive at
4s2 + 13s − 2 √ −t
π 1 −t
L −1 = −3 2e sin t − − 2e sin(t) + e−4t
(s2 + 2s + 2)(s + 4) 4 2
h √ π π i
−4t −t
=e +e −3 2 sin t cos − cos t sin − sin t
4 4


−4t −t 1 1
=e +e −3 2 sin t √ − cos t √ − sin t
2 2
= e−4t + e−t (−4 sin t + 3 cos t) (2.31)
Remark 2.6. If in the example above we had decided to expand the second
order term and use only line 5 of Table 2.1, we would have arrived at the very
same result, albeit with more lengthy and tedious calculations involving complex
numbers. We would have to separate s23s−1
+2s+2 in two as follows:

3s − 1 A + Bj C + Dj
= + (2.32)
s2 + 2s + 2 s+1+j s+1−j
As + A − Aj + Bjs + Bj + B + Cs + C + Cj + Djs + Dj − D
=
s2 + s − js + s + 1 − j + js + j + 1
s(A + C) + js(B + D) + (A + B + C − D) + j(−A + B + C + D)
=
s2 + 2s + 2
Then
C = 23
  

 A+C =3 
 C =3−A 


B + D = 0 
D = −B 
D = 2
⇔ ⇔
A + B + C − D = −1 A + B + 3 − A + B = −1 B = −2

 
 

−A + B + C + D = 0 −A + B + 3 − A − B = 0 A = 32
  

(2.33)
12 CHAPTER 2. THE LAPLACE TRANSFORM

Consequently
3 3
4s2 + 13s − 2 2 − 2j

2 + 2j 1
L −1 =L −1
+ +
(s2 + 2s + 2)(s + 4) s+1+j s+1−j s+4

3 1 3 1 1
= − 2j L −1
+ + 2j L −1
+L −1
2 s+1+j 2 s+1−j s+4

3 3
= − 2j e−(1+j)t + + 2j e−(1−j)t + e−4t
2 2

−4t 3 −t 3
=e + − 2j e (cos(−t) + j sin(−t)) + + 2j e−t (cos t + j sin t)
2 2

−4t −t 3 3
=e +e cos t − j sin t − 2j cos t − 2 sin t+
2 2

3 3
+ cos t + j sin t + 2j cos t − 2 sin t
2 2
= e−4t + e−t (3 cos t − 4 sin t) (2.34)

Notice how all the complex terms appear in complex conjugates, so that the
imaginary parts cancel out. This has to be the case, since f (t) is a real-valued
function.
Partial fraction expansion Example 2.8. The inverse Laplace transform of F (s) = s2 +22s+119
(s+10)3 is obtained
with multiple roots from lines 5, 7 and 8 of Table 2.1 together with (2.8) and (2.9):

s2 + 22s + 119 A B C
3
= + 2
+
(s + 10) s + 10 (s + 10) (s + 10)3
2
As + 20As + 100A + Bs + 10B + C
= (2.35)
(s + 10)3

Hence
 
A = 1
 A = 1

20A + B = 22 ⇔ B=2 (2.36)
 
100A + 10B + C = 119 C = −1
 

Finally,
2
−1 s + 22s + 119 1 2 −1
L =L −1
+ + (2.37)
(s + 10)3 s + 10 (s + 10)2 (s + 10)3

1 2 1 −1 2
=L −1
+ 2L −1
− L
s + 10 (s + 10)2 2 (s + 10)3

−10t −10t 1 2 −10t −10t 1 2
=e + 2t e − t e =e 1 + 2t − t
2 2

Division of polynomials Example 2.9. The inverse Laplace transform of F (s) = 2s+145
s+70 is obtained
from lines 1 and 5 of Table 2.1, but for that it is necessary to begin by dividing
the numerator of F (s) by the denominator. Because the denominator is of rst
order, in this case polynomial division can be carried out with Runi's rule
(otherwise a long division would be necessary):

2 145
−70 −140 (2.38)
2 5

2s + 145 5
So =2+ , and nally
s + 70 s + 70

2s + 145 1
L −1 = 2L −1 [1] + 5L −1
s + 70 s + 70
= 2δ(t) + e−70t (2.39)

All polynomial operations mentioned in this sections can be performed with


Matlab using the following commands:
2.3. FINDING INVERSE LAPLACE TRANSFORMS 13

ˆ roots nds the roots of a polynomial, represented by a vector with its


coecients (in decreasing order of the exponent);

ˆ conv multiplies two polynomials, represented by two vectors as above;

ˆ residue performs polynomial division and partial fraction expansion, as


needed, for a rational function, given the numerator and denominator
polynomials represented by two vectors as above.

Example 2.10. The roots of s2 + 3s + 2 are −2 and −1: Matlab's command


roots
>> roots([1 3 2])
ans =
-2
-1

Example 2.11. The roots of 4s3 + 3s2 + 2s + 1 are −0.6058, −0.0721 + 0.6383j
and −0.0721 − 0.6383j :

>> roots([4 3 2 1])


ans =
-0.6058 + 0.0000i
-0.0721 + 0.6383i
-0.0721 - 0.6383i

Example 2.12. The product of s2 + 2s + 3 and 4s3 + 5s2 + 6s + 7 is 4s5 +


13s4 + 28s3 + 34s2 + 32s + 21: Matlab's command conv
>> conv([1 2 3],[4 5 6 7])
ans =
4 13 28 34 32 21

Example 2.13. The partial fraction expansion (2.18) from Example 2.6 is Matlab's command
obtained as residue
>> [r,p,k] = residue([1 2],[1 13 30])
r =
1.1429
-0.1429
p =
-10
-3
k =
[]
Vector r contains the residues or numerators of the fractions in the partial Residues
fraction expansion. Vector p contains the poles or roots of the denominator Poles
of the original expression. Vector k contains (the coecients of the polynomial
which is) the integer part of the polynomial division, which in this case is 0
because the order of the denominator is higher than the order of the numerator.
The polynomials of the original rational function can be recovered feeding
this function back vectors r, p and k:

>> [num,den] = residue(r,p,k)


num =
1 2
den =
1 13 30

Example 2.14. The partial fraction expansion (2.34) from Example 2.7 and
Remark 2.6 is obtained as
14 CHAPTER 2. THE LAPLACE TRANSFORM

>> [r,p,k] = residue([4 13 -2],conv([1 2 2],[1 4]))


r =
1.0000 + 0.0000i
1.5000 + 2.0000i
1.5000 - 2.0000i
p =
-4.0000 + 0.0000i
-1.0000 + 1.0000i
-1.0000 - 1.0000i
k =
[]

Example 2.15. The partial fraction expansion from Example 2.9 is obtained
as
>> [r,p,k] = residue([2 145],[1 70])
r =
5
p =
-70
k =
2
Notice how this time there is an integer part of the polynomial division, since
the order of the numerator is not lower than the order of the denominator.
Example 2.16. From
>> [r,p,k] = residue([1 2 3 4 5 6],[7 8 9 10])
r =
0.1451 + 0.0000i
-0.0276 - 0.2064i
-0.0276 + 0.2064i
p =
-1.1269 + 0.0000i
-0.0080 + 1.1259i
-0.0080 - 1.1259i
k =
0.1429 0.1224 0.1050
we learn that
s5 + 2s4 + 3s3 + 4s2 + 5s + 6
(2.40)
7s3 + 8s2 + 9s + 10
0.1451 −0.0276 − 0.2064j −0.0276 + 0.2064j
= 0.1429s2 + 0.1224s + 0.1050 + + +
s + 1.1269 s + 0.0080 − 1.1259j s + 0.0080 + 1.1259j

2.4 Important properties: derivatives and inte-


grals
Now that we know how to nd Laplace transforms, it is time to wonder why
we are studying them. To answer this, rst we have to establish some very
important results.
L of the derivative Theorem 2.2. If L [f (t)] = F (s), then
L [f 0 (t)] = s F (s) − f (0) (2.41)
Apply integration by parts uv = uv − u v to denition (2.1):
R 0 R 0
Proof.

u v0
Z +∞ z}|{ z}|{
L [f (t)] = f (t) e−st dt
0
+∞ Z +∞
e−st e−st

= f (t) − f 0 (t) dt
−s 0 0 −s
e−st e0 1 +∞ 0
Z
= lim f (t) − f (0) + f (t)e−st dt (2.42)
t→+∞ −s −s s 0
2.5. WHAT DO WE NEED THIS FOR? 15

The limit has to be 0, otherwise F (s) would not exist. The integral is, by
denition, L [f 0 (t)]. From here (2.41) is obtained rearranging terms.

Corollary 2.1. If L [f (t)] = F (s), then


L [f 00 (t)] = s2 F (s) − s f (0) − f 0 (0) (2.43)

Proof. Apply (2.41) to itself:

L [f 00 (t)] = s L [f 0 (t)] − f 0 (0) = s (s F (s) − f (0)) − f 0 (0) (2.44)

Then rearrange terms.

Corollary 2.2. If L [f (t)] = F (s), then


dn dn−1 f (t)

L n
f (t) = s F (s) − s n−1
f (0) − sn−2 0
f (0) − . . . −
dtn dn−1 t t=0
n
dk−1 f (t)
X
= sn F (s) − sn−k (2.45)
dtk−1 t=0
k=1

Proof. This is proved by mathematical induction. The rst case is (2.41). The
inductive step is proved applying (2.41) to (2.45) as follows:
n+1 n
dn f (t)

d d
L f (t) = s L f (t) − (2.46)
dtn+1 dtn dtn t=0
n
!
dk−1 f (t) dn f (t)

X
= s sn F (s) − sn−k −
dtk−1 t=0 dtn t=0
k=1
n k−1
!
dn f (t)

n−k+1 d f (t)
X
n+1
=s F (s) − s −
dtk−1 t=0 dtn t=0
k=1
n
!
k−1 k−1

n+1−k d f (t) n+1−k d f (t)
X X
n+1
=s F (s) − s − s
dtk−1 t=0 dtk−1 t=0
k=1 k=n+1

Theorem 2.3. If L [f (t)] = F (s), then L of the integral

Z t
1
L f (t) = F (s) (2.47)
0 s

Proof. In (2.42), make


Z t
f (t) = g(t) dt, (2.48)
0

whence f 0 (t) = g(t). Then


Z t Z 0 Z +∞
1 1
L g(t) dt = − g(t) dt + g(t)e−st dt (2.49)
0 0 −s s 0

The rst integral is 0, the second is L [g(t)].

Remark 2.7. Notice that the Laplace transform of a derivative (2.41) involves
f (0), the value of the function itself at t = 0. This is because we are using
the Laplace transform as dened by (2.1), rather than the bilateral Laplace
transform (2.2).

2.5 What do we need this for?


We are now in position of answering the question above: we need Laplace trans- Use L to solve dierential
forms as a very useful tool to solve dierential equations. equations

Example 2.17. Solve the following dierential equation, assuming that y(0) =
0:
y 0 (t) + y(t) = e−t (2.50)
16 CHAPTER 2. THE LAPLACE TRANSFORM

Apply the Laplace transform to obtain


1 1
L [y 0 (t) + y(t)] = L e−t ⇔ sY (s) + Y (s) =

⇔ Y (s) = ⇔
s+1 (s + 1)2

1
⇔ L −1 [Y (s)] = L −1 ⇔ y(t) = t e−t (2.51)
(s + 1)2
It is easy to verify that this is indeed the solution: y 0 (t) = e−t − t e−t , and thus

y 0 (t) + y(t) = e−t ⇔ e−t − t e−t + t e−t = e−t , (2.52)

as desired.
Notice how the Laplace transform turned the dierential equation in t into
an algebraic equation in s, which is trivial to solve. All that is left is to apply
the inverse Laplace transform to turn the solution in s into a solution in t.
Take care of non-null ini- Initial conditions must be taken into account if they are not zero.
tial conditions
Example 2.18. Solve the following dierential equation, assuming that y(0) =
1
3 and y 0 (0) = 0:
y 00 (t) + 4y 0 (t) + 3y(t) = 4et (2.53)
Using the Laplace transform, we get

2 1 1 4
s Y (s) − s − 0 + 4 sY (s) − + 3Y (s) = ⇔
3 3 s−1
s 4 4
⇔ Y (s) s2 + 4s + 3 − − = (2.54)
3 3 s−1
Because s2 + 4s + 3 = (s + 1)(s + 3), we get
4 1 s+4
Y (s) = + (2.55)
(s − 1)(s + 1)(s + 3) 3 (s + 1)(s + 3)
We now need two partial fraction expansions:

4 1 s+4 A B C 1 D E
+ = + + + +
(s − 1)(s + 1)(s + 3) 3 (s + 1)(s + 3) s−1 s+1 s+3 3 s+1 s+3
A(s + 4s + 3) + B(s + 2x − 3) + C(s2 − 1) 1 Ds + 3D + Es + E
2 2

= +
(s − 1)(s + 1)(s + 3) 3 (s + 1)(s + 3)
2

s (A + B + C) + s(4A + 2B) + (3A − 3B − C) 1 s(D + E) + (3D + E)
= +
(s − 1)(s + 1)(s + 3) 3 (s + 1)(s + 3)
(2.56)
whence
   
1
A + B + C = 0
 4A − 2B = 4
 8A = 4
 A = 2

4A + B = 0 ⇔ 4A + B = 0 ⇔ B = −2A ⇔ B = −1
C = 12
   
3A − 3B − C = 4 C = 3A − 3B − 4 C = 3A − 3B − 4
   
(2.57)
and
( ( (
D+E =1 E =1−D E = − 12
⇔ ⇔ (2.58)
3D + E = 4 2D = 3 D = 32

Thus
1 1 3 1
1 1
y(t) = L −1 2
+ 2 +
− 2
− 2 (2.59)
s−1 s+1 s+3 3 s+1 s+3

1 1 1 3 −t 1 −3t 1 1 1
= et − e−t + e−3t + e − e = et − e−t + e−3t
2 2 3 2 2 2 2 3
It is easy to verify that this is indeed the solution: on the one hand,
1 t 1 −t
y 0 (t) = e + e − e−3t (2.60)
2 2
1 1 −t
y 00 (t) = et − e + 3e−3t (2.61)
2 2
2.6. MORE IMPORTANT PROPERTIES: INITIAL AND FINAL VALUES, CONVOLUTION 17

and thus
1 t 1 −t 3 3
y 00 (t) + 4y 0 (t) + 3y(t) = e − e + 3e−3t + 2et + 2e−t − 4e−3t + et − e−t + e−3t
2 2 2 2
= 4e t
(2.62)
as desired; on the other hand,
1 1 1 1
y(0) = − + = (2.63)
2 2 3 3
1 1
y 0 (t) = + − 1 = 0 (2.64)
2 2
as required.
Remark 2.8. Notice what would have happened if we had forgot to include
initial conditions. It would have been as if initial conditions were null, and we
would have got
4 4
s2 Y (s) + 4sY (s) + 3Y (s) = ⇔ Y (s) s2 + 4s + 3 = (2.65)

s−1 s−1
and then
1 1
1 1 1
y(t) = L −1 2
− + 2 = et − e−t + e−3t (2.66)
s−1 s+1 s+3 2 2
In this case,
1 t 3
y 0 (t) = e + e−t − e−3t (2.67)
2 2
1 9
y 00 (t) = et − e−t + e−3t (2.68)
2 2
and so it remains true that
1 9 12 −3t 3 t 3
y 00 (t) + 4y 0 (t) + 3y(t) = et − e−t + e−3t + 2et + 4e−t − e + e − 3e−t + e−3t
2 2 2 2 2
= 4et (2.69)
but the initial conditions are indeed
1 1
−1+ =0
y(0) = (2.70)
2 2
1 3
y 0 (t) = + 1 − = 0 (2.71)
2 2
To conclude: if in fact initial conditions were as in Example 2.18, and if we had
written (2.65) instead of (2.54), we would get a wrong result.

2.6 More important properties: initial and nal


values, convolution
Before we are done with Laplace transforms, we must establish some additional
important properties that will often be needed.
Theorem 2.4. If f (t) and f 0 (t) have Laplace transforms, Final value theorem

lim f (t) = lim s F (s) (2.72)


t→+∞ s→0

provided that limt→+∞ f (t) ∈ R.


Proof. Apply a limit to (2.41) to get
lim L [f 0 (t)] = lim (s F (s) − f (0))
s→0 s→0
Z +∞
⇔ f (0) + lim f (t)e−st dt = lim s F (s)
0
s→0 0 s→0
Z +∞
lim f 0 (t)e−st dt = lim s F (s)

⇔ f (0) +
0 s→0 s→0
Z +∞
⇔ f (0) + f 0 (t) dt = lim s F (s)
0 s→0

⇔ f (0) + lim f (t) − f (0) = lim s F (s) (2.73)


t→+∞ s→0
18 CHAPTER 2. THE LAPLACE TRANSFORM

Example 2.19. Let f (t) = e−at , a > 0. We know that limt→+∞ f (t) = 0. We
have F (s) = s+a
1
. And lims→0 s F (s) = lims→0 s+a s
= 0.
Notice that, when a < 0, it is still true that F (s) = s+a
1
and that lims→0 s F (s) =
lims→0 s+a = 0. But now limt→+∞ f (t) = +∞, which is not real.
s

Example 2.20. Let F (s) = s(s+a) , a > 0. We


1
have lims→0 s F (s) = lims→0 s+a
1
=
a. At the same time, f (t) = a (1 − e−at ), and limt→+∞ f (t) = a .
1 1 1

When a < 0, we are in a situation similar to that of the former example: we


still have lims→0 s F (s) = a1 , but limt→+∞ f (t) = +∞.

Initial value theorem Theorem 2.5. If f (t) and f 0 (t) have Laplace transforms,
lim f (t) = lim s F (s) (2.74)
t→0+ s→+∞

provided that lims→+∞ s F (s) ∈ R.

Proof. Apply a limit to (2.41) to get

lim L [f 0 (t)] = lim (s F (s) − f (0))


s→+∞ s→+∞
Z +∞
⇔ f (0) + lim 0
f (t)e−st dt = lim s F (s) (2.75)
s→+∞ 0 s→+∞

In the integrand, e−st goes to zero as s → +∞. If f 0 (t) has a Laplace trans-
form, it must be of exponential
R +∞ 0 order, and thus e−st goes to zero faster enough
to ensure that lims→+∞ 0 f (t)e −st
dt = 0. Because we are assuming the uni-
lateral Laplace transform denition, f (0) is in reality limt→0+ f (t), as whatever
may happen for t < 0 is not taken into account.

Example 2.21. Let f (t) = e−at . We know that limt→0+ f (t) = 1. We have
1
F (s) = s+a . And lims→+∞ s F (s) = lims→0 s+a
s
= 1.
Notice that, unlike what happened when we applied the nal value theorem
in Example 2.19, there is now no need to restrict a > 0.

Example 2.22. Let F (s) = s(s+a) . We have lims→+∞ s F (s) = lims→+∞ s+a =
1 1

0. At the same time, f (t) = 1


a (1 − e
−at
), and limt→+∞ f (t) = 0. There is again
no need now to make a > 0.

Convolution Denition 2.2. Given two functions f (t) and g(t) dened for t ∈ R+ , their
convolution, denoted by ∗, is a function of t given by
Z t
f (t) ∗ g(t) = f (t − τ )g(τ ) dτ (2.76)
0

Theorem 2.6. Convolution is commutative.


Proof.Use the change of variables t = t − τ , for which dτ = −dt. With this
change of variables, when τ = 0 we have t = t, and when τ = t we have t = 0.
Apply this to (2.76) to get
Z t
f (t) ∗ g(t) = f (t − τ )g(τ ) dτ
0
Z 0
=− f (t)g(t − t) dt
t
Z t
= f (τ )g(t − τ ) dτ = g(t) ∗ f (t) (2.77)
0

Theorem 2.7. If these Laplace transforms exist,


L [f (t) ∗ g(t)] = F (s) G(s) (2.78)

Proof.

Z +∞ Z t
L [f (t) ∗ g(t)] = f (t − τ )g(τ ) dτ e−st dt (2.79)
0 0
2.7. THE FOURIER TRANSFORM 19

We can change the limits of integration of the inner integral by including a


Heaviside function H(t − τ ):
Z +∞ Z +∞
L [f (t) ∗ g(t)] = f (t − τ )H(t − τ )g(τ ) dτ e−st dt (2.80)
0 0

H(t − τ ) = 1 if t − τ ≥ 0 ⇔ τ ≤ t, which is the range of values in (2.79). But


H(t − τ ) = 0 if t − τ < 0 ⇔ τ > t, the additional range of values added in
(2.79), which thus does not change the result. We can now change the order of
integration:
Z +∞ Z +∞
L [f (t) ∗ g(t)] = f (t − τ )H(t − τ )g(τ ) dτ e−st dt
0 0
Z +∞ Z +∞
= f (t − τ )H(t − τ )g(τ )e−st dt dτ
0 0
Z +∞ Z +∞
= g(τ ) f (t − τ )H(t − τ )e−st dt dτ (2.81)
0 0

We now apply to the inner integral the change of variables t = t − τ , for which
dt = dt. With this change of variables, when t = 0 we have t = −τ , and when
t → +∞ we have t → +∞ too.
Z +∞ Z +∞
L [f (t) ∗ g(t)] = g(τ ) f (t)H(t)e−s(τ +t) dt dτ (2.82)
0 −τ

We have H(t) = 1 if t ≥ 0 and H(t) = 0 if t < 0, so the integration limits can


be changed accordingly:
Z +∞ Z +∞
L [f (t) ∗ g(t)] = g(τ ) f (t)e−sτ e−st dt dτ (2.83)
0 0

All that is left is taking outside integrals terms that do not depend on the
corresponding variables:
Z +∞ Z +∞
L [f (t) ∗ g(t)] = g(τ )e−sτ f (t)e−st dt dτ
0 0
Z +∞ Z +∞
= f (t)e−st dt g(τ )e−sτ dτ (2.84)
0 0

and these integrals are the denitions of F (s) and G(s).

Example 2.23. From L −1 1s = H(t) we get


Z t Z t
1 −1 1 1
L −1 = L = H(t − τ )H(τ ) dτ = 1 dτ = t (2.85)
s2 s s 0 0

Remark 2.9. The function obtained is known as the unit slope ramp: Unit slope ramp
(
t, if t ≥ 0
f (t) = (2.86)
0, if t < 0

Table 2.2 gives a list of important properties of the Laplace transform.

2.7 The Fourier transform


Denition 2.3. If F (s) is the Laplace transform of f (t), then the Fourier Fourier transform
transform of f (t), denoted by F [f (t)], is the restriction of F (s) to purely
imaginary values of s, i.e. to the imaginary axis of the complex plane, and

F [f (t)] = L [f (t)]|s=jω = F (jω), ω ∈ R (2.87)

See Figure 2.1.

Remark 2.10. Notice that:


20 CHAPTER 2. THE LAPLACE TRANSFORM

Table 2.2: Laplace transform properties

x (t) X (s)

1 Ax1 (t) + Bx2 (t) AX1 (s) + BX2 (s)


s
2 ax (at) X
a
3 eat x (t) X (s − a)

x (t − a) t > a
4 e−as X (s)
0 t<a
dx (t)
5 sX (s) − x(0)
dt
d2 x (t)
6 s2 X (s) − sx(0) − x0 (0)
dt2
dn x (t)
7 sn X (s) − sn−1 x(0) − . . . − x(n−1) (0)
dtn
dX (s)
8 −tx (t)
ds
d2 X (s)
9 t2 x (t)
ds2
dn X (s)
10 (−1)n tn x (t)
dsn
Zt
1
11 x (u) du X (s)
s
0
Zt Zt Zt
(t − u)(n−1) 1
12 ··· x (u) du = x (u) du X (s)
(n − 1)! sn
0 0 R0t
13 x1 (t) ∗ x2 (t) = 0
x1 (u) x2 (t − u) du X1 (s) X2 (s)

Z∞
1
14 x (t) X (u) du
t
s
ZT
1
15 x (t) = x (t + T ) e−su X (u) du
1 − e−sT
0
16 x (0) lim sX (s)
s→∞

17 x (∞) = lim x (t) lim sX (s)


t→∞ s→0

=[s]

jω, ω ∈ R+

jω, ω = 0
<[s]

jω, ω ∈ R−

Figure 2.1: The imaginary axis in the complex plane.


2.7. THE FOURIER TRANSFORM 21

ˆ f (t) is a real-valued function that depends on a real variable: f (t) ∈ R,


and t ∈ R;

ˆ the Laplace transform of f (t), which is F (s) = L [f (t)], is a complex-


valued function that depends on a complex variable: F (s) ∈ C, and s ∈ C;

ˆ the Fourier transform of f (t), which is F (jω) = F [f (t)], is a complex-


valued function that depends on a real variable, that is the coordinate
along the imaginary axis: F (jω) ∈ C, and ω ∈ R.

Example 2.24. Let f (t) = e−t − e−10t . Then


9
F (s) = (2.88)
(s + 1)(s + 10)
9
F (jω) =
(jω + 1)(jω + 10)
9
=
(10 − ω 2 ) + j11ω

9 (10 − ω 2 ) − j11ω
=
((10 − ω 2 ) + j11ω) ((10 − ω 2 ) − j11ω)

9 10 − ω 2 − j99ω
= 2
(10 − ω 2 ) + 121ω 2
90 − 9ω 2 −99ω
= 4 +j 4 (2.89)
ω + 101ω 2 + 100 ω + 101ω 2 + 100

Example 2.25. Let F (jω) = ω0


ω02 −ω 2
,
where ω0 is a real constant. The function Inverse Fourier transform
f (t) of which F (jω) is the Fourier transform is the inverse Fourier transform
of F (jω), and is given by

ω0 ω0
f (t) = F −1 [F (jω)] = F −1 = F −1
ω02 − ω 2 ω02 + (jω)2

ω0
= L −1 = sin (ω0 t) (2.90)
ω02 + s2

While it should now be clear what we need Laplace transforms for, we will
only see what we need Fourier transforms for in chapter 10. A more detailed
study of this transform is found in Chapter 38.

Glossary
I said it in Hebrew I said it in Dutch
I said it in German and Greek:
But I wholly forgot (and it vexes me much)
That English is what you speak!

Lewis Carroll (1832 „1898), The hunting of the Snark, 4

bilateral Laplace transform transformada de Laplace bilateral


convolution convolução
dierential equation equação diferencial
exponential order function função de ordem exponencial
Fourier transform transformada de Fourier
integral transform transformada integral
Laplace transform transformada de Laplace
Laplace transformation transformação de Laplace
partial fraction expansion expansão em frações parciais
pole polo
polynomial division divisão de polinómios
residue resíduo
22 CHAPTER 2. THE LAPLACE TRANSFORM

Exercises
1. Find the Laplace transforms of the following functions:

(a) f (t) = 80e−0.9t


(b) f (t) = 1000 − e−6t
(c) f (t) = 97.5 × 10−3 sin(0.2785t) + 546.9 × 10−3 e0.9575t cos(0.9649t)
(d) f (t) = sin 5t + π6 Hint: remember that sin(a + b) = sin a cos b +

cos a sin b.

2. Find the inverse Laplace transforms of the following functions:

(a) F (s) = 1
3s2 +15s+18

(b) F (s) = 1
5s2 +6s+5
8s2 +34s−2
(c) F (s) = s3 +3s2 −4s
s2 +2s+8
(d) F (s) = 2s+4
−s2 +5s−2
(e) F (s) = s3 −2s2 −4s+8

3. Consider dierential equation (2.50) from Example 2.17, but now with the
initial condition y(0) = 2.
h i
(a) Show that y(t) = L −1 (s+1)2s
2 + (s+1)2 .
3

(b) Show from (2.41) that L [e−t (1 − t)] = (s+1)2 .


s

(c) Find y(t) and check that it veries both the dierential equation
(2.50) and the new initial condition.

4. Solve the following dierential equations:

(a) y 00 (t) + y(t) = t e−t , y(0) = 0, y 0 (0) = 0


(b) y 00 (t) + y(t) = t e−t , y(0) = 12 , y 0 (0) = − 12
(c) y 00 (t) + y(t) = 10t − 20, y(0) = 0, y 0 (0) = 0
(d) 3y 00 (t) + 7y 0 (t) + 2y(t) = 0, y(0) = −5, y 0 (0) = 10

5. Use the nal value and initial value theorems to nd the initial and nal
values of the inverse Laplace transforms of the functions of Exercise 2.

6. Find the Fourier transforms of the functions of exercises 1 and 2, putting


them in the form F (jω) = < [F (jω)] + j= [F (jω)].

7. Prove the result in line 7 of Table 2.1. Hint: use (2.78) together with the
result in line 5.

8. Prove the result in line 8 of Table 2.1. Hint: use mathematical induction.
Chapter 3

Examples of mechatronic
systems and signals
Eia comboios, eia pontes, eia hoteis à hora do jantar,
Eia aparelhos de todas as espécies, férreos, brutos, mínimos,
Instrumentos de precisão, aparelhos de triturar, de cavar,
Engenhos, brocas, máquinas rotativas !
Eia ! eia ! eia !
Eia electricidade, nervos doentes da Matéria !
Eia telegraa-sem-os, simpatia metálica do Inconsciente !

Álvaro de Campos, heteronym of Fernando Pessoa (1888 „1935), Ode


triunfal, Orpheu, I 1, JanuaryMarch 1915

In this chapter we discuss dierent types of mechatronic signals and systems,


and present examples of each.

3.1 Systems
In chapter 1 we have already dened system as the part of the Universe we want
to study.
A system made up of physical components may be called a plant. A system Plant
which is a combination of operations may be called a process. Process

Example 3.1. WECs, mentioned in Example 1.1, are plants. Figures 3.1, 3.2
and 3.3 show three dierent WECs; many other such devices exist.

Example 3.2. If we want to study the wave elevation at a certain onshore


location as a function of the weather on the middle of the ocean, we will be
studying a process.

The variables describing the characteristics of the system that we are inter-
ested in are its outputs. The variables on which the outputs depend are the Outputs
system's inputs. Inputs in the general sense

Figure 3.1: The Pelamis, a oating near-shore Wave Energy Con-


verter, at Aguçadoura, Portugal (source: left, Wikimedia; right, DOI
10.1155/2013/186056). Waves cause an angular movement of the several sec-
tions of the device. This movement pumps oil in a closed circuit; high pressure
oil is then used to run a turbine driving a usual rotational generator.

23
24CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.2: The Archimedes Wave Swing, a submerged oshore Wave Energy
Converter before submersion, at Viana do Castelo, Portugal. The device is lled
with air which is compressed when wave crests pass and expands during wave
troughs. The heaving movement of the AWS upper part moves an electrical
linear generator.

Figure 3.3: The Pico Power Plant (concluded in 1999, decommissioned in 2018),
an onshore Wave Energy Converter of the Oscillating Water Column (OWC)
type (source: left, WavEC; right, DOI 10.3390/en11112939). In an OWC, the
heaving movement of the water inside a chamber compresses and expands the
air, which can ow in and out the chamber through a turbine designed to always
rotate in the same direction irrespective of the sense of the ow. The turbine
drives a usual rotational generator.
3.1. SYSTEMS 25

Figure 3.4: A Panhard & Levassor Type A motorcar, the rst mass produced
car in the world, driven by the French priest Jules Gavois (1863 „1946) in
1891 (source: Wikimedia). This car still does not have a steering wheel (rst
introduced in 1894), but only a tiller.

Figure 3.5: A window unit air conditioning system (source: Wikimedia). There
are many other types of AC units.

Example 3.3. An internal combustion engine motorcar (see Figure 3.4) is a


plant. We are usually interested in its position, velocity, and attitude. We also
may want to know the rotation speed of the motor, the temperature of the oil,
the fuel consumption, or other such values. All these are outputs. They depend
on the position of the steering wheel, the position of the accelerator and brake
pedals, the gear selected, the condition and inclination of the road the car in
running on, the direction and speed of the wind, the outside temperature, and
other such values. These are the inputs. Not all the outputs depend on all the
inputs.

A control system is one devised to make one or more of the system's Control system
outputs follow some reference. Reference

Example 3.4. An air conditioning (AC) unit (see Figure 3.5) is a mechatronic
system that heats or cools a room to a temperature set by the user. It is
consequently a control system. The value of the temperature selected by the
AC user is the reference. The room's temperature is the output of the plant
that has to follow this reference.

Example 3.5. The wind at the location of a wind turbine is related to the
temperature, the solar exposition, and the atmospheric pressure, among other
variables. This is a process we cannot control. It is not a control system.

For a control system to exist, it must be possible to modify one or more


of the inputs, so as to aect the desired outputs and thereby cause them to
follow the reference. Such inputs are called manipulated variables or inputs
in the strict sense. The inputs of the system that cannot be modied are Inputs in the strict sense
called disturbances. When studying control systems, it is usual to call simply Disturbances
26CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.6: A lever, an example of a linear SISO system without dynamics


(source: Wikimedia).

inputs to the inputs in the strict sense, and to call outputs only to the variable
or variables that have to follow a reference.
Example 3.6. In the case of the OWC from Example 3.1 and Figure 3.3, the
sea waves are disturbances, since we cannot control them. The rotation speed
of the turbine is an input in the strict sense, since we can manipulate it (e.g.
varying the resistance of the electrical generator). If the OWC chamber has
a relief valve, the pressure in the chamber will be also an input, since we can
change it opening or closing the relief valve.
Example 3.7. In the case of the car from Example 3.3, the positions of the
steering wheel and of the pedals are inputs. If the car has a manual gear box, the
gear selected is an input too; if the gear box is automatic, it is not. The gusts
of wind are a disturbance, since we cannot modify them. If we are studying the
temperature of the motor of the car, this will depend on the outside temperature,
which we cannot control and is therefore a disturbance.
A system with only one input and only one output is a Single-Input, Single-
SISO system Output (SISO) system. A system with more than one input and more than one
MIMO system output is a Multi-Input, Multi-Output (MIMO) system. It is of course possible
to have Single-Input, Multiple-Output (SIMO) systems, and Multiple-Input,
Single-Output (MISO) systems. These are usually considered as particular
cases of MIMO systems.
Example 3.8. Both the OWC of Example 3.1 and the car of Example 3.3 are
MIMO plants.
Example 3.9. The lever in Figure 3.6 is a SISO system: if the extremities are
at heights x(t) and y(t), and the rst is actuated, then y(t), the output, depends
on position x(t), the input, and nothing more.
Remark 3.1. We can sometimes model a part of a MIMO system as a separate
SISO system. A car is a MIMO system, as we said, but we can model the
suspension of one wheel separately, as a SISO system relating the position of the
wheel to the position of the vehicle frame, neglecting the inuence that all the
other inputs have on this particular output. Such a model is an approximation,
but for many purposes it is good enough (as we will see in Example 4.2, in
Chapter 4 below).
Model A system's model is the mathematical relation between its outputs, on the
one hand, and its inputs in the general sense (inputs in the strict sense and
disturbances), on the other.
Linear system A system is linear if its exact model is linear, and non-linear if its exact
Non-linear system model is non-linear. Of course, exact non-linear models can be approximated
by linear models, and often are, to simplify calculations.
Example 3.10. The lever of Figure 3.6 is a linear plant, since, if its arm lengths
are Lx and Ly for the extremities at heights x(t) and y(t) respectively,
Ly
y(t) = x(t). (3.1)
Lx
Example 3.11. A Cardan joint (see Figure 3.7) connecting two rotating shafts,
with a bent corresponding to angle β , is a non-linear plant, since a rotation of
θ1 (t) in one shaft corresponds to a rotation of the other shaft given by
tan θ1 (t)
θ2 (t) = arctan . (3.2)
cos β
3.1. SYSTEMS 27

Figure 3.7: A Cardan joint, a non-linear mechanical system without dynamics


(source: Wikimedia).

If β ≈ 0, (3.2) can be approximated by

tan θ1 (t)
θ2 (t) = arctan = θ1 (t). (3.3)
1
The error incurred in approximating (3.2) by (3.3) depends on how close cos β
is to 1. There will be no error at all if the two shafts are perfectly aligned
(β = 0).

Example 3.12. A car is also an example of a non-linear plant, as any driver


knows.

A system is time-varying if its exact model changes with time, and time- Time-varying system
invariant otherwise. Time-invariant system

Example 3.13. An airplane consumes enormous amounts of fuel. Thus its


mass changes signicantly from take-o to landing. Any reasonable model of a
plane will have to have a time-varying mass. But it is possible to study a plane,
for a short period of time, using an approximation consisting of a time-invariant
model, as the mass variation is neglectable in that case.

Example 3.14. A drone powered by a battery will not have a similar variation
of mass. It is a time-invariant system (unless e.g. its mass changes because it is
a parcel-delivering drone).

Example 3.15. WECs can have time-varying parameters due to the eects of
tides. This is the case of the AWS in Figure 3.2, which is submerged and xed
to the ocean bottom. Consequently, the average height of sea water above it
varies from low tide to high time, even if the sea waves remain the same. Other
WECs are time-invariant, at least with respect to tides. That is the case of the
oating OWC in Figure 3.8, which, precisely because it oats, is not aected by
tides.

A system has no dynamics if its outputs in a certain time instant do not


depend on past values of the inputs or on past values of the disturbances. Oth-
erwise, it is a dynamic system. A system without dynamics is called static Dynamic system
system, which does not mean that it never changes; it means that, if its inputs Static system
do not change, neither do the outputs.

Example 3.16. Both mechanical systems in Figures 3.6 and 3.7 have no dy-
namics, since the output y(t) only depends on the current value of the input
u(t). Past values of the input are irrelevant.

Example 3.17. Consider a pipe with a tap (or a valve) that delivers a ow
rate Q(t) given by
Q(t) = kQ f (t) (3.4)
where f (t) ∈ [0, 1] is a variable that tells is if the tap is open (f (t) = 1) or closed
(f (t) = 0). This system is static. But a tap placed far from the point where the
ow exits the pipe will deliver a ow given by

Q(t) = kQ f (t − τ ) (3.5)

Here, τ is the time the water takes from the tap to the exit of the pipe. This is
an example of a dynamic plant, since its output at time instant t depends on a
past value of f (t).
28CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.8: A oating OWC (source: DOI 10.1016/j.energy.2016.06.054).

A system is deterministic if the same inputs starting from the same initial Deterministic system
condition always lead to the same output. A system is stochastic if its outputs Stochastic system
are not necessarily the same when it is subject to the same inputs beginning
with the same initial conditions, or, in other words, if its output is random.

Example 3.18. The process from Example 3.5 is stochastic. Even though we
may know all those variables, it is impossible to precisely predict the wind speed.
The same happens with the process from Example 3.2, and even more so.

Example 3.19. Figure 3.9 shows a laboratory setup to test controllers for the
lithography industry (which produces microchips with components positioned
with precisions of the order of 1 nm). This is a deterministic system. If lithog-
raphy plants and processes were not deterministic, it would be far more dicult
to mass produce microchips.

In this course we will only address deterministic, SISO, linear time-invariant


LTI systems (LTI) systems.

3.2 Signals
In chapter 1 we have already dened signal as a function of time or space that
conveys information about a system. In other words, it is the evolution with
time or with space of some variable that conveys information about a system.
Most of the signals we will meet depend on time but not on space.

Example 3.20. An image given by a camera is a signal that depends on space,


but not on time. A video is a signal that depends on both space and time.

Quantised signal Some signals can only take values in a discrete set; they are called quantised
Analogical signal signals. Others can take values in a continuous set; they are called analogical
signals.
Example 3.21. Consider a turbine, such as the turbine in Figure 3.10, of the
Wells type, installed in the Pico Power Plant (shown above in Figure 3.3). Its
rotation speed is real valued; it takes values in a continuous set. So the signal
consisting in the turbine's rotation speed as a function of time is an analogical
signal.
3.2. SIGNALS 29

Figure 3.9: Left: precision positioning system used at the Delft University of
Technology (source: DOI 10.1007/s11071-019-05130-2). Coil actuators 1 move
masses 2, which are connected through exures to mass 3, the position of which
is measured using sensors (encoders) 4. Mass 2 can be positioned with a preci-
sion of 1 µm or less. Right: NASA clean room for lithography (source: Wiki-
media).

Figure 3.10: The Wells turbine of the Pico Power Plant OWC in Figure 3.3
(source: DOI 10.1016/j.renene.2015.07.086).
30CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.11: Three-speed manual gearbox, typical of cars in the 1930s (source:
Wikimedia).

Example 3.22. Consider the gearbox of a car (see Figure 3.11). The signal
consisting in the speed engaged as a function of time (neutral, reverse, 1st, 2nd,
etc.) takes values in a discrete set. It is a quantised signal.
Remark 3.2. It is possible, and sometimes desirable, to approximate a quan-
tised signal by an analogical signal, and vice-versa.
Example 3.23. The rotation of a shaft θ(t) is an analogical signal; it is of course
possible to rotate the shaft by an angle as small as desired. But it is often useful
to replace it by a discrete signal ϑ(t) which is the number of revolutions (i.e. the
number of 360◦ jrotations
k of the shaft). This corresponds to an approximation
θ(t)
given by ϑ(t) = 360◦ . Figure 3.12 shows a mechanical revolution counter.

Example 3.24. A population be it the number of persons in a country, the


number of rabbits in a eld, or the number of bacteria on a Petri dish is a
quantised signal. It always increases or decreases in multiples of one, since it is
impossible that half a child be born, or that 34 of a rabbit dies. However, if the
population is large enough, a variation of one individual is so small that it is
possible to assume that it is an analogical signal, and write equations such as
dp(t)
= b(t)p(t) − d(t)p(t), (3.6)
dt
where p(t) is the population, b(t) is the birth rate, and d(t) is the death rate.
(Terms for immigration and emigration rates must be included if the popula-
tion is not isolated.) Such models (and others more complicated, that we will
mention in passing below in Chapter 43) are used for instance in Bioengineering
and in many other areas.
Example 3.25. Strictly speaking, variables such as the fuel admitted to one of
the cylinders of an internal combustion engine are also quantised, since the num-
3.2. SIGNALS 31

Figure 3.12: Mechanical 19th century revolution counter, from the former Bar-
badinhos water pumping station (currently the Water Museum), Lisbon. Nowa-
days mechanical revolution counters are still used, though electronic ones exist.

ber of molecules of fuel admitted is integer. Of course, in practice an analogical


value is assumed.

Some signals take values for all time instants: they are said to be continu- Continuous signal
ous. Others take values only at some time instants: they are said to be discrete Discrete signal
in time, or, in short, discrete. The time interval between two consecutive values
of a discrete signal is the sampling time. The sampling time may be variable Sampling time
(if it changes between dierent samples), or constant. In the later case, which
makes mathematical treatment far more simple, the inverse of the sampling time
is the sampling frequency. Sampling frequency

Example 3.26. The air pressure inside the chamber of an OWC is a continuous
signal: it takes a value for every time instant.

Example 3.27. The number of students attending the several classes of this
course along the semester is a discrete signal: there is a value for each class, and
the sampling time is the time between consecutive classes. The sampling time
may be constant (if there is e.g. one laboratory class every Monday) or variable
(if there are e.g. two lectures per week on Mondays and Wednesdays).

Example 3.28. One of the controllers used with the laboratory setup from
Example 3.19 in Figure 3.9 provided a discrete control action with sampling
frequency 20 kHz. So the sampling time was
1
Ts = = 50 × 10−6 s = 50 µs, (3.7)
20 × 103

or, in other words, every 50×10−6 s the control action for the coil actuators was
updated; or, again, the control action was updated 20 × 103 times per second.
The sampling frequency could also be given as

ωs = = 2π × 20 × 103 = 125.7 × 103 rad/s. (3.8)
50 × 10−6
Remark 3.3. Mind the numerical dierence between the value of the sampling
frequency in Hertz and in radians per second. It is a common source of mistakes
in calculations.

Remark 3.4. It is possible, and sometimes desirable, to approximate a discrete


signal by a continuous signal, and vice-versa. Approximating a continuous signal
by a discrete one is an operation called discretisation. We will study this issue Discretisation
in more detail below in Chapters 12 and 25.

Example 3.29. The control action from Example 3.28 had in fact to be con-
verted into a continuous signal to be applied by the coil actuators. As described,
this was done by keeping the control action signal constant between sampling
times. The operation corresponds to converting a discrete signal as seen in
the left of Figure 3.13 into a continuous signal as seen in the right diagram of
that Figure. The conversion of a digital signal into an analogical signal will be
addressed in detail in Chapter 25.
32CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.13: Left: discrete signal; right: continuous signal obtained from the
discrete signal by keeping the previous value between sampling times (source:
Wikimedia, modied).

Figure 3.14: Discretising a signal (source: Wikimedia), i.e. approximating a


continuous signal (grey) by a discrete one (red).

Example 3.30. Figure 3.14 illustrates the operation of discretisation.

A signal which is both discrete and quantised is a digital signal. Digital signal
A system, too, is said to be continuous, discrete, or digital, if all its inputs Continuous system
and outputs are respectively continuous, discrete, or digital. Discrete system
Electronic components are nowadays ubiquitous. As a result of sensors, Digital system
actuators, controllers, etc. being electronic, most signals are digital. Likewise,
systems that incorporate such components are digital, inasmuch their inputs
and outputs are all digital.

Example 3.31. Consider an industrial oven, seen in Figure 3.15, with a control
system to regulate its temperature. The output of this system is the actual
temperature inside the oven, and the input is the desired temperature (i.e. the
reference of the control system). The oven is heated by gas, and so the gas ow is
the manipulated variable that allows controlling the oven. This is a continuous
system, since all variables exist in all time instants. But, in all likelihood, a
digital sensor will be used for the temperature, and changes in gas ow will also
take place at sampling times, after the temperature reading is compared with
the reference and processed to nd the control action that will better eliminate
the error between actual and desired temperatures. So in practice the system
will probably be digital.

Example 3.32. A ush tank for a toilet equipped with a oat valve as seen
in the top scheme of Figure 3.16 is a control system devoid of any electronic
component, and for which all signals are continuous. (See also Figure 3.17.)
This is a continuous control system.

Bounded signal A signal is bounded if it can only assume values in a bounded interval. In
engineering, most signals (if not all) are bounded.

Example 3.33. The wave elevation at given coordinates cannot be less than
the depth of the sea there. Similarly, the rotation speed of a turbine, or the
linear velocity of a shaft, or a voltage in a circuit, are always limited by physical
constraints.

Remark 3.5. Bounded continuous signals can assume innite values, but bounded
quantised signals can only assume a nite number of values.
3.2. SIGNALS 33

Figure 3.15: Industrial oven for aircraft component manufacture (source: Wiki-
media).

Figure 3.16: Top: oat valve mechanism, well known by its use in ush tanks
(source: Wikimedia). Bottom: ush tank with a oat valve (notice that the lever
has two arms, to increase the speed with which the water ow is interrupted as
soon as the oat raises the level from the lower end of stroke).
34CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.17: Top: a oat valve (see Figure 3.16) was also used in water me-
ters devised by António Pinto Bastos in the 1850s, which were used in Lisbon
until the 1960s in spite of being obsolescent for a long time by then (source:
Wikimedia). These meters were purely mechanical. Bottom: electromagnetic
ow meters have no mechanical components; the reading can be sent elsewhere
rather than having to be read in the dials in loco (source: Wikimedia). We will
address sensors for ow measurements in Chapter 13.
3.3. MODELS 35

3.3 Models
In Section 3.1 we have already dened a system's model as a mathematical rela-
tion between its inputs and outputs. There are basically two ways of modelling
a system:
1. A model based upon rst principles is a theoretical construction, re- First principles model
sulting from the application of physical laws to the components of the
plant.
2. A model based upon experimental data results from applying identi- Experimental model
cation methods to data experimentally obtained with the plant.
It is also possible to combine both these methods.
In this course we will concentrate on models based upon rst principles, and
you will nd abundant examples thereof in Chapters 4 through 8. They can
be obtained whenever the way the system works is known. They are the only When to use rst princi-
possibility if the system does not exist yet because it is still being designed and ples models
built, or if no experimental data is available. They may be quite hard to obtain
if the system comprises many complicated interacting sub-parts. Simplications
can bring down the model to more manageable congurations, but its theoretical
origin may mean that results will dier signicantly from reality if parameters
are wrongly estimated, if too many simplications are assumed, or if many
phenomena are neglected.
The models of dynamic continuous LTI systems are given by linear dier- Dierential equations
ential equations. The models of dynamic digital LTI systems are given by
linear dierence equations. The models of static LTI systems are linear and Dierence equations
have neither derivatives nor time dierences.
Example 3.34. The static model of the lever (3.1) includes neither dierential
nor dierence equations. It is irrelevant whether x(t) and y(t) are discretised
or not. The same happens with the non-linear static model of the Cardan joint
(3.2).
Example 3.35. Continuous model (3.6) is a dierential equation. Suppose
that the model is applied to the population of a country, where immigration
and emigration are neglectable, and for which population data is available on a
yearly basis. Also suppose that birth and death rates are constant and given by
b = 0.03/year and d = 0.02/year. So

dp(t)
= 0.01p(t) (3.9)
dt
Because the sampling time is Ts = 1 year, we can perform the following approx-
imation:

dp(t) pk − pk−1
≈ , (3.10)
dt t=year k 1 year

where pk is the population in year k , and pk−1 is the population in the year
before. Notice that this is a rst order approximation for the derivative in year
k , in which we use the value of the year before, and is consequently called a
backward approximation. So we end up with the following dierence equation:
1
pk − pk−1 = 0.01pk ⇔ pk = pk−1 , (3.11)
0.99
which is an approximation of dierential equation (3.9); approximations other
than (3.10) could have been used instead. We will address this subject further
below in Part V.
Example 3.36. Dierential equation (2.53) can be approximated by dierence
equation

3yk = 0.4yk−1 + 0.2yk−2 + 0.8eTs k + 1.6eTs (k−1) + 0.8eTs (k−2) (3.12)

for sampling time Ts . Once more, we will see how to arrive at this result below
in Part V.
36CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Experimental data should, whenever available, be used to conrm, and if Experimental identi
necessary modify, models based upon rst principles. This often means that rst tion of model paramet
principles are used to nd a structure for a model (the orders of the derivatives
in a dierential equation, or the number of delays in a dierence equation), and
then the values of the parameters are found from experimental data: feeding
the model the inputs measured, checking the results, and tuning the parameters
until they are equal (or at least close) to measured outputs. This can sometimes
be done using least squares; sometimes other optimisation methods, such as
genetic algorithms, are resorted to. If the outputs of experimental data cannot
be made to agree with those of the model, when the inputs are the same, then
another model must be obtained; this often happens just because too many
simplications were assumed when deriving the model from rst principles. It
may be possible to nd, from experimental data itself, what modications to
model structure are needed. This area is known as identication, and will be
addressed below in Parts VI to VIII.
White box model Models based upon rst principles can be called white box models, since
the reason why the model has a particular structure is known. If experimental
data requires changing the structure of the model, a physical interpretation of
the new parameters may still be possible. The resulting model is often called a
Grey box model grey box model.
There are methods to nd a model from experimental data that result in
something that has no physical interpretation, neither is it expected to have.
Still the resulting mathematical model ts the data available, providing the
correct outputs for the inputs used in the experimental plant. Such models
Black box model are called black box models, in the sense that we do not understand how
they work. Such models include, among others, neural network (NN) models
(see an example in Figure 3.18) and models based upon fuzzy logic, known as
fuzzy models (see Figure 3.19). These modelling techniques are increasingly
important, but we will not study them in these Lecture Notes.

Glossary
Lascia stare, cerchiamo un libro greco!
Questo? chiedevo io mostrandogli un'opera dalle pagine coperte di
caratteri astrusi. E Guglielmo: No, questo è arabo, sciocco! Aveva
ragione Bacone che il primo dovere del sapiente è studiare le lingue!
Ma l'arabo non lo sapete neppure voi! ribattevo piccato, al che
Guglielmo mi rispondeva: Ma almeno capisco quando è arabo!

Umberto Eco (1932 „2016), Il nome della rosa, Quinto giorno, Sesta

black box model modelo de caixa negra


bounded limitado
control system sistema de controlo
continuous contínuo
deterministic determinístico
dierence equation equação às diferenças
digital digital
discrete discreto
disturbance perturbação
dynamic dinâmico
rst principles primeiros princípios
grey box model modelo de caixa cinzenta
identication identicação
manipulated variable variável manipulada
mechatronic mecatrónico
mechatronics mecatrónica
multiple input entradas múltiplas
multiple output saídas múltiplas
input entrada
model modelo
output saída
3.3. MODELS 37

Figure 3.18: Top: scheme of an example of an articial neural network (source:


DOI 10.1016/j.apor.2008.11.002). It is made of several neurons, arranged in
layers. These neurons are oversimplied models of biological neurons, seen in the
bottom scheme (source: Wikimedia), which are arranged in far more complex
patterns. The parameters of an articial neural network are the conguration of
its interconnections and the parameters of each neuron. Neuron parameters can
be optimised from experimental data using numerical methods. The NN shown
can be used to model a static MIMO system with two inputs and two outputs,
or a dynamic system with one input and two outputs if x2 (t) = x1 (t − T s), in
which case it provides a non-linear dierence equation model with sampling time
Ts . NNs are typically black box models, and parameters are not expected to
have any physical meaning at all; recently, however, signicant eorts in neural
network interpretability have been advanced. We will not study NNs in these
Lecture Notes.

Figure 3.19: In Boolean logic, propositions are either true or false. These two
cases correspond respectively to logical values 1 and 0. In fuzzy logic, all inter-
mediate logical values can be used. The plot above shows an example of this
(source: Wikimedia). For the temperature shown by the grey line, proposition
temperature is hot has the logical value 0, proposition temperature is warm
has the logical value 0.2, and proposition temperature is cold has the logical
value 0.8. This type of logic can then be used to build models, both static and
dynamic. We will not not study fuzzy logic or fuzzy models in these Lecture
Notes.
38CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.20: The Stansted Airport Transit System conveys passengers between
Terminals 1 and 2 of Stansted Airport, United Kingdom (source: Wikimedia).
Vehicles have no driver. They stop, open doors, close doors, and move between
terminals automatically.

plant planta
process processo
reference referência
sampling frequency frequência de amostragem
sampling time tempo de amostragem
signal sinal
single input entrada única
single output saída única
static estático
stochastic estocástico
white box model modelo de caixa branca

Exercises
1. Answer the following questions for each of the mechatronic systems below:

ˆ What are its outputs?


ˆ What are its inputs?
ˆ Is the system SISO or MIMO?
ˆ Which of the inputs can be manipulated, if any?
ˆ Is it a static or a dynamic system?
ˆ Is it time varying or time invariant?
ˆ Is the system continuous or digital?

(a) An automated train system, as seen in Figure 3.20.


(b) A power wheelchair, as seen in Figure 3.21.
(c) A motorboat, as seen in Figure 3.22.
(d) A rigged ship, as seen in Figure 3.22.
(e) A submarine, as seen in Figure 3.23.
(f) A space probe, as seen in Figure 3.24.
(g) A robotic arm, as seen in Figure 3.25.

2. Use the Laplace transform to solve (3.9) for the situation starting at a
time when the country's population is 10 million inhabitants. Find the
population for t = 1, 2, 3 . . . years. Then use (3.11) to nd the evolution
of the population starting with year k = 1 (corresponding to t = 0 years)
when the country's population is 10 million inhabitants. Find the popu-
lation for k = 2, 3, 4 . . . and compare the results with those obtained with
(3.9).
3.3. MODELS 39

Figure 3.21: Physicist Stephen Hawking (1942 „2018) attending a scientic


conference in 2001 (source: Wikimedia).

Figure 3.22: Left: a motorboat with an outboard motor at Zanzibar, Tan-


zania (source: Wikimedia). Right: Portuguese Navy school ship Sagres (for-
merly Brazilian school ship Guanabara, formerly German school ship Albert
Leo Schlageter; source: Wikimedia).

Figure 3.23: The Portuguese Navy submarine Tridente, of the Tridente class,
propelled by a low noise skew back propeller and powered by hydrogenoxygen
fuel cells (source: Wikimedia).

Figure 3.24: Astronomer Carl Sagan (1934 „1996) with a model of one of the
two Viking landers, space probes that descended on Mars in 1976 and worked
until 1980 and 1982 (source: Wikimedia). Descent speed was controlled by
deploying a parachute and launching three retrorockets (one on each leg) to
ensure a soft landing. The descent control system employed an inertial reference
unit, four gyroscopes, a radar altimeter, and a landing radar.
40CHAPTER 3. EXAMPLES OF MECHATRONIC SYSTEMS AND SIGNALS

Figure 3.25: Two KUKA LWR IV robotic arms extant at the Control, Automa-
tion and Robotics Laboratory of Instituto Superior Técnico, Universidade de
Lisboa, Portugal. Each robot has seven rotational joints. (Source: Professor
Jorge Martins.)
Chapter 4

Modelling mechanical systems


Lex I.
Corpus omne perseverare in statu suo quiescendi vel movendi unifor-
miter in directum, nisi quatenus a viribus impressis cogitur statum
illum mutare. (. . . )
Lex II.
Mutationem motus proportionalem esse vi motrici impressæ, & eri
secundum lineam rectam qua vis illa imprimitur. (. . . )
Lex III.
Actioni contrariam semper & æqualem esse reactionem: sive corpo-
rum duorum actiones in se mutuo semper esse æquales & in partes
contrarias dirigi.

Isaac Newton (1643 „1727), Philosophiæ Naturalis Principia Mathematica,


Axiomata sive Leges Motus

Ut tensio sic vis ; That is, The Power of any Spring is in the same
proportion with the Tension thereof: That is, if one power stretch
or bend it one space, two will bend it two, and three will bend it
three, and so forward.

Robert Hooke (1635 „1703), Lectures de Potentia Restitutiva Or of Spring


Explaining the Power of Springing Bodies

In this and the following chapters, we will pass in review the basic concepts
of system modelling, for dierent types of components. In this chapter, we
concentrate upon mechanical components. Surely you will have already learned,
if not all, at least most of these subjects in other courses. However, there are
two reasons why a brief review is convenient at this point of your studies:
1. We will systematically resort to the Laplace transform to study dynamic
systems, and after seeing too many equations with variable s it is easy to
forget that we keep talking about real things namely, in this course,
mechatronic systems that are all around us in our daily life.
2. This is a good time to stress the similarities between apparently very
dierent systems that can be described by the very same equations. We
will see that thinking of any system as an energy converter helps to see
those parallels.

4.1 Modelling the translation movement


Mechanical systems with movement along a straight line can usually be modelled
using three components with the respective three equations:
1. A mass. This component stores energy under the form of kinetic energy. Mass
To model them, apply Newton's second law (which you can read in Latin Newton's second law
at the beginning of this chapter):
X d
F = (m(t) ẋ(t)) (4.1)
dt

41
42 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Figure 4.1: Usual translation springs. Left: helical or coil spring; centre: volute
spring; right: leaf spring. (Source: Wikimedia.)

Here, F is the sum of all forces applied on the mass m(t), which is at
P
position x(t). (Product m(t) ẋ(t), as you know, is called momentum.) Momentum
Because we are assuming a movement of translation, we need not bother to
use vectors, but the forces must be applied along the direction considered;
if not, their projection onto the said direction must be used. And, as we
said in Section 3.1, we will only consider LTI systems; since the mass is,
in (4.1), a parameter, this restriction means that it will not change with
time, and so we are left with
X
F = m ẍ(t) (4.2)

A mass is usually represented by m or M .

Spring 2. A spring. This is a mechanical device that stores energy under the form
of elastic potential energy (see Figure 4.1). A translation spring usually
Hooke's law follows Hooke's law (which you can read in Latin and English at the
beginning of this chapter):

F = k (x1 − x2 ) (4.3)

Here, F is the force exerted by the spring, x1 and x2 are the positions of
the extremities of the spring (dened so that x1 − x2 is the variation in
length of the spring measured from the repose length), and k is the spring
constant. This constant is usually represented by k or K , and its SI units
are N/m. Force F opposes the relative movement of the extremities that
is its cause (i.e. force F contracts the spring when it is stretched, and
stretches the spring when it is compressed).

Damper 3. A damper. This is a mechanical device that dissipates energy (see Fig-
Viscous damping ure 4.2). The most usual model for dampers is viscous damping:

F = c (ẋ1 − ẋ2 ) (4.4)

Here, F is the force exerted by the damper, ẋ1 and ẋ2 are the velocities
of the extremities of the spring (dened so that ẋ1 − ẋ2 is the relative
velocity of the extremities of the damper), and c is the damping constant.
This constant is usually represented by c, C , b or B , and its SI units are
N s/m. Force F opposes the relative movement of the extremities that is
its cause.
Model (4.4) can also be used to model unintended energy dissipation, such
as that due to friction. Notice that since energy dissipation is ubiquitous
even a mechanical system consisting only of a mass and a spring will be
more exactly modelled by a mass, a spring, and a damper, the latter to
account for energy dissipation.

Remark 4.1. Unlike (4.2), Hooke's law (4.3) is often only an approximate
model of the phenomenon it addresses. There are three ways in which reality
usually deviates from (4.3).

1. The relation between force and variation in length can be non-linear. In


any case, as long as the relation is continuous and has a continuous deriva-
tive, a linear approximation will be valid in a limited range of length
variations (see Figure 4.3).
4.1. MODELLING THE TRANSLATION MOVEMENT 43

Figure 4.2: Dashpot damper (source: Wikimedia). There are other types of
dampers. This one, because it contains a viscous uid, follows (4.4) rather
closely.

Figure 4.3: A linear approximation of a continuous function with a continuous


derivative provides good results in some limited range (source: Wikimedia).

2. Springs that have a dierent behaviour for positive variations of length


(x > 0, extension) and negative variations of length (x < 0, compression)
are not uncommon.

3. In any case, Hooke's law is obviously valid only for a limited range of
length variations.

Example 4.1. A stainless steel helicoidal spring is 10 cm long. When a traction


force of 10 N is applied, its length increases to 12 cm. What force must be
applied so that its length increases to 15 cm? What force must be applied so
that its length increases to 40 × 103 km?
A length increase of 2×10−2 m corresponds to a 10 N force, so k = 2×10 10
−2 =

500 N/m. The answer to the rst question, when x = 5 cm = 5 × 10 m, is −2

F = 500 × 5 × 10−2 = 25 N. Or, alternatively, since the length increase is to be


12−10 = 2.5 times larger than in the original situation, the force should also be
15−10

2.5 times larger, i.e. 2.5 × 10 = 25 N.


In the second case, it should be obvious that a 10 cm helicoidal spring cannot
be stretched to a length which is roughly the perimeter of the Earth. You should
not have to calculate the ludicrous result F = 500×40×106 = 2×1010 N= 20 GN
obtained applying the linear relation (4.3) to realise that the spring will surely
break well before such a force is applied. You should have by now seen a sucient
number of diagrams such as the one in Figure 4.4 to realise this at once, without
even having to look for the yield strength of stainless steel and coming up with
an educated guess for the spring's cross-sectional area.

Remark 4.2. Our models are approximations of reality. They are valid only for
limited ranges of parameters. These important truths cannot be overstated.

Remark 4.3. Viscous damping (4.4) is another model of reality that very often
is only a rough approximation. Dashpot dampers such as the ones in Figure 4.2
follow this law more closely than other damping phenomena, where damping
may be non-linear or, if linear, proportional to another derivative of position
x (some damping models even use fractional orders of dierentiation). In any
case, it is obvious that after a while x will reach its end of stroke, and (4.4) will End of stroke
no longer apply.

Combining (4.2)(4.4) with Newton's third law which states that when Newton's third law
a body exerts a force on another, this latter body exerts an equal force, but
opposite in direction, on the rst body , it is possible to nd the dierential
equations that model translation mechanical systems.
44 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Figure 4.4: Schematic stress-strain curve of steel (source: Wikimedia).

Example 4.2. One of the most simple, but also most useful, mechanical mod- Massspringdamper
els is the so-called massspringdamper system, which can be used to model tem
the behaviour of a mass, on which a force is applied, connected to an inertial
referential by a spring and a damper (remember that any real spring also has
some damping, so, even in the absence of a dashpot damper or a similar device,
energy dissipation must be accounted for). See Figure 4.5. This model can be
applied to many systems, among which the vertical behaviour of a car's suspen-
sion (for which of course far more accurate, and complex, models can also be
used see Figure 4.6).
Since one of the extremities of the spring is xed, the force that it exerts on
M is

FK (t) = −K x(t) (4.5)

or, omitting the dependence on time, FK = −K x. There is a minus sign


because, when x increases, the force on M opposes the increase of x. Similarly,
the force exerted on M by the damper is

FB (t) = −B ẋ(t) (4.6)

or FB = −B ẋ to simplify. There is a minus sign because, when x increases, ẋ


is positive, and the force on M opposes the increase of x. Thus

F (t) − K x(t) − B ẋ(t) = M ẍ(t) (4.7)

We will now assume that initial conditions are zero. Applying the Laplace
transform,

F (s) − KX(s) − BsX(s) = M s2 X(s) (4.8)

which we can rearrange as


X(s) 1
= 2
(4.9)
F (s) M s + Bs + K

The form (4.9) in which the model of the massspringdamper system was
Transfer function put is called transfer function. It is very practical for the resolution of dy-
namic models.
Denition 4.1. Given a SISO system modelled by a dierential equation, its
transfer function is the ratio of the Laplace transform of the output (in the nu-
merator) and the Laplace transform of the input (in the denominator), assuming
that all initial conditions are zero.
Remark 4.4. When you see a transfer function, never forget that it is nothing
but a dierential equation under disguise. The transfer function is a rational
function in s, which conceals a dynamic relation in time (or a relation in space,
if the dierential equation has derivatives in space rather than in time).
4.1. MODELLING THE TRANSLATION MOVEMENT 45

Figure 4.5: A massspringdamper system, with mass M , spring constant K ,


and damping coecient B .

Figure 4.6: Independent suspension of a car's wheel (source: Wikimedia). The


spring is clearly visible. The damper can be seen inside the coils of the spring.
Even when the suspension does not consist of one spring and one damper, a
massspringdamper model can be used, as nearly all suspensions have a spring-
like restitution force and some sort of energy dissipation.
46 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Remark 4.5. Notice that it is necessary to assume zero initial conditions to


obtain a transfer function. Otherwise, additional terms would appear, and it
would be impossible to isolate on one side of the equation the ratio of the Laplace
transforms of the output and the input. We will further study this subject in
Chapter 8.

Example 4.3. Let us nd the transfer functions corresponding to (4.2)(4.4)


i.e. to a mass, to a spring, and to a damper. For the spring and the damper,
consider that extremity x2 is xed. Assume that the output is position X(s),
and force F (s) is the input. Then

X(s) 1
= (4.10)
F (s) ms2
X(s) 1
= (4.11)
F (s) k
X(s) 1
= (4.12)
F (s) cs

Since transfer functions are functions of s, they are usually represented by


one capital letter, such as F of G; when F (s) is used to represent a transfer
function, care must be taken not to use the same letter to represent the Laplace
transform F (s) of a force f (t).

Example 4.4. Suppose that force F (t) = sin(t) is applied to the system in
Figure 4.5, in which M = 1 kg, B = 3.5 N s/m, K = 1.5 N/m. What is the
output x(t)?
The system's transfer function is

X(s) 1 1
G(s) = = 2 = (4.13)
F (s) s + 3.5s + 1.5 (s + 3)(s + 0.5)

We have
1
F (s) = (4.14)
s2 + 1
and thus
L of the input transfer function
z }| { z }| {
1 1 as + b c d
X(s) = = 2 + + (4.15)
s2 + 1 (s + 3)(s + 0.5) s + 1 s + 3 s + 0.5
(as + b)(s2 + 3.5s + 1.5) + c(s2 + 1)(s + 0.5) + d(s2 + 1)(s + 3)
=
(s2 + 1)(s + 3)(s + 0.5)
3 2
s (a + c + d) + s (3.5a + b + 0.5c + 3d) + s(1.5a + 3.5b + c + d) + (1.5b + 0.5c + d)
=
(s2 + 1)(s + 3)(s + 0.5)

whence
  

a+c+d=0 
c + d = −a 
 c + d = −a

3.5a + b + 0.5c + 3d = 0 
3.5a − 0.5b = −1 
50b = 2
⇔ ⇔


1.5a + 3.5b + c + d = 0 

0.5a + 3.5b = 0 

 a = −7b
1.5b + 0.5c + 3d = 1 c + 6d = 2 − 3b c + 6d = 2 − 3b
  

7 7 1
  

 c + d = 25 
 c = 25 − d 
 c = − 25
b = 1
 
 

⇔ 25 ⇔ ⇔ (4.16)


 a = − 257 

 


47 40 8
c + 6d = 25 5d = 25 d = 25
  

Finally,
7 1 1 8
− 25 − 25

s
x(t) = L −1 + 25
+ + 25
s2 + 1 s2 + 1 s + 3 s + 0.5
7 1 1 −3t 8 −0.5t
= − cos(t) + sin(t) − e + e (4.17)
25 25 25 25
4.2. SIMULATING TRANSFER FUNCTIONS IN MATLAB 47

Figure 4.7: The system from Example 4.5, modelled by (4.20).

Example 4.5. Generalise the massspringdamper system of Example 4.2 to


include three masses connected by springs and dampers as seen in Figure 4.7.
The forces exerted by these components will be


 fK1 = K1 (x2 − x1 )

f = K (x − x )
K2 2 3 2
(4.18)


 fB1 = B (ẋ
1 2 − ẋ 1)
fB2 = B2 (ẋ3 − ẋ2 )

Applying Newton's law to the masses, we get



K1 (x2 − x1 ) + B1 (ẋ2 − ẋ1 ) = M1 ẋ1

K2 (x3 − x2 ) + B2 (ẋ3 − ẋ2 ) − K1 (x2 − x1 ) − B1 (ẋ2 − ẋ1 ) = M2 ẋ2 (4.19)

−K2 (x3 − x2 ) − B2 (ẋ3 − ẋ2 ) = M3 ẋ3

Finally, the mathematical model of the system is



M1 ẍ1 + K1 (x1 − x2 ) + B1 (ẋ1 − ẋ2 ) = 0

M2 ẍ2 + K1 (x2 − x1 ) + B1 (ẋ2 − ẋ1 ) + K2 (x2 − x3 ) + B2 (ẋ2 − ẋ3 ) = 0

M3 ẍ3 + K2 (x3 − x2 ) + B2 (ẋ3 − ẋ2 ) = 0

(4.20)
To nd a transfer function from the equations above, we would have to know
which of the three positions x1 , x2 and x3 is the input and which is the output.

Remark 4.6. Remember that it is somewhat irrelevant if positive displace-


ments are assumed to be in one direction or the other. In the example above,
positive displacements were arbitrarily assigned to the direction from the left
to the right; the opposite could have been assumed, and signs would then be
changed in such a way that the resulting model would still be correct.

4.2 Simulating transfer functions in Matlab


There are two ways of creating a transfer function with Matlab:

ˆ tf creates a transfer function, represented by two vectors with the coef-


cients of the polynomials in the numerator and in the denominator (in
decreasing order of the exponent);

ˆ s = tf('s') creates the Laplace transform variable s, which can then be


manipulated using algebraic operators.

Example 4.6. Transfer function (4.13) from Example 4.4 can be created as Matlab's command tf
>> G = tf(1,[1 3.5 1.5])

G =

1
-----------------
s^2 + 3.5 s + 1.5

Continuous-time transfer function.


48 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

0.4

0.3

0.2

0.1

x [m]
0

−0.1

−0.2

−0.3
0 10 20 30 40 50
t [s]

Figure 4.8: Results of Example 4.4.

or else as
>> s = tf('s')

s =

Continuous-time transfer function.

>> G = 1/(s^2+3.5*s+1.5)

G =

1
-----------------
s^2 + 3.5 s + 1.5

Continuous-time transfer function.

Simulation Command lsim (linear simulation) uses numerical methods to solve the dif-
ferential equation represented by a transfer function for a given input. In other
words, it simulates the LTI represented by the transfer function.
Matlab's command lsim Example 4.7. The output found in Example 4.4 can be obtained and displayed
as follows, if transfer function G(s) has been created as above:
>> t = 0 : 0.01 : 50;
>> f = sin(t);
>> x = lsim(G, f, t);
>> figure,plot(t,x, t,-7/25*cos(t)+1/25*sin(t)-1/25*exp(-3*t)+8/25*exp(-0.5*t))
>> xlabel('t [s]'), ylabel('x [m]')
See Figure 4.8. Notice that we plotted two curves: the rst was created with
lsim, the second is (4.17). As expected, they coincide (there is a small numerical
dierence, too small to show up in the plot), and only one curve can be seen.
Remark 4.7. The result (4.17) from Example 4.4 is exact. So the second curve
in Figure 4.8 only has those numerical errors resulting from the implementation
of the functions. The rst curve has the errors resulting from the numerical
method with which the dierential equation was solved. Of course, both curves
are based upon the same transfer function, and thus will suer from any errors
that there may be in that model (e.g. imprecise values of parameters M , B ,
and K , or neglected non-linearities in the spring or the damper). Do you still
remember Remark 4.2?
4.3. MODELLING THE ROTATIONAL MOVEMENT 49

Figure 4.9: Tangential force F for a rotation of radius r applied on a point-like


mass.

4.3 Modelling the rotational movement


Mechanical systems with movement of rotation can usually be modelled using
three components with the respective three equations:
1. A moment of inertia. For these components, apply Newton's second Moment of inertia
law for rotation: Newton's second law for
rotation
Theorem 4.1.
X d
τ= (J(t) ω̇(t)) (4.21)
dt
Here, τ is the sum of all torques applied on the moment of inertia J(t),
P
which is at angular position ω(t).

Proof. Let r be the radius of rotation for which are applied the tangential
forces F that cause the torque (see Figure 4.9). Because x = rω , then
P
ẋ = rω̇ , and Newton's second law (4.1) becomes
X d X d
m(t) r2 ω̇(t) (4.22)

F = (m(t) rω̇(t)) ⇔ r F =
dt dt
Because the torque τ of a force F is rF , and the moment of inertia J
of mass m is mr2 , (4.21) follows for a point-like mass. In the case of a
distributed mass, integrating (4.22) over the volume occupied will then
yield the desired result.
Corollary 4.1. Considering an LTI system, J will not change with time,
and so we are left with
X
τ = J ω̈(t) (4.23)

A moment of inertia is usually represented by J or I (the latter letter is


avoided when it can be confounded with an electrical current); its SI units
are kg m2 . A torque is usually represented by τ or T ; its SI units are N m.
2. A torsion spring. This is a mechanical device that stores energy (see Torsion spring
Figure 4.10) and usually follows the angular form of Hooke's law: Angular form of Hooke's
law
τ = κ (ω1 − ω2 ) (4.24)

Here, τ is the torque exerted by the spring, ω1 and ω2 are the angular
positions of the extremities of the spring, and κ is the spring constant.
This constant is usually represented by the Greek character κ or K (to
avoid confusion with a translation spring, for which a Latin character is
used), and its SI units are N/rad.
3. A rotary damper, or torsional damper. The most usual model for Rotary (or torsional)
this mechanical device that dissipates energy is viscous damping: damper

τ = c (ω̇1 − ω̇2 ) (4.25)

Here, τ is the torque exerted by the damper, ω̇1 and ω̇2 are the angular
velocities of the extremities of the damper, and c is the damping constant.
50 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Figure 4.10: A torsion spring mounted on a mousetrap (source: Wikimedia).


Notice that Hooke's law for torsion springs will only apply in the range of angles
comprised within the ends of stroke (say, from 0 rad to π rad).

Figure 4.11: A mechanical system comprising a moment of inertia J , a torsion


spring with constant κ, and a rotational damper with constant B .

This constant is usually represented by c, C , b or B , just like for the


translation case, but its SI units are N s/rad.
Also like (4.4), model (4.25) can be used to model unintended energy
dissipation, such as that due to friction.
Remark 4.8. When dealing with rotation, take care with angular units. Confu-
sion about values in degrees, radians, and rotations is a common source of error.
This is true also for angular speed, angular velocity, angular spring constants,
etc..
Example 4.8. Consider the system in Figure 4.11. The torque exerted on J
by the spring is

τκ (t) = −κ ω(t) (4.26)

where ω is the rotation of J in the sense of rotation in which the applied torque
τ is positive. The torque exerted by the damper is

τB (t) = −B ω̇(t) (4.27)

Thus

τ (t) − κ ω(t) − B ω̇(t) = J ω̈(t) (4.28)

Applying the Laplace transform (and assuming, once more, that all initial con-
ditions are zero),

Ω(s) 1
T (s) − κΩ(s) − BsΩ(s) = Js2 Ω(s) ⇔ = (4.29)
T (s) Js2 + Bs + κ

4.4 Energy, eort and ow


A comparison of transfer functions (4.9) and (4.29) shows us that dierent
systems can have similar models. Actually, if the numerical values of M and J ,
4.5. OTHER COMPONENTS 51

and of B (in translation) and B (in rotation), and of K and κ, are the same,
then the model will be the same.
As you surely know by now, this happens not only with mechanical systems,
but also with systems of other, dierent types, as we shall see in the following
chapters. One of the best ways of studying this parallelism is to see systems as
energy converters, and energy E as the integral of the product of two variables, Energy
called eort variable e and ow variable f : Eort
Z t Flow
E(t) = e(t) f (t) dt (4.30)
0

In other words, the product e(t) × f (t) is the instantaneous power Ė(t). Power
In the case of a translation movement,
Z t
Ė(t) = F (t) ẋ(t) ⇔ E(t) = F (t) ẋ(t) dt (4.31)
0

In the case of a rotation movement,


Z t
Ė(t) = τ (t) ω̇(t) ⇔ E(t) = τ (t) ω̇(t) dt (4.32)
0

We will consider force F and torque τ as the ow variable, and velocity ẋ and
angular velocity ω̇ as the eort variable. But notice that it would make no
dierence if it were the other way round. In any case, their product will be the
power. Both choices can be found in published literature.
The components of a system are the eort accumulator, the ow accu- Eort accumulator
mulator, and the energy dissipator, as seen in Table 4.1. For both accumu- Flow accumulator
lators, energy is the integral of accumulated ow or accumulated eort: elastic Dissipator
potential energy in the case of eort, and kinetic energy in the case of ow. The
dissipator dissipates energy and it makes no dierence whether it is kinetic or
potential energy that it dissipates. Table 4.1 also includes the relations between
these quantities.
Denition 4.2. A transfer function of a system that has the ux as input and
the eort as output is called impedance of that system. A transfer function of a Impedance
system that has the eort as input and the ux as output is called admittance Admittance
of that system. Consequently, the admittance is the inverse of the impedance.

Transfer functions (4.10)(4.12) can be rewritten so as to give the mechanical


impedance of a mass, a spring, and a damper: Mechanical impedance

sX(s) 1
= (4.33)
F (s) ms
sX(s) s
= (4.34)
F (s) k
sX(s) 1
= (4.35)
F (s) c

4.5 Other components


Among the several other components that may be found in mechanical systems,
the following ones, because of their general use and of their linearity, deserve a
passing mention:
ˆ Cogwheels, or gears. These wheels convert rotation movement into an- Cogwheels
other rotation movement, but the wheels need not be in the same plane.
For two external cogwheels, the sense of rotation is inverted, whereas for
one external and one internal cogwheel it is not (see Figure 4.12).
Theorem 4.2. Let ω1 and ω2 be the angular positions of the two cog-
wheels, and r1 and r2 the respective radius. Then
ω1 r2
=± (4.36)
ω2 r1
52

Translation mechanical system SI Rotation mechanical system SI


eort e velocity ẋ m s−1 angular velocity ω̇ rad s−1
ow f force F N torque τ Nm
eort accumulator
R spring, with spring Rconstant K N/m angular spring, with springRconstant κ N/rad
CHAPTER 4.

accumulated eort ea = e dt position x = ẋ dt m angular position ω = ω̇ dt rad


1
position x = K F angular position ω = κ1 τ
1 1 2
relation between accumulated eort and ow ea R= ϕ(f )
accumulated energy Ee = ea df elastic potential energy Ee = 2K F2 J elastic potential energy Ee = 2κ τ J
ow accumulator
R mass M R kg moment of inertia JR kg m2
accumulated ow fa = f dt momentum p = F dt kg m s−1 angular momentum h = τ dt kg m2 s−1
relation between accumulated ow and eort fa R= ϕ(e) momentum p = M ẋ angular momentum h = J ω̇
accumulated energy Ef = fa de kinetic energy Ef = 21 M ẋ2 J kinetic energy Ef = 21 J ω̇ 2 J
dissipator damper, with damping constant b N s/m rotary damper, with damping constant b N s/rad
relation between eort and ow e =R ϕ(f ) ẋ = 1b F ω̇ = 1b τ
dissipated energy Ed = f de Ed = 12 bẋ2 J Ed = 12 bω̇ 2 J
Table 4.1: Eort, ow, accumulators and dissipators in mechanical systems
MODELLING MECHANICAL SYSTEMS
4.5. OTHER COMPONENTS 53

Figure 4.12: Left: two external cogwheels (source: Wikimedia). Right: two
cogwheels, the outside one being an internal cogwheel (because the cogs are on
the inside), and the inside one being an external cogwheel (because the cogs are
on the outside; source: https://etc.usf.edu/clipart).

Figure 4.13: Proof of Theorem 4.3.

Figure 4.14: Transmission belts in a Diesel engine (source: Wikimedia).


54 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Proof. This is a straightforward consequence of the linear movement of


the point of contact between the two cogwheels being the same:

ω1 r1 = ω1 r2 (4.37)

Corollary 4.2. Let n1 and n2 be the numbers of cogs, or teeth, in the


cogwheels. Then
ω1 ω̇1 ω̈1 r2 n2
= = =± =± (4.38)
ω2 ω̇2 ω̈2 r1 n1

Proof. The spacing of the teeth in both cogwheels has to be the same,
otherwise they would not match. Thus the perimeters of the two wheels,
2πr1 and 2πr2 , are directly proportional to n1 and n2 .
As to the angular velocity and acceleration, it suces to dierentiate
(4.36).
Theorem 4.3. Let τ1 and τ2 be the torques of the two cogwheels. Then
τ1 r1 n1
= = (4.39)
τ2 r2 n2

Proof. See Figure 4.13. The forces that each wheel exerts on the other are
equal. Thus
τ1
τ1 = F r1 ⇒ F = (4.40)
r1
τ2
τ2 = F r2 ⇒ F = (4.41)
r2
and the result follows.

Belt ˆ A transmission belt. It also converts rotation movement into another


rotation movement:
ω1 ω̇1 ω̈1 r2
= = = (4.42)
ω2 ω̇2 ω̈2 r1
Here ω1 and ω2 are the angular positions of the two wheels connected by
the belt, and r1 and r2 are the respective radius. See Figure 4.14.
Rack and pinion ˆ A rackand pinion. It converts rotation movement into translation move-
ment and vice-versa:

x = ωr ⇔ ẋ = ω̇r ⇔ ẍ = ω̈r (4.43)

Here x is the distance of the translation movement, r the radius of the


wheel, and ω the angle of the rotation movement. See Figure 4.15.
Harmonic drive ˆ A harmonic drive. It converts rotation movement into another rotation
movement, using an outside internal circular gear, inside which there is an
external elliptical gear, to which an elliptical shaft is connected through a
rolling bearing:
ω1 ω̇1 ω̈1 n1 − n0
= = =− (4.44)
ω2 ω̇2 ω̈2 n0
Here ω2 is the angular position of the elliptical shaft inside the elliptical
gear, ω1 is the angular position of the shaft connected to the elliptical
gear, n1 is the number of teeth of the said gear, and n0 is the number of
teeth of the outside internal gear (which is xed). See Figure 4.15.
Remark 4.9. Linear models (4.36)(4.44) omit non-linear eects that may
appear, such as backlash due to gaps betweens cogs (see Figure 4.16). These
eects may sometimes be important but are not our concern here.
Remark 4.10. Models (4.36)(4.44) are not only linear but also static (in the
sense that outputs do not depend on past inputs, not in the sense that these
components never move, of course). Non-linearities such as backlash make the
components in fact dynamic.
4.5. OTHER COMPONENTS 55

Figure 4.15: Left: rack and pinion in a canal gate; the rack is the linear ele-
ment (in this case, vertical). Right: schematic of a harmonic drive. (Source:
Wikimedia.)

Figure 4.16: Backlash (source: Wikimedia).


56 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Glossary
Als Storm weer bijkomt is het eerste wat hij ziet het vriendelijke
gezicht van de jager.
Wat wilt u dat ik voor u doe, god?
Ik. . . kan je verstaan, maar. . . maar spreek ik nu jouw taal of jij de
mijne? En wat bedoel je met god? Ik ben geen god!
Maar natuurlijk bent u dat! Alles wijst erop. U sprak wartaal en
begreep mij niet. Nou, het is duidelijk dat de goden de mensen
niet begrijpen, anders hadden ze ze allang uitgeroeid! En nu u van
de parel der kennis hebt gegeten, begrijpt u er nog niets van. Dat
bewijst dat u gek bent! En de goden moeten gek zijn anders hadden
ze de wereld nooit zo gemaakt als hij is.

Don Lawrence (1928 „2003), Martin Lodewijk (1939 . . . ), Storm, De


kronieken van Pandarve 10, De piraten van Pandarve

accumulated eort potencial acumulado


accumulated ow uxo acumulado
admittance admitância
cogwheel roda dentada
coil spring mola helicoidal
compression compressão
damper amortecedor
damping amortecimento
dashpot amortecedor viscoso
dissipator dissipador
eort accumulator acumulador de potencial
eort variable variável de potencial
end of stroke m de curso
energy energia
extension extensão
ow accumulator acumulador de uxo
ow variable variável de uxo
gear roda dentada
harmonic drive redutor harmónico
helical spring mola helicoidal
impedance impedância
leaf spring mola de folhas, mola de lâminas
mass massa
mechanical impedance impedância mecânica
moment of inertia momento de inércia
momentum quantidade de movimento, momento linear
point-like mass massa pontual
power potência
rack and pinion pinhão e cremalheira
rotary damper amortecedor rotativo, amortecedor de torção
simulation simulação
spring mola
spring constant constante de mola
torque binário, torque (bras.)
torsion spring mola de torção
torsional damper amortecedor rotativo, amortecedor de torção
transfer function função de transferência
transmission belt correia de transmissão
volute spring mola de volutas, mola voluta

Exercises
1. Consider the system in Figure 4.17.

(a) Find the dierential equations that model the system.


4.5. OTHER COMPONENTS 57

Figure 4.17: System of Exercise 1.

Figure 4.18: System of Exercise 2.

(b) From the result above, knowing that M1 = 1 kg, M2 = 0.5 kg,
K1 = 10 N/m, K2 = 2 N/m, and B2 = 4 N s/m, nd transfer
function XF2(s)
(s)
.

2. Consider the system in Figure 4.18. The wheels have neglectable mass and
inertia; they are included to show that the masses move without friction.
(a) Find the dierential equations that model the system.
(b) From the result above, knowing that M1 = 100 kg, M2 = 10 kg,
K = 50 N/m, and B = 25 N s/m, nd transfer function X 2 (s)
X1 (s) .

3. Consider the system in Figure 4.19. The wheels have neglectable mass and
inertia; they are included to show that the masses move without friction.
(a) Find the dierential equations that model the system.
(b) From the result above, knowing that M1 = M2 1 kg, K = 5 N/m,
and B = 10 N s/m, nd transfer function XF1(s)
(s)
.
X2 (s)
(c) For the same constants, nd transfer function F (s) .

4. Consider the system in Figure 4.20.


(a) Find the dierential equations that model the system.
(b) From the result above, knowing that M1 = 1 kg, M2 = 2 kg, M3 =
3 kg, K1 = 10 N/m, K2 = 20 N/m, K3 = 30 N/m, B1 = 5 N s/m,
B2 = 10 N s/m, and B3 = 15 N s/m, nd transfer function XF1(s)
(s)
.

Figure 4.19: System of Exercise 3.


58 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Figure 4.20: System of Exercise 4.

Figure 4.21: System of Exercise 5.

X2 (s)
(c) For the same constants, nd transfer function F (s) .
X3 (s)
(d) For the same constants, nd transfer function F (s) .

5. Consider the system in Figure 4.21. The cogwheels have neglectable mo-
ments of inertia, when compared to J . Let Nu be the number of cogs in
the upper cogwheel, and Nl the number of cogs in the lower cogwheel.

(a) Find the dierential equations that model the system.


(b) From the result above, knowing that J = 50 kg m2 , Nu = 20, Nl =
30, and B = 40 N s/m, nd transfer function TΩ(s)
(s) .

6. Consider the system in Figure 4.22. The pinion's centre is xed, and its
moment of inertia I includes the lever actuated by force F .

(a) Find the dierential equations that model the system.


(b) From the result above, knowing that r = 0.2 m, I = 0.8 kg m2 ,
m = 20 kg, k = 1000 N/m, and b = 480 N s/m, nd transfer function
X(s)
F (s) .

7. Consider the system in Figure 4.23. Force F is applied through a bar of


neglectable mass, connected by the spring and the damper to mass m,
aected by friction force Fa that follows the law of viscous damping with
constant ba . The bar has velocity vF ; mass m has velocity F .

(a) Find the dierential equations that model the system.


VF (s)
(b) From the result above, nd transfer function F (s) .

8. Consider the system in Figure 4.24. The position of mass M is x(t).

(a) Find the dierential equations that model the system.


X(s)
(b) From the result above, nd transfer function T (s) .

9. For all the systems in the exercises above, nd:

(a) the eort variables;


(b) the eort accumulators;
(c) the ow variables;
(d) the ow accumulators;
4.5. OTHER COMPONENTS 59

Figure 4.22: System of Exercise 6.

Figure 4.23: System of Exercise 7.

Figure 4.24: System of Exercise 8.


60 CHAPTER 4. MODELLING MECHANICAL SYSTEMS

Figure 4.25: From left two right: two springs in series; two springs in parallel;
two dampers in series; two dampers in parallel.

Figure 4.26: Mechanical system from Exercise 11.

(e) the dissipators.

10. Find the X(s)


F (s) transfer functions, as in (4.10)(4.12), of the following sys-
tems (see Figure 4.25):

(a) two springs, with constants K1 and K2 , in series;


(b) two springs, with constants K1 and K2 , in parallel;
(c) two dampers, with constants B1 and B2 , in series;
(d) two dampers, with constants B1 and B2 , in parallel.

11. Consider the mechanical system in Figure 4.26 comprising a mass M , a


damper with viscous friction coecient B and a spring with stiness K .
These elements are connected to a xed pulley of radius r with inertia J .
The system is driven by a torque T . Let θ be the rotation angle of the
pulley.

(a) Model the system, writing the equations that describe its dynamics.
(b) Obtain the transfer function considering the torque T as input and
the mass position x as output.
Chapter 5

Modelling electrical systems


By that time Mordor was deservedly being called smithy of the na-
tions, and it could trade its manufactured goods for any amounts of
food from Khand and Umbar. Trading caravans went back and forth
through the Ithilien Crossroads day and night, and more and more
voices in Barad-dúr were saying that the country has had enough
tinkering with agriculture, which was nothing but a net loss anyway,
and the way to go was to develop what nobody else had namely,
metallurgy and chemistry. Indeed, the industrial revolution was well
underway; steam engines toiled away in mines and factories, while
the early aeronautic successes and experiments with electricity were
the talk of the educated classes.
Kirill Yeskov (1956 . . . ), The Last Ringbearer, I 3 (transl. Yisroel Markov)
This chapter addresses the modelling of electrical systems.

5.1 Passive components


The three simplest elements in an electrical circuit are:
1. A resistor. This component (see Figure 5.1) dissipates energy according Resistor
to Ohm's law: Ohm's law

U (t)
R(t) = (5.1)
I(t)
Here R is the resistance, U is the voltage (or tension, or electric potential
dierence), and I is the current. Notice that U = U1 − U2 , where U1 and
U2 are the voltages at the resistor's terminals.
The resistance R of a uniform conductor is directly proportional to its
length L and inversely proportional to its cross-section A:
L
R=ρ (5.2)
A
Proportionality constant ρ is called resistivity. This variation with length
is used to build variable resistances, shown in Figure 5.2.
2. A capacitor. This component (see Figure 5.4) stores energy and its most Capacitor
usual model is
1
U (t) = Q(t) (5.3)
C
where Q(t) is the electrical charge stored, and C is the capacity. Since
I(t) = dQ(t)
dt ,

1 t
Z
U (t) = I(t) dt (5.4)
C 0
Dierentiating, we get
dU (t)
I(t) = C (5.5)
dt

61
62 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.1: Dierent types of resistors. Left: individual resistors for use in
electronics; centre: many resistors in one encasing; right: wirewound resistors
for high tensions and currents in a train. (Source: Wikimedia.) There are still
other types of resistors.

Figure 5.2: Potentiometers (or variable resistors, or rheostats) have a slider or


a screw to move the position of a terminal, and thus the length of the resistor
which is actually employed; resistance is proportional to this length (source:
Wikimedia). See Figure 5.3.

Figure 5.3: Top: a linear potentiometer with length xmax and resistance Rmax ,
connected on the left and on the movable terminal at position x, has a resistance
R proportional to the position: xmax
x R
= Rmax ⇔ R = Rmax xmaxx
. Bottom: this
potentiometer is used as a tension divider, grounded on the left and at Vmax on
the right; the voltage at the terminal is given by Vmax
V R
= Rmax x
= xmax ⇒V =
Vmax xmax ⇔ x = xmax Vmax .
x V
5.1. PASSIVE COMPONENTS 63

Figure 5.4: Left: 100 nF capcitor; right: 20 µF capacitor.

Figure 5.5: Inductor for electronic circuits.

3. An inductor. This component (see Figure 5.5) also stores energy and its Inductor
most usual model is
1
I(t) = λ(t) (5.6)
L
Rt
where λ(t) = 0 U (t) dt is the ux linkage, and L is the inductance. Dif-
ferentiating, we get

dI(t)
U (t) = L (5.7)
dt

The transfer functions of the resistor, the capacitor, and the inductor, cor-
responding to (5.1), (5.5), and (5.7), considering always tension U (s) as the
output and current I(s) as the input, are

U (s)
=R (5.8)
I(s)
U (s) 1
= (5.9)
I(s) Cs
U (s)
= Ls (5.10)
I(s)

Remark 5.1. Notice that Ohm's law (5.1) or (5.8) corresponds to a static
system.

Remark 5.2. It cannot be overstated that relations (5.8)(5.10) are not fol-
lowed by many components:

ˆ Many resistances do not follow a linear relation between U and I such as


(5.1), and are thus called non-ohmic resistors. Still, Ohm's law can be a Non-ohmic resistors
good approximation in a limited range of values (see Figure 4.3 again).
64 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Table 5.1: Eort, ow, accumulators and dissipators in electrical systems


Electrical system SI
eort e voltage U V
ow f current I A
eort accumulator inductor with induction L H
accumulated eort ea = e dt ux linkage λ = U dt Wb
R R

relation between accumulated eort and ow ea R= ϕ(f ) ux linkage λ = LI


accumulated energy Ee = ea df inductive energy Ee = 12 LI 2 J
ow accumulator capacitor with capacity C F
accumulated ow fa = f dt charge Q = I dt C
R R

relation between accumulated ow and eort fa R= ϕ(e) charge Q = CU


accumulated energy Ef = fa de capacitative energy Ef = 12 C V̇ 2 J
dissipator resistance R Ω
relation between eort and ow e =R ϕ(f ) U = RI
dissipated energy Ed = f de Ed = 12 RI 2 J

ˆ Many capacitors have variable capacity C , depending on the voltage ap-


plied. Others follow dierential equations of fractional order (which we
will study in Chapter 35).

ˆ Inductances always have some resistance, which is often not neglectable.


So their transfer function would more accurately be R + Ls.

ˆ Even when (5.8)(5.10) are accurately followed, this only happens for a
limited range of values. Increase U or I too much, and any electrical
component will cease to function (burn, melt. . . ). What is too much
depends on the particular component: there are components that cannot
stand 1 V while others work at 104 V and more.

5.2 Energy, eort and ow


Rt
Because Ė(t) = U (t)I(t) and E(t) = 0 U (t)I(t) dt, eort and ow variables
are U and I . While either can once more play each of the roles, by universal
convention,

ˆ U is the eort variable,

ˆ I is the ow variable, and thus

ˆ the inductor is the eort accumulator,

ˆ the capacitor is the ux accumulator,

ˆ the resistor is the dissipator.

Table 5.1 sums up the passing information and relations.

Remark 5.3. Transfer functions (5.8)(5.10) have the ux as input and the
Electrical impedance eort and output. They consequently give the impedance of the corresponding
components.

To model electric systems with these components, (5.8)(5.10) are combined


Kircho 's laws with Kircho's laws:

Kircho 's current law ˆ The current law states that the sum of the currents at a circuit's node is
zero.

Kircho 's voltage law ˆ The voltage law states that the sum of the voltages around a circuit's
closed loop is zero.

Voltage divider Example 5.1. Consider the system in Figure 5.6 known as voltage divider.
The input is Vi (t) and the output is Vo (t). Applying the current law at point
5.2. ENERGY, EFFORT AND FLOW 65

Figure 5.6: Left: voltage divider. Right: RC circuit.

B , we see that the current owing from A to B must be the same that ows
from B to C . Applying Ohm's law (5.1) to the two resistances, we see that

VB (t) − VA Vo (t) − Vi (t) Vo − Vi


R1 = = ⇒I= (5.11)
I(t) I(t) R1
VC (t) − VB (t) 0 − Vo (t) −Vo
R2 = = ⇒I= (5.12)
I(t) I(t) R2

In the last equalities above, we dropped the dependence on t to alleviate the


notation. Consequently,
Vo R2
(Vo − Vi )R2 = −Vo R1 ⇔ Vo (R1 + R2 ) = Vi R2 ⇔ = (5.13)
Vi R1 + R2
Vo (t) Vo (s)
Notice that this system is static, and from Vi (t) = R2
R1 +R2 we get Vi (s) = R1 +R2 .
R2

Remark 5.4. Remember that, similarly to what happens with the positive
direction of displacements in mechanical systems, it is irrelevant if a higher
tension is presumed to exist to the left or to the right of a component. Current
is always assumed to ow from higher to lower tensions; as long as equations are
coherently written, if in end current turns out to be negative, this only means
that it will ow the other way round.

Example 5.2. The transfer function of the system in Figure 5.6 known as RC
circuit can be found in almost the same manner, thanks to impedances: RC circuit

VB (s) − VA (s) Vo (s) − Vi (s) Vo − Vi


R= = ⇒I= (5.14)
I(s) I(s) R
1 VC (s) − VB (s) 0 − Vo (s)
= = ⇒ I = −Vo Cs (5.15)
Cs I(s) I(s)

In the last equalities above, we dropped the dependence on s to alleviate the


notation. Consequently,
Vo 1
Vo − Vi = −Vo RCs ⇔ Vo (1 + RCs) = Vi ⇔ = (5.16)
Vi 1 + RCs

Notice that this system is dynamic, and from Vo (s)(1 + RCs) = Vi (s) we get
Vo (t) + RC dVdt
o (t)
= Vi (t).

Example 5.3. Both systems above are particular cases of the generic system Two generic impedances
in Figure 5.7 with two impedances:

VB (s) − VA (s) Vo (s) − Vi (s) Vo − Vi


Z1 (s) = = ⇒I= (5.17)
I(s) I(s) Z1
VC (s) − VB (s) 0 − Vo (s) −Vo
Z2 (s) = = ⇒I= (5.18)
I(s) I(s) Z2
66 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.7: Left: generic electrical system with two impedances, of which the
voltage divider (Figure 5.6), the RC circuit (Figure 5.6) and the CR circuit (to
the right) are particular cases. Right: CR circuit.

Figure 5.8: Two impedances in parallel.

Consequently,

Vo Z2
(Vo − Vi )Z2 = −Vo Z1 ⇔ = (5.19)
Vi Z1 + Z2

Replacing Z1 (s) = R1 and Z2 (s) = R2 in (5.19), we obtain (5.13).


Replacing Z1 (s) = R and Z2 (s) = Cs
1
in (5.19), we obtain (5.16).
We can also obtain the transfer function of the case where the resistor and
the capacitor are switched as also shown in Figure 5.7: when Z1 (s) = Cs 1
and
Vo (s)
CR circuit Z2 (s) = R, we have Vi (s) = R+ 1 = 1+RCs . This is known as a CR circuit.
R RCs
Cs

Impedances in series Remark 5.5. We have incidentally shown that two impedances Z1 and Z2 in
series correspond to a single impedance Z = Z1 + Z2 , i.e. two impedances in
series are summed, just as two resistances in series are. You know that two
resistances R1 and R2 in parallel are equivalent to resistance R = 1 +
1
1 , and
R1 R2
Impedances in parallel something similar happens to two impedances in parallel (see Figure 5.8):

VB − VA VB − VA
Z1 = ⇔ I1 = (5.20)
I1 Z1
VB − VA VB − VA
Z2 = ⇔ I2 = (5.21)
I2 Z2
VB − VA VB − VA 1
Z= = VB −VA = (5.22)
I1 + I2 Z + VBZ−VA
1 2
1
Z1 + 1
Z2

Because of the parallelism between systems of dierent types, this is true for me-
chanical impedances as well (see Exercise 10 from Chapter 2), and for impedances
of other types of systems we will study in the next chapters.

RLC circuit Example 5.4. Consider the system in Figure 5.9 known as RLC circuit. The
input is Vi (t) and the output is Vo (t). Applying the current law, we see that
the current owing from A to B must be the same that ows from B to C and
5.3. THE OPERATIONAL AMPLIFIER (OPAMP), AN ACTIVE COMPONENT 67

Figure 5.9: RLC circuit.

the same that ows from C to D. Then


VB (t)−VA
= VB (t)−V i (t)

R =
 I(t) I(t) ⇒ VB = RI + Vi
VC (t)−VB (t) Vo (t)−VB (s)
Ls = I(t) = I(t) ⇒ ILs = Vo − VB (5.23)
VD (s)−VC (s) 0−Vo (s)

 1
Cs = I(s) = I(s) ⇒ I = −Vo Cs

We now replace the rst equation in the second, and use it together with the
third to get

ILs = Vo − RI − Vi ⇔ I(R + Ls) = Vo − Vi (5.24)


Vo − Vi Vo 1
⇒ = −Vo Cs ⇔ Vo + Vo CRs + Vo CLs2 = Vi ⇔ =
R + Ls Vi CLs2 + CRs + 1

From Vo (s) + Vo (s)CRs + Vo (s)CLs2 = Vi (s) we get

dVo (t) d2 Vo (t)


Vo (t) + CR + CL = Vi (t) (5.25)
dt dt2

Remark 5.6. We could have established (5.25) rst, without using impedances:
VB (t)−VA (t)

1 1
R =
 I(t) ⇒ I(t) = R VB (t) − R Vi (t)
V (t) − VB (t) = dI(t)
L dt ⇒ Vo (t) − VB (t) = R L dVB (t) L dVi (t)
−R (5.26)
 C 1
R dVo (t)
dt dt
VD (t) − VC (t) = I(t) dt ⇒ − = f rac1CI(t)

C dt

Replacing the rst equation in the third, and then the result in the second,

dVo (t) 1 1 dVo (t)


− = VB (t) − Vi (t) ⇒ VB (t) = Vi (t) − RC
dt RC RC dt
(5.27)
d2 Vo (t)

dVo (t) L dVi (t) L dVi (t)
Vo (t) − Vi (t) + RC = − RC 2
− (5.28)
dt R dt dt R dt

Rearranging terms in the last equality gives (5.25). Applying the Laplace trans-
form, we then obtained transfer function (5.24). The results are of course the
same. Notice that in both cases zero initial conditions were implicitly assumed
(i.e. integrals were assumed to be zero at t = 0; in the case of the Laplace
transform, this means that there is no f (0) term in (2.41)). We will address
this further in Chapter 9.

Remark 5.7. Transfer function (5.24) is similar to transfer functions (4.9) and
(4.11). As you know, this is one case of a so-called electrical equivalent of a
mechanical system, or of a mechanical equivalent of an electrical system. The
notions of eort and ux make clear why this parallel between models exists:
both consist of an eort accumulator, a ux accumulator, and a dissipator.
But notice that the parallel is not complete: (4.9) has a ux as input and
an accumulated eort as output; both the input and the output of (5.24) are
eorts.
68 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.10: Left: an integrated circuit with a 741 OpAmp, one of the most usual
types of OpAmps (source: Wikimedia). Other OpAmp types are manufactured
in integrated circuits that have several OpAmps each, sharing the same power
supply. Right: the symbol of the OpAmp (source: Wikimedia). Power supply
tensions are often omitted in diagrams for simplicity, but never forget that an
active component without power supply does not work.

Figure 5.11: The output of an OpAmp.

5.3 The operational amplier (OpAmp), an ac-


tive component
The resistor, the capacitor and the inductor are called passive components be- Passive components
cause they do not need a source of energy to function. Components that need
Active components a source of energy to function are called active components. Among them are
diodes and transistors, together with sensors that we will study in Chapter 13.
A component we will study right away because of its importance is the opera-
tional amplier, or in short the OpAmp.
An OpAmp is an electronic component that presents itself as an integrated
circuit (see Figure 5.10) and amplies the dierence between its two inputs V −
and V + :

V out = K V + − V − (5.29)

The output V out is limited to the power supply tensions:

V S− ≤ V out ≤ V S+ (5.30)

As can be expected from the fact that the OpAmp is an active component, if
No output if no power sup- no power is supplied, i.e. if the corresponding pins of the integrated circuit are
ply disconnected and thus V S+ = V S− = 0 V, then V out = 0 V, i.e. there is no
output. The gain of the OpAmp K should ideally be innite; in practice it is
very large, e.g. 105 or 106 . See Figure 5.11.
The other important characteristic of the OpAmp is that the impedance
between its two inputs V − and V + is very large. Ideally it should be ininite;
in practice it is 2 MΩ or more.
5.3. THE OPERATIONAL AMPLIFIER (OPAMP), AN ACTIVE COMPONENT 69

Figure 5.12: Inverting OpAmp with two generic impedances.

parator Example 5.5. The OpAmp can be used to compare two tensions, connected
to the two inputs V − and V + . Because K is very large, if V + > V − , even if
only by a very small margin, the output will saturate at tension V S+ . Likewise,
if V + < V − , even if only by a very small margin, the output will saturate at
tension V S− .
Only if V + and V − are equal, and equal to a great precision, will the output
be 0 V. Consider the case of a 741 OpAmp, typically supplied with V S± =
±15 V. Suppose that K = 105 . Then the output V out will not saturate at
either +15 V or −15 V only if |V + − V − | < 15 × 10−5 V.

Example 5.6. OpAmps are very usually employed in the conguration shown
in Figure 5.12, known as inverting OpAmp or inverter. In this case, because Inverting OpAmp or in-
the OpAmp's input impedance is very large, the current I will ow from input verter
Vi to output Vo , as shown in Figure 5.12. Consequently,
 Vo
+ − −
Vo = K(V − − V ) ⇔ V −= − K

Z2 = Vo −V
I ⇔ I = Vo −V
Z2
(5.31)

V −Vi V − −Vi

Z1 = ⇔ I = Z1

I

Eliminating I and V − , we get

Vo + VKo − Vo − Vi Z1 Z1 Vo Z2 K
= K ⇔ V o Z1 + V o + Vo = −Vi Z2 ⇔ =−
Z2 Z1 K K Vi Z1 K + Z1 + Z2
(5.32)

Because K is large, (5.32) reduces to

Vo Z2
=− (5.33)
Vi Z1

Remark 5.8. Notice how (5.33) shows that we can assume


V+ =V− (5.34)

(and so in this case V − = 0). This is because of the high input impedance.

Example 5.7. If in Figure 5.12 we make Z1 = R1 and Z2 = R2 , we obtain the


circuit in Figure 5.13, known as inverting amplier, for which Inverting amplier

Vo R2
=− (5.35)
Vi R1

Notice that, because R1 , R2 > 0 (there are no negative resistances!), in this


circuit the signs of Vi and Vo are always opposite. In spite of the circuit's name,
it can

ˆ amplify the input (i.e. |Vo | > |Vi |, if R2 > R1 ), or Amplication


70 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.13: Inverter amplier.

Figure 5.14: Inverting summer or summing circuit.

ˆ attenuate the input (i.e. |Vo | < |Vi |, if R1 > R2 ). Attenuation

Example 5.8. Consider the circuit in Figure 5.14, which is another variation
of the negative feedback OpAmp. From (5.34) and the Kircho law of nodes,
implicit in the currents shown in Figure 5.14, we get

V1 −0 V1
Z 1 =
 I1 ⇔ I1 = Z1

Z2 = V2 −0
I2
V2
⇔ I2 = Z2
(5.36)
0−Vo V1 V2 −Vo
−Z Z3

Z3 = ⇔Z + Z2 = ⇔ Vo = Z1 V 1
3
− Z2 V2

I1 +I2 1 Z3

Consider what happens when all the impedances are resistors:

Inverting summer or in- inverting summer or invert-


ˆ If Z1 = Z2 = Z3 = R this circuit is called
verting summing circuit ing summing circuit. The output Vo is the sum of the two inputs V1
and V2 , but with the sign inverted.

Inverting amplifying sum- inverting amplifying


ˆ If Z1 = Z2 = R and Z3 = R3 this will be an
mer or inverting summing summer or inverting summing amplier. The amplifying ratio is
amplier − RR3 (and can correspond to amplication or attenuation).

Inverting weighted sum- ˆ If all the resistances are dierent, we will have an inverting weighted
mer summer. If R3
R1 + R3
R2 = 1 there is no amplication or attenuation; other-
wise there is.

Remark 5.9. Notice that the circuit in Figure 5.14 is a MISO system.
5.3. THE OPERATIONAL AMPLIFIER (OPAMP), AN ACTIVE COMPONENT 71

Figure 5.15: Inverting RC circuit with an OpAmp.

Figure 5.16: Inverting CR circuit with an OpAmp.

Example 5.9. If in Figure 5.12 we have Z1 = R and Z2 consists in a resistor


R and a capacitor C in parallel, we obtain the circuit in Figure 5.15, with
1 R
Z2 = 1 1 = (5.37)
R + 1 1 + RCs
Cs

Vo 1
=− (5.38)
Vi 1 + RCs
and similar to the RC circuit from Example 5.2 with transfer function (5.16).
If in Figure 5.12 we have Z2 = R and Z1 consists in a resistor R and a
capacitor C in series, we obtain the circuit in Figure 5.16, with
1 1 + RCs
Z1 = R + = (5.39)
Cs Cs
Vo RCs
=− (5.40)
Vi 1 + RCs
and similar to the CR circuit from Example 5.3.
Example 5.10. Other than the inverter conguration in Figure 5.12, the most
usual conguration with which OpAmps are used is the on in Figure 5.17, known
as the non-inverting OpAmp or non-inverter. Because of the very large Non-inverting OpAmp or
input impedance, current ows as shown, and non-inverter


Vo = K(Vi −− V ) ⇔ V =
 −
Vi − VKo

Z2 = Vo −V
I ⇔ I = Vo −V
Z2
(5.41)

V −0 V−

Z1 = I ⇔ I = Z1

Eliminating I and V − , we get


Vo
Vo − Vi + K Vi − VKo Z1 Z2 Vo Z1 + Z2
= ⇔ Vo Z1 − Vi Z1 + Vo = Vi Z2 − Vo ⇔ =
Z2 Z1 K K Vi Z1 + ZK1 + ZK2
(5.42)
72 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.17: Non-inverting OpAmp with two generic impedances.

Figure 5.18: Non-inverting amplier.

Because K is large, (5.42) reduces to

Vo Z1 + Z2
= (5.43)
Vi Z1

Remark 5.10. (5.43) shows once again that we can assume (5.34). We would
have arrived sooner at the same result.

Example 5.11. If in Figure 5.17 we make Z1 = R1 and Z2 = R2 , we obtain


Non-inverting amplier the circuit in Figure 5.18, known as non-inverting amplier, for which

Vo R1 + R2
= (5.44)
Vi R1
Notice that, because R1 , R2 > 0, not only in this circuit the signs of Vi and
Vo are always the same, as the input is always amplied (i.e. |Vo | > |Vi |): it is
impossible to attenuate the input.

Example 5.12. Suppose that we want to amplify a tension 4 times. We can


use the non-inverting amplier of Figure 5.18 with R2 = 3R1 . As an alternative,
we can use two inverting ampliers as in Figure 5.19.

Remark 5.11. When we want to attenuate a tension without inverting its


signal, a non-inverting amplier cannot be used, since it must be always true
that VVoi > 1; two inverting ampliers in series must be used instead, as in the
previous example.

Figure 5.19: Two inverting ampliers, that amplify the input 4 times.
5.4. OTHER COMPONENTS 73

Figure 5.20: Voltage buer.

Figure 5.21: Subtractor.

Example 5.13. Consider the circuit in Figure 5.20. Because of (5.34), we have
V + = V − = Vi , and Vo = V − ; hence

Vo = Vi (5.45)

While at rst sight this may seem a good candidate for the prize of the most
useless circuit, it is in reality a most useful one. We can be sure that Vo = Vi
and that whatever components are connected to Vo will not aect Vi , because
there is no current owing between Vi and Vo . (The source of energy is the
OpAmp's power supply.) If it were not for the OpAmp, anything connected to
Vo would modify the value of Vi . This circuit is known as voltage buer or
tension buer. Voltage buer

Example 5.14. The MISO system in Figure 5.21 is know as subtractor, be- Subtractor
cause

V2 −V ±
R =

 I2
V ± −Vo

R =
I2
V1 −V ±
(5.46)

R= I1
V ± −0


R =
I1

From the last two equations, we get 2V ± = V1 . From the rst two equations,
and replacing this last result,

V2 = 2V ± − Vo ⇔ Vo = V1 − V2 (5.47)

5.4 Other components


Among the several other components that may be found in mechanical systems,
we will study the model of the transformer, shown in Figure 5.22: Transformer

VP NP
= (5.48)
VS NS

Here VP and VS are the tensions in the two windings, and NP and NS are
the corresponding numbers of turns in each winding. This is an ideal model; in
practice, there are losses, but we will not need to use a more accurate expression.
74 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.22: Transformer (source: Wikimedia commons).

Glossary
Et le professeur Lidenbrock devait bien s'y connaître, car il passait
pour être un véritable polyglotte. Non pas qu'il parlât couramment
les deux mille langues et les quatre mille idiomes employés à la sur-
face du globe, mais enn il en savait sa bonne part.

Jules Verne (1828 „1905), Voyage au centre de la Terre, 2

active component componente ativo


amplication amplicação
attenuation atenuação
capacitance capacidade elétrica, capacitância (bras.)
capacitor condensador, capacitor (bras.)
current corrente, intensidade (de corrente elétrica)
electric potential dierence voltagem, tensão, diferença de potencial elétrico
ux linkage uxo magnético total
impedance impedância
inductance indutância
inductor bobina, indutor
inverting amplier amplicador inversor
inverter inversor
inverting amplifying summer somador amplicador inversor
inverting OpAmp AmpOp inversor
inverting summer somador inversor
inverting summing amplier amplicador somador inversor
inverting summing circuit circuito somador inversor
inverting weighted summer somador inversor ponderado
non-inverter não-inversor
non-inverting OpAmp AmpOp não-inversor
OpAmp AmpOp
operational amplier amplicador operacional
passive component componente passivo
potentiometer potenciómetro, resistência variável, reóstato
resistance resistência
resistor resistência, resistor (bras.)
rheostat potenciómetro, resistência variável, reóstato
subtractor subtrator
tension voltagem, tensão, diferença de potencial elétrico
5.4. OTHER COMPONENTS 75

(a) (b)

(c) (d)

(e) (f)

(g) (h)

Figure 5.23: Systems of Exercises 1 and 2.

tension buer AmpOp seguidor de tensão, buer de tensão


variable resistor potenciómetro, resistência variável, reóstato
voltage voltagem, tensão, diferença de potencial elétrico
voltage buer AmpOp seguidor de tensão, buer de tensão

Exercises
1. Find the equations describing the dynamics of the systems in Figure 5.23,
and apply the Laplace transform to the equations to nd the corresponding
transfer function.
2. Again for the systems in Figure 5.23, nd the transfer function directly
from the impedances of the components, and apply the inverse Laplace
transform to the transfer functions to nd the corresponding equations.
3. Show that the dierential equations modelling the circuit in Figure 5.24
are similar to those of the mechanical system of Exercise 1 in Chapter 4.
Explain why, using the concepts of eort and ow.
4. Find the mechanical systems equivalent to the circuits in Figure 5.25.
5. Find the transfer function of the circuit in Figure 5.12 from the impedance
of the components for the following cases:
(a) Impedance Z1 is a resistor, impedance Z2 is a capacitor.
76 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS

Figure 5.24: Circuit of Exercise 3.

(a) (b)

Figure 5.25: Systems of Exercise 4.

(b) Impedance Z1 is a capacitor, impedance Z2 is a resistor.


(c) Impedance Z1 is a resistor, impedance Z2 is an inductor.
(d) Impedance Z1 is an inductor, impedance Z2 is a resistor.
(e) Both impedances Z1 and Z2 are capacitors.
(f) Both impedances Z1 and Z2 are inductors.
(g) Impedance Z1 consists in a resistor and a capacitor in series, impedance
Z2 is a resistor.
(h) Impedance Z1 consists in a resistor and a capacitor in parallel, impedance
Z2 is a resistor.
(i) Impedance Z1 is a resistor, impedance Z2 consists in a resistor and
a capacitor in series.
(j) Impedance Z1 is a resistor, impedance Z2 consists in a resistor and
a capacitor in parallel.
(k) Both impedances Z1 and Z2 consist in a resistor and a capacitor in
series.
(l) Both impedances Z1 and Z2 consist in a resistor and a capacitor in
parallel.
(m) Impedance Z1 consists in a resistor and a capacitor in series, impedance
Z2 consists in a resistor and a capacitor in parallel.
(n) Impedance Z1 consists in a resistor and a capacitor in parallel, impedance
Z2 consists in a resistor and a capacitor in series.
(o) Impedance Z1 consists in a resistor and an inductor in series, impedance
Z2 is a resistor.
(p) Impedance Z1 consists in a resistor and an inductor in parallel,
impedance Z2 is a resistor.
(q) Impedance Z1 is a resistor, impedance Z2 consists in a resistor and
an inductor in series.
(r) Impedance Z1 is a resistor, impedance Z2 consists in a resistor and
an inductor in parallel.
(s) Both impedances Z1 and Z2 consist in a resistor and an inductor in
series.
(t) Both impedances Z1 and Z2 consist in a resistor and an inductor in
parallel.
(u) Impedance Z1 consists in a resistor and an inductor in series, impedance
Z2 consists in a resistor and an inductor in parallel.
(v) Impedance Z1 consists in a resistor and an inductor in parallel,
impedance Z2 consists in a resistor and an inductor in series.
5.4. OTHER COMPONENTS 77

Figure 5.26: Circuit of Exercise 6.

6. Find the transfer function of the circuit in Figure 5.26. Assume that all
resistors are equal.

7. How could you perform operation Vo = V1 − V2 using two OpAmps and


without resorting to the subtractor in Figure 5.21?

8. Design a circuit to perform the operation Vo = V1 + V2 − V3 + 2V4 − 3V5 .


Use only one OpAmp.

9. Design a circuit to perform the operation Vo = 10(V1 + V2 + 21 V3 ). Use


two OpAmps.

10. Modify the subtractor in Figure 5.21 so as to give:

(a) Vo = V1 − 13 V2
(b) Vo = 5(V1 − V2 )

11. Suppose you are using an OpAmp with power supply V S± = ±20 V as
comparator. Use Matlab to plot the expected output Vo for 0 s≤ t ≤ 10 s
and the following inputs:

(a) V + = sin(tπ) V and V − = 5 V


(b) V + = 5 V and V − = sin(tπ) V
(c) V + = 10 sin(tπ) V and V − = 5 V
(d) V + = 5 V and V − = 10 sin(tπ) V
78 CHAPTER 5. MODELLING ELECTRICAL SYSTEMS
Chapter 6

Modelling uidic systems


Suppose a solid held above the surface of a liquid and partially im-
mersed: a portion of the liquid is displaced, and the level of the
liquid rises. But, by this rise of level, a little bit more of the solid is
of course immersed, and so there is a new displacement of a second
portion of the liquid, and a consequent rise of level. Again, this sec-
ond rise of level causes a yet further immersion, and by consequence
another displacement of liquid and another rise. It is self-evident
that this process must continue till the entire solid is immersed,
and that the liquid will then begin to immerse whatever holds the
solid, which, being connected with it, must for the time be consid-
ered a part of it. If you hold a stick, six feet long, with its end in
a tumbler of water, and wait long enough, you must eventually be
immersed. The question as to the source from which the water is
suppliedwhich belongs to a high branch of mathematics, and is
therefore beyond our present scopedoes not apply to the sea. Let
us therefore take the familiar instance of a man standing at the edge
of the sea, at ebb-tide, with a solid in his hand, which he partially
immerses: he remains steadfast and unmoved, and we all know that
he must be drowned.
Lewis Carroll (1832 „1898), A tangled tale, Knot IX
In this chapter we are concerned with uid ow in pipes (not with uid Pipe ow
ow with a free surface). Fluidic systems can be accurately modelled using the
Navier-Stokes equations, which you learn in a dierent course. Fortunately, in
many cases of uid ow in pipes it is possible to use simplied equations as
follows.

6.1 Energy, eort and ow


Energy E is given by the integral over distance x of the force F exerted by the
uid:
Z x
E= F dx (6.1)
0

The force is equal to the product of the pressure p and the cross-sectional area
A, so
Z x
F = pA ⇒ E = p A dx (6.2)
0

The volume ow rate (or volumetric ow rate) Q is the derivative of the Volume ow rate
volume V = A x, given by
dx
Q=A (6.3)
dt
where we assume a constant A. With some abuse of notation, we can write
A = Qdxdt and replace this in (6.2) to rewrite the integral in (6.1) as
Z t
E= pQ dt (6.4)
0

79
80 CHAPTER 6. MODELLING FLUIDIC SYSTEMS

Table 6.1: Eort, ow, accumulators and dissipators in uidic systems


Fluidic system SI
eort e pressure P Pa
ow f volume ow rate Q m3 /s
eort accumulator uidic inductance with inertance L kg m−4
accumulated eort ea = e dt uidic moment Γ = p dt Pa s
R R

relation between accumulated eort and ow ea R= ϕ(f ) uidic moment Γ = LQ


accumulated energy Ee = ea df kinetic energy of the ow Ee = 21 LQ2 J
ow accumulator reservoir with capacitance C F
accumulated ow fa = f dt volume V = Q dt m3
R R

relation between accumulated ow and eort fa R= ϕ(e) volume V = Cp


accumulated energy Ef = fa de potential energy of the ow Ef = 21 Cp2 J
dissipator uidic resistance R kg s
−1
m−4
relation between eort and ow e =R ϕ(f ) p = RQ
dissipated energy Ed = f de Ed = 12 RQ2 J

So pressure p and volume ow rate Q can be used as eort and ow. By an
understandable universal convention, Q is always considered as the ow, and p
as the eort.
Table 6.1 sums up the passing information and relations. The next section
presents the basic components mentioned in that Table.

6.2 Basic components of a uidic system


The basic components of a uidic system are the following:
Reservoir 1. A reservoir or tank, which may either have a free surface (see Figure 6.1)
Tank or not. Tanks of the rst case are often used with liquids; closed tanks
are the only option when the uid is a gas, since the gas might otherwise
escape, even if its density is higher than that of the air.
Open tank In the case of a tank with a free surface, there must be a pipe at the
bottom (otherwise the tank could not be emptied). The pressure p at
that point, as you know, is
p = ρgh (6.5)
where ρ is the uid density, g is the acceleration of gravity, and h is the
height of the uid in the tank. But the volume of uid in the tank is given
Capacitance by V = A h, and so, replacing h = VA in (6.5) and solving in order to V ,
A
V =p (6.6)
ρg
|{z}
capacitance C

Pressurised tank In the case of reservoirs without a free surface, it can also be shown that
V = pC , where the value of capacitance C will depend on whether the uid
is is a liquid, a gas undergoing an isothermal compression or expansion,
or a gas undergoing an adiabatic compression or expansion. We need not
worry with that, as long as the value of C is known.
Fluidic inductance 2. A uidic inductance. This is in fact one of the two phenomena that
take place in a pipe. Its model is an application of Newton's second law
(4.1) to the uid contained in a length ` of pipe (see Figure 6.2):
d2 x
A p = ρA` (6.7)
|{z} |{z} dt2
force mass
The force is the product of the cross-sectional area and the pressure (or
rather the dierence of pressures at the two extremities of the uid sep-
R `). Integrating both sides, and introducing the uidic
arated by length
moment Γ = p dt,
dx
Γ = ρ` (6.8)
dt
6.2. BASIC COMPONENTS OF A FLUIDIC SYSTEM 81

Figure 6.1: A water reservoir at the Évora train station. (Source: Wikimedia.)

Figure 6.2: A pipe with cross-sectional area A.

From (6.3) we know that dx


dt = A,
Q
so
ρ`
Γ= Q (6.9)
A
|{z}
inertance L

3. A pressure drop. This is the other phenomena taking place in any pipe, Pressure drop
due to the resistance of viscous forces both between the uid and the
wall of the pipe and between uid particles themselves. In another course
you learn about the dierence between laminar ow (i.e. a situation in Laminar ow
which uid particles move essentially in the direction of the ow only)
and turbulent ow (i.e. a situation in which uid particles move in a far Turbulent ow
more chaotic manner).
Here it suces to notice that in laminar ow the Hagen-Poiseuille equa- Hagen-Poiseuille equation
tion applies: for laminar ow

8µ`
p= Q (6.10)
πr4
|{z}
uidic resistance R

Here p is the pressure drop over length ` of the pipe, µ is the dynamic
viscosity, and r is q
the pipe radius. (If the cross-section of the pipe is not
circular, then r = Ar .) This expression was rst determined experimen-
tally, and then proved from the Navier-Stokes equations; all that we need
to worry about is the value of the uidic resistance.
The pressure drop is always higher for turbulent ow than for laminar
ow, and the relation between p and Q is no longer linear. However, it
may be linearised around a convenient point, so as to nd an approximate
value of resistance R = Q
p
valid in some range of values of these variables.
(See Figure 4.3 again.)
The pressure also drops when the ow crosses valves, bends (or shouldered
ttings), orices, diameter reducers, etc.. Model p = RQ is usually a good
t for those situations as well.
Remark 6.1. Pipes have both inertance and resistance. Of course, it may be
that one of the two is neglectable when compared to the other; but in reality
both are present.
82 CHAPTER 6. MODELLING FLUIDIC SYSTEMS

Figure 6.3: System of Example 6.1.

Fluidic impedances Remark 6.2. The impedances of these components are as follows:
P (s) 1
= (6.11)
Q(s) Cs
P (s)
= Ls (6.12)
Q(s)
P (s)
=R (6.13)
Q(s)
Pipe ow can be modelled putting together the equations describing these
components with the conservation of mass.
Example 6.1. Consider the system in Figure 6.3, supplied with water by a
pump providing a pressure p, that ows through a long pipe with inertance L
and neglectable resistance, and either lls a tank with capacitance C or leaves
the system through a valve with resistance R. We want to know the pressure
below the tank pt .
Let q(t) be the volume ow rate through the long pipe, that is then divided
into the ow feeding the tank qt (t) and the ow through the valve qv (t). Using
the impedances, we get

P (s)−Pt (s)
P (s) − Pt (s) = LsPt (s) R1 + Cs


 Q(s) = Ls 
 
Q(s) = Pt (s) R1 + Cs
 
 Q(s) = Qt (s) + Qv (s) 
Pt (s) 1 ⇒ (6.14)
Qt (s) = Cs Qt (s) = Pt (s)Cs

 

 
 Pt (s) = R
 
Qv (s) = R1 Pt (s)
Qv (s)

The rst equation then gives the desired answer:



L Pt (s) 1
P (s) = Pt (s) 1 + s + LCs2 ⇔ = L
(6.15)
R P (s) 1+ Rs + LCs2

Remark 6.3. Notice that (6.15) is similar to the model of a massspring


damper system (4.9) or the model of an RLC system (5.24).
Remark 6.4. Liquids can be presumed to be incompressible, so ρ is constant
and independent from p. Thus (6.5) shows that there is a one-to-one relation
Hydraulic head between p and h, where h is the hydraulic head. So, when the uid is a liquid,
p is often replaced by ρgh. To do this, of course, the density of the liquid used
in the system must be xed in advance; the most usual cases are water, brine,
and crude oil.
Model (6.9) of a uidic inductance tells us that p dt = Γ = LQ; applying
R
Using the head instead of
the pressure the Laplace transform, this becomes
Fluidic inductance
p ρgh L
= LQ ⇔ = LQ ⇔ h = sQ (6.16)
s s ρg
Here, L∗ = ρg L
is the inertance relating hydraulic head and ow; L is the in-
ertance relating pressure and ow. Notice that the SI units of L are kg m−4 ;
those of L∗ are s2 m−2 .
Fluidic resistance Likewise, model (6.10) of uidic resistance tells us that p = RQ; so
R
ρgh = RQ ⇔ h = Q (6.17)
ρg
Here, R∗ = ρgR
is the resistance relating hydraulic head and ow; R is the resis-
tance relating pressure and ow. Notice that the SI units of R are kg s−1 m−4 ;
those of R∗ are s m−2 .
6.3. OTHER COMPONENTS 83

Figure 6.4: System of Example 6.2.

Example 6.2. Consider the system in Figure 6.4, with two water reservoirs
fed by a pump that delivers a ow q , and connected by a pipe with neglectable
inertance and resistance R. We have
 
q(t) = q1 (t) + q2 (t)





Q(s) = A1 H1 (s)s + A2 H2 (s)s
q (t) = A ḣ (t) Q (s) = A H (s)s
1 1 1 1 1 1
⇒ (6.18)
q2 (t) = A2 ḣ2 (t)
 Q2 (s) = A2 H2 (s)s


 h2 (t)−h1 (t) 
= q1 (t) H2 (s) − H1 (s) = RA1 H1 (s)s

R

Thus
( (
Q(s) = A1 H1 (s)s + A2 H1 (s)(RA1 s + 1)s Q(s) = H1 (s)(RA1 A2 s2 + A1 s + A2 s)
⇔ ⇔
H2 (s) = H1 (s)(RA1 s + 1) H2 (s) = H1 (s)(RA1 s + 1)

H1 (s) 1
=


Q(s) RA1 A2 s2 + (A1 + A2 )s

(6.19)
H2 (s) RA1 s + 1
=


Q(s) RA1 A2 s2 + (A1 + A2 )s

Remark 6.5. When modelling pipe ows, pay special attention to non-linearities.
All pipes have some maximum value that the ow can take. So in a pipe like
that in Figure 6.4 we have −Qmax ≤ Q ≤ Qmax . But in some systems pipes
feed tanks from above: see for instance Figure 6.8 below, corresponding to Ex-
ercise 2. In that case, 0 ≤ Q3 ≤ Q3 max . In other words, the ow can ll up the
tank below, but it cannot empty it.
Neglecting non-linearities leads to absurd models and ludicrous conclusions,
such as those mocked by mathematician Charles Dogdson in the quote at the
beginning of this chapter.

6.3 Other components


Among the several other components that may be found in pipe ow systems, the
hydraulic press deserves a passing mention. Its principle is shown in Figure 6.5.
Because of (6.2), a similar pressure on both sides means that
F1 F2 A2
= ⇔ F2 = F1 (6.20)
A1 A2 A1
where F1 and F2 are the forces exerted on the two pistons, with areas A1 and
A2 . This principle is used in presses such as that in Figure 6.6.

Glossary
Había en el puerto gran multitud de buques de todas clases y tamaños,
resplandeciendo entre ellos, llamando la atención y hasta excitando
la admiración y la envidia de los españoles, un enorme y hermosísimo
navío, construido con tal perfección, lujo y elegancia, que era una
maravilla.
Los españoles, naturalmente, tuvieron la curiosidad de saber quién
era el dueño del navío y encargaron al secretario que, sirviendo de
intérprete, se lo preguntase a algunos alemanes que habían venido a
84 CHAPTER 6. MODELLING FLUIDIC SYSTEMS

Figure 6.5: Principle of the hydraulic press (source: Wikimedia).

Figure 6.6: Hydraulic press (source: Wikimedia).


6.3. OTHER COMPONENTS 85

Figure 6.7: System of Exercise 2.

bordo.
Lo preguntó el secretario y dijo luego a sus paisanos y camaradas:
El buque es propiedad de un poderoso comerciante y naviero de
esta ciudad en que estamos, el cual se llama el señor Nichtverstehen.

Juan Valera (1824 „1905), Cuentos y chascarrillos andaluces,El señor


Nichtverstehen

brine água salgada (lit. salmoura)


uidic inductance indutância uídica
uidic moment momento uídico
uidic resistance resistência uídica
hydraulic head altura de coluna de uido (de água, de água salgada, de crude)
hydraulic press prensa hidráulica
inertance indutância uídica
pressure pressão
pressure drop perda de carga
reservoir reservatório, tanque
tank reservatório, tanque
volume ow rate caudal volumétrico
volumetric ow rate caudal volumétrico

Exercises
1. Consider the system from Example 6.1, shown in Figure 6.3. Find its
mechanical equivalent.

2. Consider the system in Figure 6.7, fed by a pump delivering volume ow
rate q1 (t). Tanks 1 and 2 are connected by a pipe with neglectable iner-
tance and uidic resistance R1 ; tanks 2 and 3 are emptied through valves
with resistances R2 and R3 respectively. Find transfer functions H 1 (s)
Q1 (s) ,
H2 (s) H3 (s)
Q1 (s) and Q1 (s) .

3. Consider the system in Figure 6.8, fed by a pump delivering volume ow
rate q1 (t). Find transfer functions H 1 (s) H2 (s) H3 (s) Q5 (s)
Q1 (s) , Q1 (s) , Q1 (s) and Q1 (s) .
86 CHAPTER 6. MODELLING FLUIDIC SYSTEMS

Figure 6.8: System of Exercise 3.


Chapter 7

Modelling thermal systems


Mais qu'entends-tu par le vide ? demanda Michel, est-ce le vide
absolu ?
C'est le vide absolument privé d'air.
Et dans lequel l'air n'est remplacé par rien ?
Si. Par l'éther, répondit Barbicane.
Ah ! Et qu'est-ce que l'éther ?
L'éther, mon ami, c'est une agglomération d'atomes impondéra-
bles, qui, relativement à leurs dimensions, disent les ouvrages de
physique moléculaire, sont aussi éloignés les uns des autres que
les corps célestes le sont dans l'espace. Leur distance, cependant,
est inférieure à un trois-millionièmes de millimètre. Ce sont ces
atomes qui, par leur mouvement vibratoire, produisent la lumière
et la chaleur, en faisant par seconde quatre cent trente trillions
d'ondulations, n'ayant que quatre à six dix-millièmes de millimètre
d'amplitude.

Jules Verne (1828 „1905), Autour de la Lune, 5

This chapter concerns thermal systems. You will study heat transfer in
depth in another course, but simple cases can be modelled with a formulation
similar to that employed to the systems in the previous chapters.

7.1 Energy, eort and ow


There is, however, an important dierence. By convention:

ˆ temperature T is the eort variable; Temperature

ˆ heat ow rate q is the ow variable. Heat ow rate

However, heat is energy; it is in fact kinetic energy of molecules and atoms. Heat is energy
(As you may know, an omnipresent æther was postulated for some centuries
to explain the propagation of heat and especially of light, but this hypothesis,
of which you may nd a popular explanation at the beginning of this chapter,
has been abandoned for about one century, having been by then contested for
decades because of experimental results with which it could not reconciled.)
Consequently, it is not true in thermal systems that energy is the integral of the
product of eort and ow see (4.30) , as the variable used for ow is an
energy rate itself. And, as a result, the parallels with the other types of systems
we have been studying are not perfect.

7.2 Basic components of a thermal system


There is only one type of accumulator, that of heat, i.e. of ow: Heat accumulator

H(t) = m Cp (T (t) − T (0)) (7.1)

87
88 CHAPTER 7. MODELLING THERMAL SYSTEMS

Here H(t) = 0 q(t) dt is the accumulated heat in mass m, which has a specic
Rt

heat Cp and is heated from temperature T (0) to temperature T (t). Specic heat
Dissipation can take place in three dierent ways:

Conduction ˆ In conduction there is no macroscopic movement of the solid or uid


that undergoes the process. Heat is transmitted, or rather diused, at
the molecular and atomic levels. The heat ow, which we assume to be
positive in the sense of increasing values of position x, is

∂T (x, t)
q(t) = −kA (7.2)
∂x
where A is the cross-sectional area and k is the thermal conductivity.
Assuming that the temperature distribution over x is linear over a distance
L, (7.2) becomes

kA
q(t) = (T (0, t) − T (L, t)) (7.3)
L
|{z}
conduction heat transfer coecient hc

∂T (x,t) T (L,t)−T (0,t)


Notice that the minus sign is gone because ∂x = limL→0 L .

Convection ˆ In convection there is macroscopic movement of the uid where heat


transfer is taking place. In solids matter cannot move and this way and
consequently there can be no convection. If the uid movement is due
Free convection solely to the temperature gradients, this is called free convection; if
uid movement is due at least in part to some other reason (like uid ow
Forced convection in pipes, or a blower), this is called forced convection. In any case,
the heat ow, again assumed positive in the sense of increasing values of
position x, is

hA (T (0, t) − T (L, t))


q(t) = |{z} (7.4)
convection heat transfer coecient hh

Here h is the convection heat transfer coecient, and A is the cross-


sectional area over which heat transfer takes place.

Radiation ˆ In radiation heat is propagated by the emission of photons. It is the only


heat transmission that can take place in a vacuum. It is also the only one
corresponding to a non-linear law:

q(t) = Cr A T14 − T24 (7.5)


Here Cr is a proportionality constant that we need not delve into. This


law, of course, can be linearised around some point, and the result will be
approximately valid in a vicinity thereof; for instance:

q(t) = Cr A (T1 + T2 ) T12 + T22 (T1 − T2 ) (7.6)



| {z }
radiation heat transfer coecient hr

Notice that all cases conduction, convection, and linearised radiation


can be reduced to the following form:

∆T = Rq (7.7)

Thermal resistance Here R is thermal resistance and ∆T is the temperature dierence.


The relations are summed up in Table 7.1. The corresponding impedances
are
∆T (s) 1
= (7.8)
Q(s) mCp s
∆T (s)
=R (7.9)
Q(s)
7.2.

Thermal system SI
eort e temperature T K or ◦ C
ow f heat ow rate q W
eort accumulator
R
accumulated eort ea = e dt
relation between accumulated eort and ow ea R= ϕ(f )
accumulated energy Ee = ea df
ow accumulator
R heat accumulator with mass Rm and specic heat Cp kg × J kg−1 K−1
accumulated ow fa = f dt heat H = q dt J
relation between accumulated ow and eort fa R= ϕ(e) heat H = m Cp T
accumulated energy Ef = fa de
dissipator thermal resistance with resistance R K/W
relation between eort and ow e =R ϕ(f ) T = Rq
dissipated energy Ed = f de
BASIC COMPONENTS OF A THERMAL SYSTEM

Table 7.1: Eort, ow, accumulators and dissipators in thermal systems


89
90 CHAPTER 7. MODELLING THERMAL SYSTEMS

Figure 7.1: A thermometer immersed in a uid.

Figure 7.2: Electrical circuit equivalent to the thermal system in Figure 7.1.

Tf Tt(0)

Tt(0) Tf

t t

Figure 7.3: Evolution of temperature Tt (t) in the system Figure 7.1 when Tt (t) <
Tf (left) and when Tt (t) > Tf (right).
7.2. BASIC COMPONENTS OF A THERMAL SYSTEM 91

Example 7.1. The reading of a mercury or alcohol thermometer at time t = 0


is Tt (0). At that instant, it is immersed in a uid at temperature Tf (see
Figure 7.1). Let the thermal resistance of the glass be R, and the specic heat
of mass m of mercury or alcohol be Cp . How does Tt (t) evolve?
This can be seen using an equivalent electrical circuit. Both temperatures
become tensions; the thermal resistance of the glass becomes a resistance R and
the heat accumulator becomes a capacitor C . So the equivalent circuit is the
one in Figure 7.2. The corresponding transfer function remember (5.16)
is
Vo (s) 1
= (7.10)
Vi (s) 1 + RCs
Temperature Tf is constant and is applied from t = 0 on, so the Laplace
transform of the input is
Tf
L [(Tf − Tt (0)) H(t)] = (7.11)
s
Notice that the amplitude of the temperature change is Tf − Tt (0); since the
Heaviside function begins at 0 and ends in 1, we must multiply it by Tf − Tt (0)
and take into account the dierent initial value also when calculating the output
we want to know:

Tf 1
Tt (t) − Tt (0) = L −1
s 1 + RmCp s
1
" #
1

RmCp − RmC t
= Tf L −1
1 = Tf 1 − e p (7.12)
s( RmC p
+ s)

We conclude that temperature Tt (t) begins at Tt (0), ends at Tf , and changes


exponentially with time. This is illustrated in Figure 7.3.

Glossary
Aber in Phantásien waren fast alle Wesen, auch die Tiere, min-
destens zweier Sprachen mächtig: Erstens der eigenen, die sie nur
mit ihresgleichen redeten und die kein Auÿenstehender verstand, und
zweitens einer allgemeinen, die man Hochphantäsisch oder auch die
Groÿe Sprache nannte. Sie beherrschte jeder, wenngleich manche sie
in etwas eigentümlicher Weise benützten.

Michael Ende (1929 „1995), Die unendliche Geschichte von A biz Z, 2

conduction condução
convection convecção
forced convection convecção forçada
free convection convecção livre
heat accumulator acumulador de calor
heat ow rate uxo de calor
radiation radiação
specic heat calor especíco
thermal resistance resistência térmica
temperature temperatura

Exercises
1. Consider the Wave Energy Converter of Figure 3.2, when submerged in
sea water at constant temperature Tsea . Assume that the air inside the
device has a homogeneous temperature Tair (t) and is heated by the de-
vice's Power Take-O (PTO) mechanism, at temperature TP T O (s), that
delivers an electrical power P (t) to the electrical grid with an eciency
η . (See Figure 7.4.) Heat transfer from the PTO to the air inside the
device takes place by convection with a constant coecient h and for area
A; neglect the thermal capacity of the metallic WEC itself; consider that
92 CHAPTER 7. MODELLING THERMAL SYSTEMS

Figure 7.4: The Wave Energy Converter of Exercise 1.

Cair and CP T O are the thermal capacities of the air and the PTO, that
have masses mair and mP T O . Let T (t) = Tair (t) − TP T O (t). Find transfer
function PT (s)
(s) .

2. Explain which of the electrical systems in Figure 5.23 have a thermal


equivalent and which do not, and why.
Chapter 8

Modelling interconnected and


non-linear systems
You are right in thinking that he is under the British government.
You would also be right in a sense if you said that occasionally he
is the British government.

My dear Holmes!


I thought I might surprise you. Mycroft draws four hundred and
fty pounds a year, remains a subordinate, has no ambitions of any
kind, will receive neither honour nor title, but remains the most
indispensable man in the country.
But how?
Well, his position is unique. He has made it for himself. There
has never been anything like it before, nor will be again. He has
the tidiest and most orderly brain, with the greatest capacity for
storing facts, of any man living. The same great powers which I
have turned to the detection of crime he has used for this particular
business. The conclusions of every department are passed to him,
and he is the central exchange, the clearinghouse, which makes out
the balance. All other men are specialists, but his specialism is
omniscience. We will suppose that a minister needs information as
to a point which involves the Navy, India, Canada and the bimetallic
question; he could get his separate advices from various departments
upon each, but only Mycroft can focus them all, and say ohand how
each factor would aect the other.

Sir Arthur Conan Doyle (1859 „1930), His last bow,


The Adventure of
the BrucePartington Plans

This chapter presents an overview of the modelling process.

8.1 Energy, eort and ow


Table 8.1 presents the impedances of all the ow accumulators, eort accumu- Impedances
lators, and energy dissipators, summing up Tables 4.1, 5.1, 6.1, and 7.1, and
showing clearly the existing parallelism between systems of dierent types.
This is the place to notice that eort variables are measured in relation to
an arbitrary value that serves as zero:
ˆ In Table 8.1 this is explicit for thermal systems, since temperature is
denoted as ∆T , as what matters is the temperature dierence.
ˆ In the case of electrical systems, what matters is always the electrical
tension at the extremities of the component.
ˆ In the case of pipe ow, resistance and inductance depend on the pressure
dierence at the extremities. Reservoirs with a free surface also depend
on a pressure dierence, between the pressure of the liquid at the bottom
and the atmospheric pressure.

93
94CHAPTER 8.

Type of system Mechanical, translation Mechanical, rotation Electrical Fluidic Thermal


eort e velocity ẋ angular velocity ω̇ voltage U pressure P temperature T
ow f force F torque τ current I volume ow rate Q heat ow rate q
eort accumulator spring angular spring inductor uidic inductance
sX(s) s sΩ(s) s U (s) P (s)
impedance F (s) = K T (s) = κ I(s) = Ls Q(s) = Ls
ow accumulator mass moment of inertia capacitor reservoir heat accumulator
sX(s) 1 sΩ(s) 1 U (s) 1 P (s) 1 ∆T (s) 1
impedance F (s) = M s T (s) = Js I(s) = Cs Q(s) = Cs Q(s) = mCp s
dissipator damper rotary damper resistor uidic resistance thermal resistance
sX(s) 1 sΩ(s) 1 U (s) P (s) ∆T (s)
impedance F (s) = b T (s) = b I(s) = R Q(s) = R Q(s) = R
Table 8.1: Eort, ow, accumulators and dissipators in dierent types systems
MODELLING INTERCONNECTED AND NON-LINEAR SYSTEMS
8.2. SYSTEM INTERCONNECTION 95

ˆ In the case of mechanical systems, the energy dissipated by a damper


depends on the relative velocities of its extremities, and the energy accu-
mulated by a spring depends on the relative position of its extremities.

Notice that there may be values of these variables that we can think of as ab-
solute zeros, such as temperature −273.15 ◦ C = 0 K, pressure 0 Pa of complete
vacuum, or position and velocity measured in an inertial frame of reference.
Still, it is often far more practical to use other values, such as atmospheric Dealing with initial condi-
pressure, room temperature, or resting position, as zero. tions

Example 8.1. A 300 kg dirigible balloon ies at constant altitude z = 200 m,


because its impulsion cancels its weight. It can move vertically thanks to two
electrical propulsors, each of which provides a force given by Fp (t) = γU (t),
where U (t) is the tension applied (control input) and the gain is γ = 15 N/V
(the force is upwards when U > 0). When the balloon moves, there is a viscous
drag force with coecient c = 30 N s/m. How does the altitude change with
time when a 20 V tension is applied during 10 s?
A balance of forces shows that

300z̈(t) = 2 × 15U (t) −30ż(t) (8.1)


| {z } | {z } | {z }
mass×acceleration propulsors drag force

We know that initial conditions are z(0) = 200 and ż(0) = 0, so we could be
tempted to apply the Laplace transform as

300 Z(s)s2 − 200s = 30U (s) − 30 (Z(s)s − 200) (8.2)


Rearranging terms,

(300s2 + 30s)Z(s) = 30U (s) + 6 × 104 s + 6 × 103 (8.3)


3 2
1 2 × 10 s 2 × 10 1 2 × 102
⇔ Z(s) = U (s) + + = U (s) +
(10s + 1)s (10s + 1)s (10s + 1)s (10s + 1)s s
Z(s)
Notice that it is impossible to nd a transfer function U (s) relating the (Laplace No transfer function if ini-
transforms of) the input and the output. To obtain a transfer function, make tial conditions are not zero
z ∗ (t) = z(t) − (0), and then

Z ∗ (s) 1
300Z ∗ (s) = 30U (s) − 30Z ∗ (s)s ⇔ = (8.4)
U (s) (10s + 1)s

The result will of course be the same, but this allows us to use many results
established for transfer functions, such as those in Chapters 9 and 11. It also
allows us to use Matlab to nd the answer as follows:

>> G = tf(1, [10 1 0]);


>> Ts = 0.001; t = 0 : Ts : 50;
>> U = zeros(size(t)); U(1:10/Ts) = 20*ones(1, 10/Ts);
>> z = lsim(G, U, t); z = z + 200;
>> figure, plot(t,Z)
>> xlabel('t [s]'), ylabel('z [m]')
Notice how we had to add 200 to the result (or else we would have to bear in
mind that the plot would show oscillations around 200 m). See Figure 8.1.

Remark 8.1. Remember that we already did something similar in Example 7.1.

8.2 System interconnection


Transfer functions are of great aid when modelling several interconnected sys-
tems, of the same or of dierent types.

Example 8.2. Consider the system in Figure 8.2. The force exerted by the
inductance in the handle that undergoes displacement x2 is given by F2 (t) =
αi(t), where i(t) is the current in the inductance. Find X 1 (s)
Vi (s) .
96CHAPTER 8. MODELLING INTERCONNECTED AND NON-LINEAR SYSTEMS

400

380

360

340

320

z [m]
300

280

260

240

220

200
0 10 20 30 40 50
t [s]

Figure 8.1: Results of Example 8.1.

Figure 8.2: System of Example 8.2.

We can of course write all the equations, and obtain the desired result with
successive replacements. Transfer functions allow us to model each system sep-
arately, making such replacements easier.
As to the electrical system, remembering (5.48),
n2 n
n1 Vi (s)
2
I(s) n1
R + Ls = ⇔ = (8.5)
I(s) Vi (s) R + Ls
As to the lever, and letting F1 be the force exerted on mass m1 ,
F1 (s) b
F1 (t)a = F2 (t)b ⇔ = (8.6)
F2 (s) a
As to the mass,
X1 (s) 1
F1 (t) − Kx1 (t) = m1 ẍ1 (t) ⇔ = 2
(8.7)
F1 (s) m1 s + K
Finally,
b n2
X1 (s) X1 (s) F1 (s) F2 (s) I(s) a α n1
= = (8.8)
Vi (s) F1 (s) F2 (s) I(s) Vi (s) (m1 s2 + K)(R + Ls)
This way, we are also able to study each transfer function separately, analysing
its inuence in the nal result.
Bond graphs Bond graphs are another tool that can be used to assist the modelling
of interconnected systems. They consist in a graphical representation of what
happens with energy in a system, based upon the concepts of eort and ux.
These are written above and below arrows (of which, by convention, only half the
8.3. DEALING WITH NON-LINEARITIES 97

Figure 8.3: Two bond graphs of systems where elements have the same ux and
there is an eort junction. Top: electrical circuit. Notice that V1 = (V1 − V2 ) +
(V2 − V3 ) + V3 . Bottom: uidic system. Since the pipe has both resistance and
inductance, the pressure change from the pump delivering a constant pressure
P to the bottom of the reservoir where the hydraulic head is h and the pressure
is ρgh is split into two, as if the uid would rst go through an inductance
without resistance and then through a resistance without inductance, so that
P = (P − P1 ) + (P1 − ρgh) + ρgh.

tip is drawn). Figure 8.3 shows two examples of bond graphs in which several
elements have the same ux and dierent eorts; the corresponding junction
of the several eorts in one system is by convention denoted by number 1.
Figure 8.4 shows two examples of bond graphs in which several elements have
the same eort and dierent ows; the corresponding junction of the several
ows in one system is by convention denoted by number 0. Also notice how
sources of energy are denoted by SE . Finally, the product of what is above and
below each arrow (the eort and the ow) will be that element's instantaneous
power, showing how energy is distributed over the system. We will not study
bond graphs more complicated than these, nor further explore the ability of this
graphical tool to assist in the modelling.

8.3 Dealing with non-linearities


Non-linearities can be classied as hard or soft, as they are respectively more
or less severe. Though no uniform denition is universally accepted, we will say
that

ˆ a soft non-linearity is one that is continuous and dierentiable, Soft non-linearity

ˆ a hard non-linearity is not dierentiable, or even not continuous. Hard non-linearity

Figure 8.5 presents two examples.


Non-linearities are very common. They may be part of the design of a
system, even of a control system. In Chapter 28 we will learn how to deal with
non-linearities in control systems. What is important here is to notice that
soft non-linearities can be approximated by a rst order approximation around
the operating point. Estimating how large the approximation error may be is
important; we will do that in Chapters 1214.

Example 8.3. In Figure 8.6, mass m = 10 kg rests on a non-linear spring and


is pulled by force F applied simultaneously on a linear spring with k = 103 N/m
and on a linear damper with b = 500 N s/m. The non-linear force of the spring
is given by Fk = 5000 − ∆y+0.1
500
(SI), where the ∆y is the variation of length
98CHAPTER 8. MODELLING INTERCONNECTED AND NON-LINEAR SYSTEMS

Figure 8.4: Two bond graphs of systems where elements have the same eort
and there is a ux junction. Top: electrical circuit. Notice that I = I1 + I2 + I3 .
Bottom: mechanical system. Notice that F − Kx − B ẋ = M ẍ ⇔ F = Kx +
B ẋ + M ẍ.

10 20

8
15
6
10
4
5
2
0
y

0
y

−5
−2
saturation
−10
−4

−6 −15
dead zone linear approximation around operation point x=6
−8 −20

−10 −25
−10 −5 0 5 10 −10 −5 0 5 10
x x

Figure 8.5: Left: hard non-linearities (dead zone and saturation; in practice
limits need not be symmetric for positive and negative values, though this is
assumption is frequent). Right: soft non-linearity and one of its linear approxi-
mations.

Figure 8.6: System of Example 8.3.


8.3. DEALING WITH NON-LINEARITIES 99

−1.9́ 10−3 m
3000

2000

1000

Fk [N]
0
−98 N

−1000

−2000

−3000
−0.03 −0.02 −0.01 0 0.01 0.02 0.03 0.04 0.05
D y [m]

Figure 8.7: Non-linear force of Example 8.3.

around the uncompressed value. We want a linear model for this system around
nominal conditions of rest when F = 0.
Figure 8.7 shows the non-linear force. When F = 0, the non-linear spring is
compressed by the weight of m, which is −9.8 × 10 N (notice the minus sign,
since the weight is downwards and the positive sign of y corresponds to an
upwards direction), corresponding to

500
−98 = 5000 − ⇔ ∆y = −1.9 × 10−3 m (8.9)
∆y + 0.1
The linearised law is

dFk 500
y = 5.2 × 104 y (SI)

Fk ≈ y= 2

d(∆y) ∆y=−1.9×10−3 m (∆y + 0.1) ∆y=−1.9×10−3 m
(8.10)

where y = ∆y + 1.9 × 10−3 m, or, if you prefer, the variation of length around
∆y = −1.9 × 10−3 m. Furthermore, the linear components are assumed to have
no mass, and hence transmit force F to mass m. Thus

mÿ = F − 5.2 × 104 (SI) (8.11)

It should be stressed that linear model (8.11) is only an approximation.

Glossary
Desejoso ainda o Fucarãdono, como mais douto q os outros, de leuar
a sua auante cõ preg utas q
embaraçasse o padre, lhe veyo arguindo
de nouo q porq razão punha nomes torpes ao Criador de todas as
cousas, & aos Sãtos q no ceo assistião em louuor seu, infamãdoo de
metiroso, pois elle, como todos criaõ, era Deos de toda a verdade ?
& para q se entenda dõde naceo a este dizer isto, se ha de saber q
na lingoa do Iapaõ se chama a metira diusa, & por q o padre quãdo
pregaua dezia q a
qella ley q
elle vinha denuciar era a verdadeira ley
de Deos, o qual nome elles pela grossaria da sua lingoa não podião
pronuciar taõ claro como nos & por dizere Deos dezião diùs, daquy
veyo que estes seruos do diabo tomaraõ motiuo de dizere aos seus
que o padre era demonio em carne q vinha infamar a Deos põdo-lhe
nome de mentiroso: (. . . ) E porque tambem se saiba a razaõ porque
lhe este bonzo disse que punha nomes torpes aos santos, foy, porque
tinha o padre por custume quando acabaua de dizer missa rezar com
todos hua Ladaynha para rogar a N. Senhor pela augmetação da fé
Catholica, & nesta ladainha dezia sempre, como nella se custuma,
Sancte Petre ora pro nobis, Sancte Paule ora pro nobis, & assi dos
100CHAPTER 8. MODELLING INTERCONNECTED AND NON-LINEAR SYSTEMS

Figure 8.8: System of Exercise 1.

Figure 8.9: System of Exercise 3.

mais Santos. E por q tambem este vocablo santi na lingoa Iapoa


he torpe & infame, daquy veyo arguyr este ao padre q punha maos
nomes aos Sãtos, (. . . ) & daly por diãte mãdou o padre q se naõ
dissesse mais sancte, senaõ beate Petre, beate Paule, & assi aos outros
Santos, porque já dantes tinhaõ os bonzos todos perante el Rey feito
peçonha disto.

Fernão Mendes Pinto (1509? „1583), Peregrinaçam, CCXIII

bond graph grafo de ligação


hard non-linearity não-linearidade severa
linearisation, linearization (US) linearização
soft non-linearity não-linearidade suave

Exercises
1. Draw the bond graph of the system in Figure 8.8.

2. Draw the bond graph of the balloon from Example 8.1.

3. The system in Figure 8.9 is fed by a water pump with a characteristic curve
given by P (t) = 105 − 2 × 106 Q(t), where P and Q are the pressure (Pa)
and the volumetric ow (m3 /s) provided.
The pipe has a 0.01 m2 cross section and a length of 50 m. Its ow
resistance is neglectable; its inertance is not.
The tank has a free surface and 1 m2 cross-section.
The valve is non-linear and veries relation

(8.12)
p
Qv (t) = 0.3 × 10−4 N (t) Pv (t)

where Qv is the ow through the valve (m3 /s), N is the opening of the
valve (dimensionless), and Pv is the pressure (Pa) at the entrance of the
valve, which is also the pressure at the bottom of the tank.
In nominal conditions, Pv = 8 × 104 Pa and Qv = 0.01 m3 /s.

(a) Show that the pipe's inertance is L = 5 × 106 kg m−4 .


(b) Show that in nominal conditions the height of water in the tank is
h̄ = 8.16 m.
8.3. DEALING WITH NON-LINEARITIES 101

Figure 8.10: System of Exercise 4.

(c) Show that the non-linear relation of the valve (8.12) can be linearised
as

Qv (t) = Qv (t) + 0.085 N (t) − N (t) + 6.25 × 10−7 Pv (t) − Pv (t)
(8.13)

(d) Show that the system can be modelled by (8.13) together with


 Pv (t) − Pv = ρg h − h̄
d(h−h̄)

(8.14)

Q(t) − Q̄ − Qv (t) − Qv = A dt
d(Q(t)−Q̄)


Pb (t) − Pb − Pv (t) − Pv = L

dt

∆Pv (s)
(e) Find transfer function ∆N (s) , relating variations around nominal
conditions.
4. In Figure 8.10, the lever with inertia I oscillates around the horizontal
position (i.e. θ(t) = 0) and is moved by torque τm . Mass m moves verti-
cally, at distance d from the fulcrum of the lever, inside a cylinder with
two springs of constant k , lled with incompressible oil. The pressure
dierence ∆p(t) between the two chambers of the cylinder moves the oil
through uidic resistance R. Thanks to oil lubrication, friction inside the
cylinder is neglectable.
(a) Write linearised equations for the dynamics of the system.
Θ(s)
(b) Find transfer function Tm (s) .

5. In Figure 8.11, the lever with inertia I is actuated by force F (t) and
supported on the other side by a spring and a damper. On the lever
there is a car with mass m, moving to sidewards due to gravity, without
friction. When F = 0 and the car is on the fulcrum (i.e. its position is
x = 0), the lever remains in the horizontal position. There is no friction
at the fulcrum.
(a) Write linearised equations for the dynamics of the system.
X(s)
(b) Find transfer function F (s) .

6. The lever in Figure 8.12, with neglectable mass, is moved by a torque τ


applied on the fulcrum, in the absence of which the lever is horizontal (i.e.
θ = 0). F is the force exerted on the fulcrum.
102CHAPTER 8. MODELLING INTERCONNECTED AND NON-LINEAR SYSTEMS

Figure 8.11: System of Exercise 5.

Figure 8.12: System of Exercise 6.

It is known that m1 = 1.5 kg, m2 = 2.0 kg, d1 = 0.6 kg, d2 = 0.4 m, and
b = 20 N s/m. The spring obeys the non-linear law in Figure 8.12, where δ
is the length variation in mm (with δ > 0 corresponding to compression),
and Fm is the resulting force in N.

(a) Show that, in nominal conditions, Fm = 1.63 N.


(b) Show from the plot in Figure 8.13 that the force of the spring can be
linearised as Fm = 1.63 + 3.26 × 103 x1 .
(c) Write linearised equations for the dynamics of the system.
F (s)
(d) Find transfer function T (s) .

7. In Figure 8.14, the fresh water (ρ = 1000 kg/m3 ) tank in the left is big
enough to keep a constant liquid height h0 = 5 m, while the tank in the
right has a 10 m2 cross-section and a variable liquid height h1 (t).
Flow qc (t) bleeds this tank and does not depend on pressure; ow q1 (t)
passes through a non-linear valve that veries

q1 (t) = 0.15xv (t) ∆p(t) (SI) (8.15)


p

where ∆p(t) is the pressure dierence on both sides of the valve and xv (t)
is mechanically actuated by h1 (t) through a rigid lever with a = 0.4 m
and b = 4 m.
In nominal conditions, qc (t) = q1 (t) = 0.2 m3 /s and h1 (t) = 3 m.
(a) Show that the model of the ow through the valve (8.15) can be
linearised around nominal conditions as

q1 (t) = 21xv (t) + 5.09 × 10−6 ∆p (SI) (8.16)

(b) Write linearised equations for the dynamics of the system.


∆H1 (s)
(c) Find transfer function Qc (s) .
8.3. DEALING WITH NON-LINEARITIES 103

Figure 8.13: Non-linear law of the spring of Exercise 6.

Figure 8.14: System of Exercise 7.


104CHAPTER 8. MODELLING INTERCONNECTED AND NON-LINEAR SYSTEMS
Part II

Systems theory

105
107

To study and not think is a waste. To think and not study is dan-
gerous.

Confucius (551 c. BC „479 c. BC), Analects, II 15 (transl. A. Charles


Muller)

In this part of the lecture notes:

Chapter 9 develops the very important notion of transfer function of a system through
the representation of interconnected systems as blocks, in so-called block
diagrams.

Chapter 10 is dedicated to the study of time and frequency responses in general.

Chapter 11 studies the time and frequency responses of dierent systems.

Here is what you need to know beforehand to follow these chapters:

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4.


108
Chapter 9

Transfer functions and block


diagrams
In this chapter we will show how transfer functions can be used together with
a graphic representation of system interconnection called block diagram. We
conclude using block diagrams as a tool for a short introduction to control.

9.1 More on transfer functions


Remember Denition 4.1 about what is a transfer function of a SISO system
modelled by a dierential equation: it is the ratio between the Laplace transform
of the output and the Laplace transform of the input, assuming initial conditions
equal to zero. Also remember that behind each transfer function there is a
dierential equation, and that dierential equations are models of real things. Transfer functions are dif-
Using transfer functions, we can easily study the behaviour of a system ferential equations
abstracting from its physical reality. This is the approach we will take from now
on. This said, notice that remembering the actual system that is being studied
can be useful to check if results are possible or not. Remember that models
approximate reality, not the other way round. Also remember Example 4.1
about the spring stretched to an impossible length (it breaks, of course), or
Remark 6.5 about pipes where the ow cannot be negative. We would not have
found that just by looking at our models, which are linear.
Theorem 9.1. The transfer function of a SISO LTI continuous in time can be Ratio of polynomials in s
expressed as the ratio of two polynomials in s.
Proof. Let the input of the SISO system be u(t) and its output be y(t). Because
the system is LTI and continuous in time, it is modelled by a linear dierential
equation:
dy(t) d2 y(t) d3 y(t) du(t) d2 u(t) d3 u(t)
a0 y(t) + a1 + a2 + a3 + . . . = b 0 u(t) + b 1 + b 2 + b 3 + ...
dt dt2 dt3 dt dt2 dt3
n
X dk y(t) X dk u(t) m
⇔ ak = bk (9.1)
dtk dtk
k=0 k=0

In the last expression, n and m are the highest derivative orders of the equa-
tion. Assuming zero initial conditions and applying the Laplace transform, this
becomes
a0 Y (s) + a1 Y (s)s + a2 Y (s)s2 + a3 Y (s)s3 + . . . = b0 U (s) + b1 U (s)s + b2 U (s)s2 + b3 U (s)s3 + . . .
X n Xm
⇔ ak Y (s)sk = bk U (s)sk (9.2)
k=0 k=0

Rearranging terms,
m
X
bk sk
2 3
Y (s) b0 + b1 s + b2 s + b3 s + . . .
= = k=0
n (9.3)
U (s) a0 + a1 s + a2 s2 + a3 s3 + . . . X
k
ak s
k=0

109
110 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Remark 9.1. Some authors change the order of the coecients, and instead of
(9.3) write
m
X
bm−k sk
Y (s)
= k=0
n (9.4)
U (s) X
k
an−k s
k=0

This is a mere detail of notation.


Remark 9.2. (9.3) corresponds to an innite number of representations of a
same transfer function. It suces to multiply both numerator and denominator
Normalising transfer func- by a constant. But it is common to normalise coecients so that a0 = 1, or
tion coecients an = 1, or b0 = 1.
Example 9.1. Consider the microprecision control setup test in Figure 3.9 from
Example 3.19. The transfer function from one of the actuators to the position
of the mass has been identied as
9602
G(s) = (9.5)
s2 + 4.27s + 7627
This was normalised so that a2 = 1, n = 2. We could also normalise a0 or b0 :
1.2589
G(s) =
131.11 × 10−6 s2 + 559.85 × 10−6 s + 1
1
= (9.6)
104.14 × 10−6 s2 + 444.70 × 10−6 s + 0.7943
Getting the transfer func- It is easy to nd the dierential equation from a transfer function. When the
tion back transfer function is represented merely by a letter, meaning that it is a function
of s, as in (9.5) above, it still corresponds to the ratio of the Laplace transforms
of output and input.
Example 9.2. (9.5) can be rewritten as
Y (s) 9602
= 2 ⇔ Y (s)(s2 + 4.27s + 7627) = 9602U (s)
U (s) s + 4.27s + 7627
⇔Y (s)s2 + 4.27Y (s)s + 7627Y (s) = 9602U (s) (9.7)

which is the Laplace transform of the dierential equation governing the plant:

y 00 (t) + 4.27y 0 (t) + 7627y(t) = 9602u(t) (9.8)

Proper transfer function Denition 9.1. A transfer function is proper if the order of the polynomial
in the numerator is equal to or less than the order of the polynomial in the
denominator.
Strictly proper transfer A transfer function is strictly proper if the order of the polynomial in the
function numerator is less than the order of the polynomial in the denominator.
In the notation of (9.3), the transfer function is proper if m ≤ n, and strictly
proper if m < n.
For reasons we shall address in Chapters 11 and 25, we will be working almost
always with proper transfer functions, and most of the times with strictly proper
transfer functions.
Order of a transfer func- Denition 9.2. The order of a transfer function is the highest order of the
tion polynomials in the numerator and the denominator. If the transfer function is
proper, its order is the order of the denominator.
Remark 9.3. The order of a transfer function is also the order of the dierential
equation from which it was formed. In fact, sk corresponds to a derivative of
order k .
Remark 9.4. Notice that some transfer functions can be simplied because
numerator and denominator have common factors. Eliminating them reduces
the order of the transfer function.
9.1. MORE ON TRANSFER FUNCTIONS 111

Example 9.3. Here are examples of proper transfer functions of:


ˆ Order 0

Ga (s) = 20 (9.9)

ˆ Order 1
19
Gb (s) = (9.10)
s + 18
17s + 16
Gc (s) = (9.11)
s + 15
14
Gd (s) = (9.12)
s
13s + 12
Ge (s) = (9.13)
s
ˆ Order 2
11
Gf (s) = (9.14)
s2 + 10s + 9
8s + 7
Gg (s) = (9.15)
s2 + 6s + 5
4s2 + 3s + 2
Gh (s) = (9.16)
s2 + s − 1
2
s − 2s + 1
Gi (s) = (9.17)
s2
2
s − 3s − 4
Gj (s) = (9.18)
s2 − 5s − 6
They have all been normalised so that the coecient of the highest order mono-
mial in the denominator is 1 (i.e. an = 1). Transfer functions Gb (s), Gd (s),
Gf (s), Gg (s), and Gi (s) are strictly proper; the other ones are not.
Gj (s) is of order 2 but can be simplied and become of order 1:
s2 − 3s − 4 (s − 4)(s + 1) s−4
Gj (s) = = = (9.19)
s2 − 5s − 6 (s − 6)(s + 1) s−6
Transfer functions are often put in the following form, that explicitly shows
the zeros of the transfer function (i.e. the zeros of the polynomial in the nu- Zeros
merator) and the poles of the transfer function (i.e. the zeros of the polynomial Poles
in the denominator):
m
Y
bm (s − zk )
Y (s) bm (s − z1 )(s − z2 )(s − z3 ) . . . k=1
= = n (9.20)
U (s) an (s − p1 )(s − p2 )(s − p3 ) . . . X
an (s − pk )
k=0

Here the zeros are zk , k = 1, 2, . . . m and the poles are pk , k = 1, 2, . . . n. Be-


cause both inputs and outputs are real, transfer function coecients are real,
and consequently the poles and zeros are either real or pairs of complex conju-
gates. (Remember Remark 2.6.) So in (9.20) it is usual to multiply such pairs,
presenting a second order term instead of two complex terms.
Example 9.4. The second order transfer functions in Example 9.3 can be
rewritten as
11
Gf (s) = (9.21)
(s + 9)(s + 1)
8s + 7
Gg (s) = (9.22)
(s + 5)(s + 1)
√ √
4 s + 3+ 8 23j s + 3− 8 23j 4s2 + 3s + 2
Gh (s) = √ √ = √ √ (9.23)
s + 1+2 5 s + 1−2 5 s + 1+2 5 s + 1−2 5
(s − 1)2
Gi (s) = (9.24)
s2
112 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

For Gj (s), see (9.19). Notice that, in the case of Gh (s), only the second expres-
sion is usual; the rst one, explicitly showing the two complex conjugate zeros,
is not.

Remark 9.5. From Denition 9.2 results that the order of a proper transfer
function is the number of its poles.

The following Matlab functions use transfer functions in this form:

Transfer function from ze- ˆ zpk creates a transfer function from its zeros, poles, and the ratio in
bm
an
ros, poles, gain (9.20), here called gain k , and also converts a transfer function created
with tf into this form;

ˆ pole nds the poles of a transfer function;

ˆ tzero nds the zeros of a transfer function.

Example 9.5. Transfer function (9.15) or (9.22)


ˆ has one zero, 8s + 7 = 0 ⇔ s = − 87 = −0.875,

ˆ has two poles, (s + 5)(s + 1) = 0 ⇔ s = −5 ∨ s = −1,

ˆ veries k = bm
an = 8
1 = 8.

Matlab's command zpk It can be created, converted to a ratio of two polynomials as in (9.3), and
converted back to the (9.20) form as follows:

>> G_g = zpk(-7/8, [-5 -1], 8)

G_g =

8 (s+0.875)
-----------
(s+5) (s+1)

Continuous-time zero/pole/gain model.

>> G_g = tf(G_g)

G_g =

8 s + 7
-------------
s^2 + 6 s + 5

Continuous-time transfer function.

>> G_g = zpk(G_g)

G_g =

8 (s+0.875)
-----------
(s+5) (s+1)

Continuous-time zero/pole/gain model.


Matlab's commands Its poles and zeros can be found as follows:
pole and tzero
>> tzero(G_g)
ans =
-0.8750
>> pole(G_g)
ans =
-5
-1
9.2. BLOCK DIAGRAMS 113

Figure 9.1: Generic block.

It does not matter whether a transfer function was created with tf or with
zpk (or with any other function to create transfer functions that we did not
study yet): pole and tzero work just the same.
Another way of nding the poles and the zeros is to access the numerator and
the denominator, and then using roots to nd the roots of these polynomials.
The transfer function must be in the tf form this time, the only one that has
the num and den elds:
>> G_g = tf(G_g);
>> G_g.num{1}
ans =
0 8 7
>> roots(ans)
ans =
-0.8750
>> G_g.den{1}
ans =
1 6 5
>> roots(ans)
ans =
-5
-1
Notice that the {1} is necessary since Matlab presumes that the transfer
function is MIMO and thus has many transfer functions relating the many inputs
with the many outputs. The cell array index accesses the rst transfer function,
which, as the system is SISO, is the only one.
A very important property of transfer functions for the rest of this chapter
has already been mention in Section 8.2 and illustrated in Example 8.2: if two
systems G1 (s) = uy11(s) y2 (s)
(s) and G2 (s) = u2 (s) are interconnected so that the output Multiplying transfer func-
of one is the input of the other, y1 (s) = u1 (s), then the resulting transfer tions
function is
y2 (s) y2 (s) y1 (s)
= = G1 (s) G2 (s) (9.25)
u1 (s) u2 (s) u1 (s)
Remark 9.6. Remember that the multiplication of two Laplace transforms Multiplication of L is con-
does not correspond to the multiplication of the original functions, but rather volution in t
to their convolution, as we have shown in (2.78). Operation convolution is
dened in (2.76). (This is sometimes a source of confusion, because the sum of
two Laplace transforms is the sum of the original functions, as L is linear.)

9.2 Block diagrams


Block diagrams are graphical representations of the relations between vari-
ables and functions. In our case, functions will be systems, and variables will
be signals (which are themselves, as you remember, functions of time, or space).
Figure 9.1 shows a generic system (represented by a block) relating two signals
(represented by lines with arrows).
The practical thing to do for LTI systems is to represent them using their
transfer functions, and consequently to represent signals by their Laplace trans-
forms. The block in Figure 9.2 means that Y (s) = G(s)U (s). This is yet another
advantage of using the Laplace transform: the (Laplace transform of the) out-
put is the product of the (transfer function of the) system and the (Laplace
transform of the) input.
114 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.2: Linear block.

Figure 9.3: Block diagram of Example 9.6, corresponding to the mechatronic


system in Figure 8.2 from Example 8.2.

Example 9.6. The mechatronic system in Example 8.2 had four transfer func-
tions, as follows:
2n
I(s) n1
G1 (s) = = (9.26)
Vi (s) R + Ls
F2 (s)
G2 (s) = =α (9.27)
I(s)
F1 (s) b
G3 (s) = = (9.28)
F2 (s) a
X1 (s) 1
G4 (s) = = (9.29)
F1 (s) m1 s2 + K
The corresponding block diagram is shown in Figure 9.3. In fact,
I(s) = G1 (s)Vi (s) (9.30)
F2 (s) = G2 (s)I(s) (9.31)
F1 (s) = G3 (s)F2 (s) (9.32)
X1 (s) = G4 (s)F1 (s) (9.33)

The Example above shows that several interconnected systems correspond


to a sequence of blocks. By similarity with electrical circuits, blocks in such a
Blocks in series sequence are said to be in series or in cascade. This is because of the property
Blocks in cascade of transfer functions illustrated in (9.25). Clearly, two blocks A and B in series
are equivalent to one block AB .
Adding signals is represented as shown in Figure 9.4, where
y = y1 + y2 = Au + Bu = (A + B)u (9.34)
Blocks in parallel By similarity with electrical circuits, blocks A and B are said to be in parallel.
Clearly, they are equivalent to one block A + B . Signal subtraction is indicated
similarly.
Feedback The block congurations in Figure 9.5, wherein the input of a block depends
on its output, is called feedback loop or just feedback: feedback, because
Loop the output is fed back to the block it originates from; and loop, because of the
Direct branch conguration of the diagram. In that Figure, A is called direct branch and
Feedback branch B feedback branch. The two block diagrams only dier because of the sign
aecting signal d(s):
Negative feedback ˆ when b(s) = a(s) − d(s), there is negative feedback;
Positive feedback ˆ when b(s) = a(s) + d(s), there is positive feedback.
Negative feedback is far more common; when feedback is mentioned without
specifying whether it is positive or negative, you can safely presume it is nega-
tive. Notice that, for both:
9.2. BLOCK DIAGRAMS 115

Figure 9.4: Block diagram with two blocks in parallel.

Figure 9.5: Block diagrams with feedback loops. Left: negative feedback. Right:
positive feedback.

t of the feedback loop ˆ the input of the loop is a(s);

ˆ the output of the loop is c(s); Output of the feedback loop

ˆ the input of the direct branch is b(s) = a(s) ∓ d(s);

ˆ the output of the direct branch is a(s);

ˆ the input of the feedback branch is c(s);

ˆ the output of the feedback branch is d(s).

Consequently, for negative feedback,

c = Ab = A(a − d) = A(a − Bc) = Aa − ABc


A
⇒ c + ABc = Aa ⇒ c = a (9.35)
1 + AB
and, for positive feedback,

c = Ab = A(a + d) = A(a + Bc) = Aa + ABc


A
⇒ c − ABc = Aa ⇒ c = a (9.36)
1 − AB

Example 9.7. The centrifugal governor (see Figure 9.6) is a control system Centrifugal governor
which had widespread use to control the pressure in boilers. It rotates because
of the pressure of the steam. The faster it rotates, the more the two spheres
go up, thereby opening a valve relieving steam pressure. Consequently the
regulator spins slower, the balls go down, and this closes the valve, so pressure
is no longer relieved and goes up again. This is negative feedback: an increase
of any variable has as consequence the decrease of another variable that caused
the original increase, and vice-versa.

Example 9.8. Audio feedback (or howl) is an example of positive feedback.


Surely you must have heard it often, whenever there is a sound system amplify-
ing the sound detected by a microphone which is too close to the loudspeakers,
so that even background noise is amplied to the point of being received again
by the microphone and amplied further see Figure 9.7. The amplitude of
the resulting sound does not become innite because at some point the amplier
and/or the loudspeakers saturate, but the howl can damage the equipment or,
more importantly, the listeners' auditory systems.
116 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.6: Centrifugal governor of a boiler in the former Barbadinhos water


pumping station (currently the Water Museum), Lisbon.

Figure 9.7: How audio feedback occurs.


9.2. BLOCK DIAGRAMS 117

Example 9.9. Biological processes provide numerous examples of both positive


and negative feedback. We will go back to this in Chapter 43.
The best way to simplify block diagrams is to write the corresponding equa-
tions and do so analytically.
Example 9.10. In the block diagram of Figure 9.8 we make
G1 (s) = 2 (9.37)
s + 10
G2 (s) = 2
(9.38)
s + 0.5s + 5
1
G3 (s) = (9.39)
s+1
20(s − 0.5)
G4 (s) = (9.40)
(s − 1)(s − 3)
1
G5 (s) = (9.41)
s
(9.42)

(The block for G1 (s) is triangular because Simulink, which we will mention
below, uses triangles for constants, but this convention is unusual; when drawing
blocks by hand, they are all usually rectangles.) Then

e = G2 c = G2 G1 b = G2 G1 (a − d) = G1 G2 (a − G3 e) ⇒
G1 G2
⇒ (1 + G1 G2 G3 )e = G1 G2 a ⇒ e = a (9.43)
1 + G1 G2 G3

G1 G2 G1 G2 G5
h = G5 g = G5 (e + f ) = G5 a + G4 a = a + G4 G5
1 + G1 G2 G3 1 + G1 G2 G3
(9.44)
Finally, the whole block diagram corresponds to transfer function
s+10 1
h(s) 2 s2 +0.5s+5 s 20(s − 0.5)
= s+10 1 + (9.45)
a(s) 1 + 2 s2 +0.5s+5 s+1 s(s − 1)(s − 3)

It is usually a good idea to put the result in one of the forms (9.3) or (9.20).
Since calculations are rather complicated, we can use Matlab:
>> s = tf('s');
>> (2/s*(s+10)/(s^2+0.5*s+5))/(1+2/(s+1)*(s+10)/(s^2+0.5*s+5))+...
20*(s-0.5)/((s-1)*(s-3)*s)

ans =

22 s^7 + 45 s^6 + 200 s^5 + 617.5 s^4 + 380.5 s^3 + 1960 s^2 - 950 s

----------------------------------------------------------------------

s^9 - 2 s^8 + 8.25 s^7 - 10.75 s^6 - 55.25 s^5 + 33.75 s^4 - 350 s^3

+ 375 s^2

Continuous-time transfer function.

>> zpk(ans)

ans =

22 s (s+2.931) (s-0.4226) (s^2 + 0.5s + 5) (s^2 - 0.9629s + 6.972)


------------------------------------------------------------------
s^2 (s-3) (s+2.5) (s-1) (s^2 + 0.5s + 5) (s^2 - s + 10)

Continuous-time zero/pole/gain model.


118 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.8: Block diagram of Example 9.10.

As you can see from the last result, it is possible to eliminate s and s2 +0.5∗s+5
from both the numerator and the denominator. So h(s) a(s) is of sixth order.

In this way it is possible to nd several generic equivalences in block dia-


grams, such as those of Figure 9.9, which may be used in block diagram sim-
plication. The analytical simplication of block diagrams is however normally
easier and less prone to errors.
Matlab has commands to combine transfer functions:

ˆ operators + and * add and multiply transfer functions (remember that two
blocks in series correspond to the product of their transfer functions);

ˆ feedback receives the direct and the feedback branches and gives the
transfer function of the negative feedback loop.

Matlab's command Example 9.11. We can verify our calculations of Example 9.10 as follows:
feedback
>> G1 = 2;
>> G2 = (s+10)/(s^2+0.5*s+5);
>> G3 = 1/(s+1);
>> G4 = 20*(s-0.5)/((s-1)*(s-3));
>> G5 = 1/s;
>> loop_from_a_to_e = feedback(G1*G2, G3)

loop_from_a_to_e =

2 s^2 + 22 s + 20
--------------------------
s^3 + 1.5 s^2 + 7.5 s + 25

Continuous-time transfer function.

>> from_a_to_g = loop_from_a_to_e + G4

from_a_to_g =

22 s^4 + 34 s^3 + 73 s^2 + 411 s - 190


-----------------------------------------------
s^5 - 2.5 s^4 + 4.5 s^3 - 0.5 s^2 - 77.5 s + 75

Continuous-time transfer function.

>> from_a_to_h = from_a_to_g * G5

from_a_to_h =

22 s^4 + 34 s^3 + 73 s^2 + 411 s - 190


---------------------------------------------------
s^6 - 2.5 s^5 + 4.5 s^4 - 0.5 s^3 - 77.5 s^2 + 75 s
9.2. BLOCK DIAGRAMS 119

Figure 9.9: Block diagram simplication.


120 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.10: Commonly used blocks of Simulink.

Continuous-time transfer function.

>> zpk(from_a_to_h)

ans =

22 (s+2.931) (s-0.4226) (s^2 - 0.9629s + 6.972)


-----------------------------------------------
s (s+2.5) (s-3) (s-1) (s^2 - s + 10)

Continuous-time zero/pole/gain model.

This is the same transfer function we found above, with the poles and zeros
common to the numerator and denominator eliminated.

Simulink Matlab's most powerful tool for working with block diagrams is Simulink.
All the block diagrams above have been created with Simulink, and then
cropped so as not to show what Simulink calls source and sink, which are
not part of what is shown in standard block diagrams (you must not include
them when drawing block diagrams by hand). To use Simulink, access its
library in Matlab by clicking the corresponding button or typing simulink.
The library looks like very dierent in dierent versions of Matlab, but its
organisation is similar: the most commonly used blocks are in one of the several
subsets of the Simulink library; then there are libraries corresponding to the
Commonly used Simulink toolboxes you have installed. Figure 9.10 shows the blocks you will likely need:
blocks
ˆ The Transfer Fcn block, from the Continuous subset of the Simulink
library, creates a transfer function like function tf.

ˆ The Zero-Pole block, from the Continuous subset of the Simulink li-
brary, creates a transfer function like function zpk.

ˆ The LTI System block, from the Control System Toolbox library, cre-
ates a transfer function using function tf or function zpk. It is also pos-
sible just to put there a variable with a transfer function, created in the
command line.

ˆ The Sum block (name hidden by default), from the Math operations sub-
set of the Simulink library, is a sum point.

ˆ The Gain block, from the Math operations subset of the Simulink li-
brary, multiplies a signal by a constant.

ˆ The From Workspace block, from the Sources subset of the Simulink
library, provides a signal to run a simulation. The signal is either a struc-
ture (see the block's dialogue for details) or a matrix with time instants in
the rst column and the corresponding values of the signal in the second
column (these will be interpolated).

ˆ The Scope block, from the Sinks subset of the Simulink library, plots
the signal it receives. It can be congured to record the data to a variable
in the workspace, which is most practical to reuse it later.

ˆ The Mux block (from multiplexer, name hidden by default), from the
Signal Routing subset of the Simulink library, joins two (or more) sig-
nals into one. The result is a vector-valued signal. If two real-values signals
are multiplexed, the result is a vector-valued signal with dimension 2.
9.2. BLOCK DIAGRAMS 121

Figure 9.11: Simulink le of Example 9.12.

0.12

0.1

0.08
x1 [m]

0.06

0.04

0.02

0
0 0.5 1 1.5 2 2.5 3
time [s]

Figure 9.12: Output of Example 9.12.

To use a block, create an empty Simulink le and drag it there. Connect blocks
with arrows by clicking and dragging from one block's output to another's input.
Double-click a block to see a dialogue where you can ll in the arguments you
would use in a Matlab command written in the command line (i.e. after the
>>). Most of the times you can use numbers or variables; you just have to
create the variables before you create the model. Right-clicking a block shows a
context menu with many options, among which those of showing or hiding the
block's name, or rotating it. You can edit a block's name by clicking it, and
add a label to a signal by double-clicking it.
To run a simulation, choose its duration in the box on the top of the window,
or go to Simulation > Model Configuration Parameters. Then click the
Play button, or use command sim with the name of the (previously saved) le
with the block diagram model.

Example 9.12. Let us simulate the mechatronic system of Examples 8.2 and 9.6,
given by (9.26)(9.29). The Simulink le is as shown in Figure 9.11 and its
running time was set to 3 s; variables have been used and must be dened before
running the simulation, but this means that they are easier to change. Block
From Workspace has matrix [0 1], meaning that at time 0 it will output value
1, and since no other value is provided this one will be kept. So we are nding
the response of the system to a Heaviside function (2.5), or rather to a tension
of 1 V being applied when the simulation begins. Block Scope is congured to
save data to variable Data. The following commands create the variables, run
the simulation, and plot again the results which you could also see in the Scope
itself:

>> n2 = 200; n1 = 100; L = 1e-2; R = 100; alpha = 100; b = 0.3; a = 0.1;


m1 = 1; K = 100;
>> sim('prob3_ficha3_2011_modif_2')
>> figure, plot(Data.time,Data.signals.values(:,2)), xlabel('time [s]'),
ylabel('x_1 [m]')
See Figure 9.12. We could have expected these oscillations with constant am-
plitude, and you will know why in Chapter 11.
122 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.13: Left: open loop control. Right: closed loop control.

Remark 9.7. Notice that the input signal was specied in time and the out-
put variable was obtained as a function of time, but the dierential equations
were specied as transfer functions, i.e. not as relations in variable t but in the
Laplace transform variable s. This is the way Simulink works. However, do not
forget that, since in a block diagram system dynamics is indicated by transfer
functions, signals too must be given by their Laplace transforms, as functions
of s. It is correct to say that y(s) = G(s)u(s); it makes no sense at all to write
y(t) = G(s)u(t) mixing t and s.
The dialogue Model Configuration Parameters, which can also be ac-
cessed through a button, allows specifying many other things, among which:
ˆ the numerical method used to solve the dierential equations;

ˆ the maximum and minimum time steps used by the numerical method;

ˆ a tolerance that will not be exceeded by the numerical method's estimate


of the errors incurred.
Notice that some numerical methods use xed time steps. These may be used
with dierential equations, but are the only ones that can be used with dierence
equations (corresponding to digital models).

9.3 Control in open-loop and in closed-loop


There are two generic congurations for control systems: open-loop control
and closed-loop control, shown in Figure 9.13. Every control system is a
variation of one of these two congurations, or a combination thereof. Both add,
to the system we want to control, another system called controller, intended
to make the controlled system's output y(t) follow some specied reference, or
desired output, r(t) (remember Section 3.1). In a perfectly controlled system,
y(t) = r(t), ∀t. The output of the controller is the system's input in the strict
sense (the input must be a manipulated variable).
Open-loop control In open-loop control the controller receives the reference that the system
should follow, and decides from this desired output what control action to take.
This control action will be the input of the system. It is not checked whether or
not the system's output does follow the reference. So, if there is some unexpected
deviation from the reference, this does not change the control action. Open-loop
control only uses blocks in series.
In open-loop control,

y(s) = G(s)u(s) = G(s)C(s)r(s) (9.46)

and since we want y(s) = r(s) then we should have C(s) = G−1 (s), i.e. the
controller should be an inverse model of the system to control. Notice that
if the model of the system is proper then the controller is not proper; you will
learn why this brings problems in Chapter 11.
Closed-loop control Closed-loop control uses negative feedback. The reference is compared with
the system output. Ideally, the error should be zero. What the controller
receives is this error, so the control action is based on the error.
The simplest closed-loop controller is proportional: C(s) = K ∈ R. With
Proportional control proportional control, if the error is small, the control action is small too; if
the error is large, the control action is also large. There are techniques to choose
an appropriate value of K , and also to develop more complex controllers, with
poles and zeros, which will be addressed in Part IV.
9.3. CONTROL IN OPEN-LOOP AND IN CLOSED-LOOP 123

Figure 9.14: Closed-loop control with disturbances and sensor dynamics.

Figure 9.15: The same as Figure 9.14, but with MIMO systems.

Actually, no control system is that simple. Figure 9.14 shows a more realistic
situation, including the following additions:

ˆ H(s) is the sensor that measures output y . A perfect sensor measures Sensor dynamics
the output exactly: ŷ(t) = y(t), ∀t; and hence H(s) = 1. No sensor is
perfect, but it is often possible to assume H(s) = 1 even so (in which case
the block does not need to be there). If this is not the case, H(s) must be
explicitly taken into account.

ˆ du (t) is a disturbance that aects the control action. This means that Control action disturbance
the control action is not precisely received by the controlled system. For
instance, if the control action is a force, this means that there are other
forces acting upon the system. Or, if the control action is a current, there
are unintended uctuations of the value determined by the controller.

ˆ dy (t) is a disturbance that aects the system output. This means that the System output disturbance
output is aected by something else other than the system. For instance,
if the output is a ow, there is some other source of uid, or some bleeding
of uid somewhere, that must be added or subtracted. Or, if the output
is a position, there may be vibrations that have to be superimposed.

ˆ dŷ (t) is a disturbance that aects the sensor's measurement of the system Output measurement dis-
output. Just like u(t) can suer a disturbance, so can ŷ(t). turbance

Remark 9.8. Disturbances in Figure 9.14 follow what is called an additive


model, since the disturbance is added to the signal it disturbs. Other models Additive disturbances
use multiplicative disturbances, that are multiplied rather than summed. Here Multiplicative disturbances
we will stick to additive disturbances, which result in linear models.

Remark 9.9. We saw in Chapter 3 that MIMO systems may have some inputs
in the general sense that are disturbances and others that are manipulated
variables. Figure 9.15 represents disturbances using MISO systems. The block
diagram in Figure 9.14 reects the same situation using only SISO systems. The
124 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.16: The same as Figure 9.14, but using transfer functions (9.48)(9.51).

price to pay for using SISO systems is less freedom in establishing mathematical
relations between disturbances and outputs.

The output of the block diagram in Figure 9.14 is

ỹ = dy + y = dy + Gũ = dy + G(du + u) = dy + Gdu + GCe


ˆ = dy + Gdu + GCr − GC(dŷ + ŷ)
= dy + Gdu + GC(r − ỹ)
= dy + Gdu + GCr − GCdŷ − GCH ỹ
⇒ (1 + GCH)ỹ = dy + Gdu + GCr − GCdŷ (9.47)
1 G GC −GC
⇒ ỹ = dy + du + r+ dŷ
1 + GCH 1 + GCH 1 + GCH 1 + GCH
Because of the linearity of the relations involved, (9.47) gives the same result as
if four transfer functions were involved as seen in Figure 9.16:
ỹ GC
G1 = = (9.48)
r 1 + GCH
ỹ G
G2 = = (9.49)
du 1 + GCH
ỹ 1
G3 = = (9.50)
dy 1 + GCH
ỹ −GC
G4 = = (9.51)
dŷ 1 + GCH

Notice that each of the four transfer functions above can be obtained assuming
that all inputs but one of them are zero. If the system were not linear, that
would not be the case.

Glossary
D'altra parte gli aveva detto la sera prima che lui possedeva un'dono:
che gli bastava udire due che parlavano in una lingua qualsiasi, e
dopo un poco era capace di parlare come loro. Dono singolare, che
Niceta credeva fosse stato concesso solo agli apostoli.

Umberto Eco (1932 „2016), Baudolino, 2

block diagram diagrama de blocos


blocks in cascade blocos em cascata
blocks in parallel blocos em paralelo
closed-loop anel fechado, malha fechada
direct branch ramo direto
disturbance perturbação
feedback retroação
feedback branch ramo de retroação
feedback loop anel de retroação, malha de retroação
inverse model modelo inverso
9.3. CONTROL IN OPEN-LOOP AND IN CLOSED-LOOP 125

open-loop anel aberto, malha aberta


order ordem
proper transfer function função de transferência própria
proportional control controlo proporcional
strictly proper transfer function função de transferência estritamente própria

Exercises
1. For each of the transfer functions below, answer the following questions:
ˆ What are its poles?
ˆ What are its zeros?
ˆ What is its order?
ˆ Is it a proper transfer function?
ˆ Is it a strictly proper transfer function?
ˆ What is the dierential equation it corresponds to?

(a) s
s2 + 12s + 20
(b) ss +
−5
1
2
(c) 3 s + 22s + 10
s − 5s + 15.25s
(d) 10
(s + 1)2 (s2 + 5s + 6)
(e) s2 + 2
2
s (s + 3)(s + 50)
(s4 + 6s3 + 8.75s2 )
(f)
(s2 + 4s + 4)2

2. Find the following transfer functions for the block diagram in Figure 9.17:
y(s)
(a)
d(s)
y(s)
(b)
r(s)
y(s)
(c)
m(s)
y(s)
(d)
n(s)
u(s)
(e)
d(s)
u(s)
(f)
r(s)
u(s)
(g)
m(s)
u(s)
(h)
n(s)
e(s)
(i)
d(s)
e(s)
(j)
r(s)
e(s)
(k)
m(s)
e(s)
(l)
n(s)

3. Figure 9.18 shows a variation of closed-loop control called internal model


control (IMC). It has this name because it requires knowing a model of the
system to control, as well as an inverse model of the system to control.In
that block diagram:
126 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS

Figure 9.17: Block diagram of Exercise 2.

Figure 9.18: Internal model control (IMC).

ˆ G(s) is the plant to control,


ˆ G∗ (s) is the model of the plant to control,
ˆ G−1 (s) is the inverse model of the plant to control.

(a) Show that, if the model is perfect, i.e. if


G∗ (s) = G(s), then the error is given by E(s) = R(s) − D(s).
(b) Show that, if, additionally, the inverse model is perfect, i.e. G−1 (s)G(s) =
1, then the output is Y (s) = R(s).
(c) Show that, whether the models are perfect or not, the block diagram
of IMC in Figure 9.18 is equivalent to the block diagram of closed-
−1
loop control in Figure 9.13, if C(s) = 1−GG (s)
−1 (s)G∗ (s) .

4. Figure 9.19 shows a variation of closed-loop control called cascade control


(or masterslave control, though that designation is out of favour nowa-
days). In that block diagram, the plant to control is G(s) = G1 (s)G2 (s),
and it possible to measure both Y1 (s) and Y2 (s). Each of the two parts of
the system to control is controlled separately.
Y1 (s)
(a) Find transfer function .
U2 (s)
Y2 (s)
(b) Use that result to nd transfer function .
R(s)

5. Redraw the block diagram of Figure 9.11 from Example 9.12 as follows:

ˆ use the values of the variables given in Example 9.12,

Figure 9.19: Cascade (or masterslave) control.


9.3. CONTROL IN OPEN-LOOP AND IN CLOSED-LOOP 127

Figure 9.20: Block diagrams of Exercise 6.

ˆ let the input Vi (s) be a manipulated variable,


ˆ let there be some reference r(t) for x1 (t) to follow,
ˆ add proportional control K .
X1 (s)
Then nd transfer function R(s) as a function of K .

6. For each of the two block diagrams in Figure 9.20:


Y (s)
(a) Find transfer function R(s) .

(b) Let A(s) = 1s , B(s) = s+1 ,


10
C(s) = 2, D(s) = s+2 .
s+0.1
Find the value
Y (s)
of R(s) .

7. Prove all the equivalences of block diagrams shown in Figure 9.9.


128 CHAPTER 9. TRANSFER FUNCTIONS AND BLOCK DIAGRAMS
Chapter 10

Time and frequency responses


Schirm und Robert iegen dort
Durch die Wolken immer fort.
Und der Hut iegt weit voran,
Stöÿt zuletzt am Himmel an.
Wo der Wind sie hingetragen,
Ja! das weiÿ kein Mensch zu sagen.

Heinrich Hoffmann (1809 „1894), Der Struwwelpeter, Die Geschichte vom


iegenden Robert

We already know that we can use the Laplace transform (and its inverse)
to nd out the output of any transfer function for any particular input. In
this chapter we study several usual particular cases. This allows us to nd
approximate responses in many cases, and to characterise with simplicity more
complex responses. It also paves the way to the important concept of frequency
responses.

10.1 Time responses: steps and impulses as in-


puts
The following inputs are routinely used to test systems:
ˆ The impulse: Impulse

u(t) = δ(t) (10.1)


L [u(t)] = 1 (10.2)

ˆ The step, with amplitude d: Step

u(t) = d H(t) (10.3)


d
L [u(t)] = (10.4)
s

ˆ In particular, the unit step, with amplitude 1: Unit step

u(t) = H(t) (10.5)


1
L [u(t)] = (10.6)
s

ˆ The ramp, with slope d: Ramp

u(t) = d t (10.7)
d
L [u(t)] = 2 (10.8)
s

ˆ In particular, the unit ramp, with slope 1: Unit ramp

u(t) = t (10.9)
1
L [u(t)] = 2 (10.10)
s

129
130 CHAPTER 10. TIME AND FREQUENCY RESPONSES

ˆ The parabola, with second derivative 2d: Parabola

u(t) = d t2 (10.11)
2d
L [u(t)] = 3 (10.12)
s
Unit parabola ˆ In particular, the unit parabola, with second derivative 2:
u(t) = t2 (10.13)
2
L [u(t)] = 3 (10.14)
s
You can either nd the Laplace transforms above in Table 2.1, or calculate them
yourself.
Remark 10.1. Notice that:
Z t
ˆ the unit step is the integral of the impulse: δ(t) dt = H(t);
0
Z t
ˆ the unit ramp is the integral of the unit step: H(t) dt = t;
0
Z t
1 2
ˆ the unit parabola is not the integral of the unit ramp: t dt = t 6=
0 2
t2 .
Properties of δ(t) Remark 10.2. Remember that while the Heaviside function H(t) is a function,
δ(t) is not a function and so are t and t2 , the Dirac delta δ(t) is not. It is a generalised function, and
the limit of the following family of functions:
(
1
, if 0 ≤ t ≤
f (t, ) = (10.15)
0, if t < 0 ∨ t >
δ(t) = lim f (t, ) (10.16)
→0+

Since
Z +∞ Z Z
1
f (t, ) dt = f (t, ) dt = dt = 1, ∀ ∈ R+ (10.17)
−∞ 0 0
Its integral in R is 1 we also have Z +∞
δ(t) dt = 1 (10.18)
−∞
Furthermore, for a continuous function g(t),
f (t, ) min g(t) ≤ f (t, )g(t) ≤ f (t, ) max g(t)
0≤t≤ 0≤t≤
Z Z Z
⇒ f (t, ) min g(t) dt ≤ f (t, )g(t) dt ≤ f (t, ) max g(t) dt
0 0≤t≤ 0 0 0≤t≤
Z Z Z
⇔ min g(t) f (t, ) dt ≤ f (t, )g(t) dt ≤ max g(t) f (t, ) dt
0≤t≤ 0 0 0≤t≤ 0
Z
⇒ min g(t) ≤ f (t, )g(t) dt ≤ max g(t) (10.19)
0≤t≤ 0 0≤t≤

where we used (10.17). Making → 0+ , we get


Z Z
g(0) ≤ f (t, )g(t) dt ≤ g(0) ⇔ f (t, )g(t) dt = g(0) (10.20)
0 0

Integral of δ(t) mutiplied A consequence of this is that


by a function Z b
g(t)δ(t) dt = g(0) (10.21)
a

as long as the integration inteval includes and overtakes 0, i.e. a ≤ 0 < b; in


particular,
Z +∞
L [δ(t)] = δ(t)e−st dt = e−s0 = 1 (10.22)
0
10.1. TIME RESPONSES: STEPS AND IMPULSES AS INPUTS 131

The reasons why (10.1)(10.13) are routinely used as inputs to test systems
are:
ˆ They are simple to create.

ˆ Calculations are simple, given their Laplace transforms.

ˆ They can be used to model many real inputs exactly, and even more as
approximations.
Example 10.1. The following situations can be modelled as steps:
ˆ A metal workpiece is taken from an oven and quenched in oil at a lower
temperature.
ˆ A sluice gate is suddenly opened, letting water into an irrigation canal.

ˆ A switch is closed and a tension is thereby applied to the motor that


rotates the joint of a welding robot.
ˆ A nished part is dropped onto a conveyer belt.

ˆ A car advancing at constant speed descends a sidewalk onto the street


pavement.
Example 10.2. The following situations can be modelled as ramps:
ˆ A deep space probe moves out of the solar system at constant speed along
a straight line in an inertial system of coordinates, due to inertia, far from
the gravitational inuence of any close celestial body.
ˆ A high-speed train moves from one station to another at cruiser speed.

ˆ A welding robot creates a welding joint at constant speed, to ensure a


uniform thickness.
Notice that, save for the rst example, the ramp is limited in time: sooner or
later, the train and the welding robot will have to stop. In fact, unlimited ramps
are seldom found.
Remark 10.3. The impulse is in fact impossible to create: there are no physical
quantities applied during no time at all, with an innite intensity. However, the
impulse is a good approximation of inputs that have a very short duration.
Figure 10.1 shows two inputs in that situation: a sequence of two steps
u1 (t) = k H(t − t0 ) − k H(t − t1 )
(
k, if t0 ≤ t ≤ t1
= ≈ k(t1 − t0 )δ(t − t0 ) (10.23)
0, if t < t0 ∨ t > t1

and, even more realistically, a sequence of two ramps, approximated by


Z +∞
1 1
δ(t) u2 (t) dt = δ(t) k(t1 − t0 ) + k(t2 − t1 ) + k(t3 − t2 )
0 2 2
k
= δ(t − t0 ) (t3 + t2 − t1 − t0 ) (10.24)
2
Of course, any input with a form such as that of Figure 10.2 can be approximated
by an impulse (multiplied by the integral over time of the input).
Remark 10.4. Unit steps are almost exclusively used because amplitude 1
makes calculations easier. Since we are assuming linearity, if the amplitude of
the step is d instead of 1, the output will be that for the unit step, multiplied
by d. The same can be said for unit ramps and unit parabolas. When steps (or
ramps, or parabolas) are applied experimentally, amplitude 1 may be too big or
too small, and a dierent one will have to be used instead.
Example 10.3. Suppose you want to test a car's suspension, when the wheel
climbs or descends a step. Obviously nobody with a sound mind would apply a
1 m step for this purpose (see Figure 10.3). A 10 cm step would for instance be
far more reasonable. Of course, if our model is linear, we can apply a unit step,
knowing well that the result will be nonsense, and then simply scale down the
result.
132 CHAPTER 10. TIME AND FREQUENCY RESPONSES

u1(t)

t0 1
t
t

Figure 10.1: Two functions that can be approximated by an impulse if t0 ≈ t1


(left) or t0 ≈ t3 (right).

k
u3(t)

t0 t 1
t

Figure 10.2: General form of a function that can be approximated by an impulse


if t0 ≈ t1 .

Figure 10.3: Would you test a car's suspension like this? (Source: Wikimedia,
modied)
10.1. TIME RESPONSES: STEPS AND IMPULSES AS INPUTS 133

Figure 10.4: The Rasteirinho mobile robot, without the laptop computer with
which it is controlled.

Example 10.4. The Rasteirinho (see Figure 10.4) is a mobile robot, of which
about a dozen units are used at IST in laboratory classes of dierent courses.
It is controlled by a laptop computer, xed with velcro. Its maximum speed
depends on the particular unit; in most, it is around 80 cm/s. Consequently, it
is useless to try to make its position follow a unit ramp, which would correspond
to a 1 m/s velocity. Once more, we could simulate its behaviour with a linear
model for a unit ramp and then scale the output down.

Example 10.5. In the WECs of Figures 3.2 and 3.3, the air inside the device is
compressed by the waves. A change of air pressure of 1 Pa is ludicrously small;
it is useless even to try to measure it. But if our model of the WEC is linear we
can simulate how much energy it produces when a unit step is applied in the air
pressure and then scale the result up to a more reasonable value of the pressure
variation.

In what follows we will concentrate on the impulse and unit step responses,
and mention responses to unit ramps and steps with amplitudes which are not 1
whenever appropriate.

Theorem 10.1. The impulse response of a transfer function has a Laplace Impulse response of a sys-
transform which is the transfer function itself. tem

Proof. Since G(s) = YU (s)


(s)
, where G(s) is a transfer function, Y (s) is the Laplace
transform of the output, and U (s) is the Laplace transform of the input, and
since the Laplace transform of an impulse is 1, the result is immediate.

Remark 10.5. This allows dening a system's transfer function as the Laplace
transform of its output when the input is an impulse. This denition is an
alternative to Denition 4.1 found in many textbooks.

Corollary 10.1. The output of a transfer function G(s) for any input u(t)
is equal to the convolution of the input with the transfer function's impulse
response g(t):
Z t
y(t) = g(t) ∗ u(t) = g(t − τ )u(τ ) dτ (10.25)
0

Proof. This is an immediate result of Theorem 10.1 and of (2.78).

Remark 10.6. It is usually easier to calculate the Laplace transform of the


input U (s) to nd the Laplace of the output as Y (s) = G(s)U (s) and then nally
the output as y(t) = L −1 [G(s)U (s)], than to calculate the output directly as
y(t) = g(t) ∗ u(t).

The following Matlab functions are useful to nd time responses:


134 CHAPTER 10. TIME AND FREQUENCY RESPONSES

ˆ step plots a system's response to a unit step (and can return the values
plotted in vectors);
ˆ impulse does the same for an impulse input;

ˆ lsim, already studied in Section 4.2, can be used for any input.

Just like lsim, both step and impulse use numerical methods to nd the re-
sponses, rather than analytical computations.
Matlab's command Example 10.6. The impulse, unit step and unit ramp responses of a plant are
impulse shown in Figure 10.5 and obtained as follows:
Matlab's command step >> s = tf('s'); G = 1/(s+1);
>> figure, impulse(G), figure, step(G)
>> t = 0 : 0.01 : 6; figure, plot(t, lsim(G, t, t))
>> xlabel('t [s]'), ylabel('output')
>> title('response to a unit ramp')
The time range is chosen automatically by step and impulse.
Example 10.7. The response of the transfer function from Example 10.6 to a
step with amplitude 10 during 20 s can be found in two dierent manners, both
providing, of course, the same result:
>> [stepresp, timevector] = step(G, 20);
>> t = 0 : 0.01 : 20;
>> figure, plot(t, lsim(G, 10*ones(size(t)), t), timevector, 10*stepresp)
>> xlabel('t [s]'), ylabel('output'), title('Step response')
There is, in fact, a slight dierence in the two plots shown in Figure 10.6, because
function step chooses the sampling time automatically, and it is dierent from
the one explicitly fed to lsim.

10.2 Steady-state response and transient response


The impulse, unit step, and unit ramp responses of
1
G(s) = (10.26)
s+1
from Example 10.6, shown in Figure 10.5 as they are numerically calculated by
Matlab, can be found analytically as follows:
ˆ Impulse response:

1
yi (t) = L −1
= e−t (10.27)
s+1

ˆ Unit step response:



1 1
ys (t) = L −1 = 1 − e−t (10.28)
s+1 s

ˆ Unit ramp response:



1 1 1 1 1
yr (t) = L −1 = L −1
− + + = t − 1 + e−t
s + 1 s2 s s2 s+1
(10.29)

In each of them we can separate the terms that tend to zero as the time increases
Transient from those that do not. The rst make up what we call the transient response.
Steady-state The latter make up what we call the steady-state response.
yi (t) = 0
|{z} e−t
+ |{z} (10.30)
steady-state transient
ys (t) = 1
|{z} e−t
− |{z} (10.31)
steady-state transient
yr (t) = e−t
t − 1 + |{z} (10.32)
| {z }
steady-state transient
10.2. STEADY-STATE RESPONSE AND TRANSIENT RESPONSE 135

Impulse Response
1

0.9

0.8

0.7
Amplitude

0.6

0.5

0.4

0.3

0.2

0.1

0
0 1 2 3 4 5 6
Time (seconds)

Step Response
1

0.9

0.8

0.7
Amplitude

0.6

0.5

0.4

0.3

0.2

0.1

0
0 1 2 3 4 5 6 7 8 9
Time (seconds)

response to a unit ramp


6

4
output

0
0 1 2 3 4 5 6
t [s]

Figure 10.5: Impulse, unit step and unit ramp responses of G(s) = s+1 ,
1
from
Example 10.6.
136 CHAPTER 10. TIME AND FREQUENCY RESPONSES

Step response
10

output
5

0
0 5 10 15 20
t [s]

Figure 10.6: Response of G(s) = 1


s+1 for a step with amplitude 10, from Exam-
ple 10.7.

In other words, a time response y(t) can be separated into two parts, the tran-
sient response yt (t) and the steady-state response yss (t), such that

y(t) = yt (t) + yss (t) (10.33)


lim yt (t) = 0 (10.34)
t→+∞

lim yss (t) 6= 0 ∨ yss (t) = 0, ∀t (10.35)


t→+∞

We also call transient to the period of time in which the response is dominated
by the transient response, and steady-state to the period of time in which the
transient response is neglectable and the response can be assumed equal to the
steady-state response. Whether a transient response can or cannot be neglected
depends on how precise our knowledge of the response has to be. Below in
Sections 11.2 and 11.3 we will see usual criteria for this.
The steady-state response can be:

ˆ zero, as the impulse response of (10.26), shown in Figure 10.5;

ˆ a non-null constant, as the unit step response of (10.26), shown in Fig-


ure 10.5;

ˆ an oscillation with constant amplitude, as the step response of (s2 +1)(s+1) ,


1

shown in Figure 10.7;

ˆ innity, with the output increasing or decreasing monotonously, as the


unit ramp response of (10.26), shown in Figure 10.5;

ˆ innity, with the output oscillating with increasing amplitude, as the im-
pulse response of (s2 +1)2 ,
s
shown in Figure 10.7.

What the steady-state response is depends on what the system is and on what
its input is.

Remark 10.7. Most systems never reach innity. The probe of Example 10.2
can move away to outer space, but temperatures do no rise to innite values
(before that the heat source is exhausted, or something will burn), robots reach
the end of their workspace, high electrical currents will activate a circuit breaker,
etc.; in other words, for big values of the variables involved, the linear model of
the system usually ceases in one way or another to be valid.

Over the next sections we will learn several ways to calculate steady-state
responses without having to nd an explicit expression for the output, and then
calculating its limit. When the steady-state response is constant or innity, it
Final value theorem can be found from the nal value theorem (Theorem 2.4), i.e. applying (2.72).
10.2. STEADY-STATE RESPONSE AND TRANSIENT RESPONSE 137

Step Response
1.8

1.6

1.4

1.2
Amplitude

0.8

0.6

0.4

0.2

0
0 10 20 30 40 50 60
Time (seconds)

Impulse Response
20

15

10
Amplitude

−5

−10

−15

−20
0 5 10 15 20 25 30 35 40
Time (seconds)

Figure 10.7: Time responses with oscillations: unit step response of 1


(s2 +1)(s+1)
(top) and impulse response of (s2 +1)
s
2 (bottom).
138 CHAPTER 10. TIME AND FREQUENCY RESPONSES

Example 10.8. The steady-states of the impulse, step and ramp responses
(10.27)(10.29) are as follows:

lim yi (t) = lim e−t = 0 (10.36)


t→+∞ t→+∞

lim ys (t) = lim 1 − e−t = 1 (10.37)


t→+∞ t→+∞

lim yr (t) = lim t − 1 + e−t = +∞ (10.38)


t→+∞ t→+∞

They can be found without the inverse Laplace transform using (2.72):
1
lim yi (t) = lim s =0 (10.39)
t→+∞ s→0 s+1
1 1
lim ys (t) = lim s =1 (10.40)
t→+∞ s→0 s + 1 s
1 1
lim yr (t) = lim s = +∞ (10.41)
t→+∞ s→0 s + 1 s2
Example 10.9. Remember that (2.72) applies when the limit in time exists.
Figure 10.7 shows two cases where this limit clearly does not exist because of os-
cillations with an amplitude that does not decrease. But the two corresponding
limits are
1 1
lim y(t) = lim s =1 (10.42)
t→+∞ s→0 (s2
+ 1)(s + 1) s
s
lim y(t) = lim s 2 =∞ (10.43)
t→+∞ s→0 (s + 1)2

In the rst case we got the average value of the steady-state response; in the
second, innity. Neither case is a valid application of the nal value theorem.
We need to know rst if the time limit exists.
Static gain Denition 10.1. The constant steady-state output of the unit step response
of a stable system G(s) = YU (s)
(s)
is called the static gain of G(s):

b0 + b1 s + b2 s2 + b3 s3 + . . . 1 b0
lim y(t) = lim s 2 3
= (10.44)
t→+∞ s→0 a + a1 s + a2 s + a3 s + . . . |{z}s a0
|0 {z }
G(s) U (s)

10.3 Stability
The time responses from Section 10.2 illustrate the importance of the concept
of stability.
Bounded signal Denition 10.2. A signal x(t) is bounded if ∃K ∈ R+ : ∀t, |x(t)| < K .
BIBO stability Denition 10.3. A system is:
ˆ stable if, for every input which is bounded, its output is bounded too;
ˆ not stable if there is at least a bounded input for which its output is not
bounded.
This denition of stability is known as bounded input, bounded output stabil-
ity (BIBO stability).
All poles of stable transfer Theorem 10.2. A transfer function is stable if and only if all its poles are on
functions are on the left the left complex half-plane.
complex half-plane
Proof. We will prove this in two steps:
ˆ A transfer function G(s) is stable if and only if its impulse response g(t)
is absolutely integrable, i.e. i ∃M ∈ R+
Z +∞
|g(t)| dt < M (10.45)
0

ˆ A transfer function's impulse response is absolutely integrable if and only


if all its poles are on the left complex half-plane.
10.3. STABILITY 139

Lemma 10.1. A transfer function is stable if and only if its impulse response
is absolutely integrable.

Proof.Let us suppose that the impulse response g(t) is absolutely integrable,


and that Z +∞
|g(τ )| dτ = K (10.46)
0

Let us also suppose that the input u(t) is bounded, as required by the denition
of BIBO stability:
|u(t)| ≤ U, ∀t (10.47)
From (10.25) we get
Z t

|y(t)| = |g(t) ∗ u(t)| = g(τ )u(t − τ ) dτ
0
Z t
≤ |g(τ )u(t − τ )| dτ
0
Z t
≤ |g(τ )| |u(t − τ )| dτ
0
Z t
≤U |g(τ )| dτ ≤ U K (10.48)
0

So the output is bounded, proving that the condition (impulse response abso-
lutely integrable) is sucient.
Reductio ad absurdum proves that it is also necessary. Suppose that the
impulse response g(t) is not absolutely integrable; thus, there is a time instant
T ∈ R+ such that
Z T
|g(τ )| dτ = +∞ (10.49)
0

Now let the input u(t) be given by

u(T − t) = sign(g(t)) (10.50)

This is a bounded input, −1 ≤ u(t) ≤ 1, ∀t, and so, if the transfer function
were stable, the output would have to be bounded. But in time instant T
Z T Z T
y(T ) = g(τ )u(t − τ ) dτ = |g(τ )| dτ = +∞ (10.51)
0 0

and thus y(t) is not bounded. This shows that the condition is not only sucient
but also necessary.

Lemma 10.2. A transfer function's impulse response is absolutely integrable


if and only if all its poles are on the left complex half-plane.

Proof. A transfer function G(s) has an impulse response given by L −1 [G(s)].


Transfer function G(s) can be expanded into a partial fraction expansion, where
the fractions have the poles of G(s) in the denominator. Poles can be divided
into four cases.

ˆ The pole is real, p ∈ R, and simple. In this case the fraction (where k
s−p
k ∈ R is some real numerator) has the inverse Laplace transform k ept .

If p = 0, then lim k ept = k. In this case the impulse response is


t→+∞
not absolutely integrable, since
Z +∞
|k| dt = lim |k|t = +∞ (10.52)
0 t→+∞

If p > 0, the exponential tends to innity: lim k ept = ±∞ (de-


t→+∞
pending on the sign of k ). If in the last case the response was not
absolutely integrable, even more so in this one.
140 CHAPTER 10. TIME AND FREQUENCY RESPONSES

If p < 0, the exponential tends to zero: lim k ept = 0. The impulse


t→+∞
response is absolutely integrable, since
Z +∞ Z +∞ +∞
pt 1 k k
k e dt = k pt
e dt = k ept = (0 − 1) = − ∈ R+
0 0 p 0 p p
(10.53)

ˆ The pole is real and its multiplicity n is 2 or higher. In this case there will
kn−1 kn−2
be, in the expansion, fractions of the form (s−p)
kn
n , (s−p)n−1 , (s−p)n−2 . . . s−p .
k1

(Here the ki ∈ R, i = 1 . . . n are the numerators in the expansion.) The


corresponding inverse Laplace transforms are of the form (i−1)! ki
ti−1 ept , i =
1 . . . n.

If p = 0, then the exponential tends to 1, but the power does diverge


ki
to innity: lim ti−1 ept = ±∞ (depending on the sign of
(i − 1)!
t→+∞
k ), ∀i ≥ 2. So in this case the impulse response is not absolutely
integrable, as seen above.
ki
If p > 0, then lim ti−1 ept = ±∞, ∀i. Again, the impulse
t→+∞ (i − 1)!
response is not absolutely integrable.
ki
If p < 0, then lim ti−1 ept = 0, ∀i, since the eect of the
t→+∞ (i − 1)!
exponential prevails. For the same reason, the impulse response is
absolute integrable, just as in (10.53).

ˆ The pole is complex, p = a + bj ∈ C\R, a, b ∈ R, and simple. Remember


once more that complex poles must appear in pairs of complex conjugates,
since all polynomial coecients are real (otherwise real inputs would case
complex outputs). In this case the fraction s−p k k
= s−(a+bj) (where k ∈ C
is some complex numerator) has the inverse Laplace transform

k k
L −1
=L −1
= k ept = k eat ebjt = k eat ebjt
s−p s − (a + bj)
= k eat (cos bt + j sin bt) (10.54)

and the fraction s−k̄


p̄ = s−(a−bj) (where z̄ is the complex conjugate of

z ∈ C) has the inverse Laplace transform



k̄ k̄
L −1
=L −1
= k̄ ep̄t = k̄ eat e−bjt = k̄ eat e−bjt
s − p̄ s − (a − bj)
= k̄ eat (cos(−bt) + j sin(−bt)) = k̄ eat (cos bt − j sin bt)
(10.55)

Their eect on the impulse response is their sum:



k k̄
L −1
+L −1
= k eat (cos bt + j sin bt) + k̄ eat (cos bt − j sin bt)
s−p s − p̄
= (k + k̄) eat cos bt = 2<(k) eat cos bt
(10.56)

Notice that the imaginary parts cancel out, and we are left with oscillations
having:

period 2π
b , where b is the positive imaginary part of the poles;
amplitude 2<(k)eat , where a is the real part of the poles. The ex-
ponential is the important term, since it is the exponential that may
cause this term to vanish or diverge.

So:

If a = 0, then the amplitude of the oscillations remains constant; they


do not go to zero neither do they diverge to an innite amplitude.
10.3. STABILITY 141

This means that the impulse response is not absolutely integrable,


since
Z +∞ Z +∞
|2<(k) cos bt| dt = 2|<(k)| |cos bt| dt
0 0
Z 2π
b
= 2|<(k)| lim n |cos bt| dt
n→+∞ 0
Z π
b
= 4|<(k)| lim n sin bt dt
n→+∞ 0
4|<(k)| π
= lim n [− cos bt]0b
b n→+∞
8|<(k)|
= lim n = +∞ (10.57)
b n→+∞

If a > 0, the amplitude of the oscillations tends to innity. Conse-


quently the impulse response will not be absolutely integrable.
If a < 0, the exponential tends to zero, and so will the oscillations.
In this case the impulse response is absolutely integrable, since
Z +∞ Z +∞
2<(k) eat cos bt dt ≤ 2|<(k)| eat dt (10.58)

0 0

and we end up with a case similar to (10.53).

ˆ The pole is complex and its multiplicity n is 2 or higher. This case is a


mixture of the last two. There will be terms of the form ki
(s−(a+bj))i +

(s−(a−bj))i , i = 1 . . . n. The corresponding inverse Laplace transform is


ki

2<(ki ) i−1 at
(i−1)! t e cos bt. So:

If a = 0, then eat = 1 but the amplitude of the oscillations still grows


to innity, because of the power function, if i ≥ 2. So in this case
the impulse response will not be absolutely integrable.
If a > 0, the amplitude of the oscillations tends to innity. The same
conclusion follows.
If a < 0, the exponential tends to zero, and for large times its eect
prevails; so the the impulse response will be absolutely integrable.

It is clear that one single term not tending exponentially to zero suces to
prevent the impulse response from being absolutely integrable. Consequently,
the only way for the impulse response to tend to zero is that all poles should
have negative real parts; in other words, that all poles should lie on the left
complex half-plane.

While some authors call unstable to all systems that are not stable, the
following distinction is current.

Denition 10.4. A system is: Unstable and marginally


stable systems
ˆ unstable if its impulse response is not bounded;
Unstable systems
ˆ marginally stable if it is not stable and its impulse response is bounded. Marginal stability

Theorem 10.3. Marginally stable systems have no poles on the right complex Marginally stable systems
half-plane, and one or more simple poles on the imaginary axis. have simple poles on the
imaginary axis
Proof. It is clear from the proof of Lemma 10.2 that simple poles on the imag-
inary axis correspond to:

ˆ impulse responses which are bounded:

a pole at the origin has a constant impulse response;


a pair of complex conjugate imaginary poles has constant amplitude
sinusoidal oscillations as impulse response;
142 CHAPTER 10. TIME AND FREQUENCY RESPONSES

ˆ responses to bounded inputs which are not bounded, since systems with
such poles are not stable.

A single pole p on the right complex half-plane makes a system unstable, since,
whatever the input may be, in the partial fraction expansion of the output there
will be a fraction of the form s−p
k
, and the proof of Lemma 10.2 shows that such
terms always diverge exponentially to innity.
The same happens with multiple poles on the imaginary axis:

ˆ multiple poles at the origin cause a polynomial impulse response, which


diverges to innity (check Table 2.1, or (11.206) below);

ˆ pure imaginary multiple poles also cause the impulse response to diverge,
as argued in the proof of Lemma 10.2.

The eect of each pole on the stability of a system justies the following
nomenclature.

Stable, marginally stable, Denition 10.5. Poles are:


and unstable poles
ˆ stable, when located on the left complex half-plane;
ˆ marginally stable, when simple and located on the imaginary axis, i.e.
s = jω, ω ∈ R, and notice that this includes the origin, s = 0;

ˆ unstable, when multiple and located on the imaginary axis, or when


located on the right complex half-plane.

Stability depends on pole A system is:


location
ˆ stable, when all its poles are stable;
ˆ marginally stable, when it has no unstable poles, and one or more of its
poles are marginally stable;

ˆ unstable, when it has one or more unstable poles.


Example 10.10. From the location of the poles, we can conclude the following
about the stability of these transfer functions:
s+4
ˆ ; poles: −1, −2, −3; stable transfer function
(s + 1)(s + 2)(s + 3)
s−5 √
ˆ 2
; poles: ± 6j ; marginally stable transfer function
s +6
s+7 √
ˆ 2 2
; poles: ± 8j (double); unstable transfer function
(s + 8)
(s − 12)(s + 13)
ˆ ; poles: −9 (double), −10 ± 11j ; stable transfer
(s + 9)2 (s2 + 20s + 221)
function
14
ˆ ; poles: 15; unstable transfer function
s − 15
16
ˆ ; poles: 0; marginally stable transfer function
s
−17
ˆ ; poles: 0 (double); unstable transfer function
s2
18 √
ˆ 2
; poles: 0, ± 19j ; marginally stable transfer function
s(s + 19)
24
ˆ ; poles: −20, −21, −22, 23; unstable trans-
(s + 20)(s + 21)(s + 22)(s − 23)
fer function

Poles, not zeros, deter- Remark 10.8. Never forget that zeros have nothing to do with stability.
mine stability
10.4. TIME RESPONSES: PERIODIC INPUTS 143

Figure 10.8: A weaving loom (source:Wikimedia).

10.4 Time responses: periodic inputs


Consider the weaving loom in Figure 10.8. The shuttle that carries the yarn
that will become the weft thread moves without cease from the left to the right
and then back. Meanwhile, half the warp threads are pulled up by a harness,
which will then lower them while the other half goes up, and this too without
cease. The corresponding references are similar to those in Figure 10.9. They
are called square wave and triangle wave, and are examples of periodic Square wave
signals. Triangle wave

Denition 10.6. A periodic signal is one for which ∃T ∈ R+ Periodic signals

f (t + T) = f (t), ∀t (10.59)

T = min T is the period of signal f (t).


Remark 10.9. Notice that the dierent values of T are in fact the integer
multiples of T , i.e.

f (t + T ) = f (t), ∀t ⇒ f (t + nT ) = f (t), ∀t, n ∈ N (10.60)

Triangle waves are also a useful alternative to ramps, since they avoid the
inconvenience of an innitely large signal. Square waves are useful in experi-
mental settings for another reason: they allow seeing successive step responses,
and consequently allow measuring parameters several times in a row. For this
purpose, the period must be large enough for the transient regime to disappear.
Example 10.11. We can nd the output of G(s) = 15
s+20 to a square wave with Matlab's command
period 1 s and amplitude 1 using Matlab as follows: square
>> t = 0 : 0.001 : 3;
>> u = square(t*2*pi);
>> figure, plot(t,u, t,lsim(15/(s+20),u,t))
>> axis([0 3 -1.5 1.5])
>> xlabel('t [s]'), ylabel('input and output'), legend({'input','output'})
144 CHAPTER 10. TIME AND FREQUENCY RESPONSES

1.5
square wave
triangle wave
1

0.5

signal
0

−0.5

−1

−1.5
0 1 2 3 4 5
t [s]

Figure 10.9: A square wave and a triangle wave (both with period 1 and ampli-
tude 1).

Notice that the amplitude of the rst step is 1 and the amplitude of the following
steps is the peak to peak amplitude, twice as big, viz. 2. Also notice that there
is a step every half period, i.e. every 0.5 s.
The period was appropriately chosen since (as we shall see in Section 11.2)
the transient response is practically gone after 0.5 s. A period four times smaller
would not allow seeing a complete step response. Both cases are shown in
Figure 10.10.
Another useful periodic signal is the sinusoid, which appears naturally with
any phenomena that are the projection onto a plane of a circular movement on
a perpendicular plane. In practice, sinusoids are found (at least as approxima-
tions) when working with such dierent things as tides, motor vibrations, or
daily thermal variations.
Sinusoidal inputs cause si- Theorem 10.4. The stationary response y(t) of a stable linear plant G(s)
nusoidal outputs in steady subject to a sinusoidal input u(t) = sin(ωt) is
state
y(t) = |G(jω)| sin(ωt + ∠G(jω)) (10.61)

where ∠z is the phase, or argument, of z ∈ C (also notated often as arg z ), so


that z = |z|ej∠z .
Proof. The output is

y(t) = L −1 [Y (s)] (10.62)

and
ω ω
Y (s) = G(s)U (s) = G(s)L [sin(ωt)] = G(s) = G(s)
s2 + ω 2 (s + jω)(s − jω)
(10.63)

If all poles pk , k = 1, . . . , n of G(s) are simple, we can perform a partial fraction


expansion of Y (s) as follows:
n
b0 b0 X bk
Y (s) = + +
s + jω s − jω s − pk
k=1
n
X
⇒ y(t) = b0 e−jωt + b0 ejωt + bk e p k t (10.64)
| {z }
k=1
steady-state response yss (t) | {z }
transient

response yt (t)

We know that all terms in the transient response yt (t) belong there because the
exponentials are vanishing, since the poles are on the left complex half-plane.
10.4. TIME RESPONSES: PERIODIC INPUTS 145

1.5
input
output
1
input and output

0.5

−0.5

−1

−1.5
0 0.5 1 1.5 2 2.5 3
t [s]

1.5
input
output
1
input and output

0.5

−0.5

−1

−1.5
0 0.5 1 1.5 2 2.5 3
t [s]

15
Figure 10.10: Response of G(s) = to two square waves with dierent
s + 20
periods.
146 CHAPTER 10. TIME AND FREQUENCY RESPONSES

If there are multiple poles, the only dierence is that there will be terms of the
form (i−1)!
bk
ti−1 epk t , i ∈ N in the transient response yt (t), which will still, of
course, be vanishing with time. In either case, the steady-state response is the
same.
From (10.63) we know that Y (s) = G(s) (s+jω)(s−jω)
ω
, and from (10.64) we
know that Y (s) = b0
s+jω + b0
s−jω + L [yt (t)]. We can multiply both by s + jω
and obtain

ω b0
G(s) = b0 + + L [yt (t)] (s + jω) (10.65)
s − jω s − jω

Now we evaluate this equality at s = −jω :


ω
G(−jω) = b0 (10.66)
−2jω

Replacing b0 = G(−jω) −2j


1
and b0 = G(jω) 2j
1
in yss (t) = b0 e−jωt + b0 ejωt , we
obtain
1 −jωt 1
yss (t) = G(−jω) e + G(jω) ejωt
−2j 2j
1 −jωt 1
= |G(−jω)|ej∠G(−jω) e + |G(jω)|ej∠G(jω) ejωt
−2j 2j
1 1
= −|G(jω)|ej(∠G(−jω)−ωt) + |G(jω)|ej(∠G(jω)+ωt)
2j 2j
1
= |G(jω)| ej(∠G(jω)+ωt) − ej(∠G(−jω)−ωt)
2j

1
= |G(jω)| cos (∠G(jω) + ωt) + j sin (∠G(jω) + ωt)
2j

− cos − (∠G(jω) + ωt) − j sin − (∠G(jω) + ωt)
1
= |G(jω)| cos (∠G(jω) + ωt) + j sin (∠G(jω) + ωt)
2j

− cos (∠G(jω) + ωt) + j sin (∠G(jω) + ωt)
1
= |G(jω)|2j sin (∠G(jω) + ωt)
2j
= |G(jω)| sin (ωt + ∠G(jω)) (10.67)

Corollary 10.2. Since G(s) is not only stable but also linear, if the input is
u(t) = A sin(ωt) instead, the output is

y(t) = A|G(jω)| sin(ωt + ∠G(jω)) (10.68)

Example 10.12. Figure 10.11 shows the simulated vertical position of the Wave
Energy Converter of Figure 3.2, the Archimedes Wave Swing, when subject to
sinusoidal waves of dierent amplitudes. The device is in steady-state, as is clear
both from the regularity of its movements and from the time already passed since
the beginning of the simulation. As the input is sinusoidal, if the model were
linear, the output should be sinusoidal too. But the shape of the output is not
sinusoidal; it is not even symmetrical around its mean value; its amplitude does
not increase linearly with the amplitude of the input. The model used to obtain
these simulation results is obviously non-linear.

10.5 Frequency responses and the Bode diagram


(10.68) shows that, if a stable system G(s) has a sinusoidal input, the steady-
state output is related to the input through G(jω), which is the Fourier trans-
form (2.87) of the dierential equation describing the system's dynamics:

Frequency, amplitude, and ˆ if the input is sinusoidal, the steady-state output is sinusoidal too;
phase of output for sinu-
soidal inputs ˆ if the input has frequency ω , the steady-state output has frequency ω too;
10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 147

4
2.0 m
3

x / m
1

0
0.5 m
−1

−2

300 310 320 330 340 350


time / s

Figure 10.11: Vertical position of the AWS from Figure 3.2, simulated assuming
sinusoidal sea waves of dierent amplitudes between 0.5 m and 2.0 m.

ˆ if the input has amplitude A (or peak-to-peak amplitude 2A), the steady-
state output has amplitude A|G(jω)| (or peak-to-peak amplitude 2A|G(jω)|);

ˆ if the input has phase θ at some time instant t, the steady-state output
has phase θ + ∠G(jω) at that time instant t.

Remember that:

ˆ the steady-state output is sinusoidal, but the transient is not: you must The transient is not sinu-
wait for the transient to go away to have a sinusoidal output; soidal

ˆ unstable systems have transient responses that do not go away, so you will
never have a sinusoidal output;

ˆ ω is the frequency in radians per second. ω is in rad/s

Denition 10.7. Given a system G(s):


ˆ its frequency response is G(jω), a function of ω ; Frequency response

ˆ its gain at frequency ω is |G(jω)|; Gain

ˆ its gain in decibel (denoted by symbol dB) is 20 log10 |G(jω)| (gain Gain in dB
|G(jω)| is often called gain in absolute value, to avoid confusion with the Gain in absolute value
gain in decibel);

ˆ its phase at frequency ω is ∠G(jω). Phase

Remark 10.10. These denitions are used even if G(s) is not stable. If the
system is stable:

ˆ the gain is the ratio between the amplitude of the steady-state output and
the amplitude of the input;

ˆ the phase is the dierence in phase between the steady-state output sinu-
soid and the input sinusoid.

Example 10.13. Figure 10.12 shows the output of G(s) = 300(s+1)


(s+10)(s+100) for a
sinusoidal input of frequency 1 rad/s, found as follows:

>> s = tf('s');
>> G = 300*(s+1)/((s+10)*(s+100));
>> t = 0 : 0.001 : 30;
>> figure, plot(t,sin(t), t,lsim(G,sin(t),t))
>> xlabel('time [s]'), ylabel('output'), grid
148 CHAPTER 10. TIME AND FREQUENCY RESPONSES

The amplitude of the input is 1, by construction; the amplitude of the out-


put is 0.4219. So the gain at 1 rad/s is 0.4219
1 = 0.4219 in absolute value, or
20 log10 0.4219 = −7.50 dB. This maximum value is taking place at 26 s, while
the corresponding maximum of the input takes place later, at 4×2π+ π2 = 26.7 s.
As the period is 2π = 6.28 s, the phase is 26.7−26
6.28 × 360◦ = 40◦ .
Figure 10.12 also shows the output of G(s) when the frequency is 200 rad/s:
>> t = 0 : 0.0001 : 0.2;
>> figure, plot(t,sin(200*t), t,lsim(G,sin(200*t),t))
>> xlabel('time [s]'), ylabel('output'), grid
In that case, the amplitude of the input is still 1 and the amplitude of the
output is 1.313. So the gain at 200 rad/s is 1.313 1 = 1.313 in absolute value, or
20 log10 1.313 = 2.37 dB. This maximum value is taking place at 0.1703 s, while
π
the corresponding maximum of the input takes place earlier, at 5 × 200 2π
+ 200
2
=
0.1649 s. As the period is 200 = 0.0314 s, the phase is
2π 0.1649−0.1703
0.0314 × 360 ◦
=
−62◦ .
In both cases, it is visible that the rst oscillations are not sinusoidal, because
of both their shape and their varying amplitudes. In other words, the transient
has not yet disappeared by then.
In the example above, the amplitude of the output was larger than that of
the input in one case, and smaller in the other. Also in one case the extremes
of the output sinusoid took place earlier than those of the input sinusoid, while
in the other case it was the other way round.
Denition 10.8. Given
ˆ a stable system G(s),

ˆ with sinusoidal input of frequency ω and amplitude Au ,

ˆ with steady-state sinusoidal output also of frequency ω and amplitude


Ay = Au |G(jω)|,
then:
ˆ If the amplitude of the output is larger than the amplitude of the input,
Amplication Ay > Au , the system is amplifying its input:

Ay
Ay > Au ⇒ |G(jω)| = > 1 ⇒ 20 log10 |G(jω)| > 0 dB (10.69)
Au
That is to say:
the gain in absolute value is larger than 1;
the gain in decibel is larger than 0 dB.
ˆ If the amplitude of the output is smaller than the amplitude of the input,
Attenuation Ay > Au , the system is attenuating its input:

Ay
Ay < Au ⇒ |G(jω)| = < 1 ⇒ 20 log10 |G(jω)| < 0 dB (10.70)
Au
That is to say:
the gain in absolute value is smaller than 1;
the gain in decibel is smaller than 0 dB.
ˆ If the amplitude of the output and the amplitude of the input are the same,
Ay = Au , the system is neither amplifying nor attenuating its input:

Ay
Ay = Au ⇒ |G(jω)| = = 1 ⇒ 20 log10 |G(jω)| = 0 dB (10.71)
Au
That is to say:
the gain in absolute value is 1;
the gain in decibel is 0 dB.
10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 149

0.8

0.6 X: 26
Y: 0.4219

0.4

0.2
output

−0.2

−0.4

−0.6

−0.8

−1
0 5 10 15 20 25 30
time [s]

X: 0.1703
1.5 Y: 1.313

1
output

0.5

−0.5

−1

−1.5
0 0.05 0.1 0.15 0.2
time [s]

300(s + 1)
Figure 10.12: Response of G(s) = to two sinusoids with dif-
(s + 10)(s + 100)
ferent periods.
150 CHAPTER 10. TIME AND FREQUENCY RESPONSES

Table 10.1: Gain values; Au is the amplitude of the input sinusoid and Ay is
the amplitude of the steady-state output sinusoid
Gain in absolute value Gain in decibel Amplitudes
Minimum value |G(jω)| = 0 20 log 10|G(jω)| = −∞ dB Ay = 0
Attenuation 0 < |G(jω)| < 1 20 log 10|G(jω)| < 0 dB Ay < Au
Input and output with same amplitude |G(jω)| = 1 20 log 10|G(jω)| = 0 dB Ay = Au
Amplication |G(jω)| > 1 20 log 10|G(jω)| > 0 dB Ay > Au

Furthermore:
ˆ If the extremes of the output take place earlier than the corresponding
Phase lead extremes of the input, the output leads in relation to the input; this
means that

∠G(jω) > 0 (10.72)

ˆ If the extremes of the output take place later than the corresponding
Phase lag extremes of the input, the output lags in relation to the input; this means
that

∠G(jω) < 0 (10.73)

ˆ If the extremes of the output and the corresponding extremes of the input
take place at the same time, the output and the input are in phase; this
means that

∠G(jω) = 0 (10.74)

ˆ If the maxima of the output and the minima of the input take place at
Phase opposition the same time, and vice versa, the output and the input are in phase
opposition; this means that
∠G(jω) = ±180◦ = ±π rad (10.75)

Remark 10.11. Notice that, since sinusoids are periodic, the phase is dened
up to 360◦ shifts: a 90◦ phase is undistinguishable from a −270◦ phase, or for
that matter from a 3690◦ phase or any 90◦ + k360◦ , k ∈ Z phase. While each
of these values can be in principle arbitrarily chosen, it usual to make the phase
vary continuously (as much as possible) with frequency, starting from values for
low frequencies determined as we will see below in Section 11.4.
Gain crossover frequency Denition 10.9. Frequencies ωgc at which the frequency response of a plant
G(s) veries

|G(jω)| = 1 ⇔ 20 log10 |G(jω)| = 0 dB (10.76)

are called gain crossover frequencies.


Phase crossover frequency Denition 10.10. Frequencies at which input and output are in phase oppo-
sition are called phase crossover frequencies.
Gain values can be summed up as shown in Table 10.1.
Example 10.14. Consider the responses to sinusoidal inputs of G(s) = 1
s2 +0.5s+1
in Figure 10.13.
ˆ For ω = 0.5 rad/s:

The amplitude of the output is larger than that of the input, so we


must have

|G(j0.5)| > 1 ⇔ 20 log10 |G(j0.5)| > 0 dB (10.77)

In fact, the gain is



1 1
= √ 1
|G(j0.5)| =

2
=
= 1.26
(j0.5) + 0.5j0.5 + 1 1 − 0.25 + j0.25 0.75 + 0.252
2

⇒ 20 log10 G(j0.5) = 20 log10 1.26 = 2 dB (10.78)


10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 151

The output is delayed in relation to the input, so we must have


∠G(j0.5) < 0.
In fact, the phase is

1 0.25
∠G(j0.5) = ∠ = ∠1 − ∠(0.75 + j0.25) = 0◦ − arctan = −18◦
0.75 + j0.25 0.75
(10.79)

ˆ For ω = 1 rad/s:

The amplitude of the output is even larger now, so


|G(j)| > |G(j0.5)| = 1.26 ⇔ 20 log10 |G(j)| > 20 log10 G(j0.5) = 2 dB
(10.80)

In fact, the gain is



1 1
= 1 =2
|G(j)| = 2
=

j + 0.5j + 1 j0.5 0.5
⇒ 20 log10 G(j) = 20 log10 2 = 6 dB (10.81)

The output is delayed in relation to the input. Furthermore, the


output crosses zero as the input is already at a peak or at a through.
So the phase is negative, and equal to −90◦ .
In fact,

1
∠G(j) = ∠ = ∠1 − ∠(j0.5) = 0◦ − 90◦ = −90◦ (10.82)
j0.5

ˆ For ω = 2 rad/s:

The amplitude of the input is larger than that of the output, so we


must have

|G(j2)| < 1 ⇔ 20 log10 |G(j2)| < 0 dB (10.83)

In fact, the gain is



1 1
= √ 1
|G(j2)| =

2
=
= 0.316
(2j) + 0.5j2 + 1 −3 + j 9+1
1
⇒ 20 log10 G(j2) = 20 log10 10− 2 = −10 dB (10.84)

The output is delayed in relation to the input. Furthermore, input


and output are almost in phase opposition, but not yet. So we must
have 0◦ < ∠G(j2) < −180◦ , but close to the latter value.
In fact, the phase is

1 1
∠G(j2) = ∠ = ∠1 − ∠(−3 + j) = 0◦ − arctan = −162◦
−3 + j −3
(10.85)

The Bode diagram, or Bode plot, is a graphical representation of the fre- Bode diagram
quency response of a system, as a function of frequency. This diagram comprises
two plots:
ˆ a top plot, showing the gain in dB (y axis) as a function of frequency in
a semi-logarithmic scale (xaxis);
ˆ a bottom plot, showing the phase in degrees (y axis) as a function of
frequency in a semi-logarithmic scale (xaxis).
Frequency is usually given in rad/s, but sometimes in Hz.
Denition 10.11. A frequency variation corresponding to a 10fold increase Decade
or decrease is called decade. In a Bode diagram, since the frequency is shown
in a logarithmic scale, decades are equally spaced.
152 CHAPTER 10. TIME AND FREQUENCY RESPONSES

Figure 10.13: Responses of G(s) = s2 +0.5s+1


1
(blue) to input sinusoids (red)
with 0.5 rad/s (top), 1 rad/s (centre) and 2 rad/s (bottom).
10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 153

Bode Diagram
10

Magnitude (dB)
0

−10

−20

−30
90

Phase (deg)
45

−45

−90
−2 −1 0 1 2 3 4
10 10 10 10 10 10 10
Frequency (rad/s)

300(s + 1)
Figure 10.14: Bode diagram of G(s) = .
(s + 10)(s + 100)

In the following sections we will learn how to plot by hand the Bode diagram
of any plant (or at least a reasonable approximation thereof); meanwhile, the
following Matlab commands can be used instead:
ˆ bode plots the Bode diagram of a system;

ˆ freqresp calculates the frequency response of a system.

Example 10.15. The Bode diagram in Figure 10.14 of G(s) = 300(s+1)


(s+10)(s+100) Matlab's command bode
from Example 10.13 is found as follows:
>> s = tf('s');
>> G = 300*(s+1)/((s+10)*(s+100));
>> figure, bode(G), grid
The gains and phases at ω = 1 rad/s and ω = 200 rad/s found in Example 10.13
can be observed in the diagram.
This way we rst nd the frequency response and then use it to plot the Matlab's command
Bode diagram: freqresp
>> [Gjw, w] = freqresp(G); % Gjw returned as a 3-dimensional tensor...
>> Gjw = squeeze(Gjw); % ...must now be squeezed to a vector
>> figure, subplot(2,1,1), semilogx(w, 20*log10(abs(Gjw)))
>> grid, xlabel('frequency [rad/s]'), ylabel('gain [dB]'), title('Bode diagram')
>> subplot(2,1,2), semilogx(w, rad2deg(unwrap(angle(Gjw))))
>> grid, ylabel('phase [degrees]') % unwrap avoids jumps of 360 degrees
To nd the gains and phases to conrm those found found in Example 10.13:
>> Gjw = freqresp(G, [1 200])
Gjw(:,:,1) =
0.3294 + 0.2640i
Gjw(:,:,2) =
0.6525 - 1.1704i
>> gains = 20*log10(abs(Gjw))
gains(:,:,1) =
-7.4909
gains(:,:,2) =
2.5420
>> phases = rad2deg(unwrap(angle(Gjw)))
phases(:,:,1) =
38.7165
phases(:,:,2) =
-60.8590
Here's another way of nd the same values:
154 CHAPTER 10. TIME AND FREQUENCY RESPONSES

>> w = [1 200];
>> Gjw = 300*(1i*w+1)./((1i*w+10).*(1i*w+100));
Gjw =
0.3271 + 0.2676i 0.6186 - 1.2212i
>> gains = 20*log10(abs(Gjw))
gains =
-7.4909 2.5420
>> phases = rad2deg(unwrap(angle(Gjw)))
phases =
38.7165 -60.8590
Notice the small dierences due to numerical errors.
Example 10.16. The Bode diagram in Figure 10.15 of G(s) = from
1
s2 +0.5s+1
Example 10.14 shows the gains and phases found in that example, that can also
be found as follows:
>> G = tf(1,[1 .5 1])

G =

1
---------------
s^2 + 0.5 s + 1

Continuous-time transfer function.

>> figure,bode(G),grid on
>> Gjw = squeeze(freqresp(G, [.5 1 2]))
Gjw =
1.2000 - 0.4000i
0.0000 - 2.0000i
-0.3000 - 0.1000i
>> gains = 20*log10(abs(Gjw))
gains =
2.0412
6.0206
-10.0000
>> phases = rad2deg(unwrap(angle(Gjw)))
phases =
-18.4349
-90.0000
-161.5651

Example 10.17. From the Bode diagram in Figure 10.16, even without know-
ing what transfer function it belongs to, we can conclude the following:
20
ˆ At ω = 0.1 rad/s, the gain is 20 dB (i.e. 10 20 = 10 in absolute value) and
the phase is 0 = 0 rad. So, if the input is

π
u(t) = 5 sin(0.1t + ) (10.86)
6
the steady-state output will be
π π
y(t) = 5 × 10 sin(0.1t + ) = 50 sin(0.1t + ) (10.87)
6 6
17
ˆ At ω = 10 rad/s, the gain is 17 dB (i.e. 10 20 = 7.1 in absolute value) and
the phase is −45◦ = − π4 rad. So, if the input is
π
u(t) = 5 sin(10t + ) (10.88)
6
the steady-state output will be
π π π
y(t) = 5 × 7.1 sin(10t + − ) = 35.5 sin(10t − ) (10.89)
6 4 12
10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 155

Bode Diagram
10

Magnitude (dB)
0

−10

−20

−30

−40
0

Phase (deg)
−45

−90

−135

−180
−1 0 1
10 10 10
Frequency (rad/s)

1
Figure 10.15: Bode diagram of .
s2 + 0.5s + 1

ˆ At ω = 100 rad/s, the gain is 0 dB (i.e. 100 = 1 in absolute value) and


the phase is −85◦ = −1.466 rad. So, if the input is
π
u(t) = 5 sin(100t + ) (10.90)
6
the steady-state output will be

y(t) = 5 × 1 sin(100t + 0.524 − 1.466) = 5 sin(100t − 0.942) (10.91)

−20
ˆ At ω = 1000 rad/s, the gain is −20 dB (i.e. 10 = 0.1 in absolute value) 20

and the phase is −90◦ = − π2 rad. So, if the input is


π
u(t) = 5 sin(1000t + ) (10.92)
6
the steady-state output will be
π π π
y(t) = 5 × 0.1 sin(1000t + − ) = 0.5 sin(1000t − ) (10.93)
6 2 3

ˆ The system is linear. So, if the input is

π π
u(t) = 0.5 sin(0.1t + ) + 25 sin(1000t + ) (10.94)
6 6
the steady-state output will be
π π π
y(t) = 0.5 × 10 sin(0.1t + ) + 25 × 0.1 sin(1000t + − )
6 6 2
π π
= 5 sin(0.1t + ) + 2.5 sin(1000t − ) (10.95)
6 3
Notice how the frequency with the largest amplitude in the input now has
the smallest.

Glossary
And he said: Behold, it is one people, and one tongue is to al: and
they haue begunne to doe this, neyther wil they leaue of from their
determinations, til they accomplish them indede. Come ye therfore,
let vs goe downe, and there confound their tongue, that none may
heare is neighbours voice.

Moses (attrib.; 13th c. BC?), Genesis, xi 67, Douay-Rheims version (1609)


156 CHAPTER 10. TIME AND FREQUENCY RESPONSES

Bode Diagram
20

Magnitude (dB)
10

−10

−20
0

Phase (deg)
−45

−90
−1 0 1 2 3
10 10 10 10 10
Frequency (rad/s)

Figure 10.16: Bode diagram of Example 10.17.

amplication amplicação
attenuation atenuação
bounded signal sinal limitado
decade década
frequency response resposta em frequência
gain ganho
gain crossover frequency frequência de cruzamento de ganho
impulse impulso
marginally stable marginalmente estável
phase fase
phase crossover frequency frequência de cruzamento de fase
phase lag atraso de fase
phase lead avanço de fase
phase opposition oposição de fase
phase crossover frequency frequência de cruzamento de fase
ramp rampa
square wave onda quadrada
static gain ganho estacionário
steady-state estado estacionário
steady-state response resposta estacionária
stable estável
step degrau, escalão
transient response resposta transiente
triangle wave onda triangular
unit ramp rampa unitária
unit step degrau unitário
unstable instável

Exercises
1. For each of the following pairs of a transfer function and an input:

ˆ nd the Laplace transform of the input;


ˆ nd the Laplace transform of the output;
ˆ nd the value of the output for t 1 without using the inverse
Laplace transform;
ˆ nd the output as a function of time;
ˆ separate that function of time into a transient and a steady state;
ˆ conrm the value of the output for t 1 found previously.

10
(a) G(s) = and u(t) = 0.4, t > 0
s2 + 21s + 20
10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 157

5
(b) G(s) = and u(t) = 2t, t > 0
s + 0.1
s
(c) G(s) = 2 and u(t) = δ(t)
s +s+1
s
(d) G(s) = 2 and u(t) = 0.4, t > 0
s +s+1
7
(e) G(s) = and u(t) = 0.4, t > 0
s
2. From the poles of the transfer functions of Exercise 1 of Chapter 9, explain
which of them are stable, unstable, or marginally stable.
3. Figure 10.17 shows the Bode diagrams of some transfer functions. For each
of them, read in the Bode diagram the values from which you can calculate
the transfer function's steady state response to the following inputs:
ˆ u(t) = sin(2t)
π
ˆ u(t) = sin(2t + 2)
ˆ u(t) = sin(1000t)
ˆ u(t) = 10 sin(1000t)
1
ˆ u(t) = 3 sin(0.1t − π4 ) + sin(2t + π2 )10 sin(1000t)

4. For each of the following transfer functions:


ˆ nd the corresponding Fourier transform;
ˆ nd the gain (both in absolute value and in decibel) and the phase
(in radians or degrees, as you prefer) at the indicated frequencies.
5
(a) G(s) = and ω = 0.01, 0.1, 1 rad/s
s + 0.1
s
(b) G(s) = 2 and ω = 0.1, 1, 10 rad/s
s +s+1
7
(c) G(s) = and ω = 1, 10, 100 rad/s
s
5. In naval and ocean engineering it is usual to call Response Amplitude RAO
Operator (RAO) to what we called gain. It is often represented in abso-
lute value in a linear plot as a function of frequency. Figure 10.18 shows
the RAO of four dierent heaving buoys. Suppose that each of them is
subject to waves with an amplitude of 2 m and a frequency of 2π rad/s.
What will be the amplitude of the oscillation of each buoy?
10
6. Consider transfer function G(s) = .
10s + 1
(a) When the input is a unit step, what will the steady state response
be?
(b) When the input is a step with amplitude 3, what will the steady state
response be?
(c) Without computing an expression for the output, give a rough esti-
mate of how long it takes for the output to reach 20, when the input
is a step with amplitude 3.
(d) Without computing an expression for the output, give a rough esti-
mate of the 2% settling time, when the input is a step with amplitude
3.
(e) Calculate the output as a function of time, using an inverse Laplace
transform, and nd the exact values of the estimations from the last
two questions.
(f) Suppose that the input is now a unit step again. What will the
new value of the 2% settling time be? Hint: is the system linear or
non-linear?
7. Show that, in (10.21), if 0 ∈
/ [a, b] and function g(t) is bounded, the inte-
grand is zero everywhere, and the integral is zero.
158 CHAPTER 10. TIME AND FREQUENCY RESPONSES

Bode Diagram
Magnitude (dB) 200

100

−100
−180
Phase (deg)

−225

−270

−315

−360
−3 −2 −1 0 1 2 3
10 10 10 10 10 10 10
Frequency (rad/s)

Bode Diagram
−30
Magnitude (dB)

−40

−50

−60

−70
180
Phase (deg)

90

−90
−2 −1 0 1 2 3 4
10 10 10 10 10 10 10
Frequency (rad/s)

Figure 10.17: Bode diagrams of Exercise 3.


10.5. FREQUENCY RESPONSES AND THE BODE DIAGRAM 159

Figure 10.18: RAO of four heaving buoys of Exercise 5 (source:


http://marine-eng.ir/article-1-80-en.pdf).
160 CHAPTER 10. TIME AND FREQUENCY RESPONSES
Chapter 11

Finding time and frequency


responses
A rocket-driven spaceship can, obviously, only accelerate along its
major axis that is, `forwards'. Any deviation from a straight
course demands a physical turning of the ship, so that the motors
can blast in another direction. Everyone knows that this is done by
internal gyros or tangential steering jets: but very few people know
just how long this simple manoeuvre takes. The average cruiser,
fully fuelled, has a mass of two or three thousand tons, which does
not make for rapid footwork. But things are even worse than this,
for it is not the mass, but the moment of inertia that matters here
and since a cruiser is a long, thin object, its moment of inertia
is slightly colossal. The sad fact remains (though it is seldom men-
tioned by astronautical engineers) that it takes a good ten minutes to
rotate a spaceship through 180 degrees, with gyros of any reasonable
size. Control jets are not much quicker, and in any case their use is
restricted because the rotation they produce is permanent and they
are liable to leave the ship spinning like a slow-motion pin-wheel, to
the annoyance of all inside.
In the ordinary way, these disadvantages are not very grave. One
has millions of kilometres and hundreds of hours in which to deal
with such minor matters as a change in the ship's orientation. It is
denitely against the rules to move in ten-kilometre-radius circles,
and the commander of the Doradus felt distinctly aggrieved.

Arthur C. Clarke (1917 „2008), Hide-and-seek, Astounding Science


Fiction, September 1949

In this chapter we systematically study the time and frequency responses of


dierent systems, beginning with the simplest cases.

11.1 Time and frequency responses of a pole at


the origin
In this section we study the behaviour of transfer functions of the form
b
G(s) = , b>0 (11.1)
s
which have one pole at the origin, s = 0.
As to time responses, it is clear that, for any input u(t), the output is 1
s integrates its input
Z t
b
y(t) = L −1
U (s) =b u(t) (11.2)
s 0

where we have used (2.47). In particular, the unit step response of (11.1) is b
Unit step response of s

b
y(t) = L −1
= bt (11.3)
s2

161
162 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.1: Response of b


s to a step of amplitude K .

Figure 11.2: Bode diagram of sb .

and in the more general case of a step with amplitude K the response is b
Step response of s

y(t) = bKt (11.4)

This response will go up if K > 0 and go down if K < 0, as seen in Figure 11.1.
As we know, (11.1) is marginally stable, since
ˆ its response to a step, which is a bounded input, is not bounded;

ˆ its impulse response, y(t) = L −1 = b H(t), is bounded.


b
s
b
Frequency response of s The frequency response of (11.1) is
b
G(jω) = (11.5)


b b
|G(jω)| = = (11.6)
jω ω

b
20 log10 |G(jω)| = = 20 log10 b + 20 log10 ω (11.7)

∠b − ∠(jω) = −90◦
∠G(jω) = |{z} (11.8)

| {z }
0 90◦

As to the gain of (11.8), notice that:


ˆ it is shown as a straight line in a Bode diagram, since it has a linear
variation with log10 ω ;
11.2. TIME AND FREQUENCY RESPONSES OF A FIRST-ORDER SYSTEM WITHOUT ZEROS 163

ˆ the slope of that straight line is always −20 dB per decade;

ˆ there is one gain crossover frequency, which is b rad/s;

ˆ when compared with the case b = 1, the gain is shifted up if b > 1 or down
if 0 < b < 1, by 20 log10 b in either case.

11.2 Time and frequency responses of a rst-order


system without zeros
In this section we study the behaviour of transfer functions of the form
b
G(s) = , a 6= 0, b > 0 (11.9)
s+a
which have one pole, s = −a 6= 0.
The unit step response of (11.9) is, as can be seen in Table 2.1, b
Step response of s+a

b
1 − e−at (11.10)

y(t) =
a
and, in the more general case of a step with amplitude K , the step response is
bK
1 − e−at (11.11)

y(t) =
a
As we know, (11.9) is
ˆ stable if a > 0 (pole in −a ∈ R− ), in which case the exponential in
(11.10)(11.11) vanishes when t increases;
ˆ unstable if a < 0 (pole in −a ∈ R+ ), in which case the exponential in
(11.10)(11.11) keeps increasing when t increases.
Figure 11.3 shows the general shape of the step response. Notice that, if the
system is stable:
ˆ the steady-state response is constant and given by yss = a ;
bK

ˆ the response will go up if K > 0 and down if K < 0;

ˆ the response is monotonous, and thus the output is never larger than the
steady-state value;
ˆ the response changes with time as follows:

0.7 bK
1 − e−0.7 = 0.50 yss (11.12)

y =
a a

1 bK
1 − e−1 = 0.63 yss (11.13)

y =
a a

2 bK
1 − e−2 = 0.86 yss (11.14)

y =
a a

2.3 bK
1 − e−2.3 = 0.90 yss (11.15)

y =
a a

3 bK
1 − e−3 = 0.95 yss (11.16)

y =
a a

4 bK
1 − e−4 = 0.98 yss (11.17)

y =
a a

4.6 bK
1 − e−4.6 = 0.99 yss (11.18)

y =
a a

ˆ 1
a is called time constant; Time constant

ˆ the slope of the response at t = 0 is given by

bK −a0
y 0 (0) = ae = bK (11.19)
a
164 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.3: Response of b


s+a to a step with amplitude K .

Denition 11.1. The x%settling time ts,x% is the minimum value of time Settling time
for which
x x
∀t > ts,x% , yss 1 − ≤ y(t) ≤ yss 1 + (11.20)
100 100
The most usual are the 5%settling time and the 2%settling time, though other
values, such as 10%, 15%, or 1%, are sometimes found.

Since step response (11.11) is monotonous, (11.12)(11.18) show that

ˆ its 10% settling time is ts,10% = a ;


2.3

ˆ its 5% settling time is ts,5% = a;


3

ˆ its 2% settling time is ts,2% = a;


4

ˆ its 1% settling time is ts,1% = a .


4.6

b
Frequency response of s+a The frequency response of (11.9) is

b b(a − jω)
G(jω) = = 2 (11.21)
jω + a a + ω2

b
|G(jω)| = = √ b (11.22)
jω + a a2 + ω 2
20 log10 |G(jω)| = 20 log10 b − 10 log10 a2 + ω 2
[dB] (11.23)

ω
∠G(jω) = 0 − ∠(jω + a) = − arctan (11.24)
a
and thus, if a > 0 (stable system):

ˆ for low frequencies,

b
ω a ⇒ G(jω) ≈ (11.25)
a
b b
ω a ⇒ |G(jω)| ≈ = (11.26)
a a
b
ω a ⇒ 20 log10 |G(jω)| ≈ 20 log10 [dB] (11.27)
a
b
ω a ⇒ ∠G(jω) ≈ ∠ =0 ◦
(11.28)
a
11.2. TIME AND FREQUENCY RESPONSES OF A FIRST-ORDER SYSTEM WITHOUT ZEROS 165

ˆ for frequency ω = a,

b
G(ja) = (11.29)
a(j + 1)

b = b √1 (11.30)

|G(ja)| =
a(j + 1) a 2
b √ b
20 log10 |G(ja)| = 20 log10 − 20 log10 1 + 1 ≈ 20 log10 − 3 [dB]
a a
(11.31)
∠G(ja) = 0 − ∠(j + 1) = −45◦ (11.32)

ˆ for high frequencies,

b
ω a ⇒ G(jω) ≈ (11.33)


b b
ω a ⇒ |G(jω)| ≈ = (11.34)
jω ω
ω a ⇒ 20 log10 |G(jω)| ≈ 20 log10 b − 20 log10 ω [dB] (11.35)

b
ω a ⇒ ∠G(jω) ≈ ∠ = −90◦ (11.36)

In other words:

ˆ for low frequencies, b


s+a is similar to constant a,
b
with a zero phase and a
constant gain;

ˆ for high frequencies, is similar to sb , with a −90◦ phase and a linear


b
s+a
gain with a slope of −20 dB per decade;

ˆ the phase goes down from 0◦ for low frequencies to −90◦ for high frequen-
cies.

If a < 0, the gain is the same; only the phase changes:

ˆ for low frequencies,



b
ω a ⇒ ∠G(jω) ≈ ∠ = −180◦ (11.37)
a

ˆ for frequency ω = |a|,

b b
G(j|a|) = = (11.38)
a + j|a| |a|(−1 + j)
ω = |a| ⇒ ∠G(jω) = 0 − ∠(−1 + j) = −135◦ (11.39)

ˆ for high frequencies,



b b
ω a ⇒ G(jω) ≈ ω a ⇒ ∠G(jω) ≈∠ = −90◦ (11.40)
jω jω

So in this case the phase goes up from −180◦ for low frequencies to −90◦ for
high frequencies. Remember that since the system is unstable in this case the
output will not be a sinusoid in steady state (it will have diverged exponentially
to innity).
Figure 11.4 shows the Bode diagram of (11.9).

Remark 11.1. The Bode diagram of (11.9) in Figure 11.4 is often approximated
by its asymptotes shown in Figure 11.5.

Remark 11.2. The steady-state response of (11.9) to a unit step ab can be found
from the gain for low frequencies (11.25). In fact, a low frequency corresponds
to a large time span.
166 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.4: Bode diagram of s+a .


b
11.2. TIME AND FREQUENCY RESPONSES OF A FIRST-ORDER SYSTEM WITHOUT ZEROS 167

Figure 11.5: Asymptotes of the Bode diagram of b


s+a in Figure 11.4.
168 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

11.3 Time and frequency responses of a second-


order system without zeros
In this section we study the behaviour of transfer functions of the form

b
G(s) = , b>0 (11.41)
s2 + a1 s + a2

which have two poles. It is usual to rewrite (11.41) as

b b
G(s) = = , b>0
s2 2
p p
+ 2ξωn s + ωn (s + ξωn + ξ + 1)(s + ξωn − ξ 2 + 1)
2

(11.42)

For reasons we will see later, ξ is called damping coecient and ωn natural
frequency. The poles of (11.42) are
p
p1 = −ξωn + ωn ξ 2 − 1 (11.43)
p
p2 = −ξωn − ωn ξ 2 − 1 (11.44)

Notice that:

ˆ (11.41) can always be put in the form (11.42), save

when a2 < 0, in which case the transfer function is unstable, as can


be easily seen in a way we will learn below in section 11.5),
or when a2 = 0 6= a1 , in which case there is one pole at the origin,
and the transfer function is marginally stable;

ˆ if either ξ or ωn are negative the real part of the poles is positive and
(11.42) is unstable too;

ˆ if both ξ or ωn are negative, (11.42) is just as if both were positive, so


that case need not be considered;

ˆ if ωn = 0 then G(s) = s2 ,
b
which is unstable;

ˆ if ξ ≥ 1 then the poles are real, in which case we can write

b
G(s) = , b > 0, p1 , p2 ∈ R (11.45)
(s + p1 )(s + p2 )

ˆ if, in particular, ξ = 1 then the two real poles are both equal to −ωn :

b
G(s) = , b, ωn > 0 (11.46)
(s + ωn )2

ˆ if 0 ≤ ξ < 1 the system is not unstable and the complex conjugate poles
are given by
p
p1 = −ξωn + jωn 1 − ξ2 (11.47)
p
p2 = −ξωn − jωn 1 − ξ 2 (11.48)

Five cases will be treated separately:

Overdamped system ˆ ξ > 1, i.e. the two poles are real and dierent, as in (11.45): in this case
the system is called overdamped;

Critically damped system ˆ ξ = 1, i.e. there is a double pole, as in (11.46): in this case the system is
called critically damped;

Underdamped system ˆ 0 < ξ < 1, i.e. the two poles are complex conjugate and stable: in this
case the system is called underdamped;

System with no damping ˆ ξ = 0, i.e. the two poles are complex conjugate and marginally stable: in
this case the system is said to have no damping;
11.3. TIME AND FREQUENCY RESPONSES OF A SECOND-ORDER SYSTEM WITHOUT ZEROS 169

Figure 11.6: Location of the poles in the complex plane of second order systems.
Notice that the bottom left undamped system is marginally stable, as well as
the bottom centre one with a pole at the origin.

ˆ G(s) = b b
= s(s+a
s2 +a1 s 1)
, b > 0, i.e. the transfer function is marginally
stable with one pole in the origin.

See Figure 11.6.


response of If both poles of (11.41) are real, dierent from zero and dierent from each
damped system other, then its response to a step of amplitude K is, as can be seen in Table 2.1,
b
1 )(s+p2 )
bK 1
p2 e−p1 t − p1 e−p2 t (11.49)

y(t) = 1+
p1 p2 p1 − p2

As expected, should either p1 or p2 be negative, (11.49) would diverge to innity.


Assuming that both p1 and p2 are positive, we can rewrite (11.49) using (11.43)
(11.44):
p p
p1 p2 = (−ξωn + ωn ξ 2 − 1)(−ξωn − ωn ξ 2 − 1)
= ξ 2 ωn2 − ωn2 (ξ 2 − 1) = ωn2 (11.50)
p p p
p1 − p2 = −ξωn + ωn ξ 2 − 1 − (−ξωn − ωn ξ 2 − 1) = 2ωn 1 − ξ 2 (11.51)
√ √
!
bK 1 p
2 (ξ− ξ 2 −1)ωn t
p
2 (ξ+ ξ 2 −1)ωn t

y(t) = 2 1 + p (−ξ − ξ − 1) e − (−ξ + ξ − 1) e
ωn 2 1 − ξ2
(11.52)

Then:

ˆ the steady-state response is constant and given by yss = bK


p1 p2 = 2 ;
bK
ωn

ˆ the response begins at 0 with a horizontal slope, since

bK 1
y 0 (t) = −p1 p2 e−p1 t + p1 p2 e−p2 t (11.53)

p1 p2 p1 − p2

and thus y 0 (0) = 0;

ˆ the response is monotonous, since y 0 (t) = bK


p1 −p2 (e−p2 t − e−p1 t ) = 0 admits
only one solution which is t = 0;
170 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

ˆ there is an inection point, which can be found as follows:

bK
y 00 (t) = p1 e−p1 t − p2 e−p2 t = 0

p1 − p2
⇒ log p1 − p1 t = log p2 − p2 t
p1 − p2
⇔t= (11.54)
log p1 − log p2

(11.52) shows that y(t) depends on t only in the argument of the two exponen-
tials, where t appears multiplied by ωn . This product ωn t has no dimensions.
This step response can be put as a function of ωn t, as in Figure 11.7, and then
will vary only with ξ as shown.
Frequency response The frequency response in this case can be easily found thanks to the fol-
of overdamped system lowing result:
b
(s+p1 )(s+p2 ) Theorem 11.1. The gain in dB and the phase of the product of two transfer
functions are the sum of their separate gains and phases:

20 log10 |G1 (s)G2 (s)| = 20 log10 |G1 (s)| + 20 log10 |G2 (s)| (11.55)
∠ [G1 (s)G2 (s)] = ∠ [G1 (s)] + ∠ [G2 (s)] (11.56)

So we can just add the frequency responses of two rst-order systems and
obtain the responses in Figure 11.8. Again, it usual to plot the corresponding
asymptotes, shown in Figure 11.9, instead. Notice that:
ˆ For low frequencies, the gain is 20 log10 = 20 log10 ωb2 dB, and the
b
p1 p2 n
phase is 0 . Indeed, when ω ≈ 0, the system is similar to a constant:

b b
G(jω) = ≈ 2 (11.57)
−ω 2 + 2ξωn jω + ωn2 ωn

ˆ For high frequencies, the gain is linear with a slope of −40 dB per decade,
and the phase is −180◦ . Indeed, when ω p1 , p2 , the system is similar
to a double integrator:
b b
G(jω) = ≈− 2 (11.58)
−ω 2 2
+ 2ξωn jω + ωn ω

ˆ When the two poles do not have the same order of magnitude, it is possible
to notice their eect on gain and phase separately. But, if the values of
p1 and p2 are close to each other, their eects on the frequency response
merge.
Step response of critically If both poles of (11.41) are equal, (11.50) shows that p1 = p2 = ωn , and the
b
damped system (s+ω )2
n
system's response to a step of amplitude K is, as can be seen in Table 2.1,
bK
1 − e−ωn t − ωn te−ωn t (11.59)

y(t) = 2
ωn
As expected, should p be negative, (11.59) would diverge to innity. Assuming
that p is positive, then:
ˆ the steady-state response is constant and given by yss = 2 ;
bK
ωn

ˆ the response begins at 0 with a horizontal slope, since

bK
y 0 (t) = ωn e−ωn t − ωn e−ωn t + ωn2 te−ωn t = bKte−ωn t (11.60)

2
ωn
and thus y 0 (0) = 0;
ˆ the response is monotonous, since y 0 (t) = bKte−ωn t = 0 admits only one
solution which is t = 0;
ˆ there is an inection point, which can be found as follows:

y 00 (t) = bK e−ωn t − ωn te−ωn t = bK(1 − ωn t)e−ωn t = 0


1
⇔t= (11.61)
ωn
11.3. TIME AND FREQUENCY RESPONSES OF A SECOND-ORDER SYSTEM WITHOUT ZEROS 171

Figure 11.7: Response of s2 +2ξωbn s+ω2 , b, ωn > 0 to a step with ampli-


n
tude K > 0. Top: ξ = 1, 1.2, 1.4, 1.6, 1.8, 2, 2.2, 2.4, 2.6, 2.8, 3. Bottom:
ξ = 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.
172 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.8: Bode diagram of b


2 ,
s2 +2ξωn s+ωn b, ωn > 0, ξ > 1, i.e. of
b
(s+p1 )(s+p2 ) , b, p1 , p2 > 0. Top: ξ 1. Bottom: ξ > 1.
11.3. TIME AND FREQUENCY RESPONSES OF A SECOND-ORDER SYSTEM WITHOUT ZEROS 173

Figure 11.9: Asymptotes of the Bode diagram of b


2 ,
s2 +2ξωn s+ωn b, ωn > 0, ξ > 1,
i.e. of b
b, p1 , p2 > 0, in Figure 11.8. Top: ξ 1. Bottom: ξ > 1.
(s+p1 )(s+p2 ) ,
Notice how in the latter case the aporoximation is poorer.
174 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.10: Bode diagram of s2 +2ξωbn s+ω2 , b, ωn > 0, for ξ =


n
0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.

Once more, (11.59) shows that y(t), given in Figure 11.7, depends on t only, by
product ωn t.
Frequency response of The frequency response in this case can be found thanks to (11.55)(11.56)
critically damped system and is shown in Figure 11.10. Again, it usual to plot instead the corresponding
b
(s+ωn )2 asymptotes, shown in Figure 11.11. Notice that:

ˆ For low and high frequencies, the frequency response is the same as in the
overdamped case.

ˆ For ω = ωn , the gain and phase are

b b b
G(jωn ) = = 2 = (11.62)
(jωn + ωn )2 ωn (j + 1)2 2jωn2
b
20 log10 |G(jωn )| = 20 log10 2 − 20 log10 2
ωn
b
= 20 log10 2 − 6 dB (11.63)
ωn
∠G(jωn ) = −90◦ (11.64)

Step response of un- If the poles of (11.41) are complex conjugate, the system's response to a step
derdamped system of amplitude K is, as can be seen in Table 2.1,
b
s2 +2ξωn s+ωn
2 p !!
bK 1 −ξωn t
p
2
1 − ξ2
y(t) = 2 1 − p e sin ωn 1 − ξ t + arctan
ωn 1 − ξ2 ξ
(11.65)

See Figure 11.7. As already mentioned, should product −ξω be positive (i.e. if
either ξ or ωn are negative), (11.65) would diverge to innity. Assuming that
the system is stable, i.e. that 0 < ξ < 1, then:

ˆ the steady-state response is again constant and given by yss = 2 ;


bK
ωn

ˆ the response has oscillations caused by the sinusoid, and so is not monotonous;

ˆ the frequency of the oscillations, ωn 1 − ξ 2 , is called damped frequency


p
Damped frequency
(as opposed to natural frequency ωn );

ˆ the oscillations have decreasing amplitudes thanks to the exponential;


11.3. TIME AND FREQUENCY RESPONSES OF A SECOND-ORDER SYSTEM WITHOUT ZEROS 175

Figure 11.11: Asymptotes of the Bode diagram of b


2 ,
s2 +2ξωn s+ωn b, ωn > 0, for

ξ = 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, and 2
2
≤ ξ ≤ 1.

ˆ indeed, since −1 ≤ sin x ≤ 1, ∀x, the response y(t) is limited by two


exponential curves ȳ(t) and y(t) that converge to yss (see Figure 11.12):
! !
bK e−ξωn t bK e−ξωn t
y(t) = 2 1− p ≤ y(t) ≤ 2 1+ p = ȳ(t)
ωn 1 − ξ2 ωn 1 − ξ2
(11.66)

ˆ the oscillations take place around the steady-state, which means that the Overshoot
response will exceed that value at some instants: this is called overshoot
(see Figure 11.12);

ˆ the response begins at 0 with a horizontal slope, since


" p !
0 bK −ξωn t
p
2
1 − ξ2
y (t) = − p −ξωn e sin ωn 1 − ξ t + arctan
ωn2 1 − ξ 2 ξ
p !#
p p 1 − ξ2
+ωn 1 − ξ 2 e−ξωn t cos ωn 1 − ξ 2 t + arctan
ξ
" p !
bK e−ξωn t p 1 − ξ2
= p ξ sin ωn 1 − ξ 2 t + arctan
ωn 1 − ξ 2 ξ
p !#
p p 1 − ξ 2
− 1 − ξ 2 cos ωn 1 − ξ 2 t + arctan (11.67)
ξ

and thus
sin sin
zp }| { z }| { !
p
2 1 − ξ2
p
bK 1−ξ
y 0 (0) = p ξ sin arctan − 1 − ξ 2 cos arctan
ωn 1 − ξ2 ξ ξ
|{z} |{z}
cos cos
bK p p
= p ξ 1 − ξ2 − 1 − ξ2ξ = 0 (11.68)
ωn 1 − ξ 2

ˆ that the response is not monotonous can also be seen equalling (11.67) to
176 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

zero, so as to nd the time instants in which (11.65) changes direction:


y 0 (t) = 0 (11.69)
p !
p 1 − ξ2
⇔ ξ sin ωn 1 − ξ 2 t + arctan
ξ
p !
p
2
p
2
1 − ξ2
− 1 − ξ cos ωn 1 − ξ t + arctan =0
ξ
p ! p
p 1 − ξ 2 1 − ξ2
⇔ tan ωn 1 − ξ 2 t + arctan =
ξ ξ
p p
p
2
1 − ξ2 1 − ξ2
⇒ ωn 1 − ξ t + arctan = arctan + kπ
ξ ξ

⇔t= p , k∈Z
ωn 1 − ξ 2

ˆ because the upper exponential curve in (11.66) limiting the response de-
creases with time, the rst overshoot is the largest, and its maximum value
is thus the the maximum overshoot;
Maximum overshoot ˆ the value Mp of this maximum overshoot is usually given as a percentage
of the steady-state value:
max y(t) − yss
Mp = ⇔ max y(t) = yss (1 + Mp ) (11.70)
yss

Peak time ˆ the time instant at which the maximum overshoot takes place is the peak
time tp , which is consequently given by (11.69) for k = 1:
π
tp = p (11.71)
ωn 1 − ξ 2

ˆ Mp can be found replacing (11.71) in (11.65) and then using (11.70):


p !!
bK 1 −ξωn √π p π 1 − ξ2
y(tp ) = 2 1− p e ωn 1−ξ2 sin ωn 1− ξ2 p + arctan
ωn 1 − ξ2 ωn 1 − ξ 2 ξ
sin
zp }| { !
1 − ξ2
−ξπ

bK 1 √
= 2
1− p e 1−ξ2 sin π + arctan
ωn 1−ξ 2 ξ
|{z}
cos
√ 2
| {z }
sin arctan 1−ξ /ξ

bK √−ξπ
= 1+e 1−ξ2
ωn2

√−ξπ
bK bK
2
ωn 1+e 1−ξ2 − 2
ωn √−ξπ
⇒ Mp = bK
=e 1−ξ2 (11.72)
2
ωn

Settling time ˆ (11.65) could be used to nd settling times for dierent percentages of
the steady-state value, but the sinusoid makes calculations dicult (the
response is not monotonous) and numerical results have abrupt variations
with ξ ; it is easier to obtain approximated (by excess) settling times from
the (monotonous) limiting exponential curves in (11.66), e.g. ȳ(t):
x
ȳ(ts,x% ) = yss 1 +
! 100
bK e−ξωn t x bK
⇔ 2 1+ p = 1+
ωn 1 − ξ2 100 ωn2
x p
⇔ e−ξωn t = 1 − ξ2
100
x
p
− log 100 1 − ξ2 x
− log 100
⇒t= ≤ (11.73)
ξωn ξωn
11.3. TIME AND FREQUENCY RESPONSES OF A SECOND-ORDER SYSTEM WITHOUT ZEROS 177

Figure 11.12: Overshoots, maximum overshoot Mp , peak time tp , 5% settling


time ts,5% approximated from the envelope exponentials.

and thus, replacing x with dierent values, we nd that (compare these
values with those of a rst order system without poles):

the 10% settling time is ts,10% = ξωn ;


2.3

the 5% settling time is ts,5% = ξωn ;


3

the 2% settling time is ts,2% = ξωn ;


4

the 1% settling time is ts,1% = ξωn .


4.6

The frequency response in this case cannot be found from that of rst order Frequency response of
transfer functions using Theorem 11.1. We can write underdamped system
b
s2 +2ξωn s+ωn
2
b
G(jω) = (11.74)
−ω 2 + 2ξωn jω + ωn2
b
|G(jω)| = p (11.75)
(ωn2 − ω 2 )2 + 4ξ 2 ωn2 ω 2
(11.76)
p
20 log10 |G(jω)| = 20 log10 b − 20 log10 (ωn2 − ω 2 )2 + 4ξ 2 ωn2 ω 2
2ξωn ω
∠G(jω) = − arctan 2 (11.77)
ωn − ω 2

and see that for high and low frequencies the frequency response is the same as
in the overdamped and critically damped cases. But this time the gain (11.75)
may not be monotonous. To nd this, because numerator b is constant and the
square root is monotonous, we only need to calculate the derivative

d 2
(ωn − ω 2 )2 + 4ξ 2 ωn2 ω 2 = 2(ωn2 − ω 2 )(−2ω) + 8ξ 2 ωn2 ω (11.78)

Equalling to zero we nd that the gain has a maximum at a frequency called Resonance frequency
resonance frequency ωr given by

ωr2 − ωn2 + 2ξ 2 ωn2 = 0


⇔ ωr2 = ωn2 − 2ξ 2 ωn2
p
⇒ ωr = ωn 1 − 2ξ 2 (11.79)
178 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.13: Pole location in the complex plane, unit step responses and Bode
ω2
diagrams of three transfer functions given by s2 +2ξωnn s+ω2 , when ωn is constant.
n

as long as the square root is real, i.e. 1 − 2ξ 2 > 0 ⇔ ξ < √12 ≈ 0.707. In this
case, the corresponding maximum value of the gain is found from (11.76):
p
20 log10 |G(jωr )| = 20 log10 b − 20 log10 (ωn2 − ωn2 (1 − 2ξ 2 ))2 + 4ξ 2 ωn4 (1 − 2ξ 2 )
p
= 20 log10 b − 20 log10 ωn4 (1 − 1 + 2ξ 2 )2 + ωn4 (4ξ 2 − 8ξ 4 )
p
= 20 log10 b − 20 log10 ωn2 4ξ 4 + 4ξ 2 − 8ξ 4
∈[0,1]
z p}| {
= 20 log10 b − 20 log10 ωn2 −20 log10 2ξ 1 − ξ 2 (11.80)
| {z }| {z }
gain at low frequencies >0
√ √ q
(Notice that since 0 < ξ < 22 we have 2ξ 1 − ξ 2 < 2 1 − 12 = 1.) This
p

frequency behaviour is shown in Figure 11.10, and the corresponding asymptotes


in Figure 11.11, where the resonant peak of −20 log10 2ξ 1 − ξ 2 dB is marked.
p

Step response of undamped For ξ = 0, system (11.41) is marginally stable, and step response (11.65)
b
system s2 +ω 2 simplies to
n

bK π
y(t) = 2 1 − sin ωn t + (11.81)
ωn 2
and thus the steady-state response consists in oscillations with frequency ωn
Why ωn is the natural fre- that are not damped; that is why ωn is called natural frequency: it is the
quency frequency of the system's step response (or impulse response; check Table 2.1
Why ξ is the damping co- again) oscillations when the damping coecient is 0. The reason why ξ is the
ecient damping coecient, by the way, is that it is proportional to the coecient of the
damper in (4.9); more generically, it is related to the coecient of the energy
dissipator, as can be seen e.g. in (5.24).
Frequency response of un- The corresponding frequency response is given by (11.74) with ξ = 0:
b
damped system s2 +ω 2
n b
G(jω) = (11.82)
ωn2 − ω2
This is always a real number, and so the phase jumps from 0◦ (when ω < ωn )
to −180p ◦
(when ω > ωn ) as seen in Figure 11.10. At resonance frequency
ωr = ωn 1 − 2ξ 2 = ωn , the peak is
b
lim |G(jωr )| = lim |G(jωn )| = lim p = +∞ (11.83)
ω→ωr ω→ωn ω→ωn (ωn − ω 2 )2
2
11.3. TIME AND FREQUENCY RESPONSES OF A SECOND-ORDER SYSTEM WITHOUT ZEROS 179

Figure 11.14: Pole location in the complex plane, unit step responses and Bode
ω2
diagrams of three transfer functions given by s2 +2ξωnn s+ω2 , when ξ is constant.
n

Of course, in practice systems have some residual damping, and in any case
sinusoidal outputs never have innite amplitudes (reread Example 4.1 and Re-
mark 10.7 if you need).
We can now sum up what happens for the four dierent cases of (11.41) we
have studied (check Figure 11.6 again):

ˆ step responses begin at 0 with a horizontal slope;

ˆ step responses have a bK


2
ωn steady-state (where K is the amplitude of the
step);

√−ξπ
ˆ step responses have no overshoot if ξ ≥ 1, and have a Mp = e 1−ξ2

overshoot if 0 ≤ ξ < 1;

ˆ frequency responses have a phase that goes from 0◦ (at low frequencies)
to −180◦ (at high frequencies) as the frequency increases;

ˆ frequency responses have a gain that goes from (i.e. 20 log10 ωb2 dB, at
b
ωn2
n
low frequencies) to 0 (i.e. −∞ dB, at high frequencies) as the frequency
increases;

ˆ the slope of the gain is −40 dB per decade at high frequencies;



ˆ the gain has no resonant peak if ξ ≥ 2 ,
and has a −20 log10 2ξ 1 − ξ 2 >
2
p

0 resonant peak if 0 ≤ ξ < 22 (so in this case, for a sinusoidal input with Meaning of the resonant
a frequency equal to or around ωr , the system's sinusoidal steady-state peak
output will have an amplitude larger than the input's).

Figures 11.1311.16 illustrate how step and frequency responses of (11.42) with
complex conjugate poles change according to their position on the complex
plane.
To conclude this section, the fth and nal case of a second order transfer b
Step response of s(s+a)
function to be considered is that in which either pole is 0: (11.49) cannot be
applied; (11.41) will integrate the output of the other pole.
180 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.15: Pole location in the complex plane, unit step responses and Bode
diagrams of three transfer functions given by (s+pp11)(s+p
p2
2)
, when the real part of
the poles is constant.

Figure 11.16: Pole location in the complex plane, unit step responses and Bode
diagrams of three transfer functions given by (s+pp11)(s+p
p2
2)
, when the imaginary
part of the poles is constant.
11.4. SYSTEMS WITH MORE ZEROS AND POLES: FREQUENCY RESPONSES 181

11.4 Systems with more zeros and poles: fre-


quency responses
The frequency response of systems with more than two poles, or with zeros, or
with a negative gain, can be found from the frequency response of

ˆ each real pole and zero,

ˆ each pair of complex conjugate poles and zeros, and

ˆ its gain

found separately. To nd the frequency response of any transfer function, write
it as a product of smaller transfer functions found therein, and sum the corre-
sponding gains and phases, according to Theorem 11.1.

Remark 11.3. It is often easier to write those smaller transfer functions so


that they have a 0 dB gain at low frequencies (excepting poles or zeros at the
origin, of course, which have no constant gain at low frequencies), and then add
the eect of a gain as needed. This is how we will proceed in what follows.
But it is possible to have dierent low-frequency gains for the dierent smaller
transfer functions.

We already know the following:

ˆ the frequency response of a pole at the origin 1


s was studied in section 11.1:

1
G(jω) = (11.84)

20 log10 |G(jω)| = −20 log10 ω dB (11.85)
∠G(jω) = −90 ◦
(11.86)

ˆ the frequency response of a real pole in the left complex half-plane a


s+a , a>
0 was studied in section 11.2:
a
G(jω) = (11.87)
jω + a
20 log10 |G(jω)| ≈ 0 dB, ω a (11.88)

∠G(jω) ≈ 0 , ω a (11.89)
a 1
20 log10 |G(ja)| = 20 log10 √ = 20 log10 √ = −3 dB (11.90)
2
a +a 2 2
a

∠G(ja) = 0 − arctan = −45 ◦
(11.91)
a
20 log10 |G(jω)| ≈ 20 log10 a − 20 log10 ω dB, ω a (11.92)
∠G(jω) ≈ −90◦ , ω a (11.93)

ˆ the frequency response of a real pole in the right complex half-plane


a
s−a , a > 0 was also studied in section 11.2:

a
G(jω) = (11.94)
jω − a
20 log10 |G(jω)| ≈ 0 dB, ω a (11.95)
∠G(jω) ≈ −180 , ω a ◦
(11.96)
a 1
20 log10 |G(ja)| = 20 log10 √ = 20 log10 √ = −3 dB (11.97)
2
a +a 2 2
a

∠G(ja) = 0 − arctan = −135 ◦
(11.98)
−a
20 log10 |G(jω)| ≈ 20 log10 a − 20 log10 ω dB, ω a (11.99)

∠G(jω) ≈ −90 , ω a (11.100)

ˆ the frequency response of a pair of complex conjugate poles in the left


2
ωn
complex half-plane 2 ,
s2 +2ξωn s+ωn ωn > 0, 0 ≤ ξ < 1 was studied in sec-
182 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

tion 11.3:
ωn2
G(jω) = (11.101)
ωn2 − ω 2 + j2ξωn ω
20 log10 |G(jω)| ≈ 0 dB, ω ωn (11.102)

∠G(jω) ≈ 0 , ω ωn (11.103)
p p
20 log10 |G(jωn 1 − 2ξ 2 )| = −20 log10 2ξ 1 − ξ 2 dB > 0 dB (11.104)
20 log10 |G(jωn )| = −20 log10 2ξ dB (11.105)
1
∠G(jωn ) = ∠ = −90◦ (11.106)
j2ξ
20 log10 |G(jω)| ≈ 20 log10 ωn2 − 40 log10 ω dB, ω ωn
(11.107)
∠G(jω) ≈ −180◦ , ω ωn (11.108)

We will now nd the following frequency responses:


ˆ A positive gain k > 0:

G(jω) = k (11.109)
20 log10 |G(jω)| = 20 log10 k dB (11.110)
∠G(jω) = 0◦ (11.111)

ˆ A negative gain k > 0:

G(jω) = −k (11.112)
20 log10 |G(jω)| = 20 log10 |k| dB (11.113)
∠G(jω) = −180 ◦
(11.114)

ˆ A zero at the origin s:

G(jω) = jω (11.115)
20 log10 |G(jω)| = 20 log10 ω dB (11.116)
∠G(jω) = 90 ◦
(11.117)

ˆ A zero in the left complex half-plane s+b


b , b > 0:

jω + b
G(jω) = (11.118)
b
20 log10 |G(jω)| ≈ 0 dB, ω b (11.119)
∠G(jω) ≈ 0◦ , ω b (11.120)

b2 + b2 √
20 log10 |G(jb)| = 20 log10 = 20 log10 2 = 3 dB (11.121)
b
b
∠G(jb) = arctan = 45◦ (11.122)
b
20 log10 |G(jω)| ≈ 20 log10 ω − 20 log10 b dB, ω b (11.123)

∠G(jω) ≈ 90 , ω b (11.124)

ˆ A zero in the right complex half-plane s−b


b , b > 0:

jω − b
G(jω) = (11.125)
b
20 log10 |G(jω)| ≈ 0 dB, ω b (11.126)
∠G(jω) ≈ 180 , ω b ◦
(11.127)

b2 + b2 √
20 log10 |G(jb)| = 20 log10 = 20 log10 2 = 3 dB (11.128)
b
b
∠G(jb) = arctan = 135◦ (11.129)
−b
20 log10 |G(jω)| ≈ 20 log10 ω − 20 log10 b dB, ω b (11.130)
∠G(jω) ≈ 90◦ , ω b (11.131)
11.4. SYSTEMS WITH MORE ZEROS AND POLES: FREQUENCY RESPONSES 183

2
ωn
ˆ A pair of complex conjugate poles in the right complex half-plane 2 ,
s2 −2ξωn s+ωn ωn >
0, 0 ≤ ξ < 1:
ωn2
G(jω) = (11.132)
ωn2 − ω 2 − j2ξωn ω
20 log10 |G(jω)| ≈ 0 dB, ω ωn (11.133)

∠G(jω) ≈ 0 ≡ −360 , ω ωn ◦
(11.134)
p p
20 log10 |G(jωn 1 − 2ξ )| = −20 log10 2ξ 1 − ξ dB > 0 dB (11.135)
2 2

20 log10 |G(jωn )| = −20 log10 2ξ dB (11.136)


1
∠G(jωn ) = ∠ = −270◦ (11.137)
−j2ξ
20 log10 |G(jω)| ≈ 20 log10 ωn2 − 40 log10 ω dB, ω ωn
(11.138)
∠G(jω) ≈ −180◦ ≡ −180◦ , ω ωn (11.139)
(Notice that the phase goes up from −360◦ to −180◦ , or from 0◦ to 180◦ .)
s2 +2ξωn s+ωn
2
ˆ A pair of complex conjugate zeros in the left complex half-plane 2
ωn , ωn >
0, 0 ≤ ξ < 1:
ωn2 − ω 2 + j2ξωn ω
G(jω) = (11.140)
ωn2
20 log10 |G(jω)| ≈ 0 dB, ω ωn (11.141)

∠G(jω) ≈ 0 , ω ωn (11.142)
p p
20 log10 |G(jωn 1 − 2ξ 2 )| = 20 log10 2ξ 1 − ξ 2 dB < 0 dB (11.143)
20 log10 |G(jωn )| = 20 log10 2ξ dB (11.144)
∠G(jωn ) = ∠j2ξ = 90 ◦
(11.145)
20 log10 |G(jω)| ≈ 40 log10 ω − 20 log10 ωn2 dB, ω ωn
(11.146)
∠G(jω) ≈ 180◦ , ω ωn (11.147)

s2 −2ξωn s+ωn
2
ˆ A pair of complex conjugate zeros in the right complex half-plane 2
ωn , ωn >
0, ξ ≥ 0:
ωn2 − ω 2 − j2ξωn ω
G(jω) = (11.148)
ωn2
20 log10 |G(jω)| ≈ 0 dB, ω ωn (11.149)

∠G(jω) ≈ 0 , ω ωn (11.150)
p p
20 log10 |G(jωn 1 − 2ξ 2 )| = 20 log10 2ξ 1 − ξ 2 dB < 0 dB (11.151)
20 log10 |G(jωn )| = 20 log10 2ξ dB (11.152)
∠G(jωn ) = ∠ − j2ξ = −90 ◦
(11.153)
20 log10 |G(jω)| ≈ 40 log10 ω − 20 log10 ωn2 dB, ω ωn
(11.154)
∠G(jω) ≈ −180◦ , ω ωn (11.155)

All the corresponding frequency responses are summed up in Figures 11.17


11.19.
Example 11.1. Find the Bode diagram of
s + 100 1 s + 100 1
G(s) = 100 ×
= |{z} × × 2 (11.156)
s(s2 + 0.5s + 1) s 100 s + 0.5s +1
G1 (s) |{z} | {z } | {z }
G2 (s) G3 (s) G4 (s)

First plot the asymptotes of the Bode diagrams of the four transfer function
G1 (s) to G4 (s), in Figure 11.20. Add them to obtain the asymptotes of the Bode
diagram of G(s) in the same Figure, which also shows the actual Bode diagram.
The asymptotes are seen to be a rather√fair approximation, especially when the
resonance peak given by −20 log10 (0.5 1 − 0.252 ) = 6.3 dB is added.
184 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.17: Bode diagrams of k , −k , 1


s and s, k > 0.

Remark 11.4. Since the phase is determined up to shifts of 360◦ , there are
dierent ways of choosing which particular values are used. In all of them the
phase is, of course, continuous with frequency ω whenever possible.
ˆ Choose the low frequency phase value to be closest to zero. In this way
a low frequency value of, say, −90◦ is preferred to 270◦ , no matter what.
This criterion presents no reason to choose among 180◦ and −180◦ , when
input and output are in phase opposition at low frequencies.
ˆ Choose the low frequency phase value that better shows the number of
3
zeros and poles at the origin. In this way, transfer function sD(s)
N (s)
, where
polynomials N (s) and D(s) have no roots at the origin, will have a low
frequency phase beginning at 270◦ and not at −90◦ , since a zero pushes the
phase up and so this phase shows that the three zeros are responsible for
N (s)
the low frequency behaviour. The phase of transfer function sD(s) would
begin at −90 for a similar reason. This criterion may or may not give

the same result as the one above. It allows choosing among low frequency
phases of 180◦ and −180◦ if there are two poles or two zeros at the origin,
but not if there is a negative gain.
ˆ Choose the closest values to zero in the entire frequency range of concern,
as long as the phase is continuous with ω .
Example 11.2. Find the Bode diagram of
−s + 5 1 1 10 s−5
G(s) = = − × 2 × × (11.157)
s2 (s
+ 10) 2
|{z} s
|{z} s + 10 5
| {z } | {z }
G1 (s) G2 (s) G3 (s) G4 (s)

First plot the asymptotes of the Bode diagrams of the four transfer function
G1 (s) to G4 (s), in Figure 11.21. Add them to obtain the asymptotes of the
Bode diagram of G(s) in the same Figure, which also shows the actual Bode
diagram.

Remark 11.5. Given the way Bode diagrams can be built from smaller transfer
functions, this can be used to identify a model for a plant from its frequency
response. The Bode diagram is split into the sum of several Bode diagrams
corresponding to frequency responses in Figures 11.1711.19; the model will be
the product of the respective transfer functions.
11.4. SYSTEMS WITH MORE ZEROS AND POLES: FREQUENCY RESPONSES 185

Figure 11.18: Bode diagrams (left) and corresponding asymptotes (right) of


s+a , s−a , a and a , a > 0.
a a s+a s−a
186 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.19: Bode diagrams (left) and corresponding asymptotes (right) of


2 2
ωn ωn s2 +2ξωn s+ωn
2
s2 −2ξωn s+ωn
2

s2 +2ξωn s+ω 2 , s2 −2ξωn s+ω 2 ,


n n n ω2 and
n ω2 , ωn > 0, ξ ≥ 0.
11.4. SYSTEMS WITH MORE ZEROS AND POLES: FREQUENCY RESPONSES 187

Figure 11.20: Building the Bode diagram of (11.156) from Example 11.1.
188 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.21: Building the Bode diagram of (11.157) from Example 11.2.
11.4. SYSTEMS WITH MORE ZEROS AND POLES: FREQUENCY RESPONSES 189

Example 11.3. Given either Bode diagram of Examples 11.1 or 11.2, rst
draw its asymptotes, as shown in Figures 11.20 or 11.21; then divide them into
the separate asymptotes, also shown in the Figures, corresponding to transfer
functions from Figures 11.1711.19. The product of these transfer functions is
the desired transfer function, either (11.156) or (11.157).

Denition 11.2. A zero on the left complex half-plane (i.e. a zero with a Minimum and non-
negative real part) is a minimum phase zero. A zero on the right complex minimum phase zeros
half-plane (i.e. a zero with a positive real part) is a non-minimum phase
zero.
Remark 11.6. The reason for these names can be seen in Figure 11.18: the
a , a > 0 is between 0 and 90 , while the phase of a , a > 0 is
phase of s+a ◦ ◦ s−a

between 180 and 90 . The latter is thus, for low frequencies and in average,
◦ ◦

larger than the former.

A system's frequency response at high frequencies depends on the dierence Gain slope at high frequen-
between the number of poles n and the number of zeros m. More precisely, it cies
is clear from Figures 11.1711.19 that, at high frequencies, each pole will con-
tribute to the gain with a slope of −20 dB/decade, and each zero will contribute
to the gain with a slope of 20 dB/decade. Consequently, the slope of the gain in
a Bode diagram will be 20(m−n) dB per decade. So, as the frequency increases:

ˆ the gain of strictly proper transfer functions goes to −∞ dB, i.e. to 0 in


absolute value;

ˆ the gain of transfer functions with the same number of poles and zeros
goes to a constant value (in both dB and absolute value);

ˆ the gain of transfer functions which are not proper goes to +∞ dB, i.e. to
+∞ in absolute value.

In the latter case, if the transfer function is stable, this means that inputs with Why transfer functions
oscillations of smaller and smaller periods correspond to steady-state output should be strictly proper
oscillations with larger and larger amplitudes (and with the same small period
of the input). The velocity with which the output would be changing would
become innite. This is clearly impossible in practice, as it would require an
arbitrarily large energy. (For instance, in the case of an output which is a
position, there would a frequency above which this position would be changing
faster than light speed.) The same happens even in the case of a constant
gain for high frequencies, since the amplitude may not be increasing, but the
period decreases. The only models which are physically possible are those with
more poles than zeros, i.e. strictly proper models. That is why most models are
strictly proper. Of course, all models are only valid for a range of parameters.
So we can use models with as many zeros as poles, or more zeros than poles,
being aware that for frequencies high enough they cannot be valid: there have
to be unmodelled poles changing the behaviour of the plant so that it does not
require an impossibly innite energy.
On the other hand, the slope of the gain at (very) low frequencies depends on Gain slope at low frequen-
the number of zeros or poles at the origin: it is clear from Figures 11.1711.19 cies
only they cause a slope at such frequencies:

ˆ n poles at the origin cause a low frequency gain slope of −20n dB/decade;

ˆ m zeros at the origin cause a low frequency gain slope of 20m dB/decade.

Example 11.4. Consider the Bode diagram of Example 11.1 in Figure 11.20.
At low frequencies, the gain has a −20 dB/decade slope. Consequently, there
has to be a pole at the origin. At high frequencies, the gain has a −40 dB/decade
slope. Consequently, the number of poles exceeds the number of zeros by 2 (we
could have 0 zeros and 2 poles, or 1 zero and 3 poles, or 2 zeros and 4 poles,
etc.).

Example 11.5. Consider the Bode diagram of Example 11.2 in Figure 11.21.
At low frequencies, the gain has a −40 dB/decade slope. Consequently, there
have to be 2 poles at the origin. At high frequencies, the gain has a −40 dB/decade
slope. Consequently, the number of poles exceeds the number of zeros by 2.
190 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Remark 11.7. Notice that the gain of a stable system at low frequencies is Stable system's gain a
constant and equal to its static gain: frequencies



b0 + b1 s + b2 s2 + b3 s3 + . . . b0
lim G(jω) = lim = (11.158)
ω→0 a0 + a1 s + a2 s2 + a3 s3 + . . . a0

ω→0
| {z }
G(s)

s=jω

Type of a transfer function Denition 11.3. The type of a transfer function is its number of poles at the
origin.
Example 11.6. Here are transfer functions of type 0, type 1, type 2 and type
3:
1
G0 (s) = (11.159)
s+1
1
G1 (s) = (11.160)
s(s + 1)
1
G2 (s) = 2 (11.161)
s (s + 1)
1
G3 (s) = 3 (11.162)
s (s + 1)

11.5 Systems with more zeros and poles: stabil-


ity
We know that a stable plant's poles have real negative parts. If there are only
one or two poles, this is not dicult to verify. Things change if there are three or
more poles, since nding the roots of polynomials of such orders is not trivial.
There are of course numerical algorithms to do so eciently. But there is a
way of knowing if all the roots of a polynomial are on the left complex half-
plane without having to compute them: the Routh-Hurwitz criterion. It
even lets us know how many poles there are on the right complex half-plane.
Demonstrating the validity of this criterion is not trivial and we will not do
that. We will only present it together with examples of application.
Routh-Hurwitz criterion Consider a polynomial in s given by
n
X
p(s) = ak sk = an sn + an−1 sn−1 + . . . + a1 s + a0 (11.163)
k=0

For each of if its n roots, we want to know if it has positive real parts, negative
real parts, or lies on the imaginary axis.
ˆ If a0 = 0, there is a root at the origin. Divide the polynomial by s and
start again.
ˆ If not all the ak have the same sign, there is at least one root with positive
real part. If all the ak are negative, we can multiply p(s) by −1, which
does not change its roots, and all coecients become positive; so we can
say instead that all the ak must be positive if all the roots are to have
negative real parts. This is a necessary condition, but it is not sucient (it
may happen that all the ak are positive and still some roots have positive
real parts).
Routh-Hurwitz table ˆ The number of roots with positive real parts is equal to the number of
sign changes of the rst column of the Routh-Hurwitz table, which has n
lines, n2 columns, and is built as follows:

sn an an−2 an−4 ... 0


s n−1
an−1 an−3 an−5 ... 0
sn−2 b1 b2 ...
sn−3 c1 c2 ...
.. .. .. (11.164)
. . .
s2 d1 d2
s1 e1
s0 f1
11.5. SYSTEMS WITH MORE ZEROS AND POLES: STABILITY 191

Here,
an−1 an−2 − an−3 an an−3 an
b1 = = an−2 − (11.165)
an−1 an−1
an−1 an−4 − an−5 an an−5 an
b2 = = an−4 − (11.166)
an−1 an−1
..
. (11.167)
b1 an−3 − b2 an−1 b2 an−1
c1 = = an−3 − (11.168)
b1 b1
b1 an−5 − b3 an−1 b3 an−1
c2 = = an−5 − (11.169)
b1 b1
..
. (11.170)

This pattern goes on in each line until all further elements are necessarily
zero, and goes down until all n lines are lled in.

Example 11.7. Consider a transfer function given by N (s)


s3 +6s2 +11s+6 . We build
the Routh-Hurwitz table
s3 1 11
s2 6 6
6×11−6×1 (11.171)
s 6 = 10
10×6−0×6
1 10 =6

and verify that all elements in the rst column are positive. So the transfer
function is stable (whatever the numerator may be, since, remember, zeros have
nothing to do with stability).

If there is a zero in the left column, replace it with a vanishing ε. If when Zero in the left column
ε −→ 0+ all the coecients below are positive, there is a pair of complex
conjugate pure imaginary poles (which are marginally stable), and the other
poles are stable. If some are negative, the transfer function is unstable.

Example 11.8. Consider a transfer function given by N (s)


s3 +s2 +4s+4 . We build
the Routh-Hurwitz table
s3 1 4
s2 1 4
ε (11.172)
1×4−4×1
s 1 = 0
ε×4−0×1
1 ε =4

and verify that when ε −→ 0+ the rst column is entirely positive. So there are
no unstable poles. The zero is caused by a pair of complex conjugate poles on
the imaginary axis: s3 + s2 + 4s + 4 = (s + 1)(s + 2j)(s − 2j).

Example 11.9. Consider a transfer function given by N (s)


s6 +4s5 +9s4 +13s3 −17s−10 .
Since there are both positive and negative coecients in the denominator, we
can tell right away that the transfer function is not stable. (Remember that if
they were all positive the transfer function might still be unstable.) To know
how many of the 6 poles are unstable, we build the Routh-Hurwitz table

s6 1 9 0 −10
s5 4 13 −17
13
s4 9− 4 = 23
4
17
4 −10
17
s3 13 − 23 = 231 −17 + 40
23 = − 231
231 17
+
4
231 23
23 4
23
(11.173)
s2 23 4
231
23 4
= 10 -10
23
ε
(
10 − 231 )
23 +10 23
231
s 10 = 0

1 −10

and verify that when ε −→ 0+ there is one sign change in the rst column, from
line s to line 1. So there are ve stable poles, and one unstable pole (in fact
s6 + 4s5 + 9s4 + 13s3 − 17s − 10 = (s − 1)(s + 1)2 (s + 2)(s2 + s + 5)).
192 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.22: Control system from Examples 11.12 and 11.13.

Example 11.10. Consider a transfer function given by N (s)


s3 −12s+16 . We build
the Routh-Hurwitz table
s3 1 −12
ε
s2 0 16 (11.174)
16
s −12 − ε
1 16

and verify that when ε −→ 0+ the element below in the rst column is negative.
So there are two sign changes, and two unstable poles (in fact s3 − 12s + 16 =
(s − 2)2 (s + 4)).
Remark 11.8. Notice that coecient a0 always turns up in the last line of the
table. If it does not, you got your calculations wrong.
Line of zeros If there is a whole line of zeros, build a polynomial with the coecients of the
line above, dierentiate it, and use the coecients of the derivative to replace
the zeros.
Example 11.11. Consider a transfer function given by N (s)
s6 −4s4 +4s2 −16 . We
begin the Routh-Hurwitz table
s6 1 −4 4 −16
(11.175)
s5 0 0 0
and verify that the second line only has zeros. So we look at the line above,
which is line s6 , and use the coecients of that line with powers s6 , s4 , s2 and
s to obtain ds s − 4s + 4s − 16 = 6s5 − 16s3 + 8s.
d
0 6 4 2

s6 1 −4 4 −16
s5 6 −16 8
s4 − 34 8
3 −16
s3 −4 −64 (11.176)
s2 24 −16
s − 200
3
1 −16

There are three sign changes, and so three unstable poles (in fact s6 − 4s4 +
4s2 − 16 = (s − 1 + j)(s − 1 − j)(s + 1 + j)(s − 1 − j)(s + 2)(s − 2)).
The Routh-Hurwitz criterion is important not only because it allows nding
out by hand whether or not a system is stable, but above all because it lets us
nd analytical conditions for the stability of a closed-loop that depends on a
parameter.
Example 11.12. Plant
y(s) 1
= (11.177)
u(s) (s − 1)(s + 2)
is controlled in closed loop with a proportional controller K , as seen in Fig-
ure 11.22. We rst assume that the sensor is perfect, i.e. H(s) = 1. To know
what values of K ensure that the closed loop is stable, we nd the closed loop
transfer function
K
y(s) 2 K
= s +s−2K
= 2 (11.178)
r(s) 1 + s2 +s−2 s +s+K −2
11.5. SYSTEMS WITH MORE ZEROS AND POLES: STABILITY 193

and build the corresponding Routh-Hurwitz table

s2 1 K −2
s 1 (11.179)
1 K −2

from which we see that all coecients are positive in the left column if

K −2>0⇔K >2 (11.180)

Example 11.13. If in the last example we make K = 10 and then nd out that
the sensor has dynamics given by H(s) = s+a a
, we want to know what values
of pole a still let the closed loop be stable. So the closed loop transfer function
becomes
10
y(s) s2 +s−2 10
= 10a = (11.181)
r(s) 1+ (s2 +s−2)(s+a)
s3 + (a + 1)s2 + (a − 2)s + 8a

From the Routh-Hurwitz table


s3 1 a−2
s2 a+1 8a
(a+1)(a−2)−8a a2 −9a+2 (11.182)
s a+1 = a+1
1 8a

we see that all coecients are positive in the left column if


 
a2+ 1 > 0
 a > −1

a −9a+2
a+1 > 0 ⇒ (a+0.22)(a−9.22)
a+1 >0 (11.183)
 
8a > 0 a>0
 

For the second condition,

−0.22 −1 9.22
a2 − 9a + 2 + 0 − − 0 +
a+1 − − 0 + +
− 0 + ∞ − 0 +
(11.184)

and so we conclude that the system is stable if a > 9.22.


Remark 11.9. In the example above, it would obviously have been wiser to
choose the sensor rst, and only then the proportional controller K . And there
are surely other requirements for the control system other than ensuring stabil-
ity; we will address them in Part IV.
Example 11.14. Plant
1.5s2 + 22.5s + 66
G(s) = (11.185)
s2 − 8s − 9
is controlled in closed loop with a proportional controller K and a perfect sensor.
To know what values of K ensure that the closed loop is stable, we nd the closed
loop transfer function
2
y(s) K 1.5ss2+22.5s+66
−8s−9
= 2
r(s) 1 + K 1.5ss2+22.5s+66
−8s−9
K(1.5s2 + 22.5s + 66)
=
s2
− 8s − 9 + K(1.5s2 + 22.5s + 66)
1.5Ks2 + 22.5Ks + 66K
= (11.186)
(1.5K + 1)s2 + (22.5K − 8)s + (66K − 9)
and build the Routh-Hurwitz table
s2 1.5K + 1 66K − 9
s 22.5K − 8 (11.187)
1 66K − 9
194 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

We are tempted to write


 
2
1 + 1.5K > 0
 K > − 3 = −0.6667

22.5K − 8 > 0 ⇔ K > 22.5 8
= 0.3556 ⇒ K > 0.3556 (11.188)
9
 
66K − 9 > 0 K > 66 = 0.1364
 

and conclude that only these values of K make the closed loop stable. But if
we make K = −1 in (11.186) we get

y(s) −1.5s2 − 22.5s − 66 3s2 + 45s + 132


= = (11.189)
r(s) −0.5s2 − 30.5s − 75 s2 + 61s + 150

which has poles in −58.4330 and −2.5670 and is thus stable. Why is this so?
Because the number of unstable poles is the number of sign changes in the rst
column of the Routh-Hurwitz table; if they are all negative, there are no sign
changes, and no unstable poles. Since G(s) is not strictly proper, the entire
rst column depends on K , while in all previous examples there was always a
positive number in that column, meaning that all others had to be positive too
for all poles to be stable. In this case, we can let the entire column be negative,
i.e.
 
2
1 + 1.5K < 0
 K < − 3 = −0.6667

22.5K − 8 < 0 ⇔ K < 22.5 8
= 0.3556 ⇒ K < −0.6667 (11.190)
9
 
66K − 9 < 0 K < 66 = 0.1364
 

and thereby conclude that if K ∈] − ∞, −0.6667[∪]0.3556, +∞[ the closed loop


is stable.

11.6 Systems with more zeros and poles: time


responses
We know from the proof of Theorem 10.2, or from

1
L −1
= e−at (11.191)
s+a

together with a reasoning similar to that of Remark 2.6, that each pole of a
transfer function will originate an exponential in its time response:
Eects of the real part of a ˆ if the pole is stable, its (negative) real part corresponds to how fast this
pole part of the time response is vanishing;
The imaginary parts of ˆ if there is an imaginary part, it will correspond (together with that of the
poles cause oscillations pole's complex conjugate) to oscillations in time (which, the pole being
stable, are vanishing).
Consequently,
Faster poles ˆ the more negative the real part of a stable pole is, the faster its eect in
the time responses vanishes;
Slower poles ˆ the closer a stable pole is to the imaginary axis, the slower its eect in the
time responses vanishes.
Meaning of the residues When a transfer function is written as a partial fraction expansion, the
residues show the weight that each pole will have in the time responses. Slower
poles, even when weighted with a residue which is relatively small when com-
pared with the others, have a lasting eect in time responses just for being slow,
i.e. for the slowly vanishing eect of their contribution, and are thus called dom-
Dominant poles inant poles.
When a transfer function has only one dominant pole, or one pair of complex
conjugate dominant poles, clearly far from the other ones, its time response will
be mostly determined by that pole or poles. This is not so when there are
several dominant poles, or, rather, when there are none, since no pole has an
eect clearly dominating that of the others.
11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 195

Figure 11.23: Unit step responses of the transfer functions of Example 11.15.

Figure 11.24: Poles and zeros of the transfer functions of Example 11.15.
196 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.25: Bode plots of the transfer functions of Example 11.15.


11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 197

Figure 11.26: Unit step responses of the transfer functions of Example 11.16.

Example 11.15. Transfer function


2s + 11 1 1
G1 (s) = = + (11.192)
s2 + 11s + 10 s + 1 s + 10
has a dominant pole, −1, since pole −10 is faster. Residues are the same, so we
can expect the step response of G1 (s) to be rather similar to that of
11
Ĝ1 (s) = 10
(11.193)
s+1
(which has the same static gain) as is indeed the case: see Figure 11.23. But
transfer function
101s + 110 1 100
G2 (s) = = + (11.194)
s2 + 11s + 10 s + 1 s + 10
which has the same poles has a much larger residue for the slower pole, and
consequently its step response is not really that similar to that of
11
Ĝ2 (s) = (11.195)
s+1
(with the same static gain) as seen in Figure 11.23. This can also be seen from
the position of the zero in both cases, given in Figure 11.24. G1 (s) has the zero
far from the dominant pole, in a location where its eect is faster, and so does
not interfere signicantly with its behaviour. Gs (s) has the zero quite close to
the dominant pole, thus interfering with its eect in time responses.
Remark 11.10. This can be more clearly understood looking at the Bode
diagrams of G1 (s) and G2 (s) in Figure 11.25 in comparison with those of Ĝ1 (s)
and Ĝ2 (s). The zero does not aect the frequency response of low frequency pole
−1 for G1 (s), but does so for G2 (s). Remember that low frequencies correspond
to larger time intervals, so in the case of G1 (s) step responses will be, for large
time intervals, similar to those of Ĝ1 (s).

Example 11.16. Transfer function


3s2 + 6s + 4 1 1 1
G(s) = = + + (11.196)
s3 + 3s2 + 4s + 2 s+1 s+1+j s+1−j
has three poles, none of which is dominant. So the step response of G(s) is
inbetween those of
2
Ĝ1 (s) = (11.197)
s+1
2 2
Ĝ2 (s) = + (11.198)
s+1+j s+1−j
as seen in Figure 11.26.
198 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.27: Unit step and unit ramp responses of the transfer functions of
Example 11.17.

A time response can also be studied with respect to:


ˆ its steady-state response, using the nal value theorem, as seen above in
Section 10.2;
ˆ its transient response, from the dierence between the number of zeros
and poles, and the eventual presence of non-minimum phase zeros.
Undershoot The latter cause an undershoot in time responses, i.e. the response begins with
a negative derivative if the steady-state value is positive, or a positive derivative
if the steady-state value is negative. In simpler terms, the response goes down
before going up, or up before going down.
Example 11.17. Figure 11.27 shows the unit step and unit ramp responses of
−s + 1
G1 (s) = (11.199)
(s + 1)(s + 2)
s−1
G2 (s) = 2 (11.200)
s + 0.5s + 2
The responses illustrate the following:
ˆ undershoots exist in all time responses of the plant;

ˆ there may or may not be further oscillations in the plant's response;

ˆ undershoots exist whether the steady-state corresponds to a positive or a


negative value.
Theorem 11.2. A non-minimum phase zero or pole causes an undershoot in
time responses.
11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 199

Proof. Let us consider the case of a transfer function with a non-minimum phase
zero and a positive steady-state value; other cases are similar:
−s + b
G(s) = n (11.201)
Y
(s + pk )
k=1

The beginning of the transient response corresponds to very small time values,
i.e. to very high frequencies. At high frequencies,
−jω + b −jω
G(jω) = n ≈ (11.202)
Y (jω)n
(jω + pk )
k=1

which is also the frequency response of


1
Ĝ(jω) = − (11.203)
sn−1
So, for small values of t, G(s) and Ĝ(s) behave similarly. Ĝ(s) has negative time
responses to positive inputs (and positive time responses to negative inputs),
and consequently so does G(s) for t ≈ 0.
Theorem 11.3. A transfer function with n poles and m zeros will have step Dierence between the
responses y(t) with n − m − 1 continuous derivatives, i.e. number of poles and the
number of zeros
ˆ if n = m, then n − m − 1 = −1: the step response y(t) itself with be
discontinuous;
ˆ if n = m + 1, then n − m − 1 = 0: the step response y(t) is continuous,
dy(t)
but its rst derivative dt is discontinuous (and thus so are higher order
derivatives);
ˆ if n = m+2, then n−m−1 = 1: the step response y(t) and its rst deriva-
d2 y(t)
tive dy(t)
dt are continuous, but its second derivative dt2 is discontinuous
(and thus so are higher order derivatives);
ˆ if n = m + 3, then n − m − 1 = 2: the step response y(t), its rst derivative
dy(t) d2 y(t)
dt and its second derivative dt2 are continuous, but its third deriva-
d3 y(t)
tive dt3 is discontinuous (and thus so are higher order derivatives);
ˆ and so on.

Proof. The line of reasoning is similar to that of the theorem above, and because
the system is linear we can consider the unit step response of a transfer function
with an arbitrary gain:
 m 
Y
 (jω + zk ) 
−1  1 k=1
y(t) = L  (11.204)
 

n
s Y 
(jω + pk )
 
k=1

Again we are interested in the beginning of the transient response, which cor-
responds to very small time values, i.e. to very high frequencies, at which
1 (jω)m 2
Y (jω) ≈ = (11.205)
jω (jω)n (jω)n−m+1

This is the Fourier transform corresponding to sn−m+11


. It is easily proved by
mathematical induction, from the Laplace transform of the Heaviside function
and the Laplace transform of the integral, that
tk−1

1
L −1
= , t ≥ 0, k ∈ N (11.206)
sk (k − 1)!
n−m
Thus, for small values of t, y(t) and (n−m)!
t
will behave similarly. The number
of continuous derivatives of t n−m
, n − m ∈ N, is as stated.
200 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.28: Step responses of three dierent transfer functions, for which the
dierence between the number of poles and zeros is 0, 1 and 2.

Remark 11.11. It is straightforward to nd, in a similar manner, how many


continuous derivatives will have the response of a system to a ramp, a parabola,
or another input given by a polynomial. For inputs which are not polynomial,
a polynomial approximation of the input may be used.

Example 11.18. Consider these transfer functions, with the following dier-
ences between the number of poles and zeros:

s+1
G0 (s) = , n−m=0 (11.207)
s+2
1
G1 (s) = , n−m=1 (11.208)
s+1
s+1
G2 (s) = , n−m=2 (11.209)
(s + 0.5)(s + 1.5)(s + 2)

According to Theorem 11.3 and its proof, at t = 0 their outputs will be similar
to

−1 1
y0 (s) = L = H(t) (11.210)
s

1
y1 (s) = L −1 2 = t (11.211)
s
t2

1
y2 (s) = L −1 3 = (11.212)
s 2

in what concerns the number of continuous derivatives. Figure 11.28 shows


visually that it is so.

Glossary
`To you I may seem a vulgar robber, but I bear on my shoulders
the destiny of the human race. Your tribal life with its stone-age
weapons and beehive huts, its primitive coracles and elementary
social structure, has nothing to compare with our civilization
with our science, medicine and law, our armies, our architecture, our
commerce, and our transport system which is rapidly annihilating
space and time. Our right to supersede you is the right of the higher
over the lower. Life '
`Half a moment,' said Ransom in English. `That's about as much
as I can manage at one go.' Then, turning to Oyarsa, he began
translating as well as he could. The process was dicult and the
11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 201

result which he felt to be rather unsatisfactory was something


like this:
`Among us, Oyarsa, there is a kind of hnau who will take other
hnaus ' food and and things, when they are not looking. He says
he is not an ordinary one of that kind. He says what he does now
will make very dierent things happen to those of our people who
are not yet born. He says that, among you, hnau of one kindred all
live together and the hrossa have spears like those we used a very
long time ago and your huts are small and round and your boats
small and light and like our old ones, and you have one ruler. He
says it is dierent with us. He says we know much. There is a thing
happens in our world when the body of a living creature feels pains
and becomes weak, and he says we sometimes know how to stop it.
He says we have many bent people and we kill them or shut them
in huts and that we have people for settling quarrels between the
bent hnau about their huts and mates and things. He says we have
many ways for the hnau of one land to kill those of another and
some are trained to do it. He says we build very big and strong huts
of stones and other things like the ptriggi. And he says we
exchange many things among ourselves and can carry heavy weights
very quickly a long way. Because of all this, he says it would not be
the act of a bent hnau if our people killed all your people.'

C. S. Lewis (1868 „1963), Out of the silent planet, 20

critically damped criticamente amortecido


damped frequency frequência amortecida
damping amortecimento
dominant pole polo dominante
maximum overshoot máximo sobreimpulso
minimum phase fase mínima
natural frequency frequência natural
non-minimum phase fase não-mínima
overdamped sobreamortecido
overshoot sobreimpulso
peak time tempo de pico
resonance frequency frequência de ressonância
resonant peak pico de ressonância
settling time tempo de estabelecimento
time constant constante de tempo
underdamped subamortecido
undamped sem amortecimento
undershoot subimpulso

Exercises
1. Sketch the following step responses, marking, whenever they exist,
ˆ the settling time according to the 5% criterion,
ˆ the settling time according to the 2% criterion,
ˆ the steady-state value.

15
(a) G(s) = , for input u(t) = 4H(t)
s+5
10
(b) G(s) = , for input u(t) = H(t)
s−1
1
(c) G(s) = , for input u(t) = −H(t)
2s + 1
−2
(d) G(s) = , for input u(t) = 10H(t)
4s + 1
10
(e) G(s) = , for input u(t) = H(t)
s
202 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Table 11.1: Unit step response of Exercise 4.


time output time output
0.0 0.0000 0.8 0.0950
0.1 0.0000 0.9 0.0982
0.2 0.0000 1.0 0.0993
0.3 0.0000 1.1 0.0998
0.4 0.0000 1.2 0.0999
0.5 0.0000 1.3 0.1000
0.6 0.0632 1.4 0.1000
0.7 0.0865 1.5 0.1000

2. Sketch the Bode diagrams of the following transfer functions, indicating

ˆ the gain for low frequencies,


ˆ the frequency at which the gain is 3 dB below the gain for low fre-
quencies,
ˆ the slope of the gain for high frequencies,
ˆ the phase for low frequencies,
ˆ the phase for high frequencies,
ˆ the frequency at which the phase is the average of those two values.

Hint: draw the asymptotes of the Bode diagram. Mark the frequency at
which the gain has decreased 3 dB.
15
(a) G(s) =
s+5
1
(b) G(s) =
s + 10
1
(c) G(s) =
2s + 1
2
(d) G(s) =
4s + 1
10
(e) G(s) =
s
1
3. Let G(s) = .
s+1
(a) Consider the unit step response of G(s). What is the settling time,
according to the 5% criterion?
(b) Find analytically the unit ramp response y(t) of G(s).
(c) Find the analytical expression of the steady-state yss (t) of that re-
sponse y(t).

(d) How long does it take for yss (t)−y(t) to be less than 5%? In other

y(t)
words, nd how long it takes for the unit ramp response to be within
a 5% wide band around its steady state.

4. A rst order system s+p K


has the response tabulated in Table 11.1, when
its input is a unit step applied at instant t = 0.5 s. Find the gain K and
the pole p. Hint: subtract the response from the steady state value; you
should now have an exponential with a negative power. Plot its logarithm
and adjust a straight line.

5. For each of the transfer functions below, and for the corresponding step
input, nd, if they exist:

ˆ the natural frequency ωn and the damping factor ξ ,


ˆ the steady state value yss ,
ˆ the peak time tp and the maximum overshoot Mp (expressed in per-
centage),
11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 203

ˆ the 5% and the 2% settling times (use the expressions for the expo-
nential envelope of the oscillations),
ˆ the location of the poles,
ˆ the time instant at which the response rst reaches 2 ,
yss

and sketch the step response.


7
(a) G(s) = , for input u(t) = 0.1H(t)
s2 + 0.4s + 1
1
(b) G(s) = 2
, for input u(t) = 18H(t)
s + 5.1s + 9
1
(c) G(s) = , for input u(t) = H(t)
2s2 + 8
10
(d) G(s) = 2
, for input u(t) = 2H(t)
s −s+1
0.3
(e) G(s) = , for input u(t) = 15H(t)
s2 + 4s − 1
6. Sketch the Bode diagrams of the following transfer functions, indicating

ˆ the gain for low frequencies,


ˆ the resonant peak value, and the frequency at which it is located, if
indeed there is one,
ˆ the slope of the gain for high frequencies,
ˆ the phase for low frequencies,
ˆ the phase for high frequencies,
ˆ the frequency at which the phase is the average of those two values.

Hint: draw the asymptotes of the Bode diagram. If there is a resonant


peak mark it in your plot.
1
(a) G(s) =
s2 + 20s + 100
7
(b) G(s) = 2
s + 0.4s + 1
1
(c) G(s) = 2
s + 5.1s + 9
1
(d) G(s) = 2
2s + 8
7. Find the second order transfer functions that, for a unit step input, have:

(a) tp = 0.403 s, Mp = 16.3%, yss = 0.8


(b) tp = 0.907 s, y(tp ) = 11.63, yss = 10
(c) tr = 0.132 s, ts2% = 2.0 s, yss = 0.5

8. Consider the mechanical system in Figure 11.29. When f (t) = 8.9 N,


t ≥ 0, the output has tp = 1 s, Mp = 9.7%, and yss = 3 × 10−2 m.

(a) Find the values of mass M , viscous damping coecient B , and spring
stiness K .
(b) Suppose we want the same steady-state regime and the same settling
time, but a maximum overshoot of 0.15%. What should the new
values of M , B and K be?

9. Plot the Bode diagrams of the following plants:


−4s + 20
(a) G(s) =
s3
+ 0.4s2 + 4s
3
d y(t) d2 y(t) dy(t) du(t)
(b) + 16 + 65 + 50y(t) = 100 + 50u(t)
dt3 dt2 dt dt
120(s + 1)
(c) G(s) =
s(s + 2)2 (s + 3)
204 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.29: System of Exercise 8.

s2
(d) G(s) =
(s + 0.5)(s + 10)
10s
(e) G(s) =
(s + 10)(s2 + s + 2)
(s + 4)(s + 20)
(f) G(s) =
(s + 1)(s + 80)
10. Establish a correspondence between the three Bode diagrams and the three
unit step responses in Figure 11.30.
11. Establish a correspondence between the three Bode diagrams and the three
unit step responses in Figure 11.31.
12. Find the transfer functions corresponding to the Bode diagrams in Fig-
ure 11.32.
13. Use the Routh-Hurwitz criterion to nd how many unstable poles each of
the following transfer functions has, and classify each system as stable,
marginally stable, or unstable.
5
s2 + s − 10
(a) 7
s4 − 2s3 − 13s2 + 14s + 24
(b) s+2
s4 − 2s3 − 13s2 + 14s + 24
(c) s+2 Hint: can you put anything in evi-
s6 − 2s5 − 13s4 + 14s3 + 24s2
dence in the denominator?
(d) s3 + 2s2 + s
s + 4s3 + 4s + 5
4

(e) s3 + 2s2 + s
s5 + 4s4 + 4s2 + 5s
(f) s3 + 2s2 + s
2s3 − 6s + 4
14. Find the ranges of values of K1 , K2 ∈ R for which the systems having
transfer functions with the following denominators are stable.
(a) s3 + 3s2 + 10s + K1
(b) s3 + K2 s2 + 10s + 5
(c) s3 + 2s2 + (K1 + 1)s + K2
15. How many unstable, marginally stable, and stable poles do the following
transfer functions have?
s−2
(a) G1 (s) =
s4 + 2s3 + 5s2 + 8s + 4
11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 205

Figure 11.30: Bode diagrams and unit step responses of Exercise 10.
206 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES

Figure 11.31: Bode diagrams and unit step responses of Exercise 11.

Bode Diagram
200
Magnitude (dB)

100

−100

−200

−300
−90
Phase (deg)

−135

−180

−225

−270
−4 −2 0 2 4 6
10 10 10 10 10 10
Frequency (rad/s)

Bode Diagram
100
Magnitude (dB)

−100

−200
−90
Phase (deg)

−120

−150

−180
−2 −1 0 1 2 3 4
10 10 10 10 10 10 10
Frequency (rad/s)

Figure 11.32: Bode diagrams of Exercise 12.


11.6. SYSTEMS WITH MORE ZEROS AND POLES: TIME RESPONSES 207

Figure 11.33: The Sopwith Camel, a ghter aircraft from World War I.

s4 + 20s3 + 150s2 + 500s + 625


(b) G2 (s) =
s5 − 2s4 + 5s3 − 8s2 + 4s
s2 − 4
(c) G3 (s) = 3
s + 5s2 + 6s + 8
100
16. Find analytically the unit step responses of G1 (s) = and
s + 10
s + 100
G2 (s) = . Sketch them both in the same plot, marking the 5%
s + 10
settling time for each. Plot separately the dierence between them. Then
8 s+8
do the same for G3 (s) = and G4 (s) = .
s + 12 s + 12
17. Consider the following transfer functions:
5050s + 10000
G1 (s) = (11.213)
s2 + 101s + 100
101s + 10000
G2 (s) = 2 (11.214)
s + 101s + 100
(a) Find their poles.
(b) Which pole is faster? Why?
(c) Which of the two transfer functions will respond faster to a unit step?
Why?

18. The roll angle φ (rotation around the x-axis) of the aircraft in Figure 11.33
is given by
ṗ = −2p + 12δA (11.215)
where p = φ̇ and δA is the aileron deection. All variables are given in SI
units.
p(s)
(a) Find transfer function Gp (s) = .
δA (s)
φ(s)
(b) Find transfer function Gφ (s) = .
δA (s)
(c) Sketch p(t) when the ailerons undergo a 1◦ = π
180 rad step.
(d) What is p(t) when t = 0.5 s?
(e) Sketch φ(t) for the same input.
(f) Suppose you want φ = 30◦ after 20 s. Without calculating φ(t), nd
an approximate value for the necessary aileron deection.

120 (s + 1)
19. Plot the Bode diagram of transfer function G(s) = 2 .
s (s + 2) (s + 3)
208 CHAPTER 11. FINDING TIME AND FREQUENCY RESPONSES
Part III

Sensors and actuators

209
211

Then Dick gave a cry. It's just come into sight. Look, when we
passed those tall trees on the bank yonder, Tall Stone came into
view. It was behind them before that.
Good, said Julian. Now I'm going to stop paddling and keep Tall
Stone in sight. If it goes out of sight I'll tell you and you must back-
paddle. Dick, can you possibly paddle and look out for something
that could be Tock Hill on the opposite side? I daren't take my eyes
o Tall Stone in case it disappears.
Right, said Dick, and paddled while he looked earnestly for Tock
Hill.
Got it! he said suddenly. It must be it! Look, over there a
funny little hill with a pointed top. Julian, can you still see Tall
Stone?
Yes, said Julian. Keep your eyes on Tock Hill. Now it's up to the
girls. George, paddle away and see if you can spot Steeple.
I can see it now, already! said George, and for one moment the
boys took their eyes o Tall Stone and Tock Hill and looked where
George pointed. They saw the steeple of a faraway church glinting
in the morning sun.
Good, good, good, said Julian. Now Anne look for Chimney
look down towards the end of the lake where the house is. Can
you see its one chimney?
Not quite, said Anne. Paddle just a bit to the left the left, I
said, George! Yes yes, I can see the one chimney. Stop paddling
everyone. We're here!
They stopped paddling but the raft drifted on, and Anne lost the
chimney again! They had to paddle back a bit until it came into
sight. By that time George had lost her steeple!
At last all four things were in view at once, and the raft seemed to
be still and unmoving on the quiet waters of the lake.

Enid Blyton (1897 „1968), Five on a hike together, XVIII

In this part of the lecture notes:

Chapter 12 introduces the basic concepts of measuring chains and control loops.

Chapter 13 presents the technology of the most common types of sensors, and the
criteria to choose them.

Chapter 14 presents the technology of the most common types of actuators, and the
criteria to choose them.

Here is what you need to know beforehand to follow these chapters:

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4;

ˆ System theory, from Part II.


212
Chapter 12

Measuring chains and


actuation chains
In this chapter we take a closer look on sensors and actuators.

12.1 What are measuring chains and actuation


chains
Let us take another look at the simplest representation of a feedback control
system, already know to us from Figure 9.13 and repeated in Figure 12.1. We
saw in chapter 9 that, to feed back the output to the controller, we need a sensor
that measures the output y . The sensor is a device that converts the variable
to be read into another which can be read directly. This conversion is called
transduction. While we can often assume a perfect sensor H(s) = 1, in which Transduction
case the measured output ŷ is equal to the output itself (i.e. ŷ = y ), the sensor
must exist. Sensor technology will be addressed in more detail in chapter 13.

Example 12.1. The analogical ammeter in Figure 12.2 transduces current into
an angle. The angle can be read directly by sight on a scale. This sensor does
not record the reading.

Example 12.2. The seismograph in Figure 12.3 transduces a position (corre-


sponding to the amplitude of the vibration of the ground) again into an angle.
The reading is recorded on paper; time is transduced into a position thanks to
a rotation of the drum obtained through clockwork.

Likewise, the control action u provided by the controller must somehow be


implemented in the plant G(s); this is done through an actuator: for instance, Actuator
a motor in a mechanical plant, or a heater in a thermal plant. This is shown
in Figure 12.1. Once more, we can have such a good actuator Ga (s) that we
can assume the control action actually applied ũ to be equal to the control
action u that should be applied, the one given by the actuator that is to say,
Ga (a) = 1 or ũ = u. Even if this is not assumed, the (imperfect) behaviour
of the actuator may be considered simply as part of the plant to be controlled
G(s). This makes sense if there is no way of changing the actuator, but if the
actuator can be replaced by a dierent one (hopefully a better one, though poor
replacement parts and actuator malfunctions are also part of life) it is easier to
have separate models and change only the actuator model. Actuator technology
will be addressed in more detail in chapter 14.
It is perfectly possible to have plants where no more elements need to be
modelled: think of the ush tank from Figure 3.16, where the sensor is the
oater, and the actuator the lever that rotates on a hinge and is connected to the
oater. But nowadays most sensors and actuators are electronic, and perform
a transduction of the measured variable to an electrical quantity (voltage or
current); the controllers that use measurements to decide the control actions to
apply are also electronic. Consequently, ŷ and u are digital signals (i.e. both
discrete in time and quantised in amplitude, as we saw in section 3.2); while y
is analogical, and ũ must be, if not analogical, at least continuous in time. That
is why it is necessary to have a digital to analogical converter , or simply a DA DA converter

213
214 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.1: Closed loop control. Top: simplest representation (see Figure 9.13).
Bottom: sensor and actuator explicitly shown.

Figure 12.2: Ammeter from the Tagus power plant (currently the Museum of
Electricity), Lisbon. Notice that the scale is not linear.

Figure 12.3: Seismograph from the Santa Marta lighthouse (currently a mu-
seum), Cascais.
12.2. FILTERS 215

Figure 12.4: Closed loop control with sensor, actuator and AD/DA conversion
explicitly shown.

Figure 12.5: Open loop control with actuation chain explicitly shown.

converter, between the controller and the actuator, as seen in Figure 12.4. The
function of the AD converter is to receive a digital signal as input and provide
an analogical output (remember the example in Figure 3.13). Likewise, if after
all the sensor provides a measurement ŷ which is not digital, an analogical to
digital converter , or DA converter in short, is needed after the sensor. Even if the AD converter
sensor itself already provides a digital output, it is because it incorporates the
function of the DA converter. The function of the AD converter is to discretise
(in time) and quantise (in amplitude) its input.
The AD and the DA conversions may be carried out by the same device, AD/DA converter
which will have:

ˆ analog inputs, and the corresponding digital outputs;

ˆ digital inputs, and the corresponding analog outputs.

Figure 12.4 shows yet another element after the sensor: a lter, that is, a Filter
system designed to eliminate noise from the measurement. This noise can be
present in the output of the plant, or be a result of the sensor itself. The lter
can be applied to the analog measurement before AD conversion, or be applied
to the digital signal after AD conversion (this last option is the only one possible
if the sensor provides a digital reading).
Figure 12.4 also indicates what, in a digital control system, constitutes

ˆ the measuring chain: sensor, lter, AD conversion; Measuring chain

ˆ the actuation chain: DA conversion, actuator. Actuation chain

If these chains are ideal, they can be modelled by = 1 and uũ = 1.



y
An open-loop control system will also have an actuation chain, as seen if
Figure 12.5, but no measuring chain. A measuring chain is present in a system
which is measured but not controlled.

12.2 Filters
We have just mentioned lters in connection with the measuring chain, as a
means of eliminating noise from sensor measurements. In general, a lter is a
system that eliminates some frequency components of a signal. These compo-
nents are said to be cut. Those that are not eliminated are said to pass the
lter. Figure 12.6 shows the ideal behaviour of four types of lters: Types of lters
216 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.6: Ideal lters.

ˆ low-pass lters eliminate high frequencies and pass low frequencies;


ˆ high-pass lters eliminate low frequencies and pass high frequencies;
ˆ band-pass lters eliminate both low and high frequencies and pass inter-
mediate frequencies;

ˆ band-stop or band-reject lters eliminate intermediate frequencies and


pass both high and low frequencies.

In terms of periods of oscillations:

ˆ low-pass lters eliminate small periods and pass large periods;

ˆ high-pass lters eliminate large periods and pass small periods;

ˆ band-pass lters eliminate both small and large periods and pass interme-
diate periods;

ˆ band-stop lters eliminate intermediate periods and pass both small and
large periods.

What low and high frequencies (or large and small periods) are depends on the
Cut-o frequency application. The cut-o frequency ωc is the limit separating the pass-band (the
interval of frequencies that pass the lter) from the stop-band (the interval of
frequencies that the lter eliminates).
Perfect lters do not exist No lter can be as good as what Figure 12.6 shows. Figure 12.7 pictures a
more realistic behaviour. Notice in particular:

ˆ that both the pass-band and the stop-band are dened within some tol-
erance (in Figure 12.7, δp is the tolerance of the pass-band and δs is the
tolerance of the stop-band), which can be larger or narrower depending
on what is needed for each particular application;

ˆ that there may be ripples in each of those intervals of frequencies;

ˆ that, because the gain of a lter within the stop-band will never reach
0 (i.e. −∞ dB), no frequencies of the ltered signal are ever eliminated:
only attenuated;

ˆ that, because the gain within the pass-band will not always be 1 (i.e.
0 dB), neither will the phase of the lter in the interval be always 0◦ : and
so, in practice, all lters always introduce some distortion in the signal
that passes;
12.2. FILTERS 217

Figure 12.7: Behaviour of lters, closer to reality than the ideal behaviour in
Figure 12.6. Notice that the band-stop lter shown has a larger value of δs , and
larger ripples in the stop-band, than the other lters.

ˆ that there is between the pass-band and the stop-band a transition band,
i.e. a range of frequencies where the signal no longer passes (since the
gain is below tolerance δp of the pass-band) and where it is not su-
ciently attenuated (since the gain is above tolerance δs of the stop-band),
lying between the cut-o frequency ωc which delimits the pass-band and
frequency ωs which delimits the stop-band.

Example 12.3. A 1 Hz signal is measured with an electronic sensor, and the


reading is corrupted with 50 Hz noise from the electric grid. To lter out this
2π × 50 = 314 rad/s noise without distorting the 2π × 1 = 6.28 rad/s signal,
we will use a rst order system, with the pole at the same distance from the
frequencies of signal and noise in a Bode diagram. A Bode diagram has a
logarithmic scale for frequencies, so the
√ pole should be at the geometric mean
of 6.28 rad/s and 314 rad/s, which is 6.28 × 314 = 44.4 rad/s:
44.4
F1 (s) = (12.1)
s + 44.4
Figure 12.8 shows the Bode diagram of F1 (s), and the gain and the phase at
the frequencies of both signal and noise:
−0.0861
ˆ |F1 (j 6.28)| = 10 20 = 0.99, which means that 99% of the signal passes:
it undergoes a 1% attenuation;
ˆ ∠F1 (j 6.28) = −8◦ , which means that distortion due to a delay in the
phase is not very signicant;
−17.1
ˆ |F1 (j 314)| = 10 20= 0.14, which means that 14% of the noise passes:
it undergoes a 86% attenuation;
ˆ ∠F1 (j 314) = −82◦ , which means that noise is not only attenuated: its
phase is also signicantly distorted.

Example 12.4. If the 14% attenuation is not enough, a second order lter can
be used instead. Let us put two poles at 44.4 rad/s:

44.42
F2 (s) = (12.2)
(s + 44.4)2
Figure 12.9 shows the Bode diagram of F2 (s), and the gain and the phase at
the frequencies of both signal and noise:
218 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.8: Bode diagram of lter F1 (s) given by (12.1).

Figure 12.9: Bode diagram of lter F2 (s) given by (12.2).

−0.172
ˆ |F2 (j 6.28)| = 10 = 0.98, which means that 98% of the signal passes:
20

it undergoes a 2% attenuation;

ˆ ∠F2 (j 6.28) = −16◦ , which means that distortion due to a delay in the
phase is now larger;
−34.2
ˆ |F2 (j 314)| = 10 = 0.02, which means that 2% of the noise passes: it
20

undergoes a 98% attenuation;

ˆ ∠F2 (j 314) = −164◦ , which means that noise is now even more signi-
cantly distorted.

Notice how we got a better attenuation of the noise, paying the price of distorting
more the signal.

Second order lters should



Remark 12.1. In the previous example we used a second order system with
2
have 2 ≤ ξ ≤ 1 damping coecient ξ = 1 (double real pole). Notice that:

ˆ it does not make sense to have an overdamped system, ξ > 1, with two real
poles which do not coincide: the transition band would be larger without
any advantage (see Figures 11.8 and 11.9 again);

ˆ it does not make sense to have an underdamped system with ξ < 2 :
there
2

would be a resonance peak, meaning that the input would be amplied


near the end of the pass band, which does not make sense for a lter (see
Figures 11.10 and 11.11 again).
12.2. FILTERS 219

As a consequence, second order lters only make sense if critically damped or


lightly underdamped.
Remark 12.2. In both examples above, lter design is rather easy, because
signal and noise have well dened frequencies, which are signicantly apart from
each other. Whenever frequency ranges of signal or noise are not well known, or When lter design becomes
whenever they are close to each other, lter design becomes far more dicult. hard
When they overlap, it is of course impossible to lter out noise without damaging
the signal, or preserving the signal without letting some noise pass.
Remark 12.3. In both examples above, putting ωc halfway through signal and
noise frequencies is an attempt to balance good noise attenuation on the one
hand and little signal distortion on the other. We could also have:
ˆ xed in advance the minimum acceptable attenuation of the noise, nd
the resulting ωc , and then check if signal distortion is acceptable; or
ˆ xed in advance the maximum acceptable distortion of the signal, nd the
resulting ωc , and then check if noise attenuation is acceptable.
To design lters of orders above 2, there are two criteria that can be followed:
ˆ minimise the ripple of the pass-band (the price to pay being a larger
transition band);
ˆ minimise the width of the transition band (the price to pay being ripples
in the pass-band).
Minimising ripples leads to Butterworth lters. We will not prove, but only Butterworth lters min-
state the following result: imise pass-band ripples

ˆ low-pass Butterworth lters of order n with cut-o frequency ωc are given


by
1
F (s) = (12.3)
s
Hn ωc

ˆ high-pass Butterworth lters of order n with cut-o frequency ωc are given


by
1
F (s) = ωc
(12.4)
Hn s

where Hn (x) are Butterworth polynomials, given by

H1 (x) = x + 1 (12.5)
2
H2 (x) = x + 1.4142x + 1 (12.6)
H3 (x) = (x + 1)(x + x + 1) 2
(12.7)
3 2
= x + 2x + 2x + 1 (12.8)
2 2
H4 (x) = (x + 0.7654x + 1)(x + 1.8478x + 1) (12.9)
4 3 2
= x + 2.6131x + 3.4142x + 2.6131x + 1 (12.10)
2 2
H5 (x) = (x + 1)(x + 0.6180x + 1)(x + 1.6180x + 1) (12.11)
5 4 3
= x + 3.2361x + 5.2361x + 5.2361x + 3.2361 + 1 2
(12.12)
..
.
n
X
Hn (x) = ak,n xk (12.13)
k=0
a0,n = 1 (12.14)
k
Y cos (m−1)π
ak,n = 2n
mπ , k = 1, . . . , n (12.15)
m=1
sin 2n

Example 12.5. Figure 12.10 shows the Bode diagram of the rst 10 Butter-
worth lters with ωc = 44.4 rad/s, as in Examples 12.3 and 12.4. Notice how
steeper gain slopes, and consequently larger attenuations at high frequencies,
are got at the cost of earlier distortions in the phase. A constant gain and a
220 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.10: Bode diagram of Butterworth lters from Example 12.5.

negative phase mean that the signal will be delayed; as we will see in Chap-
ter 24, delays are a serious nuisance in control systems, and easily make them
unstable.
The transfer functions of the rst two lters are
1
F1 (s) = s (12.16)
44.4+1
1 1971
F2 (s) = √ = 2 (12.17)
s 2 2 s s + 62.79s + 1971
+2 +1
44.4 2
|{z} 44.4
ξ

Notice that (12.16) is the same as (12.1).

Chebyshev and elliptic l- Designing a lter by minimising the width of the transition band leads to
ters minimise the transi- Chebyshev and elliptic lters. We will not study them, just mention their ex-
tion band istence. Butterworth, Chebyshev and elliptic lters of any order can be easily
used in Simulink with block Analog Filter Design (from the DSP System
toolbox). All you have to do is to specify what type of lter you want (low-
pass, high-pass, band-pass, or band-stop), what design method you want (el-
liptic, Butterworth, Chebyshev. . . ), the order of the lter, and the passband.
Figure 12.11 compares lters of fth order of these types.

12.3 Bandwidth
Bandwidth of a lter Strictly speaking, the bandwidth ωb of a lter is the width of its pass-band.
Consequently:

ˆ In the case of a low-pass lter, the lower limit of the pass-band is 0 rad/s,
thus ωb = ωc − 0 = ωc .

ˆ In the case of a high-pass lter, the upper limit of the pass-band is innite,
so strictly speaking ωb = ∞ − ωc = ∞. But, since for a low-pass lter
ωb = ωc , for high-pass lters ωc is frequently given as the bandwidth as
well.

ˆ In the case of a band-stop lter, there are two pass-bands: the lower fre-
quency pass-band has bandwidth ωb = ωcl − 0 = ωcl ; the upper frequency
pass-band has ωb = ∞ − ωch = ∞, and, as for a high-pass lter, ωch is
often given instead.
12.3. BANDWIDTH 221

Figure 12.11: Absolute value of the gain of dierent fth order lters, as a
function of normalised frequency (source: Wikimedia).

ˆ In the case of a band-pass lter, ωb = ωch − ωcl (see Figure 12.7). But
the two limits of the pass-band ωcl and ωch are often given instead, as for
band-stop lters.
So in practice bandwidth ωb is frequently identied with the cut-o frequency
ωc (or frequencies, if there are more than one). Consequently, ωb will be the
frequency (or frequencies) where the gain crosses tolerance δp of the pass-band
(see Figure 12.7 again). The value of δp should be dened according to the
specications of the particular situation where the lter is employed. Very often,
the −3 dB criterion is used, i.e. the bandwidth ωb of a lter F (s) is dened as −3 dB criterion for the
the frequency where its gain |F (jω)| crosses −3 dB, or, in absolute value, bandwidth

−3
20 log10 |F (jωb )| = −3 dB ⇔ |F (jωb )| = 10 20 = 0.708 (12.18)

So, with this criterion, 70% of the signal passes, i.e. there is an attenuation of
30%. (Of course, if this is not acceptable, either because 30% of attenuation
is too much or because larger attenuations of the signal can be tolerated, a
dierent criterion should be used.) The advantage of this criterion is that
ˆ a rst-order lter F (s) = a
s+a has a −3 dB gain at the frequency of the
pole, as we see by (11.90), and so ωb = a;

ˆ a second-order lter with ξ = 2
2
and natural frequency ωn = a, given by

a2
F (s) = √ (12.19)
2
s2 + 2 2 as + a2

has a −20 log10 2 22 = −3 dB gain at frequency ωn = a, as we saw in
(11.105), and so ωb = a;
ˆ and indeed all Butterworth lters of any order, not only those of rst-order
and second-order just mentioned, will have ωb = a.
When a bandwidth is mentioned, and no indication is given about the criterion
used to dene it, you can safely assume that the −3 dB criterion was employed.
The notion of bandwidth can be extended to any plant. Again, strictly Bandwidth of a plant in
speaking, the bandwidth is the width of a frequency range, but in practice general
222 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.12: Bode diagram of a rst-order plant with gain gmax = 20 dB at low
frequencies. Using the gmax − 3 dB criterion for the bandwidth, the frequency
of the pole is found.

the limits of the range are given instead, or rather only one limit if the other
is 0 rad/s or innity. The bandwidth will thus be once more a frequency or
frequencies that satisfy one of several criteria, according to what better suits
the plant.

ˆ If the largest value of the gain of the plant is 0 dB, then the −3 dB criterion
can be used just as it is for lters.

ˆ If the largest value of the gain is larger than 0 dB, the −3 dB criterion
can also be used just the same.

ˆ If the largest value of the gain is larger than 0 dB, the 0 dB criterion
can be used instead. The bandwidth will then separate the frequencies
where the input is amplied from those where the input is attenuated. In
this case, the bandwidth will be just another name for the gain crossover
frequency, according to Denition 10.9.

ˆ If the largest value of the gain is some value gmax dB, a criterion can be
used by which the bandwidth is the frequency (or frequencies) where the
gain crosses gmax − 3 dB. See Figure 12.12 to see an example showing why
this makes sense.

ˆ The former criterion makes particular sense if gmax < 0 dB, since the gain
does not cross 0 dB and may not even cross −3 dB.

ˆ The former criterion makes no sense if there are poles at the origin, since
in that case gmax = +∞.

ˆ Some other value that better suits the problem addressed can be used
instead.

The 0 dB criterion is often useful, but since a plant's gain can be known with
uncertainty, or undergo small changes, for safety the −3 dB criterion is used
instead.

12.4 Signal characteristics


Having studied lters, let us now look again at AD/DA conversion:

ˆ AD conversion consists in two changes:


12.4. SIGNAL CHARACTERISTICS 223

the signal is sampled in time;


the amplitude of the signal is quantized.
ˆ DA conversion consists in two changes:

the amplitude of the signal must be reconstructed;


the signal will become continuous in time.
Changes in time will be addressed below in Chapter 25. Here we will address
changes in amplitude.
Digital signals are (almost always) binary, consisting in an integer number Values of an n-bit digital
in base 2, i.e. they are a sequence of binary digits or bits, i.e. zeros or ones. A signal
digital signal with n bits can assume 2n values, ranging in decimal form from 0
to 2n − 1.

Example 12.6. A 4-bit digital signal can assume 24 = 16 values which are
binary decimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
1010 10
1011 11
1100 12
1101 13
1110 14
1111 15
Notice that 16 in base 2 is 10000 and requires 5 bits to be represented. It is
impossible to represent it with 4 bits.

Remark 12.4. This is similar to what happens with an integer decimal number
with n digits, which can assume 10n values ranging from 0 to 10n −1. With three
decimal digits we can represent 999, but 103 = 1000 would require 4 decimal
digits. Of course, there are 1000 numbers from 0 (or 000, if you prefer) to 999.

Converting integers from base 2 to base 10 can be done summing the powers From base 2 to base 10
of 2 corresponding to bits which are 1.

Remark 12.5. This is similar to the interpretation of a decimal integer number.


We know that 60789, which has 5 decimal digits, is in fact

60789 = 6 × 104 + 0 × 103 + 7 × 102 + 8 × 101 + 9 × 100 (12.20)

The rightmost digit multiplies 100 and thus, if there are n digits, the leftmost
digit multiplies 10n−1 . Binary numbers are even easier to handle, because bits
are either 0 or 1.

Example 12.7. Binary number 10011101, which has 8 bits, corresponds to


decimal number

1×27 +0×26 +0×25 +1×24 +1×23 +1×22 +0×21 +1×20 = 128+0+0+16+8+4+0+1 = 157
(12.21)
It is sometimes convenient to write the number like this:
order 7 6 5 4 3 2 1 0
bits 1 0 0 1 1 1 0 1
powers of 2 27 26 25 24 23 22 21 20
weights 128 64 32 16 8 4 2 1
224 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Thereafter, the weights corresponding to bits equal to 1 are summed.


Example 12.8. Binary number 000111010110, which has 12 bits, corresponds
to decimal number

order 11 10 9 8 7 6 5 4 3 2 1 0
bits 0 0 0 1 1 1 0 1 0 1 1 0
powers of 2 211 210 29 28 27 26 25 24 23 22 21 20
weights 2048 1024 512 256 128 64 32 16 8 4 2 1

28 + 27 + 26 + 24 + 22 + 21 = 256 + 128 + 64 + 16 + 4 + 2 = 470 (12.22)


Remark 12.6. In the last example, there were useless zeros at the left of the
last bit equal to 1. Of course, AD/DA converters work with a xed number
of bits, and thus only half of the values they can assume do not begin with a
zero.
From base 10 to base 2 Converting integers from base 10 to base 2 can be done subtracting succes-
sively the largest possible power of 2. These powers will correspond to the bits
that are equal to 1.
Example 12.9. Decimal number m = 789 can be converted to binary as follows.
First we nd all the powers of 2 until we exceed m.
210 29 28 27 26 25 24 23 22 21 20
1024 512 256 128 64 32 16 8 4 2 1

Since 210 > m we now know we will need 10 bits, corresponding to powers from
20 to 29 . Now we successively subtract the larger possible weight from the table
above:

789 − 512 = 789 − 29 = 277 (12.23)


277 − 256 = 277 − 2 = 21 8
(12.24)
21 − 16 = 21 − 2 = 5 4
(12.25)
5−4=5−2 =1 2
(12.26)
1−1=1−2 =0 0
(12.27)

The bits equal to 1 are those of the powers we used:


29 28 27 26 25 24 23 22 21 20
1 1 0 0 0 1 0 1 0 1
Consequently m = 1100010101(2) . If a larger number of bits is required, the
number is padded with zeros at the left. For instance, if m is to be written
using 16 bits, we will have 0000001100010101.
Resolution The number of bits in an AD/DA converter lets us know the resolution of
its output, which is the smallest interval between two consecutive readings.
Example 12.10. An 8-bit AD converter receives signals ranging from 0 V to
28 = 256 = 0.0195 V = 19.5 mV.
5 V. Its resolution is 5−0 5

Example 12.11. A 12-bit DA converter outputs signals ranging from −10 V


10−(−10)
to 10 V. Its resolution is 212 = 20
4096 = 0.0049 V = 4.9 mV.
The resolution can also be given referring to the variable which is being
measured, in the case of AD conversion, or which is being output, in the case
of DA conversion. This is fairly simple if transduction is linear. In the case
of a sensor with linear transduction, the proportion between the variable of
Sensibility transduction and the measured variable is called sensibility.
Example 12.12. Consider a sensor measuring distances from 0 cm to 50 cm
and with an output ranging from 0 V to 5 V. Its sensibility is constant, and
equal to 50−0
5−0
= 0.1 V/cm. The sensor is connected to the 8-bit AD converter
receiving signals from 0 V to 5 V of Example 12.10. The resolution of the
distance measurement is 50−028
50
= 256 = 0.195 cm. This can be graphically
depicted as in Figure 12.13.
12.4. SIGNAL CHARACTERISTICS 225

Figure 12.13: Relations in the measuring chain of Example 12.12.

Example 12.13. Consider a sensor measuring temperatures from 20 ◦ C to


120 ◦ C and with an output ranging from 1.25 V to 7.5 V. Its sensibility is
120−20 = 0.0625 V/ C. The sensor is connected to a
constant, and equal to 7.5−1.25 ◦

10-bit AD converter receiving signals from −10 V to 10 V. The resolution of the


temperature measurement can be found in dierent ways:

ˆ The range of the output of the sensor is 7.5−1.25 = 6.25 V. Consequently,


we are using only 6.25
20 = 0.3125 of the 2
10
= 1024 values that the AD
converter can output, i.e. we are using only 0.3125 × 1024 = 320 values.
Thus the resolution is 120−20
320 = 0.3125 ◦ C.

10−(−10)
ˆ The resolution of the AD converter in Volt is 210
20
= 1024 = 0.0195 V.
Hence the resolution in degree Celsius is 0.0625 = 0.3125 C.
0.0195 ◦

7.5−(−10)
ˆ 7.5 V corresponds to output 10−(−10) × 1024 = 896. 1.25 V corresponds
1.25−(−10)
to output 10−(−10) × 1024 = 576. Thus the resolution is 120−20
896−576 =
0.3125 ◦ C.

Of course, all these ways of reasoning consist in fact in the same calculation and
give the same result. See Figure 12.14.

In the previous example, outputs were found with rules of three. When
the result is not integer, it must be rounded down, because both AD and DA AD/DA conversion
converters work as shown in Figure 12.15 (in the next section we will see why). rounds down
Notice that, as a result:

ˆ in AD conversion, when the input is the maximum voltage admissible


Vmax , the output should be 2n , where n is the number of bits, but, since
it is impossible to represent this number with n bits, the output is 2n − 1
instead;

ˆ in DA conversion, since the largest input is 2n −1, the output never reaches
Vmax , but only Vmax − ∆V = Vmax − Vmax −Vmin
2n .

Example 12.14. A 16-bit AD converter working in the ±10 V range receives


2 V as input. The output is

2 − (−10) 16
2 = b39321.6c = 39321 (12.28)
10 − (−10)
226 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.14: Relations in the measuring chain of Example 12.13.

Figure 12.15: Blue line: how AD and DA conversions take place, for a 3-bit
converter working with voltages in the range from Vmin to Vmax ; the resolution
is ∆V = Vmax −V
8
min
. The extension to any other number of bits is immediate.
12.4. SIGNAL CHARACTERISTICS 227

Converting this to binary form,

39321 − 215 = 6553 (12.29)


6553 − 2 12
= 2457 (12.30)
2457 − 2 11
= 409 (12.31)
8
409 − 2 = 153 (12.32)
6
153 − 2 = 25 (12.33)
4
25 − 2 = 9 (12.34)
9−2 =1 3
(12.35)
1−2 =0 0
(12.36)

we get 1001100101011001.
Example 12.15. A 6-bit DA converter has outputs in the −5 V to 5 V range
and receives 110001 as input. Since 110001(2) = 25 + 24 + 20 = 32 + 16 + 1 = 49,
the output will be

25 + 24 + 20 32 + 16 + 1 490
−5 + (5 − (−5)) = −5 + 10 = − 5 = 2.656 V
26 64 64
(12.37)
Knowing the resolution is important to calculate the precision: Precision

ˆ the precision εmax of a measuring chain in the maximum absolute value


of the error ε between the measured value x̂ and the exact value of the
variable that is being measured x, that is,

εmax = max |ε| = max |x̂ − x| (12.38)


x̂ x̂

ˆ the precision εmax of an actuation chain is the maximum absolute value


of the error ε between the control action applied ũ and the desired control
action u found by the controller, that is,

εmax = max |ε| = max |ũ − u| (12.39)


ũ ũ

The precision of the chain, being a maximum value of an absolute error, is the
sum of the precision of its components.
Indeed, sensor and actuator accuracy is aected by errors, which can be Systematic vs. stochastic
classied as systematic when their value remains the same for identical condi- errors
tions, or stochastic when they are a random variable. Systematic errors lead
to a bias in measurements. Stochastic errors corresponding to random variables
that do not have a zero mean also lead to bias in measurements. We will study
stochastic systems in detail in Part VIII of these Lecture Notes.
Example 12.16. Suppose that the sensor from Example 12.12 has an accuracy
of 5 mm. Since the range is 50 cm, this is often indicated as 50 cm = 1% of
5 mm

full-scale reading. This means that the accuracy is 1% × 50 cm = 5 mm. Accuracy as % of full-scale
Since the resolution of the AD conversion is 0.39 cm = 3.9 mm, if there are reading
no other sources of noise present, the precision of the measuring chain shall be
5 + 3.9 = 8.9 mm.
Example 12.17. Analog measurements have resolution and precision too. Con-
sider the weighing scale in Figure 12.16. Mass can be measured in the 5 kg to
100 kg range, with a resolution of 0.1 kg, and a precision of 0.1 kg. There is
no ner resolution because the graduation has ten marks per kilogram. The
precision is a result of the characteristics of the device.

Example 12.18. In Example 12.17 the resolution and the precision have the
same value, but this is often not the case. Figure 12.17 shows luggage scales with
a resolution of 1 g, but with a precision of 5 g or 10 g depending on the range
where the measurement falls. (Varying precisions are found for some types of
sensors, especially because of non-linearities, as we shall see in Chapter 13.)
228 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.16: Weighing scales once used in the Beªchatów coal mine, Poland.
12.4. SIGNAL CHARACTERISTICS 229

Figure 12.17: Luggage scales.


230 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.18: Relations in the measuring chain of Example 12.19.

Remark 12.7. It makes sense to have a resolution equal to the precision, as in


Example 12.17, in which case all gures of the measurement are certain; and it
makes sense to have a resolution higher than the precision, as in Example 12.18,
in which case the last gure of the measurement is uncertain. It would make no
sense to have a resolution more than 10 times larger than the precision, since in
that case at least the last gure of the measurement would have no signicance.
It would also make no sense to have a resolution coarser than the precision,
since the capacities of the sensor would be wasted.

In Examples 12.12 and 12.16 the range of outputs of the sensor S is precisely
the range of inputs of the AD converter C . If S 6= C there are three possible
situations:

ˆ If S 6⊂ C , then it is necessary to modify S , adding (or subtracting) some


value, or multiplying it by some gain, or both, until S ⊂ C . We will see
in the next section that this can be easily done with op-amps.

ˆ If S ⊂ C , but S is clearly smaller than C , and the resolution of the AD


conversion has a signicant weight in the precision of the measurement
chain, then S should be modied as well.

ˆ If S ⊂ C , and the resolution of the AD conversion is ne, there is no need


to do anything.

A similar reasoning applies to DA conversion in the actuation chain.

Example 12.19. A sensor has an output in the 0 V to 10 V range, and will be


connected to a 24 bit AD converter that receives values in the 0 V to 5 V range.
The output of the sensor must be halved. Otherwise, the AD would overow
and its output would saturate. See Figure 12.18.

Example 12.20. A sensor has an output in the 0 V to 10 V range, and will


be connected to a 24 bit AD converter that receives values in the −5 V to 5 V
range. 5 V must be subtracted to the output of the sensor. See Figure 12.19.

Example 12.21. An electric motor receives an input in the 0 V to 10 V range,


corresponding to rotation speeds between 1 rpm and 100 rpm. It will be con-
nected to an 8 bit DA converter that has an output in the 0 V to 5 V range.
We do not want the motor to run faster than 45 rpm. Thus control actions
larger than 4.5 V are not needed, and the output of the DA converter can be
connected directly to the motor (likely through a power amplier, as we will see
in Chapter 14).
12.5. OP-AMP IMPLEMENTATION OF SIGNAL CONDITIONING 231

Figure 12.19: Relations in the measuring chain of Example 12.20.

Example 12.22. If the temperature sensor from Example 12.13 has an accuracy
of 3 ◦ C, then the precision of the measurement is 3.3125 ◦ C. The contribution of
the AD converter for this is 0.3125 ◦ C and is not very relevant when compared
to sensor accuracy. So the sensor can be directly connected to the AD converter.

Example 12.23. If the temperature sensor from Example 12.13 has an accuracy
of 0.1 ◦ C, then the precision of the measurement is 0.4125 ◦ C. The contribution
of the AD conversion is signicant, and if we need a precision of 0.2 ◦ C it is clear
that it is the resolution of the AD conversion that is preventing this specication
from being fullled. The resolution is poor because only 320 of the 1024 values
that the AD can output are being used. If all values were used, the precision of
the measurement would be 0.1 + 120−20 1024 = 0.1977 < 0.2 C as required. So the

output of the sensor must be corrected:


ˆ its range is from 1.25 V to 7.5 V, with an amplitude of 6.25 V and a mean
value of 4.375 V;
ˆ we need it to range from −10 V to 10 V, with an amplitude of 20 V and
a mean value of 0 V;
ˆ so rst its mean should be corrected by subtracting 4.375 V;

ˆ then its range must be corrected through an amplication of 20


6.25 = 3.2
times.
See Figure 12.20.

12.5 Op-amp implementation of signal condition-


ing
Signal conditioning consists in the several operations underwent by a signal in
the measuring chain or in the actuation chain ltering, correction of the mean,
amplication, etc.. They can be implemented using op-amps in the several
congurations we studied in Chapter 5.
Example 12.24. The operations in Example 12.23 can be implemented with
op-amps with ±15 V supply tensions as shown in Figure 12.21. Notice that:
ˆ Because a −4.375 V is unlikely to be directly available, it was obtained
from the 15 V tension which must be available to supply the op-amps.
232 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.20: Relations in the measuring chain of Example 12.23. Compare this
with the original situation in Figure 12.14.

ˆ Care must be taken not to exceed supply tensions anywhere. That is why
it is not possible to multiply the sensor output S ∈ [1.25 V, 7.5 V] by 3.2
rst, and only then correct the mean value subtracting 14 V. Apparently
the nal result would be the same, since of course 3.2(x−4.375) = 3.2x−14.
But the rst operation would require voltages in the range

3.2 × [1.25 V, 7.5 V] = [4 V, 24 V] 6⊂ [−15 V, 15 V] (12.40)

and so the op-amps would saturate.

ˆ The circuit in Figure 12.21 is not the only possible way of implementing
the desired operations. A weighted subtracting op-amp could have been
used instead. (Try to draw the corresponding circuit.)

ˆ In particular, resistor values could change as long as the proportions for


each op-amp are kept. However, resistor values should not be too small
or too large.

ˆ Resistor values that cannot be found o the shelf can be obtained combin-
ing resistors in series (or in parallel), or with a potentiometer. The later
Calibration option allows calibrating the measuring (or actuation) chain, i.e. changing
the parameters of the components (in this case, resistance values) so that
the value read is exact in situations where the accurate value to be read
is known.

ˆ Small resistor values mean high currents, since from Ohm's law I = R.
U

And high currents mean signicant energy dissipation by Joule eect, since
the power dissipated is given by P = RI 2 = U I ; this also means that the
resistances would get very hot.

ˆ Another reason to avoid small resistor values is that jump wires, cables,
and other components have resistance too; such resistances are small, but
cannot be neglected if resistors have small values. As a consequence,
proportions of resistances around the op-amps would not be the desired
ones, and signal conditioning would be inaccurate.

ˆ Large resistor values are also undesirable, since currents would be small.
In that case, noise aecting currents would hardly be neglectable, and
measurements would be unreliable.
12.5. OP-AMP IMPLEMENTATION OF SIGNAL CONDITIONING 233

Figure 12.21: Circuit of Example 12.24, implementing the relations of Exam-


ple 12.23.

Filters can implemented analogically with op-amps. Several congurations


that can be used for lters have appeared in Exercises 1 and 5 of Chapter 5;
see also Exercises 6 and 7 in this chapter. These lters lter signals before AD
conversion. We will see in Part V how to implement (numerically) lters after
AD conversion, i.e. lters that receive the signal already discretised in time.
AD/DA conversion is always done using commercially available converters,
but it is important to know how it is done using op-amps, since this makes
clearer why it behaves how it does:
ˆ DA conversion is obtained with a sequence of summing ampliers, as seen
in Exercise 9 below;
ˆ AD conversion is obtained with one or more comparator op-amps. The
input is compared with the values of the voltages of possible binary outputs
(the full points in Figure 12.15). The output is the largest binary number
that is not larger than the input. That is why AD conversion results in
a step-like behaviour as seen in Figure 12.15, rounding the output down.
While there are dierent possible congurations, the most common ones
are:
There are as many comparators as possible outputs. This is fast,
since all comparisons are done simultaneously. On the other hand,
if the number of bits n is high, 2n op-amps take lots of space and
energy.
There is only one comparator, that sequentially compares the input
with a variable voltage. This voltage is obtained, using a DA con-
verter, from a binary number sent by a microprocessor. The compar-
ison could be done beginning with 0 and then going up one bit at a
time, but this takes too much time; in practice, the microprocessor
usually runs a binary search algorithm (which you may know from
computer programming) instead:
1. If the conversion has n bits, the rst comparison is always with
2n−1 , which corresponds to the middle of interval [Vmin , Vmax ].
2. If the input is larger, the output must be in the [2n−1 , 2n − 1]
range. If the input is smaller, the output must be in the [0, 2n−1 −
1] range.
3. The midpoint of this interval where we now know that the output
must be is used for a new comparison.
4. This goes on until it is clear that the interval where the output
must be has only one point; i.e. until it is clear that input V
veries V ≥ m and V < m + 1. Then m is the output.
These are called successive approximation AD converters. See Fig-
ure 12.22.

Glossary
Ora menganava tanto
que cuydey que ereis vos santo
& vos falais castellano
234 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.22: Successive approximation AD converter with N bits (source:


Wikimedia). S/H (sample and hold) denotes discretisation in time; DAC is
the digital to analog converter; and SAR (successive approximation register) is
the microprocessor's generator of binary numbers according to the binary search
algorithm.

Gil Vicente (1465? „1536?), Floresta denganos

accuracy precisão
active lter ltro ativo
actuation chain cadeia de atuação
AD converter conversor AD
band-pass (lter) (ltro) passa-banda
band-stop, band-reject (lter) (ltro) corta-banda
bandwidth largura de banda
bias enviesamento
calibration calibração
cut-o frequency frequência de corte
DA converter conversor DA
distortion distorção
lter ltro
high-pass (lter) (ltro) passa-alto
low-pass (lter) (ltro) passa-baixo
measuring chain cadeia de medida
measuring range gama de medida
pass-band banda (de frequências) de passagem
passive lter ltro passivo
precision precisão
repeatability repetibilidade
resolution resolução
signal conditioning condicionamento de sinal
sensibility sensibilidade
stochastic error erro estocástico
stop-band banda (de frequências) de corte, banda de rejeição
successive approximation aproximação sucessiva
systematic error erro sistemático
transduction transdução
transition band banda (de frequências) de transição

Exercises
1. The speedometer of a car's dashboard receives a signal in the [0, 2] V range
and shows speed values in the [0, 200] km/h range. It will be connected to
a sensor that measures speeds in the [0, 50] m/s range, providing a reading
in the [0, 50] mV range. Design the signal conditioning needed to connect
the sensor to the dashboard's speedometer.

2. A submarine has a sonar that creates a sound and detects its reection by
an object. The sound travels from the submarine to the object and back,
and then is detected. The speed of sound in water is 1500 m/s.
12.5. OP-AMP IMPLEMENTATION OF SIGNAL CONDITIONING 235

Figure 12.23: Circuit with the lter of Exercise 5. The sensor is connected to
the left of the breadboard, and the ltered signal is read to the right (source:
Professor Carlos Cardeira).

(a) How is the distance d to the object related to the time t between the
emission of the sound and the detection of its reection?
(b) The sound detector that measures t returns a tension given by 100 mV
per second. It will be connected directly to a display that receives
signals in the [0, 5] V range. What is the largest distance d that can
be shown, before the display saturates?
3. An accelerometer outputs 14 mV per g , where g = 9.8 m/s2 . Design a
signal conditioning to convert this into 0.25 V per m/s2 .
4. A quadcopter has a sensor to measure its height. The maximum frequency
of this signal is 10 Hz. There is noise at frequencies of 1 kHz and higher.
Design a lter with at least 37 dB attenuation for noise, while letting at
least 99% of the signal pass.
5. A sensor reads a signal given by y(t) = cos(10t). A power amplier in-
troduces noise estimated as d(t) = 0.5 cos(104 t). In order to reduce the
amplitude of the noise to 0.01, the lter in Figure 12.23 was employed.
(a) The resistance is R = 10 kΩ and the capacitor is C = 6 µF. Explain
why the lter is not suitable for its purpose.
(b) What values of R and C would be suitable?

6. Consider the lter in Figure 12.24.


Vout (s)
(a) Find transfer function Vin (s) .

(b) What kind of lter is this?


(c) What values of R1 , R2 , C1 and C2 would you use to obtain a cut-o
frequency of 100 Hz?
(d) Plot the resulting Bode diagram.
(e) Replace resistors by capacitors and vice-versa, and answer again all
the questions above.

7. Repeat the last exercise, using the lters with the circuits in Figure 12.25.

8. An 8bit AD converter receives values in the in the [0, 10] V range.


(a) What is the converter's input when its output is 10101001?
(b) What is the converter's input when its output is 01010111?
(c) What is the converter's output when its input is 3 V?
236 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS

Figure 12.24: Circuit with the lter of Exercise 6.

Figure 12.25: Circuit with the lters of Exercise 7.

(d) What is the converter's resolution?

9. Consider the DA converter in Figure 12.26.

(a) What is the converter's output when its input is 1001?


(b) What is the converter's output when its input is 0101?

10. A distance sensor with a sensibility of 0.1 V/mm measures distances in


the range from 20 mm to 120 mm. The reading will be read by an AD
converter that receives signals in the [−5, +5] V range. Project a signal
conditioning circuit with only one OpAmp, supplied with ±15 V tensions;
assume that you have a DC +5 V tension available.
12.5. OP-AMP IMPLEMENTATION OF SIGNAL CONDITIONING 237

Figure 12.26: DA converter of Exercise 9.


238 CHAPTER 12. MEASURING CHAINS AND ACTUATION CHAINS
Chapter 13

Sensors
Once outside the town, Stomper led them into a thick sedge and bade
them to be small and quiet lest they be seen by Sorhed's agents, who
would soon revive and mount the hunt.
The party was still panting when sharp-eared Arrowroot adjusted
the volume on his hearing aid and laid his head to the ground.
Hark and lo! he whispered, I do hear the sound of Nine Riders
galloping nigh the road in full battle array. A few minutes later a
dispirited brace of steers ambled awkwardly past, but to give Stom-
per his due, they did carry some rather lethal-looking antlerettes.
The foul Nozdrul have bewitched my ears, mumbled Stomper as
he apologetically replaced his batteries, but it is safe to proceed,
for the nonce. It was at that moment that the thundering hooves
of the dreaded pig riders echoed along the road.

Henry N. Beard (1945 . . . ), Douglas C. Kenney (1946 „1980), Bored of


the Rings, III

In this chapter we will study how sensors for dierent types of physical
quantities work. Most sensors nowadays transduce what they are measuring
into a voltage or a current, which will then be acquired electronically. Even
if the signal is not recorded, but merely shown to a human user, such sensors
are employed with a digital display. As a consequence, measuring chains need,
almost always, to be supplied energy to function.
Sensors used to display a reading on a scale, as in Figure 12.2, are not found
today as often as they once were. In any case,

ˆ if a sensor transduces the quantity measured into an angular (or linear)


position, easily shown on a scale, a further transduction of the angle into
a voltage (or a current) allows acquiring the measurement electronically;

ˆ if a sensor transduces the quantity measured into a voltage (or a current),


a further transduction into an angle (or a linear position) allows showing
the reading on a scale.

In either case, the measurement will be based on more than one transduction. The working principle of
This is usual: as we will see, there are sensors with working principles based some sensors uses two or
upon more than two transductions. more transductions
The output of some sensors is already digital; they do not require AD con-
version.
You are strongly advised to search the Internet for websites of manufacturers
and sellers of the dierent types of sensors, and check the technical documen-
tation available. This is the best way to get acquainted with the characteristics
of the dierent sensors: range, resolution, precision, bandwidth, type of output, Important characteristics
type of supply, repeatability, linearity, temperature or humidity limitations of sensors
and if possible check yet another very important non-technical characteristic
which is the price.

239
240 CHAPTER 13. SENSORS

Figure 13.1: Bode diagrams of s (dierentiation) and of 1


s (integration).

Figure 13.2: Left: a signal corrupted by high frequency noise. Right: the
derivative we would like to have, and what we really get when we dierentiate
without bothering to lter.

13.1 Position, proximity, velocity and accelera-


tion sensors
Finding x, ẋ and ẍ from Position, velocity and acceleration can be found from one another. This means
one another that a sensor for one of these variables can be used to nd the others. This is
done in practice, but is not without problems:

ˆ Velocity can be found dierentiating position, and acceleration can be


found dierentiating velocity or dierentiating position twice. But dif-
ferentiation amplies high-frequency noise: see the Bode diagram in Fig-
ure 13.1, and an example of the eect in Figure 13.2. Amplied high-
frequency (i.e. short period) noise is felt at once.

ˆ Velocity can be found integrating acceleration, and position can be found


integrating velocity or integrating acceleration twice. But integration am-
plies low-frequency noise: see the Bode diagram in Figure 13.1, and an
example of the eect in Figure 13.3. Amplied low-frequency (i.e. large
period) noise is felt only after a while.

Proximity sensors return a binary variable related to position x: the sen-


sor detects if x < xmax , where xmax is some threshold below which presence
Relation between proxim- is detected. Position sensors can be used as proximity sensors: it is merely
ity and position sensors a question of comparing the measured distance x with the desired threshold.
Several proximity sensors can be used to measure a distance, as seen in Fig-
ure 13.4; the resolution will be the distance between two consecutive sensors.
13.1. POSITION, PROXIMITY, VELOCITY AND ACCELERATION SENSORS 241

Figure 13.3: Left: a signal corrupted by low frequency noise. Right: the inte-
gral we would like to have, and what we really get when we integrate without
bothering to lter.

Figure 13.4: Several proximity sensors with range r, placed at a distance d from
each other, can be used to measure position (in this case, the position of the
dark square), if d < 2r.

This distance can never be larger than xmax , and in practice should probably
be inferior; otherwise it is possible that an object will not be detected by any
sensor.
Proximity sensors can also be easily used to measure the angular velocity of
non-homogeneous bodies. The example of a cog is shown in Figure 13.5: the
sensor detects the proximity of a tooth; the angular velocity is found dierenti-
ating with respect to time the value of a counter that accumulates the number
of teeth.

Example 13.1. The cog of Figure 13.5 has 28 teeth. A proximity sensor has the
output shown in that Figure; i.e., 14 teeth could be counted during 1 s. Thus,
the cog rotates at 14
28 = 0.5 Hz, i.e. 0.5 × 2π = π rad/s, or still 0.5 × 60 = 30 rpm.
Usually the values of a counter would be known instead of the sensor output.
For instance, the counter would have 753 at t = 31 s, and 767 at t = 32 s; thus,
767−753
ω = 32−31
28
= 0.5 Hz = π rad/s = 30 rpm.

As we saw in Chapter 4, position, velocity and acceleration can be linear


or angular. Sensors for linear quantities can be used for angular quantities and
vice-versa, using e.g. a rack and pinion (remember Figure 4.15) or a roller wheel.
We will now study the more frequently found working principles of these types

Figure 13.5: Left: a proximity sensor detects the teeth of a cog (source: adapted
from Wikimedia). Right: output of the proximity sensor for Example 13.1.
242 CHAPTER 13. SENSORS

Figure 13.6: Left: rotary potentiometer. Right: output of a rotary potentiome-


ter with one terminal grounded and another at 5 V.

of sensors. Some only work for linear quantities; others only work for angular
quantities; others work for both.

13.2 Working principles of position sensors


The following sensors measure both linear and angular positions.

Potentiometric sensors ˆ Potentiometric sensors consist in a potentiometer with the terminals


at xed voltages. The resistance is uniform, and so the position of the
slider is proportional to the resistance between the slider and one of the
terminals; see (5.2) and Figure 5.3 again. These sensors use to be relatively
cheap, but, because the slider must move and overcome friction, they are
subject to wear and there are limitations to the velocity of the slider. In
other words, the bandwidth of the sensor is limited (i.e. the frequency of
the changes in the measured position cannot be very high).
Rotary potentiometers Rotary potentiometers have the resistance shaped in a round form, as
in Figure 13.6. In this case, for a multi-turn measurement, the output
will have a discontinuity when the cursor passes from one terminal to the
other.

ˆ Encoders are more often used to measure angular position, though linear
encoders exist as well. A rotary encoder is a sensor consisting in a wheel
with perforations (shaped as slits), disposed in such a way that the light of
a LED on one side of the wheel may be detected by a light sensor (which
we will address below in Section 13.6) on the other side, if the hole is
aligned with both the LED and the sensor. Instead of a perforated wheel,
it is possible to have a wheel with a surface which either reects light or
not; in this case, both the LED and the light sensor are on the same side of
the wheel. Because the encoder output depends on light sensors detecting
light or not, it is digital by construction. There are two main types of
encoders:

Incremental encoders Incremental encoders, or relative encoders, have a row of n


slits along the rim (or non-reective dark spots, though incremental
encoders more often have slits). As the wheel turns, the output of
a light sensor mounted as seen in Figure 13.7 will be a square wave.
(More precisely, if the rotation speed is constant, the output will be
a square wave. Otherwise, the up and down steps will not be evenly
distributed in time.) A counter counts the number m of peaks in
this wave, and thus, since the counter was reset, the angle θ that the
wheel has described is
m
θ= 360◦ (13.1)
n
If the wheel always turns in the same sense of rotation, this is enough;
otherwise, the counter just keeps incrementing its value even when
13.2. WORKING PRINCIPLES OF POSITION SENSORS 243

Figure 13.7: Left: incremental encoder. Right: output of the light sensors.
(Source: ISBN 9780128123195.)

0 0 0 0 0 0 0 0
1 0 0 1 1 0 0 1
2 0 1 0 5 1 0 1
3 0 1 1 7 1 1 1
4 1 0 0 3 0 1 1
5 1 0 1 2 0 1 0
6 1 1 0 6 1 1 0
7 1 1 1 4 1 0 0

Figure 13.8: Left: 3-bit encoder wheel with binary numbers. Right: 3-bit
encoder wheel with Gray code. (Source: Wikimedia.) Notice how on the left
all three bits may change at one time, while on the right, by construction, only
one changes at a time.

the shaft rotates back. To know the sense of rotation, two dierent
light sensors are needed. They will either be slightly misaligned so
that they will not detect a slit at the same time, or correspond to two
dierent rows of misaligned slits along the rim. In this way, there will
be two square waves, and knowing which of them goes up rst it is
possible to know if the wheel turns clockwise or counter-clockwise, i.e.
if the count should be incremented or decremented. In any case, the
rotation is measured from the position of the shaft when the counter
was reset. Some encoders include a third sensor, to detect a single
slit that will correspond to 0◦ ; but this will only work if that sensor
is ever activated (small oscillating shaft rotations may prevent that).
And, in any case, the position is found integrating or rather, since
a digital value is used, summing a measurement.
Absolute encoders give the absolute value of the angular position Absolute encoders
of the shaft. The wheel is divided into n concentric annuli, and into
2n sectors, as seen in Figure 13.8. Each sector has its n sectors of
annuli painted so as to correspond to a dierent number in base 2.
(Slits would prevent a smooth transition of the reading from one
sector to the next.) There are n sensors, and the binary number
formed by the readings of the sensors gives the angular position of

the shaft, with resolution 360
2n . Numbers may follow in numerical
order, but in this way it is possible that, when the reading changes
from one sector to the next, dierent light sensors will change its
output at slightly dierent instants. Consequently, for a short period
of time, the output will be wrong. Thus, it is usual to arrange the
binary numbers in such a way that only one bit changes at a time.
This arrangement is known as Gray code and shown in Figure ??. Gray code

The encoders described above are optical encoders, by far the most com- Optical vs. magnetic en-
mon. Magnetic encoders are similar but replace the LED and the light coders
sensor by magnetic pulses. Instead of slits in the wheel, or zones that alter-
nately reect and do not reect light, the wheel has permanent magnets,
244 CHAPTER 13. SENSORS

Figure 13.9: Magnetic linear incremental encoder (source: DOI


10.3390/s18072281).

Figure 13.10: LVDT distance sensor (source: Wikimedia).

and their presence is detected by a circuit where a current is induced.


Measuring a linear position with an encoder is normally done using a rack
Linear encoders and pinion or a roller wheel, but there are linear encoders (though not as
common as rotary encoders) such as the one in Figure 13.9.

LVDT and RVDT sensors ˆ Linear variable dierential transformers (LVDT sensors) and ro-
tary variable dierential transformers (RVDT sensors) have three
coils and a ferromagnetic core connected by a shaft to the position to be
measured. The shaft moves back and forward, as seen in Figure 13.10, in
a LVDT; in a RVDT, shown in Figure 13.11, it rotates. A xed voltage is
applied to coil A, the primary coil, and the core becomes an electromag-
net. If it is equidistant from both the other coils, the secondary coils, the
core induces no current in them, and there is no voltage B ; this is called
the null point. If the core moves aside, there will be a current in one of
the secondary coils, and B 6= 0. LVDT and RVDT sensors have good
resolution and bandwidth, little wear, and few temperature restrictions.

The following sensors measure linear position only.

Capacitive sensors ˆ Capacitive sensors, or capacitance sensors, have the position to be mea-
sured connected to one of the plates of a capacitor. If the moving target
is conductive, it may be used as one of the plates. The capacitance C of
a capacitor with plates of area A separated by distance x is given by

C= (13.2)
x
where ε the dielectric constant of the medium between the plates. Capac-
itance is then measured applying a known current, so that the resulting
13.2. WORKING PRINCIPLES OF POSITION SENSORS 245

Figure 13.11: Left: RVDT with its core at the null point, and thus equal volt-
ages in the secondary windings. Right: dierent voltages in the two secondary
windings. (Source: https://www.youtube.com/watch?v=lNKxIsM_W3M.)

Figure 13.12: Eddy currents with intensity I induced by the magnetic eld
B of a magnet on a moving conducting material C with velocity V (source:
Wikimedia).

voltage, after the capacitor is charged, is inversely proportional to the


capacity C (remember (5.9)), and consequently linear with x.

ˆ Eddy current sensors are based on eddy currents, or Foucault currents, Eddy current sensors
and require that the target be conductive. As Figure 13.12 shows, a mov-
ing magnetic eld induces an electric current in a conductive material.
Since the target may not be moving, sensors use an electromagnet with
a high frequency alternating current. In this way, the magnetic eld is
always changing, just as if a permanent magnet were moving. The closer
the target, the more energy these currents have. They generate a magnetic
eld that counteracts the one that originates them. The result is that the
sensor and the target can be modelled as a transformer with a variable
coupling coecient (remember Figure 5.22). The sensor itself will be sim-
ilar to an LR system with both impedance L and resistance R depending
on the distance x, as in Figure 13.13. These sensors operate in a wide
amplitude of temperatures and have a high bandwidth.

ˆ Hall sensors, or Hall eect sensors, are based on the Hall eect, explained Hall sensors
in Figure 13.14, and again require a conductive target. The presence of
the conductive target in the magnetic eld changes the dielectric constant
and consequently the Hall voltage. The variation of this voltage is used
to nd the distance of the target.

ˆ Inductive sensors are similar, and are also based on an electromagnet. Inductive sensors
Unlike Hall sensors, only variations in the magnetic eld caused by a
metallic target are detected. Consequently, these sensors are proximity
sensors.

ˆ Strain gauges are resistances glued to a surface, in such a way that Strain gauges
will be stretched or compressed with it. They are used to measure small

Figure 13.13: Model of an eddy currents sensor.


246 CHAPTER 13. SENSORS

Figure 13.14: Hall eect: magnet (3) generates a magnetic eld (4) that deviates
the electrons (1) passing through plate (2) which is part of the circuit fed by
battery (5). The force acting on the electrons is called Lorentz force. Because
electrons are deected, there is a dierence of electric potential between the
upper and the lower sides of plate (2), called Hall voltage. In practice, the plate
is usually a semiconductor. (Source: adapted from Wikimedia.)

displacements (as well as several other quantities, as we will see in the


following sections).

When the surface is stretched, so is the resistance: its length increases


and its cross-section decreases. (5.2) shows that the resistance will
consequently increase.

When the surface is compressed, so is the resistance: its length de-


creases and its cross-section increases. (5.2) shows that the resistance
will consequently increase.

See Figure 13.15. The resistance of a strain gauge has several windings
to maximise the changes in length and cross-section; see Figure 13.16. It
should be glued so that these windings are parallel, or oblique, to the
direction of the stretch or compression; it should never be perpendicular
thereto.

Theorem 13.1. The variation of the resistance ∆R of a strain gauge is


linear with the variation of ist length ∆L, provided that it be small.

Proof. As the strain gauge is solid, its volume before and after the change
in length is the same. Let the initial length be L and the initial cross-
section be A. The nal length will be L + ∆L, and the nal cross-section
will be A − ∆A; the variations ∆L and ∆A will be either both positive
or both negative. Neglecting second order terms (that is why we need a
small ∆L),

≈0
z }| {
LA = (L + ∆L)(A − ∆A) = LA − L∆A + A∆L − ∆L∆A
A
⇒ ∆A = ∆L (13.3)
L

From (5.2), we know that the initial resistance R is R = ρ A


L
, and that the
13.2. WORKING PRINCIPLES OF POSITION SENSORS 247

Figure 13.15: How a strain gauge's length and cross section change when it is
stretched and compressed (source: Wikimedia).

Figure 13.16: A strain gauge (source: Wikimedia).


248 CHAPTER 13. SENSORS

nal resistance is
L + ∆L
R + ∆R = ρ
A − ∆A
L L + ∆L
⇔ ρ + ∆R = ρ
A A − ∆A
L + ∆L L
⇒ ∆R = ρ A
−ρ
A − ∆L A
2L
L2

L + L∆L
=ρ −
LA − A∆L LA
| {z }
≈LA
L∆L ρ
=ρ = ∆L (13.4)
LA A
Since a strain gauge transduces the variation in length into a resistance,
another transduction is needed to obtain a voltage. The simplest way
to do this would be a tension divider, as in Figure 13.17. A constant
reference voltage Vi is provided, the output is Vo , and we let the additional
resistor of the divider be equal to the nominal value of the resistance of
the gauge:
(
R + ∆R = Vi −Vi
o
Vi − Vo Vo
Vo ⇒i= =
R= i R + ∆R R
⇒ Vi R − Vo R = Vo R + Vo ∆R ⇔ Vo (2R + ∆R) = Vi R
Vo R
⇔ = (13.5)
Vi 2R + ∆R
Because, as we saw, ∆R R, this conguration seldom, if ever, leads to
acceptable results, as VVoi will be nearly constant. That is why an alterna-
tive conguration, teh Wheatstone bridge, is used instead. There are
in fact three dierent variations, shown in Figure 13.17, depending on the
number of gauges used:
Wheatstone bridge: quar- In a quarter bridge, there is one gauge, and
ter bridge ( !
R
VA = Vi R+R+∆R 1 1
R
⇒ Vo = VB − VA = Vi −
VB = Vi R+R 2 2 + ∆R
R
∆R
Vo 2+ 2 1 ∆R
⇒ = R
− ≈ (13.6)
Vi ∆R ∆R 4 R
2 (2 + ) 2 (2 + )
| {zR } | {zR }
≈2 ≈2

Wheatstone bridge: half In a half bridge, there are two gauges, placed in such a way that
bridge one will be stretched and the other compressed; i.e. the variations of
resistance will be symmetrical. If the distance measured is the result
of bending a beam, that means that a gauge is placed on top and
another at the bottom. Then
( !
R−∆R
VA = Vi R−∆R+R+∆R 1 1 − ∆R R
R
⇒ Vo = VB − VA = Vi −
VB = Vi R+R 2 2
Vo 1 ∆R
⇒ = (13.7)
Vi 2 R
Wheatstone bridge: full In a full bridge, there are four gauges, placed in such a way that
bridge two will be stretched and two compressed:
( !
R−∆R
VA = Vi R−∆R+R+∆R 1 + ∆R
R 1 − ∆R
R
R+∆R
⇒ Vo = VB − VA = Vi −
VB = Vi R−∆R+R+∆R 2 2
Vo ∆R
⇒ = (13.8)
Vi R
Even with a Wheatstone bridge, the output voltage usually needs to be
signicantly amplied to be read by an AD converter.
13.2. WORKING PRINCIPLES OF POSITION SENSORS 249

(a) (b)

(c) (d)

Figure 13.17: A strain gauge needs to be used with other resistors. (a) Volt-
age divider, a very poor conguration because the output hardly changes. (b)
Wheastsone quarter bridge, with one gauge. (c) Wheatstone half bridge, with
two symmetrical gauges. (d) Wheatstone full bridge, with two pairs of symmet-
rical gauges.
250 CHAPTER 13. SENSORS

Figure 13.18: Measuring a distance using a laser triangulation sensor (source:


Wikimedia). When the object comes closer by a distance DZ , its image in the
light sensor moves by a distance Dz .

ˆ Laser sensors use a laser (Light Amplication by Stimulated Emission


of Radiation) beam to measure distance in one of two ways:

Pulses of light are emitted and reected in an object. The reected


light is called return, and detected; the time t between the emission
of the pulse and the detection of the return is given by c = dt , where
c is the speed of light and d the desired distance. This is the way
Lidar a lidar (LIght Detection And Ranging) works. Lidar sensors are
often used in autonomous vehicles, because they are fast (they have
a very large bandwidth) and can return distances for a wide range
of angles, allowing a 3D image of the environment to be built. They
are also used in cartography. In this case, the location and altitude
of an airplane carrying a lidar are found using a GPS (which we will
address below); the lidar gives the distance of the airplane to the
ground, once more sweeping a wide range of angles. Since the GPS
gives the altitude not in relation to the ground, but as a distance
to the centre of the Earth, the lidar readings can be used to build a
3D image of what the airplane is ying over. The range of distances a
lidar can measure varies signicantly; it can be of tens, hundreds, or
even thousands of meters. Larger ranges result in lower accuracies.
Laser triangulation The laser is emitted continuously, is reected, and detected. The
position where it is detected is related with the distance to the surface
as shown in Figure 13.18. This is called triangulation. The range
of lengths that can be measured in this way is smaller than that of
the lidar, but on the other hand an accuracy of almost 1 µm can be
obtained.

Ultrasound sensors ˆ Ultrasound sensors emit ultrasounds and measure the time it takes for
the echo to return. This may be done with a single transducer, that both
emits the ultrasound and measures the echo. In a way, they are similar
to a lidar, but using ultrasounds instead of laser pulses; this means that
the sensor works even when there is smoke or fog (environments that pose
problems to laser sensors), or when the material fails to reect a laser
beam because of being translucid. On the other hand, the range is usually
of at most a few meters only, and care must be taken because the speed
of sound is not constant (it depends on temperature and on other usually
less relevant factors).

Sonar ˆ A similar principle can be found in a sonar (SOund Navigation And


Ranging), that uses audible sound to measure underwater distances.

ˆ GNSS (Global Navigation Satellite Systems) deserve to be mentioned


here, though they are signicantly dierent from the precedent technolo-
gies and are used for dierent purposes. The better known GNSS is the
GPS GPS (Global Positioning System) of the government of the United States
13.2. WORKING PRINCIPLES OF POSITION SENSORS 251

Figure 13.19: Knowing one's distance to a point of known location (such as


a GPS satellite), we know we are on the surface of a sphere. Knowing one's
distance to two points of known location, we know we are on the intersection
of two spheres, i.e. on a circle (source: Wikimedia). Knowing one's distance
to three points of known location, the current location can be know precisely
if there are no errors in the distances or the positions of the spheres' centres
(source: Wikimedia). (In fact the intersection of three spheres leads to two
points, but the GPS receiver is presumed to be at the point closer to the Earth,
and not in outer space.) Knowing one's distance to more than three points
of known location allows a better reckoning of the current location using least
squares.

of America, though there are others, such as the European Union's Galileo,
and many are compatible with each other; in any case, GPS is often used
by synecdoche to design all GNSSs. These systems are based on satellites
orbiting the Earth, broadcasting radio signals that include the satellite's
location and the time, given by an atomic clock (this is a very simplied
description, but suces for our purpose). GPS receivers read these signals
and nd how much time the signal took to arrive; from this time t, the
distance d to the satellite is found as c = dt , where c is the speed of light.
Knowing the distance to several such satellites, and their position, the
current location is found as the point which is at the correct distance from
all the satellites (see Figure 13.19). Receiving four signals, it is possible to
correct the GPS receiver's clock (which is not as precise as the satellites'
clocks).
As to angular position sensors:
ˆ There is an additional sensor technology that measures angular position
only and deserves a mention. A resolver is similar to a transformer Resolver
(which we studied in Section 5.4), or, rather, to two transformers, with
the primary winding in a rotor, and two secondary windings in a stator
within which the rotor rotates. (Notice the dierence to a RVDT.) The
number of turns in the two secondary windings must be the same; the
number of turns in the primary winding can be dierent, but to simplify
we will assume that all windings have the same number of turns, and that
there are no losses.
The primary voltage VP is an AC voltage with a frequency ωI which must
be clearly above the frequency of rotation of the rotor:
VP (t) = A sin(ωI t) (13.9)
The two secondary windings make an angle of 90◦ with each other; see
Figure 13.20. When the primary is aligned with one of them, a voltage
equal to VP (t) will be induced in that winding, while the other one, being
perpendicular, will have no current whatsoever. When the rotor makes an
angle θ with one of the windings, the voltages will be
VS1 (t) = A cos θ sin(ωI t) (13.10)
VS2 (t) = A sin θ sin(ωI t) (13.11)
For this reason, the two stator windings are known as cos and sin wind-
ings. If the rotor rotates with a constant angular velocity θ̇, their voltages
252 CHAPTER 13. SENSORS

Figure 13.20: Left: the three windings of a resolver. Right: how the voltages
of the sin and cos windings change with time when the rotor rotates with a
constant angular velocity.

change as shown in Figure 13.20, and θ(t) is found as

VS2 (t)
θ(t) = arctan (13.12)
VS1 (t)

Because the signs of both the numerator and the denominator are known,
θ(t) can be found in any quadrant.
Clinometer ˆ Inclinometer or clinometer is a generic name for a sensor that measures
the inclination or tilt of a probe, either from the vertical or from the
horizontal. Any working principle for an angular position sensor will do, as
long as it can measure small angles with a reasonable precision; frequently,
servo accelerometers, addressed below in Section 13.3, are used.
Compass ˆ A compass is often employed with a GPS to know not only one's position,
but one's orientation as well. Most compasses make use of the Hall eect
(remember Figure 13.14).

13.3 Working principles of velocity and accelera-


tion sensors
Tachometers Only angular velocity sensors, known as tachometers, use some working prin-
ciples not yet addressed:
ˆ Some are DC generators, i.e. they are DC motors that, instead of trans-
forming electrical energy into movement, transform movement into a DC cur-
rent. We will address DC motors in Chapter 14.
Stroboscope ˆ A stroboscope is a ashing light. It is used to nd an angular velocity
in the following way:
The rotating body has one distinctive mark.
The frequency of the ashes ω is varied until the distinctive mark
seems to be stopped.
This means that, in period ω ,

the disc completed an integer number
of rotations.
The frequency of the ashes is increased until the highest value for
which the mark seems to be stopped. In this case, the disc will
ω , and its angular velocity is
complete only one rotation in period 2π
ω.
It is usual to check that this is the real period increasing the frequency
of the ashes to 2ω . The mark should then be seen twice, on opposite
sides of the rotating body. Notice that this test is not completely
conclusive. If during the suspected period 2πω the body completes
in fact an even number of rotations n, doubling the frequency we
will see in the new period ωπ a number of rotations n2 which is still
integer, and we will know that ω was not yet the angular velocity of
13.3. WORKING PRINCIPLES OF VELOCITY AND ACCELERATION SENSORS 253

Figure 13.21: Eddy currents in a disk induced by a magnet (source: Wikimedia).


If the disk rotates, and the magnet does not, it functions as a brake. If the
magnet rotates, it drags the disk along.

the rotating body. But if n is odd, say, equal to 3, in the new period
ω there will be 1.5 rotations, and the mark will be seen on opposite
π

sides of the body just as if ω were the actual angular velocity of the
rotating body. Thus, doubling ω should only be done when it is quite
certain that the body is rotating at most twice during period 2π ω .

ˆ Drag cup tachometers are based on eddy currents, already mentioned Drag cup
about eddy current sensors. While eddy current sensors use an AC elec-
tromagnet, so as to be able to measure the position of a target which did
not move, these tachometers use a permanent magnet that rotates with
the body whose angular velocity we want to measure. It is this rotation
that induces eddy currents in a metallic (usually aluminium) cup, within
which the magnet rotates. As mentioned, these currents themselves gen-
erate a magnetic eld; thus, there is a torque between the magnet and
the disk, proportional to the velocity of the magnet. In other words, the
rotation of the magnet drags the cup; it would cause it to rotate as well,
but the cup is connected to a rotational spring, that exerts a force propor-
tional to the angular position, as in (4.24). Thus, the cup will stop at an
angular position proportional to the angular velocity of the magnet. See
Figure 13.21.

The cup may be connected to a pointer (to show the velocity on a grad-
uated dial) or connected to a sensor of angular position. These sensors
were often used in cars, though nowadays less often. In a car, they can
be used to show the velocity of the vehicle (with the magnet connected
to the output of the gearing box, and thus rotating with the wheels) or
the velocity of the engine (with the magnet connected to the input of the
gearing box, and thus rotating with the engine).

Accelerometers, or acceleration sensors, use the following working princi-


ples:

ˆ This chapter is still being written.


254 CHAPTER 13. SENSORS

13.4 Sensors for force, binary, pressure and level

13.5 Sensors for ow and pressure in ows


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

13.6 Sensors for temperature and luminosity


This chapter is still being written.

13.7 Sensors for pH and concentration


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

Glossary
᾿Εὰν οὖν μὴ ειδῶ τὴν δύναμιν τῆς φωνῆς, ἔσομαι τῷ λαλοῦντι βάρβαρος
και ὁ λαλῶν ἐν ἐμοι βάρβαρος.

Saint Paul of Tarsus (5 BC? „67?), First Epistle to the Corinthians, xiv 11

anemometer anemómetro
encoder contador incremental
extensometer extensómetro
speedometer velocímetro

Exercises
1. According to European standards, car speedometers must never indicate
a speed below the actual speed, and the indicated speed must not exceed
the actual speed by more than 10% of the actual value plus 4 km/h.
(a) Let v be the actual speed and vm the indicated speed. Plot the
maximum and minimum admissible values of vm as functions of v ,
together in the same plot.
13.7. SENSORS FOR PH AND CONCENTRATION 255

Figure 13.22: Angular position measurement system from Exercise 2.

(b) Plot the maximum and minimum admissible values of v as functions


of vm , together in another dierent plot.

2. The angular position α in Figure 13.22 is measured using a laser sensor,


able to provide readings in the [100 mm, 200 mm] range, with a resolution
of 1 mm and a precision of 5 mm.

(a) What are the resolution and the precision in relation to the 100 mm
width of the measuring range?
(b) Show that the angular position α and the linear position x are related
by

d
tan α = (13.13)
x − x0

What are the values of d and x0 ?


(c) What are the maximum and minimum values of α that can be mea-
sured?
(d) Plot α(x) for the entire possible ranges of both variables.
(e) What is the precision in the measurement of α?
(f) What values can the resolution take?

3. The angular velocity ω of a rotating shaft is measured with an encoder


that provides 1024 pulses per rotation, connected to a counter that uses a
5 Hz sampling frequency. The shaft can rotate up to 7500 rpm.

(a) Show that the change ∆n of the counter reading between two suc-
cessive sampling instants is given by

∆n = b32.6ωc (13.14)

when ω is given in rad/s.


(b) Find the absolute value of the resolution of the angular velocity mea-
surement.
(c) Find the resolution in relation to the largest possible value of the
angular velocity.
(d) How many 4bit counters are needed to make up a counter that can
read all possible values?
(e) If only the rst 8 bits are considered, what will be the resolution of
the angular velocity measurement?
256 CHAPTER 13. SENSORS

Table 13.1: Three accelerometers for Exercise 4.


Servo Piezoelectric Piezoresistive
Range 10 g 10 g 10 g
Pass band 300 Hz [1 Hz, 10000 Hz] 1000 Hz
Sensibility 1 mA/g 0.1 V s2 /m 5 µV/V/g
Precision 10 g−4
0.5% 1%
Price 1800 ¿ 180 ¿ 500 ¿

Figure 13.23: Time responses from Exercise 5.

4. An accelerometer is needed to measure accelerations in an automobile, in


the [0 g, 2 g] range, with frequencies in the [0 Hz, 50 Hz] range, during
2 hours.
(a) Which of the three sensors in Table 13.1 would you choose, and why?
(b) The AD converter has 8 bits and an input in the [0 V, 5 V] range.
Assuming that the power supply for the sensor will be the 12 V DC
car battery, design the necessary signal conditioning.
(c) What will the resolution be?
(d) If data is recorded with a 250 Hz sampling frequency, how large will
be the le where measurements are recorded?
5. A velocity sensor was tested for three dierent constant speeds. The time
responses obtained are shown in Figure 13.23.
(a) Do these time responses support that the sensor measurement is lin-
ear?
(b) Find a suitable transfer function to model the sensor response.
6. An elevator comprises a 500 kg cabin, a 600 kg counterweight, and an
electrical motor to move the steel cable that connects them. A 280 Ω
extensometer, with sensibility δR
R = 2, mounted in a simple bridge pow-
ered at 24 V, measures the elastic deformation of the cable, given by (see
Figure 13.24)
F
ε= (13.15)
SE
where the cable's cross-section is S = 4 cm2 , and the Young modulus is
E = 1011 Pa. The objective is to detect a cargo above the maximum
admissible value of 150 kg.
(a) Draw a scheme of the signal conditioning described.
(b) With this signal conditioning, what will the sensibility be, in V/N?
(c) Design an additional signal conditioning element to sound a buzzer
when the cargo is too heavy.
13.7. SENSORS FOR PH AND CONCENTRATION 257

Figure 13.24: The elevator cable from Exercise 6.

7. The temperature of a motor can assume values in the [10◦ C, 180◦ C] range,
and is measured with an infrared sensor that works in the [−18◦ C, 538◦ C]
range. Its output is in the [0 V, 5 V] range, and its precision is given by

max {4◦ C, 2%TF } (13.16)

where TF is the temperature measured, in ◦ F.


(a) Find the relation between the sensor output e and the temperature
T.
(b) What is the sensor's sensibility?
(c) Given the range of temperatures being measured, what will be the
actual range of e?
(d) Plot the precision as function of TF , in ◦ F.
(e) Given the range of temperatures being measured, what will be the
maximum value of the error?
(f) The sensor is directly connected to an 8bit AD converter, that re-
ceives inputs in the [0 V, 5 V] range. Find the AD output as a
function of temperature.
(g) What will be the resolution of the measurement, in ◦ C?
(h) AD converter noise aects 3 LSB. What will be the precision of the
measurement, considering both conversion noise and sensor preci-
sion?
(i) The emissivity is 0.6, but estimated as 0.5. How will this aect
precision?
8. A sensor outputs a tension in the [0.2 V, 3.3 V] range, varying linearly
with the relative humidity in the [0%, 100%] range.
(a) Design the signal conditioning that will convert this output into the
[0 V, 1 V] range. Available tensions are 12 V, −12 V, and 5 V.
(b) This will be connected to a 10bit AD converter that receives tensions
in the [0 V, 1 V] range. What is the resolution of the measurement?
(c) The precision of the sensor is 1% or less. What is the precision of
the measurement, considering both the precision of the sensor and
the resolution of the AD converter?
(d) Figure 13.25 shows a control system of relative humidity H(s), where
Href (s) is the reference for humidity H(s), P (s) is a disturbance,
100
Gp (s) = s+100 is the process we want to control, Gs (s) is the sensor,
H(s)
and Gc (s) = s+10
10
is a controller. Find transfer function Href (s) , and
plot its Bode diagram.

9. What is the resolution of the position measurement depicted in Figure 13.4?


258 CHAPTER 13. SENSORS

Figure 13.25: Relative humidity control system from Exercise 8.


Chapter 14

Actuators
An engineer is a person who enjoys the feel of tools, the noise of
dynamos and smell of oil.

George Orwell (1903 „1950), Benet of Clergy: Some Notes on Salvador


Dali

This chapter is still being written.

14.1 Generalities about electric motors


AC, DC, power amplication.

14.2 DC motors
In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

14.3 AC motors
This chapter is still being written.

14.4 Generalities about pneumatic and hydraulic


actuators
In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

14.5 Pneumatic and hydraulic compressors and


motors
This chapter is still being written.

14.6 Cylinders and valves


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

259
260 CHAPTER 14. ACTUATORS

14.7 Dimensioning of pneumatic and hydraulic


circuits

Glossary
Os bos e xenerosos
a nosa voz entenden
e con arroubo atenden
o noso rouco son,
máis sóo os iñorantes,
e féridos e duros,
imbéciles e escuros
non os entenden, non.
Eduardo María González-Pondal Abente (1835 „1917), Queixumes dos
pinos, Os pinos
alternating current corrente alternada
brushless motor motor sem escovas
compressed air ar comprimido
compressor compressor
coreless motor motor sem núcleo
direct current corrente contínua
double acting valve, double action valve válvula de duplo efeito
power amplier amplicador de potência
stepper motor motor passo-a-passo

Exercises
1. We want to control the angular position of a brushless DC motor, with
the characteristics given in Figure 14.1. An 8-bit DA converter will be
used, with the characteristics given in Figures 14.2 and 14.3. The supply
voltage VDD of the DA converter will be the highest possible.
(a) The motor should turn in both senses, and consequently must re-
ceive a voltage in the range from −12 V to +12 V. Design a signal
conditioning to connect the output of the DA converter to the motor
input.
(b) Show how you could implement this signal conditioning using OpAmps.
Find reasonable values for resistors and other components you may
need. Assume that you have −12 V and +12 V available.
14.7. DIMENSIONING OF PNEUMATIC AND HYDRAULIC CIRCUITS 261

(c) Find the resolution of the control action in Volt, after the signal
conditioning.
(d) Tensions −12 V and +12 V correspond to the motor's nominal rota-
tion velocity of 6070 rpm shown in Figure 14.1 (in dierent senses of
rotation, of course). What is the resolution of the rotation velocity?
(e) When the DA converter's output is 01101001, what tension will be
supplied to the motor, and what will be its rotation speed?
(f) The angular position of the motor's shaft is being measured with
160 Hz noise. Design a rst order lter that brings the amplitude
of the noise down to 10% of its original value, with the smallest
possible attenuation to low frequencies two decades or more below
the frequency of the noise. (There is no need to show how the lter
could be implemented with OpAmps.)
(g) The DC motor takes a time interval τ to reach 95% of the expected
rotation velocity when there is a step in the tension supplied. Model
this dynamic behaviour with a rst order transfer function (with unit
gain at low frequencies).

Figure 14.1: Part of a DC motor's datasheet.

Figure 14.2: Part of a DA converter's datasheet.

Figure 14.3: Part of a DA converter's datasheet (continued).

2. To control the angular velocity of a shaft, its angular position is mea-


sured with an encoder. Figure 14.4 shows part of the encoder's manual.
The sampling frequency will be the highest supported by the enconder,
which is 1 kHz. The shaft is actuated by a brushed DC motor with the
characteristics shown in Figure 14.5.

(a) What values, in both degrees and radians, do the two resolutions
mentioned in Figure 14.4 correspond to?
(b) Which of the two resolutions allows reading a lower angular velocity
of the motor? Find the value of that velocity in radians per second.
262 CHAPTER 14. ACTUATORS

Figure 14.4: Part of an encoder's manual for Exercise 2.

Figure 14.5: Part of a brushed DC motor's manual for Exercise 2.

(c) The plot in Figure 14.4 shows the non-linearity of the sensor for
the worst situation that still respects alignment tolerance, when 256
counts per turn are selected. That largest absolute value of the angle
given in the plot correspond to how many LSB?
(d) For the rated angular velocity of the motor (do not confound this
with the angular velocity when there is no load), and for both res-
olutions mentioned in Figure 14.4, nd the change in the reading of
the encoder during a sample time.
(e) Between the DA converter providing the control action and the DC
motor, there is one of the two signal conditioning circuits in Fig-
ure 14.6. For each of the circuits, nd what is the largest voltage
that the DA can supply, without exceeding the nominal voltage at
the input of the motor. (Consider that the power amplier does not
change the voltage.)

3. A pneumatic double acting cylinder is used in a circuit with compressed


air at 10 bar. The inside diameter of the cylinder (i.e. the bore) is 5 cm.
The diameter of the rod is 1 cm.

(a) If this is a cylinder with a through rod, what force can it exert?
(b) If this cylinder does not have a through rod, what force can it exert?
14.7. DIMENSIONING OF PNEUMATIC AND HYDRAULIC CIRCUITS 263

Figure 14.6: Signal conditioning circuits for Exercise 2.


264 CHAPTER 14. ACTUATORS
Part IV

Control systems

265
267

The thought makes me feel old. I can remember when there wasn't
an automobile in the world with brains enough to nd its own way
home. I chaueured dead lumps of machines that needed a man's
hand at their controls every minute. Every year machines like that
used to kill tens of thousands of people.
The automatics xed that. A positronic brain can react much faster
than a human one, of course, and it paid people to keep hands o
the controls. You got in, punched your destination and let it go its
own way.
We take it for granted now, but I remember when the rst laws came
out forcing the old machines o the highways and limiting travel
to automatics. Lord, what a fuss. They called it everything from
communism to fascism, but it emptied the highways and stopped the
killing, and still more people get around more easily the new way.
Of course, the automatics were ten to a hundred times as expensive
as the hand-driven ones, and there weren't many that could aord
a private vehicle. The industry specialized in turning out omnibus-
automatics. You could always call a company and have one stop at
your door in a matter of minutes and take you where you wanted to
go. Usually, you had to drive with others who were going your way,
but what's wrong with that?

Isaac Asimov (1920 „1992), Sally, Fantastic, May-June 1953

In this part of the lecture notes:

Chapter 15 is about control strategies and controller structures, among which are PID
controllers and lead-lag controllers.

Chapter 16 presents the root locus plot, which is a tool to study closed loop control
systems, and how it can be used to design controllers.

Chapter 18 concerns the Nyquist stability criterion, which are another tool to study
closed loop control systems.

Chapter 17 addresses stability margins, yet another tool to study closed loop control
systems.

Chapter 19 shows the Nichols plot, a further tool for the study of closed loop control
systems.

Chapter 20 studies steady-state errors in closed loop control systems.

Chapter 21 systematically exposes methods to design controllers of the PID type.

Chapter 22 systematically exposes methods to design controllers of the lead-lag type.

Chapter 23 shows how to design controllers using the Internal Model Control method-
ology.

Chapter 24 introduces pure delay systems and the problem they cause to control.

Here is what you need to know beforehand to follow these chapters:

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4;

ˆ System theory, from Part II;

ˆ Filters, from Sections 12.2 and 12.3 of Chapter 12.


268
Chapter 15

Control strategies and


controller structures
Bon! Peut-être les Sélénites ont-ils poussé plus loin que vous le
calcul intégral! Et à propos, qu'est-ce que ce calcul intégral ?
C'est un calcul qui est l'inverse du calcul diérentiel, répondit
sérieusement Barbicane.
Bien obligé.
Autrement dit, c'est un calcul par lequel on cherche les quantités
nies dont on connaît la diérentielle.
Au moins, voilà qui est clair, répondit Michel d'un air on ne peut
plus satisfait.

Jules Verne (1828 „1905), Autour de la Lune, IV

In Chapter 9 we already studied the two basic congurations for control


systems:

ˆ open-loop control, in which there is no feedback of the output, and the


controller's input is the reference that the output must follow;

ˆ closed-loop control, in which there is output feedback, and the controller's


input is the closed-loop error between the reference and the output.

See Section 9.3 again, and in particular Figure 9.13. In this chapter we will
study what these congurations can do, and what controllers are used with
each.

15.1 Open loop control


Open loop control:

ˆ is conceptually simpler than closed loop control;

ˆ does not require a measurement of the output;

ˆ consequently, it can be implemented even when the output cannot be


measured, or is dicult or expensive to measure: no sensor for the output
variable is required to implement it;

ˆ can anticipate control actions if the reference is known in advance;

ˆ works well if two conditions are simultaneously met:

we know a perfect model of the plant;


there are no unknown disturbances (noise) of either the control action
or the output.

269
270CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

Figure 15.1: Open-loop control of (15.1) from Example 15.1.

Example 15.1. In the open-loop of Figure 9.13, let


0.1
G(s) = (15.1)
s2 + 1.5s + 1
C(s) = 10 (15.2)
Plant G(s) is an underdamped second order plant, with damping coecient
ξ = 0.75 and steady-state gain 0.1. Controller C(s) ensures that the steady-
state of the open-loop y(s)
r(s) is 1. Figure 15.1 shows how a reference consisting
of three steps is followed, together with the corresponding control action, which
should be always checked to see if control actions are not too large (remember
that actuators saturate).
This is what happens when the reference is known for the time instant when
Open-loop control when it must be applied. But suppose that the reference is known in advance. In this
the reference is known in case, the corresponding control action can begin before each step takes place.
advance The best way to do so is to schedule the control action beforehand; in this case,
C(s) does not receive the reference as an input, as it must be followed; it just
provides the control action chosen beforehand to follow the reference. Of course,
in closed-loop control this would make no sense, since the controller needs the
error, found from the current value of the output: and if the reference can be
known in advance, the output cannot. Figure 15.2 shows this new situation.
Open-loop control does not But,
work that well in practice
ˆ if the model of the plant is not perfect, or

ˆ if there is noise,

things do not work that well. And, most importantly, it is nigh to impossible
to control unstable plants in open loop.
Example 15.2. Consider the case of Example 15.1 again, with two changes:
ˆ Figure 15.3 shows what happens if there is an error identifying the plant:
in particular, a 10% error in the gain. Consequently,
0.11
G(s) = (15.3)
s2 + 1.5s + 1
but the controller remains the same. Notice that the output has steady-
state errors, but, since the controller does not receive any measurement
of the output (which may even not be measured at all), nothing is done
about it.
15.1. OPEN LOOP CONTROL 271

Figure 15.2: Open-loop control of (15.1) from Example 15.1, with an anticipated
control action.

Figure 15.3: Open-loop control of (15.1) from Example 15.1, when the plant is
known with a modelling error.
272CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

Figure 15.4: Open-loop control of (15.1) from Example 15.1, when the output
is aected by sinusoidal disturbance (15.4).

ˆ Figure 15.4 shows what happens if there is a disturbance: in particular,


an additive disturbance in the output dy ; see Figure 9.14. The actual,
disturbed output ỹ(t) is given by
π
ỹ(t) = y(t) + sin t (15.4)
| {z5 }
yd (t)

where y(t) is the output we expected. Again, because the controller does
not receive any measurement of the output, nothing is done about this
oscillation which appears in the output.

15.2 Closed loop control


Thanks to output feedback, closed loop control can mitigate the eects of noise
and wrong models.

Example 15.3. The underdamped second-order plant of Examples 15.1 and 15.2
can be controlled in closed-loop, as seen in Figure 9.13, with
30
C(s) = 55 + + 25s (15.5)
s
This is a type of controller that we will study later on in this chapter. For more
realistic simulations of performance, and for fairer comparison with open-loop
control, control actions were limited to the [−500, 500] interval. (The eects of
this saturation of the control action will be studied in depth in Chapter 28.)
Figures 15.5 and 15.6 show that:

ˆ in the absence of modelling errors or disturbances, faster responses are


now provided, albeit at the cost of a higher overshoot (overshoots vs. fast
responses are a frequent dilemma in closed-loop control, as we shall see in
the next chapters);

ˆ the eect of a 10% modelling error, that of (15.3), is nearly eliminated;

ˆ noise (15.4) is signicantly attenuated, even if not completely eliminated.


15.2. CLOSED LOOP CONTROL 273

Figure 15.5: Closed-loop control of (15.1) from Example 15.1

A closed loop can also stabilise unstable plants.


Example 15.4. In the closed-loop of Figure 9.13, let
1
G(s) = (15.6)
s−1
5
C(s) = 10 + (15.7)
s
Figure 15.7 shows the response of the closed-loop to the same step-wise reference
of the previous examples. We could have known that the closed-loop is stable,
even though the plant controlled is not, by nding its poles:

10 + 5s s−1
1
y(s)
=
1 + 10 + 5s s−1
1
r(s)
10s+5
s2 −s 10s + 5
= = (15.8)
1 + 10s+5
s2 −s
s2 + 9s + 5

The roots of the denominator are −8.4 and −0.6: the closed-loop is thereby
stable.
However, badly designed closed loop control can also make stable plants
unstable.
Example 15.5. In the closed-loop of Figure 9.13, let
1
G(s) = (15.9)
s3 + 4s2+ 6s + 4
C(s) = 25 (15.10)

The poles of G(s) are −2 and −1 ± j , and so the plant is stable; but the closed-
loop and its poles are
>> G = 1/((s+2)*(s+1+1i)*(s+1-1i));
>> closed_loop = feedback(25*G, 1)

closed_loop =

25
----------------------
274CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

Figure 15.6: Top: closed-loop control of (15.1) from Example 15.1, when the
plant is known with a modelling error. Bottom: the same, when the output is
aected by sinusoidal disturbance (15.4).
15.2. CLOSED LOOP CONTROL 275

Figure 15.7: Closed-loop control of (15.6) from Example 15.4.

s^3 + 4 s^2 + 6 s + 29

Continuous-time transfer function.

>> pole(closed_loop)

ans =

-4.2107 + 0.0000i
0.1054 + 2.6222i
0.1054 - 2.6222i

and thus the closed-loop is unstable, because of a badly designed controller.

Remark 15.1. Assuming that the controller of Example 15.5 is proportional, Routh-Hurwitz criterion
C(s) = K ∈ R, it is easy to use the Routh-Hurwitz criterion to nd which and proportional control
values of K would ensure a stable closed-loop:
K
y(s) 3 2
= s +4s +6s+4
r(s) 1 + s3 +4sK
2 +6s+4

K
= (15.11)
s3 + 4s2 + 6s + (4 + K)

s3 1 6
s2 4 4+K
4×6−(4+K) (15.12)
s 4
1 4+K

So as to have all the elements in the rst column positive,

24 − 4 − K
> 0 ⇒ K < 20 (15.13)
4
4 + K > 0 ⇒ K > −4 (15.14)

Consequently, in Example 15.5, controller C(s) = K = 25 caused an unstable


closed-loop, since the loop will be stable only if K ∈] − 4, 20[.
Also check Example 11.12 again.
276CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

Of course, unlike open-loop control, closed-loop control requires a measuring


chain for the feedback branch and, while it is possible to cope with noise,
noise still reduces performance, and completely wrong measurements prevent
control systems from working.

15.3 Design of open loop controllers


From Figure 9.13 it is clear that

y(s) = G(s)C(s)r(s) (15.15)

and thus if we want the output y(s) to follow the reference r(s) perfectly, i.e.
y(s) = r(s), all we have to do is
1
C(s) = (15.16)
G(s)
and perfect control is achieved.
Open-loop controller de- In practice things are not that simple. As we saw in Chapter 11, plant
sign in practice models ought to be strictly proper, i.e. to have more poles than zeros. If so,
applying (15.16) we get a controller C(s) which is not proper, i.e. has more zeros
than poles. This controller, as we know, has a behaviour at high frequencies
that is impossible. Consequently, additional poles must be added, so that C(s)
will be strictly proper, or at least proper. Ideally, additional poles should have
a frequency as high as possible, preferably higher than the frequency of every
zero and pole in G(s), so as to not alter the desired behaviour in the frequencies
where the model is valid (and in which the controller must thus do its job). Of
course, higher frequencies will mean faster responses, and faster responses mean
higher values of the control actions, so even if the actuator can respond fast
enough it may saturate if poles are too far away.
Example 15.6. Suppose that we want to control plant
s+1
G(s) = (15.17)
s(s + 10)
in open loop. It has one zero and two poles; so, if the controller is to be proper,
it needs an additional pole. One decade above the highest frequency zero or
pole would place it at 100 rad/s. But assume that control actions would be too
large, or that the actuator does not respond that fast, and we are left with
20s(s + 10)
C1 (s) = (15.18)
(s + 1)(s + 20)
or even with
10s
C2 (s) = (15.19)
s+1
which corresponds to an additional pole at 10 rad/s, which then cancels the
zero. Figure 15.8 shows the results obtained with both controllers when the
reference is the same of previous examples.
Combining open and It is possible to combine open-loop and closed-loop control in a single control
closed loop control system.
Example 15.7. Plant (15.17) from Example 15.6, with a 10% error in the
steady-state gain, can be controlled combining open-loop controller (15.19) with
a closed-loop proportional controller, as seen in Figure 15.9. The result, when
there is a sinusoidal output disturbance given by (15.4), is shown in Figure 15.10,
and is clearly better than results got with only one of the controllers, shown in
Figure 15.11.

15.4 Closed loop controllers


The design of closed loop controllers is not as trivial, and will occupy the re-
maining chapters of this Part. We will study right away the most common forms
that closed loop controllers take.
15.4. CLOSED LOOP CONTROLLERS 277

Figure 15.8: Closed-loop control of (15.17) from Example 15.6.

Figure 15.9: Simulink le with which simulation results in Figures 15.10
and 15.11 were obtained, corresponding to Example 15.7.
278CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

Figure 15.10: Control of (15.17) from Example 15.7, combining open-loop and
closed-loop control as seen in Figure 15.9.

P controllers ˆ Proportional controllers are already known to us. They apply a control
action

u(t) = K e(t), K 6= 0 (15.20)


⇒ u(s) = K e(s) (15.21)
u(s)
⇒ = C(s) = K (15.22)
e(s)

proportional to the loop error: the larger the error, the larger the control
action. Notice that a proportional controller is a static system.

PI controllers ˆ Proportionalintegral controllers apply a control action which is the


sum of two control actions:

one proportional to the loop error,


one proportional to the integral of the loop error:

Z t
u(t) = Kp e(t) + Ki e(t) dt, Kp , Ki 6= 0 (15.23)
0
Ki
⇒ u(s) = Kp e(s) + e(s) (15.24)
s
u(s) Ki
⇒ = C(s) = Kp + (15.25)
e(s) s

The reasoning behind this second term is that, in this way, if proportional
control achieves a steady-state error, since the integral of the error will
grow with time, the control action will also keep increasing, eliminating
the error. We will see in Chapter 20 when this actually works and when
it does not.

PD controllers ˆ Proportionalderivative controllers apply a control action which is


the sum of two control actions:

one proportional to the loop error,


one proportional to the derivative of the loop error:
15.4. CLOSED LOOP CONTROLLERS 279

Figure 15.11: Control of (15.17) from Example 15.7. Top: open-loop control
only. Bottom: closed-loop control only.
280CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

de(t)
u(t) = Kp e(t) + Kd dt, Kp , Kd 6= 0 (15.26)
dt
⇒ u(s) = Kp e(s) + Kd s e(s) (15.27)
u(s)
⇒ = C(s) = Kp + Kd s e(s) (15.28)
e(s)

The reasoning behind this second term is that, in this way, if there is a
sudden increase of the error, the control action will immediately increase
to counter it, rather than waiting for a large error (or, even worse, for a
large integral of the error) to do so. We will see in the next chapters when
this makes sense and when it does on.

PID controllers ˆ Proportionalintegralderivative controllers apply a control action


which is the sum of three control actions:
Z t
de(t)
u(t) = Kp e(t) + Ki e(t) + Kd dt (15.29)
0 dt
Ki
⇒ u(s) = Kp e(s) + e(s) + Kd s e(s) (15.30)
s
u(s) Ki
⇒ = C(s) = Kp + + Kd s (15.31)
e(s) s

This combines the desired advantages of both PI and PD control. Of


course,

proportional control is a particular case of PID control, in which


Ki = Kd = 0;
PI control is a particular case of PID control, in which Kd = 0;
PD control is a particular case of PID control, in which Ki = 0.
PID family ˆ The PID family of controllers includes not only
proportional controllers,
PI controllers,
PD controllers,
PID controllers,

but also similar controllers with more than one derivative part (though
this is seldom found) or (more often) more than one integral part, such as

PI2 D controllers:
Ki1 Ki2
C(s) = Kp + + 2 + Kd s (15.32)
s s

PI3 D controllers:
Ki1 Ki2 Ki3
C(s) = Kp + + 2 + 3 + Kd s (15.33)
s s s

PID2 controllers:
Ki
C(s) = Kp + + Kd1 s + Kd2 s2 (15.34)
s

and so on. We will see in Chapter 20 why additional integral parts may
be needed. Chapter 21 is devoted to design methods for the PID family
of controllers.

ˆ Lead-lag controllers have one pole, one zero, and a positive gain that
tends to zero at either low or high frequencies:

Lead controllers Lead controllers are given by


αs + a
C(s) = , α > 1, a > 0 (15.35)
s+a
15.4. CLOSED LOOP CONTROLLERS 281

controllers Lag controllers are given by


s+a
C(s) = , α > 1, a > 0 (15.36)
s + αa

So, both (15.35) and (15.36) correspond to particular cases of


s+b
C(s) = K (15.37)
s+p
with some restrictions on the parameters (gain K , pole −p, and zero −b).
We will see in Chapters 18 and 20 why we want these controllers, and
will learn how to design them in Chapter 22. In that Chapter we plot the
Bode diagrams of (15.35) and (15.36), and see that they have, respectively,
phases which are positive (lead) and negative (lag) hence the names.
In the following chapters we will see abundant examples of controllers of all
these types (and of other types too).
Meanwhile notice that Proper controllers have
additional poles
ˆ lead-lag controllers (15.35)(15.36) and PI controllers (15.25) are proper
but not strictly proper,
ˆ PD controllers (15.28) and PID controllers (15.31) are not proper,

and so all require additional poles to be implemented in practice. We will see


in Chapter 29 more details on this.

Glossary
I have remarked that the paper had fallen away in parts. In this
particular corner of the room a large piece had peeled o, leaving a
yellow square of coarse plastering. Across this bare space there was
scrawled in blood-red letters a single word:
rache

What do you think of that? cried the detective, with the air of a
showman exhibiting his show. This was overlooked because it was
in the darkest corner of the room, and no one thought of looking
there. The murderer has written it with his or her own blood. See
this smear where it has trickled down the wall! That disposes of the
idea of suicide anyhow. Why was that corner chosen to write it on?
I will tell you. See that candle on the mantelpiece. It was lit at the
time, and if it was lit this corner would be the brightest instead of
the darkest portion of the wall.
And what does it mean now that you have found it? asked Gregson
in a depreciatory voice.
Mean? Why, it means that the writer was going to put the female
name Rachel, but was disturbed before he or she had time to nish.
You mark my words, when this case comes to be cleared up you will
nd that a woman named Rachel has something to do with it. It's
all very well for you to laugh, Mr. Sherlock Holmes. You may be
very smart and clever, but the old hound is the best, when all is said
and done.
(. . . )
One other thing, Lestrade, he added, turning round at the door,
`Rache' is the German for `revenge,' so don't lose your time by
looking for Miss Rachel.

Sir Arthur Conan Doyle (1859 „1930), A study in scarlet, I3

lag controller controlador de atraso


lead controller controlador de avanço
lead-lag controller controlador de avanço-atraso
proportional controller controlador proporcional
282CHAPTER 15. CONTROL STRATEGIES AND CONTROLLER STRUCTURES

proportionalderivative controller controlador proporcionalderivativo


proportionalintegrative controller controlador proporcionalintegral
proportionalintegrativederivative controller controlador proporcional
integralderivativo

Exercises
1. A train can travel at a maximum speed of 115.2 km/h, and its maximum
acceleration is ±0.8 m/s2 .

(a) What is the minimum time that the train takes to travel between
two stations 6.4 km apart? Draw the evolution of velocity with time.
(b) Assume that larger accelerations (or decelerations) mean a larger
consumption of energy. (In fact things are more complicated in real
life.) If, due to timetable constraints, the train must take exactly
six minutes to travel between the same two stations, how should the
velocity change with time so that energy consumption is as low as
possible?
Chapter 16

Root locus
Minos' daughter Ariadne was among the spectators and she fell in
love with Theseus at rst sight as he marched past her. She sent
for Daedalus and told him he must show her a way to get out of the
Labyrinth, and she sent for Theseus and told him she would bring
about his escape if he would promise to take her back to Athens
and marry her. As may be imagined, he made no diculty about
that, and she gave him the clue she had got from Daedalus, a ball
of thread which he was to fasten at one end to the inside of the door
and unwind as he went on. This he did and, certain that he could
retrace his steps whenever he chose, he walked boldly into the maze
looking for the Minotaur.

Edith Hamilton (1867 „1963), Mythology, III 9

The root locus diagram:


ˆ shows the location (or locus) in the complex plane of the poles of a
closed loop (i.e. the roots of the denominator of the closed loop transfer
function),
ˆ when the gain of the open loop changes.
It can be used in one of the following situations (see Figure 16.1): What the root locus dia-
gram is for
ˆ to design a proportional controller,

ˆ to design the gain of a controller that has poles and zeros, once these are
known,
ˆ to see what happens to a closed loop control system with a known con-
troller, when the gain of the plant changes for some reason.
As we already saw, the location of the poles of the closed loop control system:
ˆ lets us know if it is stable (remember Section 10.3);

ˆ can give us an idea of how its time responses will be (remember Sec-
tion 11.6).

16.1 Simple examples


Example 16.1. Let plant y(s)
u(s) = 1
s+1 be controlled in closed loop by propor-
u(s)
tional controller e(s) = K . The closed loop transfer function is

K
y(s) K
= s+1K = (16.1)
r(s) 1 + s+1 s+1+K

and thus has always only one pole, located at

s = −1 − K (16.2)

283
284 CHAPTER 16. ROOT LOCUS

Figure 16.1: Situations in which the root locus diagram is useful. (a) The
plant G(s) is known. The controller K is proportional. We want to set a
reasonable value for K . (b) The plant G(s) is known. The controller K × C(s)
has known poles and zeros (collected in transfer function C(s)). We want to set
a reasonable value for controller gain K . (c) The controller C(s) is known. The
plant K × G(s) has known poles and zeros (collected in transfer function G(s)).
We want to know what happens when the gain of the plant K changes for some
reason. (Notice that in this case we cannot change K at will, otherwise it would
be part of the controller, not the plant.)
16.1. SIMPLE EXAMPLES 285

Table 16.1: Variation of the closed loop pole with open loop gain K in Exam-
ple 16.1.
K 5 4 3 2 1 0 −1 −2 −3 −4 −5
pole −6 −5 −4 −3 −2 −1 0 1 2 3 4

This pole will be stable if

s < 0 ⇔ −1 − K < 0 ⇔ K > −1 (16.3)

Notice that, if K = 0, the closed loop pole (16.2) will be K = −1, which is the
open loop pole too. But in that case the numerator of the closed loop (16.1) is
zero, the control action u(t) will be always zero, and the control system will not
work; there is not, properly speaking, a closed loop when K = 0.
We can give dierent values to K and nd the values for the closed loop
pole in Table 16.1, which are then plotted in Figure 16.2. Plotting more points
is easy using two for cycles in Matlab, one for positive and one for negative
values of K , with the result also shown in Figure 16.2:

G = tf(1,[1 1]);
% positive values of K
poles_closed_loop = [];
for K = 0 : 0.25 : 6
poles_closed_loop = [poles_closed_loop; pole(feedback(K*G, 1))];
end
figure, plot(real(poles_closed_loop), imag(poles_closed_loop), 'bx')
% negative values of K
poles_closed_loop = [];
for K = 0 : -0.25 : -6
poles_closed_loop = [poles_closed_loop; pole(feedback(K*G, 1))];
end
hold on, plot(real(poles_closed_loop), imag(poles_closed_loop), 'rx')
grid on, xlabel('Real axis'), ylabel('Imaginary axis'), legend({'K>0','K<0'})
Of course, the root locus diagram corresponds to an innitely small reso-
lution in K . This diagram shows what happens to the closed loop pole with the
variation of K . The last plot of Figure 16.2 was obtained with Matlab using
commands Matlab command
rlocus
>> s = tf('s');
>> figure,rlocus(1/(s+1))
>> hold on, rlocus(-1/(s+1),'g') % the 'g' option forces the green colour
>> legend({'K>0','K<0'})
Function rlocus always assumes a positive open loop gain K ; that is why it
was used twice, the second time with the minus sign inserted in the open loop
itself. For this simple open loop transfer function with only one pole, the root
locus could also have been easily plotted by hand from (16.2).

Example 16.2. Let plant y(s)


u(s) = 1
(s+4)(s+2) be controlled in closed loop by
u(s)
proportional controller e(s) = K . The closed loop transfer function is

K
y(s) 2 K
= s +6s+8K
= 2 (16.4)
r(s) 1 + s2 +6s+8 s + 6s + 8 + K

There are two poles, located at



−6 ± 36 − 32 − 4K √
s= = −3 ± 1 − K (16.5)
2
These poles verify the following:

ˆ If K = 0, they are those of the open loop, s = −3 ± 1 ⇔ s = −4 ∨ s = −2,


though once more the numerator of the closed loop (16.4) is zero, so there
is in fact no closed loop at all.
286 CHAPTER 16. ROOT LOCUS

y(s)
Figure 16.2: Top left: pole of the close loop consisting of plant u(s) 1
= s+1 and
a proportional controller K , for the cases in Table 16.1. Top right: the same,
calculated with for cycles for more values of K . Bottom: root locus diagram
of the plant.

ˆ If 0 < K < 1, they are real.

ˆ If K = 1, they coincide, s = −1.

ˆ If K > 1, they are imaginary, having a constant real part <(s) = −1;

ˆ If K < 0, they are real. If −3 + 1 − K > 0 ⇒ 1 − K > 9 ⇔ K < −8,
one of them will be positive.

These conclusions can be qualitatively seen in the root locus diagram, which
can be plot as

G = tf(1,conv([1 4],[1 2]));


% positive values of K
poles_closed_loop = [];
for K = 0 : 0.2 : 10
poles_closed_loop = [poles_closed_loop; pole(feedback(K*G, 1))];
end
figure, plot(real(poles_closed_loop), imag(poles_closed_loop), 'bx')
% negative values of K
poles_closed_loop = [];
for K = 0 : -0.2 : -10
poles_closed_loop = [poles_closed_loop; pole(feedback(K*G, 1))];
end
hold on, plot(real(poles_closed_loop), imag(poles_closed_loop), 'gx')
grid on, xlabel('Real axis'), ylabel('Imaginary axis'), legend({'K>0','K<0'})

or better still as

s = tf('s');
G = 1/((s+2)*(s+4));
figure,rlocus(G,-G)
legend({'K>0','K<0'})

and can be seen in Figure 16.3.


16.1. SIMPLE EXAMPLES 287

Table 16.2: Rules to plot the root locus of G(s)


m m−1
bm s + bm−1 s + . . . + b0
1. G(s) = must be proper, i.e. n ≥ m. Write its product by the varying gain K ∈ R
an sn + an−1 sn−1 + . . . + a0
in the form
K bm (s − z1 ) . . . (s − zm )
KG(s) = , K∈R (16.6)
an (s − p1 ) . . . (s − pn )

Two cases must be considered, corresponding to Kabnm > 0 and Kabnm < 0.
2. Plot the n open loop poles on the complex plane using a cross ×, and the m open loop zeros using a circle ◦.
3. The root locus diagram is symmetric in relation to the real axis.
4. If n − m ≥ 2, the centroid of the root locus is constant, irrespective of the value of K .
5. Points on the real axis belong to the root locus

ˆ if there is an odd number of open loop poles and zeros to its right, and Kabm > 0;
ˆ if there is an even number of open loop poles and zeros to its right, ornno poles and zeros at all, and
K bm
an < 0.
6. The diagram has n branches, each of which corresponds to a closed loop pole.
7. All branches converge to the open loop poles when K → 0.
8. m branches converge to the open loop zeros when |K| → ∞.
9. n − m branches diverge to innity when |K| → ∞, following asymptotes that make with the positive real axis
angles of

180◦ (2k + 1) K bm


 , k = 0, . . . , n − m − 1, if >0
γ = 360n◦ k− m K bm
an (16.7)
, k = 0, . . . , n − m − 1, if <0


n−m an
and intersect on the real axis at point
n
X m
X
pk − zk
k=1 k=1
σ= (16.8)
n−m
10. The branches of the root locus converge or diverge on the real axis, perpendicularly thereto, at the real roots of

d 1 d (s − p1 ) . . . (s − pn )
=0⇔ =0 (16.9)
ds G(s) ds (s − z1 ) . . . (z − zm )
11. In the neighbourhood of a complex open loop pole pi , branches have an asymptote with an angle φi given by
m n
X X K bm
− φk + 180◦ , if


 ψ k >0


k=1 an
k=1

k6=i
φi = X m n (16.10)
X K bm
if


 ψ k − φ k , < 0
an



k=1 k=1
k6=i

where

φk = ∠[pi − pk ], k = 1, . . . , n, k 6= i (16.11)
ψk = ∠[pi − zk ], k = 1, . . . , m (16.12)

as seen in Figure 16.4.


12. In the neighbourhood of a complex open loop zero zi , branches have an asymptote with an angle ψi given by
 n m
X X K bm
− ψk + 180◦ , if


 φ k >0


k=1 an
k=1

k6=i
ψi = X m m (16.13)
X K bm
ψk , if


 φk − <0
an



k=1 k=1
k6=i

where

φk = ∠[zi − pk ], k = 1, . . . , n (16.14)
ψk = ∠[zi − zk ], k = 1, . . . , m, k 6= i (16.15)

as seen in Figure 16.4.


288 CHAPTER 16. ROOT LOCUS

Figure 16.3: Left: root locus of 1


(s+4)(s+2) obtained with for cycles. Right: the
same, obtained with rlocus.

Figure 16.4: Measuring the angles for rules 11 and 12 from Table 16.2.

16.2 Rules for the root locus


Root locus diagrams can be easily found with Matlab, but it is also possible
to draw them by hand. Drawing root locus diagrams by hand is as important
as drawing Bode diagrams by hand: of course both can be accurately found
using Matlab, but hand-drawn diagrams help to gain sensibility to the eects
of poles and zeros and of their location in the complex plane.
We present a systematic set of rules to draw root locus diagrams in Ta-
ble 16.2, together with some simple examples. In the next section, we will see
where these rules come from.
Example 16.3. Consider plant
20
G(s) = (16.16)
s2 + 2s + 2
To plot its root locus by hand, we follow the steps in Table 16.2:
1. We rewrite the open loop transfer function as G(s) = 20K (s+1+j)(s+1−j)
1
.
The two cases we must consider are 20K > 0 ⇔ K > 0 and 20K < 0 ⇔
K < 0.
2. There are n = 2 poles, a complex conjugate pair at −1 ± j . There are no
zeros, i.e. m = 0.
3. We know that the diagram is always symmetric in relation to the real axis.
16.2. RULES FOR THE ROOT LOCUS 289

4. Because n − m = 2, the centroid will be constant. So, when a closed loop


pole moves in one direction, the other must move in the same direction
but in the opposite sense, so that the centroid remains the same.
5. Real points to the right of s = −1 have no open loop poles to their right,
i.e.
∀s > −1, s > <(p1 ) ∧ s > <(p2 ) (16.17)
Consequently, that part of the real axis belongs to the root locus when
K < 0. Real points to the left of s = −1 have two open loop poles to their
right, i.e.
∀s < −1, s < <(p1 ) ∧ s < <(p2 ) (16.18)
Since 2 is an even number, that part of the real axis also belongs to the
root locus when K < 0. No part of the real axis belongs to the root locus
when K > 0. We can now draw the rst, incomplete sketch of the root
locus diagram in Figure 16.5.
6. The diagram has n = 2 branches, i.e. the closed loop has 2 poles.
7. Both branches converge to −1 ± j when K → 0.
8. Since there are no open loop zeros, no branches of the root locus converge
to them.
9. n − m = 2 branches, i.e. both of them, diverge to innity when K is large.
When K > 0, they follow asymptotes with slopes given by the angles
180◦ (2 × 0 + 1)
γ0 = = 90◦ (16.19)
2
180◦ (2 × 1 + 1)
γ1 = = 270◦ ≡ −90◦ (16.20)
2
It would have suced to nd γ0 = 90◦ ; since the root locus is symmetric
in relation to the real axis, the other angle would have to be −90◦ . When
K > 0, the asymptotes correspond to angles
360◦ × 0
γ0 = = 0◦ (16.21)
2
360◦ × 1
γ1 = = 180◦ (16.22)
2
These asymptotes are already in the plot, as they are in fact the real axis
itself. Asymptotes pass through the real point
−1 + j − 1 − j
σ= =1 (16.23)
2
Notice that we might have considered only the real parts; the imaginary
parts are bound to cancel out. We now know that the vertical asymptotes,
the ones with the angle ±90◦ for K > 0, pass through σ = −1. We know
enough to draw the complete root locus diagram in Figure 16.5. Mind the
arrows indicating the increasing values of K .
10. It is obvious that the point of divergence on the real axis is −1, but we
can conrm this calculating
d s2 + 2s + 2
= 0 ⇔ 2s + 2 = 0 ⇔ s = −1 (16.24)
ds 20
11. It also obvious that the branches arrive at the complex conjugate open
loop poles when K → 0− and leave them when K increases from 0 with
vertical asymptotes (after all, the vertical asymptotes for K → +∞ pass
right through the open loop poles themselves). But we can conrm this as
follows: let p1 = −1−j and p2 = −1+j ; then the angles of the asymptotes
aroung p2 are found as
(
φ2 = 180◦ − 90◦ = 90◦ , K > 0

φ1 = 90 ⇒ (16.25)
φ2 = −90◦ , K < 0
290 CHAPTER 16. ROOT LOCUS

Figure 16.5: Root locus of (16.16) from Example 16.3. Left: incomplete sketch
after step 5. Right: complete sketch after step 9.

Because of the symmetry, we can tell right away that


(
φ1 = −90◦ , K > 0
(16.26)
φ1 = 90◦ , K < 0

12. There are no complex conjugate open loop poles, so this rule does not
apply.
It is clear from the root locus that
ˆ G(s) can be controlled in closed loop with a proportional controller K > 0,
being always stable;
ˆ there will always be oscillations in the controlled system, since the closed
loop poles will always be complex;
ˆ the larger the value of K , the more oscillations the controlled system will
have;
ˆ a negative proportional controller may result in real poles, if K is negative
enough;
ˆ however, for values of K which are negative and very large, the controlled
system will become unstable, since one of the closed loop poles will be
positive. We can nd the value of K below which the closed loop is
unstable applying to the closed loop transfer function
20K
y(s) 2
= s +2s+2
20K
r(s) 1 + s2 +2s+2
20K
= (16.27)
s2 + 2s + (2 + 20K)
the Routh-Hurwitz criterion:
s2 1 2 + 20K
s 2 (16.28)
1 2 + 20K

We see that the closed loop is stable if

2 + 20K > 0 ⇔ K > −0.1 (16.29)

ˆ for this gain value K = −0.1 which makes the closed loop marginally
stable, there will be a pole at s = 0.

Example 16.4. The root locus of plant


s+4
G(s) = (16.30)
(−s + 1)(s + 3)(s2 + 4s + 8)
is found as follows.
16.2. RULES FOR THE ROOT LOCUS 291

1. We rewrite the open loop transfer function as


s+4
G(s) = −K (16.31)
(s − 1)(s + 3)(s + 2 + 2j)(s + 2 − 2j)
The two cases we must consider are −K > 0 ⇔ K < 0 and −K < 0 ⇔
K > 0. Notice how the unstable pole causes the two cases to switch in
what the sign of K is concerned.
2. There are n = 4 poles, one unstable at s = 1, a stable real pole at s = −3,
and a pair of complex conjuate stable poles ate s = −2 ± 2j . There is
m = 1 zero, which is a mininum phase zero, at s = −4.
3. We know that the diagram is always symmetric in relation to the real axis.
4. Because n − m = 3, the centroid will be constant. So, when a closed loop
pole moves in one direction, the others must move in such a way that the
centroid remains the same.
5. Real points verify the following:
ˆ Those to the right of s = 1 have no open loop poles to their right, so
that part of the real axis belongs to the root locus when −K < 0 ⇔
K > 0.
ˆ Those in ] − 2, 1[ have one open loop pole to their right, so as 1
is odd that part of the real axis belongs to the root locus when
−K > 0 ⇔ K < 0.
ˆ Those in ] − 3, −2[ have three open loop poles to their right, so as 3
is odd that part of the real axis also belongs to the root locus when
−K > 0 ⇔ K < 0.
ˆ Those in ] − 4, −3[ have four open loop poles to their right, so as
4 is even that part of the real axis belongs to the root locus when
−K < 0 ⇔ K > 0.
ˆ Those to the left of s = −4 have to their right four open loop poles
and one open loop zero, so as the total 5 is odd that part of the real
axis belongs to the root locus when −K > 0 ⇔ K < 0.
6. The diagram has n = 4 branches, i.e. the closed loop has 4 poles.
7. The four branches converge to the open loop poles s = 1, s = −3, s =
−2 ± 2j when K → 0.
8. One of the branches will converge to the open loop zero s = −4 when
|K| → ∞. Since the zero is real, this convergence is already shown in the
sketch above.
9. n − m = 3 branches diverge to innity when K is large. When K > 0,
they follow asymptotes with slopes given by the angles
360◦ × 0
γ0 = = 0◦ (16.32)
2

360 × 1
γ1 = = 120◦ (16.33)
3

360 × 2
γ2 = = 240◦ ≡ −120◦ (16.34)
3
Notice that, because the root locus is symmetric in relation to the real
axis, it suces to nd the angles between 0◦ and 180◦ ; the others are
symmetric. When K < 0,
180◦ (2 × 0 + 1)
γ0 = = 60◦ (16.35)
3
180◦ (2 × 1 + 1)
γ1 = = 180◦ (16.36)
3
and of course γ2 = −60◦ ≡ 300◦ . Asymptotes pass through the real point
1 − 3 − 2 − 2 − (−4) 2
σ= =− (16.37)
3 3
We can now draw the rst, incomplete sketch of the root locus diagram
in Figure 16.6.
292 CHAPTER 16. ROOT LOCUS

10. The points of divergence or convergence on the real axis are found solving

−s4 −6s3 −13s2 −4s+24


z }| {
d (−s + 1)(s + 3)(s2 + 4s + 8)
=0
ds s+4
(−4s3 − 18s2 − 26s − 4)(s + 4) + s4 + 6s3 + 13s2 + 4s − 24
⇔ =0
(s + 4)2
−3s2 − 28s3 − 85s2 − 104s − 40
⇔ =0
(s + 4)2
(16.38)

This is too dicult to solve anallytically, but we can make

>> roots([3 28 85 104 40])

ans =

-4.8449 + 0.0000i
-1.8950 + 0.5908i
-1.8950 - 0.5908i
-0.6985 + 0.0000i

Only the real roots matter, viz. −4.8449 and −0.6985.

11. Let p1 = 1, p2 = −2 + 2j , p3 = −2 − 2j , p4 = −3 and z1 = −4. See


Figure 16.7. The angles of the asymptotes aroung p2 are found as

φ1 = 180◦ − arctan 23 = 146.3◦





= 90◦

φ
3


 φ4 = arctan 21 = 63.4◦
ψ1 = arctan 22 = 45◦

(
φ2 = 45◦ − 146.3◦ − 90◦ − 63.4◦ = −254.7◦ ≡ 105.3◦ , K > 0

φ2 = −254.7◦ + 180◦ = −76.7◦ , K < 0
(16.39)

Because of the symmetry, we can tell right away that


(
φ3 = −105.3◦ , K > 0
(16.40)
φ3 = 76.7◦ , K < 0

12. There are no complex conjugate open loop poles, so this rule does not
apply. With all we know, the second diagram in Figure 16.6 can now be
drawn.

It is clear from the root locus that

ˆ G(s) can be controlled in closed loop with a proportional controller K ;

ˆ when K > 0, the control loop is always unstable;

ˆ when K < 0 is close to 0, the control loop is also unstable;

ˆ when K < 0 is very large, the control loop is unstable too;

ˆ when the control loop is stable, there may be two complex conjugate
dominant poles, resulting in an oscillating response, or one real dominant
pole;

ˆ even when there is a real dominant pole, there will be complex conjugate
poles;
16.2. RULES FOR THE ROOT LOCUS 293

Figure 16.6: Root locus of (16.30) from Example 16.4. Left: incomplete sketch
after step 9. Right: complete sketch after step 11.

ˆ the control loop will be stable only for an interval of negative values of K ,
that can be found applying to the closed loop transfer function
K(s+4)
y(s) 4 3 2 −4s+24
= −s −6s −13s
K(s+4)
r(s) 1 + −s4 −6s3 −13s2 −4s+24
Ks + 4K
=
−s4 − 6s3 − 13s2 − 4s + 24 + Ks + 4K
−Ks − 4K
= 4 3 2
(16.41)
s + 6s + 13s + s(4 − K) + (−4K − 24)

(in which we took the care of letting the rst coecient of the denominator
be positive) the Routh-Hurwitz criterion:

s4 1 13 −4K − 24
s3 6 4−K
s2 13 + K−4
6 −4K − 24 (16.42)
4K+24
s 4 − K + 6 13+ K−4
6
1 −4K − 24

For stability, the entire rst column must have the same sign (in this case,
positive), and so

K−4
13 + 6 > 0

4K+24
4 − K + 36 78+K−4 >0

−4K − 24 > 0


K − 4 > −78

⇒ (−K+4)(K+74)+144K+864
K+74 >0

4K < −24


K2> −74

⇒ K −74K−1160
K+74 <0

K < −6


K > −74

⇒ −13.3 < K < 87.3 ⇒ −13.3 < K < −6 (16.43)

K < −6

Notice that these negative values of K , replaced in the closed loop (16.41),
result in a positive steady state value;
ˆ when K = −6, the marginally stable closed loop has a pole at s = 0;

ˆ when K = −13.3, the closed loop has two imaginary poles s = ±jω .

Example 16.5. In the previous example, it may be interesting to know where


exactly does the root locus cross the imaginary axis, i.e. the value of ω > 0 for
the closed loop poles s = ±jω when K = −13.3. This can be found from the
294 CHAPTER 16. ROOT LOCUS

Figure 16.7: Angles needed for the root locus of (16.30) from Example 16.4.

Figure 16.8: Step response of the marginally stable closed loop consisting in
plant (16.30) controlled with K = −13.3, from Example 16.5.

denominator of the closed loop (16.41), which must be zero at these poles. If
we replace K = −13.3 and s = jω , and equal to zero:
(jω)4 + 6(jω)3 + 13(jω)2 + jω(4 + 13.3) + (−4(−13.3) − 24) = 0
⇔ω 4 − j6ω 3 − 13ω 2 + j17.3ω + 29.2 = 0
(
ω 4 − 13ω 2 + 29.2 = 0

−6ω 3 + 17.3ω = 0
( √
ω 2 = 13± 169−4×29.2
2

ω = 0 ∨ −6ω 2 + 17.3 = 0
(
ω 2 = 10.1 ∨ ω 2 = 2.9

ω = 0 ∨ ω 2 = 2.9
(
ω = 3.2 ∨ ω = 1.7
⇔ (16.44)
ω = 0 ∨ ω = 1.7
Thus, when K = −13.3 the root locus crosses the imaginary axis at s = ±1.7j ,
as shown in Figure 16.6. The interest of knowing this is that, as we saw in
Chapter 10, this ω is the frequency of an oscillation. The oscillation is that of
the step response of the closed loop, which is marginally stable (since it has no
unstable poles, and two poles on the imaginary axis). If we make
figure,step(feedback(-13.3 * (s+4)/( (-s+1)*(s+3)*(s^2+4*s+8) ), 1), 25)
we get the response in Figure 16.8. The frequency of the oscillation is, as
expected,

ω= = 1.7 rad/s (16.45)
24.4 − 20.7

16.3 Proofs of rules for the root locus


We now establish the results we used in the last section and incidentally meet
the important concept of characteristic equation.
16.3. PROOFS OF RULES FOR THE ROOT LOCUS 295

Theorem 16.1. The root locus diagram is symmetric in relation to real axis.
Proof. This is a consequence of poles being either real or pairs of complex con-
jugates, as we saw in Section 9.1.
Denition 16.1. Given a plant with transfer function Characteristic equation

N (s)
G(s) = (16.46)
D(s)
where N (s) and D(s) are polynomials in s, the equation D(s) = 0, the roots of
which are the poles of G(s), is called characteristic equation.
Corollary 16.1. Let the direct branch of any of the closed loop control systems
in Figure 16.1 be K N (s)
D(s) , where K is the varying gain and polynomials N (s) and
D(s) collect the zeros and the poles. Since the transfer function of the closed
loop is
y(s) KN (s)
D(s)
= (16.47)
r(s) 1+KN (s)
D(s)
the characteristic equation of the closed loop is Closed loop characteristic
equation
N (s)
1+K =0 (16.48)
D(s)
which can also be written in any of the following forms:
D(s) + KN (s) = 0 (16.49)
N (s)
K = −1 (16.50)
D(s)
|N (s)|

|K|
 =1
|D(s)| (16.51)
∠ K N (s) = π + 2kπ, k ∈ Z

D(s)
In what follows we always presume that the open loop transfer function
KN (s)
D(s) is proper, i.e. that the order n of polynomial N (s) is not larger than
the order m of polynomial D(s), i.e. that there are not more zeros than poles
(remember Denition 9.1 and the discussion about the number of poles and
zeros in Section 11.4). Also let
N (s) = bm sm + bm−1 sm−1 + . . . + b0
= bm (s − z1 ) . . . (s − zm ) (16.52)
n n−1
D(s) = an s + an−1 s + . . . + a0
= an (s − p1 ) . . . (s − pn ) (16.53)
where z1 , . . . , zm are the zeros of the open loop, and p1 , . . . , pn the poles.
Theorem 16.2. Points s on the real axis that are not zeros of G(s) belong to
the root locus
ˆ if there is an odd number of open loop poles and zeros to its right, and
Kbm > 0;
an
ˆ if there is an even number of open loop poles and zeros to its right, or no
poles and zeros at all, and Kb
an < 0.
m

The phase condition of (16.51) can be written as


Proof.

bm (s − z1 ) . . . (s − zm )
∠ K = π + 2kπ
an (s − p1 ) . . . (s − pn )
∈R
z }| {
Kbm
⇔∠ + ∠[s − z1 ] + . . . + ∠[s − zm ] − ∠[s − p1 ] − . . . − ∠[s − pn ] = π + 2kπ
an

Kbm
⇔∠[s − z1 ] + . . . + ∠[s − zm ] − ∠[s − p1 ] − . . . − ∠[s − pn ] = −∠ +π + 2kπ
an
| {z }
either 0 or ±π
(16.54)
296 CHAPTER 16. ROOT LOCUS

Let s be real. As we know, poles and zeros may either be real or appear as
complex conjugates:
ˆ When a zero zi or pole pi is real, the angle ∠[s − zi ] or ∠[s − pi ] is either
0 or ±π .
It will be 0 if s − zi > 0 ⇔ s > zi or s − pi > 0 ⇔ s > pi , i.e. if the
pole or zero lies to the left of s.
It will be ±π if s − zi < 0 ⇔ s < zi or s − pi < 0 ⇔ s < pi , i.e. if the
pole or zero lies to the right of s. Notice that it is irrelevant whether
we are talking about a pole or a zero, since +π ≡ −π .
ˆ When there is a pair of complex conjugate poles or zeros, since s is real
and thus s = s, the angles must always cancel out:

∠[s − zi ] + ∠[s − zi ] = ∠[s − zi ] + ∠[s − zi ]


= ∠[s − zi ] − ∠[s − zi ] = 0 (16.55)
−∠[s − pi ] − ∠[s − pi ] = −∠[s − pi ] − ∠[s − pi ]
= −∠[s − pi ] − (−∠[s − pi ]) = 0 (16.56)

(This is graphically represented in Figure 16.9, since each of the terms s − z1


to s − pn , which is a complex number, can also be thought of as a vector on
the complex plane.) Thus, complex conjugate zeros and poles are irrelevant for
(16.54), and each real zero or pole to the right of s contributes with a phase of
±π . So:
Kb Kbm = 0, and (16.54) becomes
h i
ˆ If a m > 0, then −∠ an
n

∠[s − z1 ] + . . . + ∠[s − zm ] − ∠[s − p1 ] − . . . − ∠[s − pn ] = π + 2kπ


(16.57)

There must be an odd number of real zeros and poles to the right of s, if
s is to belong to the root locus.
Kb Kbm = ±π , and (16.54) becomes
h i
ˆ If a m < 0, then −∠ a
n n

∠[s − z1 ] + . . . + ∠[s − zm ] − ∠[s − p1 ] − . . . − ∠[s − pn ] = 2kπ (16.58)

There must be an even number of real zeros and poles to the right of s, if
s is to belong to the root locus.
Because adding 2 to an odd number results in an odd number, and adding 2 to
an even number results in an even number, the total number of zeros and poles
can be considered; pairs of complex conjugates change nothing just the same.
We have shown when s may belong to the root locus because the phase
condition of (16.51) is fullled. But, if the phase condition is fullled, the gain
condition of (16.51) is fullled making
|D(s)|
|K| = (16.59)
|N (s)|
which is always possible as long as N (s) 6= 0.

Theorem 16.3. The number of poles of the closed loop is the number of poles
of the open loop n.
Proof. Since we assumed that m ≤ n, and K is a scalar, the polynomial in the
left member of (16.49) is of order n.
Theorem 16.4. When K → 0, the poles of the closed loop converge to the
poles of the open loop, i.e. the roots of D(s).
Proof. When K → 0, (16.49) becomes D(s) = 0.
Theorem 16.5. When K → ±∞, m closed loop poles converge to the zeros
of the open loop, i.e. the roots of N (s), and n − m closed loop poles diverge to
innity.
16.3. PROOFS OF RULES FOR THE ROOT LOCUS 297

Figure 16.9: Diagrams to illustrate the proof of Theorem 16.2. Left: s has all
the open loop zeros and poles to its left. Right: some open loop zeros and poles
are on the right side of s, some on the left.

Proof. When K → ±∞, (16.49) can be approximated by N (s) = 0. So the


roots of N (s), i.e. the zeros of the open loop, will be roots of the closed loop.
If n = m, this accounts for all the closed loop poles. If the open loop is
strictly proper, there will be n − m closed loop poles unaccounted for. In that
case, the characteristic equation (16.49) becomes

an sn + . . . + am+1 sm+1 + am sm + . . . + a0 + Kbm sm + . . . + Kb0 = 0


⇔ an sn + . . . + am+1 sm+1 + (am + Kbm )sm + . . . + a0 + Kb0 = 0
⇔ an sn + . . . + am+1 sm+1 = −(am + Kbm )sm − . . . − (a0 + Kb0 )
(16.60)

Since |K| → +∞, the right member is diverging to innity. The only way the
left member is also diverging to innity is |s| → +∞. (Notice that s is complex
and may be diverging to innity in any direction.)
Theorem 16.6. The n − m closed loop poles diverging to innity have asymp-
totes making with the positive real axis angles given by

π(2k + 1) Kbm
 n − m , if a > 0


n
(16.61)
if Kb

 2kπ ,
 m
n−m an < 0
Proof. Since |s| ← ∞,

N (s) bm sm + bm−1 sm−1 + . . . + b0


lim K = lim K
|s|→∞ D(s) |s|→∞ an sn + an−1 sn−1 + . . . + a0
Kbm (s − z1 ) . . . (s − zm )
= lim
|s|→∞ an (s − p1 ) . . . (s − pn )
Kbm sm Kbm 1
= lim = lim (16.62)
|s|→∞ an sn |s|→∞ an sn−m

The phase condition of (16.51) becomes



Kbm 1
∠ = π + 2kπ, k ∈ Z
an sn−m

Kbm
⇔∠ −(n − m)∠s = π + 2kπ, k ∈ Z (16.63)
an
| {z }
either 0 or π

If Kbm
an > 0, its contribution for the phase is 0, and we get

π + 2kπ π(2k + 1)
∠s = − = , k∈Z (16.64)
n−m n−m
298 CHAPTER 16. ROOT LOCUS

If Kbm
an < 0, its contribution for the phase is π , and we get instead
2kπ 2kπ
∠s = − = , k∈Z (16.65)
n−m n−m

Theorem 16.7. The branches of the root locus converge or diverge on the real
axis at the real roots of
d (s − p1 ) . . . (s − pn )
=0 (16.66)
ds (s − z1 ) . . . (z − zm )
Proof. When the branches converge or diverge, the real point s where they do
so will correspond to either a maximum or a minimum value of K on the real
axis. Indeed, if we move along the real axis with K increasing, and reach a
point of divergence s, then K will increase along branches that are no longer
real, and to the other side of s gain K will now decrease. And, if we move along
the real axis with K decreasing, and reach a point of convergence s, then K will
decrease along branches that are no longer real, and to the other side of s gain
K will now increase. This is clear by looking at any root locus diagram where
such points exist.
Consequently, if K has a local maximum or minimum for a certain real point
ds = 0. Using (16.50),
s, then dK
D(s)
K=− ⇒
N (s)

dK d D(s) d D(s)
= − = =0 (16.67)
ds ds N (s) ds N (s)
Theorem 16.8. Rules 11 and 12 from Table 16.2 hold.
Proof. Let s be a point of the root locus in the vicinity of pole pi , i.e. we make
s → pi . We take the limit of the phase condition of (16.51)

K bm (s − z1 ) . . . (s − zm )
lim ∠ = π + 2kπ, k ∈ Z (16.68)
s→pi an (s − p1 ) . . . (s − pn )
which becomes (dropping the 2kπ periodicity)
either 0 or ±π
z }| { ∠[pi −z1 ]=ψ1 ∠[pi −zm ]=ψm
Kbm z }| { z }| {
∠ + lim ∠[s − z1 ] + . . . + lim ∠[s − zm ]
an s→pi s→pi

− lim ∠[s − p1 ] − . . . − lim ∠[s − pi ] − . . . − lim ∠[s − pn ] = 0 (16.69)


s→pi s→pi s→pi
| {z } | {z } | {z }
∠[pi −p1 ]=φ1 φi ∠[pn −p1 ]=φn

Solving for φi , we get (16.10). The proof for a zero is similar.


We will not prove:
ˆ expression (16.8) for the intersection of the asymptotes;

ˆ that branches only converge or diverge on the real axis;

ˆ that they converge or diverge perpendicularly to the real axis;

ˆ that the centroid of the root locus is constant if n − m ≥ 2.


Root locus when the feed- Remark 16.1. Up until now we have assumed that the feedback branch of the
back branch is not 1 closed loop is 1 (i.e. we have assumed a perfect sensor). If this is not the case,
the closed loop in Figure 16.10
y KG
y = KG(r − Hy) ⇒ y(1 + KGH) = KGr ⇒ = (16.70)
r 1 + KGH
has the characteristic equation
(
|KGH| = 1
1 + KGH = 0 ⇔ KGH = −1 ⇔ (16.71)
∠[KGH] = π + 2kπ, k ∈ Z
Thus, in this situation, instead of the root locus of G(s), the root locus of
G(s)H(s) has to be used instead.
16.4. FINDING DESIRED POLES FROM SPECIFICATIONS 299

Figure 16.10: Closed loop with non-unitary feedback.

16.4 Finding desired poles from specications


Suppose that we are given specications of how the time responses of a controlled
system should be. To use the root locus diagram to design a proportional
controller, or to adjust the gain of any other type of controller, we

ˆ nd from the specications the zones of the complex plane where the closed
loop poles must lie;

ˆ nd for which values of gain the root locus is inside such zones. If there are
no values of the gain that put all the closed poles in those zones, another
controller is necessary.

We know from Section 11.6 that the poles are not the only thing that determines
the time response of a system, but reasonable approximations can be found in
this way if there is a dominant real pole s = −a, or a pair of complex conjugate
dominant poles

s = −a ± jb
p
= −ξωn ± jωn 1 − ξ 2 (16.72)
 p
|s| = ξ 2 ωn2 + ωn2 (1 − ξ 2 ) = ωn
⇒ (16.73)
p p
2 2
∠s = arctan ±ωn 1 − ξ = arctan ± 1 − ξ
−ξωn −ξ

(remember (11.43)(11.44)).
Recall from Sections 11.2 and 11.3 that, in either case, Zones of C for a given set-
tling time
2.3 2.3
ˆ the 10% settling time is ts,10% = ⇔ −a = − ;
a ts,10%

3 3
ˆ the 5% settling time is ts,5% = ⇔ −a = − ;
a ts,5%

4 4
ˆ the 2% settling time is ts,2% = ⇔ −a = − ;
a ts,2%

4.6 4.6
ˆ the 1% settling time is ts,1% = ⇔ −a = − .
a ts,1%

Suppose that a maximum value for the settling time is required. This settling
time will correpond to poles on a vertical straight line with real part −a found
from the relations above. The dominant poles can be on this line, or, better
still, somewhat to its left, in which case they will be faster. See Figure 16.11.
Also recall that: Zones of C for a maximum
value of Mp
ˆ if there is a dominant real pole (i.e. without imaginary part), there is no
overshoot;

ˆ if there is a pair of complex conjugate dominant poles, the maximum


300 CHAPTER 16. ROOT LOCUS

Figure 16.11: Left: zone of the complex plane where dominant poles must be,
given a real part −a found from a maximum settling time ts specication. Right:
zone of the complex plane where the dominant poles must be, given a maximum
overshoot Mp that is not to be exceeded.

overshoot (as a fraction of the steady-state value) is given by (11.72):


√−ξπ
Mp = e 1−ξ2

ξπ
⇒p = − log Mp
1 − ξ2
⇒ ξ 2 π 2 = (log Mp )2 (1 − ξ 2 )
⇒ ξ2 π 2 + (log Mp )2 = (log Mp )2

(log Mp )2
⇒ ξ2 = (16.74)
π2 + (log Mp )2

Of the two possible values of the square root, one is positive and the other
is negative. Usually the maximum overshoot is smaller than 100%, i.e.
than 1; thus, it is with the minus sign that we get a positive value for the
damping coecient ξ :
− log Mp
ξ=p (16.75)
π 2 + (log Mp )2

So, if one of the specications is that a certain value of the maximum over-
shoot cannot be exceeded, (16.75) is used to nd the minimum admissible
damping factor (ξ can be higher, since larger damping factor correspond
to more damped oscillations, i.e. with smaller amplitudes). From (16.73),
we know that ξ has no eect on the magnitude of the poles, and suces
to nd their phase. Replacing (16.74) and (16.75) in (16.73),
s
(log Mp )2
± 1− 2
π + (log Mp )2
∠s = arctan
− log Mp
−p
π 2 + (log Mp )2
s
π2
±
π 2 + (log Mp )2
= arctan
log Mp
p
π + (log Mp )2
2

π
= arctan ± (16.76)
log Mp

Since the poles are stable, these angles are in the second ( π2 ≤ ∠s ≤ π )
and third quadrants (−π ≤ ∠s ≤ − π2 ). Poles closer to the real axis,
where there are no oscillations, will have lower values of the maximum
overshoot (the imaginary parts of the poles are smaller; remember from
16.4. FINDING DESIRED POLES FROM SPECIFICATIONS 301

Figure 16.12: Left: zone of C where dominant poles must be in Example 16.6.
Right: root locus of C(s)G(s).

Section 11.6 that the imaginary parts of the poles are what originate the
oscillations). Thus, a specication for the largest admissible value of Mp
translates into a sector of the complex plane around the negative real axis.
See Figure 16.11.
Of course, if there is no clearly dominant pole or pair of complex conjugate
poles, the approximations above for the desired locations of poles will be poor.
Example 16.6. Plant G(s) = s2 +s+1 will be controlled
10
in closed loop by a PID
controller given by C(s) = Kp 1 + 5s + 20
s
. We want
ˆ a maximum overshoot of 5% or less;

ˆ a 5% settling time of 1 s or less.


What should be the value of the PID gain Kp ?
We can nd the zone of C where the dominant pole or poles should be as
follows:

ˆ From Mp ≤ 5% = 0.05, we get |∠s| ≥ arctan log π0.05 = 134◦ . Notice that

we chose the angle in the second quadrant; calculating arctan log π0.05 will
likely gives us −46◦ , in the fourth quadrant, as the result.
ˆ From ts,5% ≤ 1 s, we get −a ≤ −3.
This zone is shown in Figure 16.12. We now plot the root locus of C(s)G(s) and
check the values of Kp for which all poles are inside the desired zone: Kp = 3.8,
in this case. Choosing the lowest possible of Kp , the control action will be
as low as possible. But it may be reasonable to allow for some uncertainty in
parameters, and thus use a slightly larger value of Kp to ensure that all poles
are indeed inside the desired zone.
The step responses of the closed loop for Kp = 5 and Kp = 30 are shown in
Figure 16.13. Notice how, for Kp = 5, the specications are still not followed,
even though all the poles, and consequently the dominant one or dominant ones,
are inside the zone of the complex plane corresponding to the specications. If
the control action is feasible, the problem is solved using C(s) = 30 1 + 5s + 20
s
.

Remark 16.2. In the Example above, as we do not know what type of system
G(s) is (mechanical, thermal, etc.), and what actuator is being used, we can
form no idea about whether the control action is reasonably small, or too large.
We also do not know if the actuator bandwidth required to implement this
control action is feasible. In real life, it is important to know what system is
being controlled, so that these matters can be decided.
Matlab includes the app controlSystemDesigner (called sisotool in
older versions) to assist the design of closed loop controllers for SISO plants.
Among other functionalities, this app lets us select a plant and change the open
loop gain in its root locus diagram, showing interactively how the closed loop
step response will be in each case. See Figure 16.14.
302 CHAPTER 16. ROOT LOCUS

Figure 16.13: Behaviour of the closed loop control system from Example 16.6.

Figure 16.14: controlSystemDesigner from Matlab.

Glossary
And Eliacim, and Sobna, and Ioahe sayd to Rabsaces: Speake to
thy seruants in the Syrian tongue: for we vnderstand it: speake not
to vs in the Iewes language in the eares of the people, that is vpon
the wal. And Rabsaces sayd to them: Why, did my lord send me to
thy lord and to thee, to speake al these wordes; and not rather to
the men, that sitte on the wal (. . . )?

Isaiah ben Amoz (attrib.; 8th7th c. BC), Isaiah, xxxvi 1112, Douay-Rheims
version (1610)

branch ramo
characteristic equation equação característica
root locus lugar geométrico das raízes (LGR)

Exercises
1. Consider the plants with the following open-loop transfer functions. Admit
both cases K > 0 and K < 0. Plot their root-locus, determining all
the relevant points, the asymptotes, the departure and arrival angles, the
values of K ensuring stability (resorting to the Routh-Hurwitz criterion as
needed), and the points where the root locus crosses the imaginary axis.
1
(a) G1 (s) =
s + 10
1
(b) G2 (s) =
s − 10
s + 30
(c) G3 (s) =
s + 10
s + 10
(d) G4 (s) =
s + 30
16.4. FINDING DESIRED POLES FROM SPECIFICATIONS 303

1
(e) G5 (s) =
(s + 10)(s + 30)
1
(f) G6 (s) =
(s + 10)(s − 30)
1
(g) G7 (s) =
(s − 10)(s + 30)
1
(h) G8 (s) =
(s − 10)(s − 30)
s + 20
(i) G9 (s) =
(s + 10)(s + 30)
1
(j) G10 (s) =
(s + 10)(s + 20)(s + 30)
1
(k) G11 (s) = 2
s + 20s + 200
s + 20
(l) G12 (s) = 2
s + 20s + 200
2. Consider the plants with the following open-loop transfer functions. Admit
both cases K > 0 and K < 0. Plot their root-locus, determining all
the relevant points, the asymptotes, the departure and arrival angles, the
values of K ensuring stability (resorting to the Routh-Hurwitz criterion as
needed), and the points where the root locus crosses the imaginary axis.
(s + 1)
(a) G1 (s) =
s2 (s + 2)
(s − 2)
(b) G2 (s) =
s2 (s + 1) (s + 3)
1
(c) G3 (s) =
s (s2 + 0.2s + 1)
(s + 1)
(d) G4 (s) =
s (s2 + 3s + 9)
1
(e) G5 (s) = 3
s (s + 1)

s2 + 2, 8s + 4
(f) G6 (s) =
s (s + 3) (s2 + 2s + 4)
(s + 1)
(g) G7 (s) =
s2 (s + 3) (s + 4)
(s + 1)
(h) G8 (s) =
s2 (s + 10)
(s + 2)
(i) G9 (s) =
s (s2 + 2s + 2)
(−10s + 40)
(j) G10 (s) =
s(s2 + 40s + 1025)
3. Find the zones of the complex plane corresponding to the following spec-
ications:

(a) Settling time under 5 min; no overshoot.


(b) Settling time under 1 min; overshoot under 5%.
(c) Settling time under 10 ms; overshoot under 25%.

4. Find a proportional controller for the following plants and specications,


whenever possible:
s + 100
(a) G(s) = , settling time under 50 s, overshoot under
s2 + 100s + 2600
1%.
s + 100
(b) G(s) = , settling time under 5 s, overshoot under
s2 + 100s + 2600
15%.
304 CHAPTER 16. ROOT LOCUS

Figure 16.15: Root locus from Exercise 5.

100
(c) G(s) = , settling time under 50 s, overshoot under
s2 + 100s + 2600
1%.

5. The plant with the root locus in Figure 16.15 will be controlled in closed
loop with a proportional controller K .

(a) Is the loop always stable when K > 0?


(b) Is the loop always unstable when K > 0?
(c) Is the loop always stable when K < 0?
(d) Is the loop always unstable when K < 0?
(e) Is the loop stable if |K| is small enough?
(f) Is there any value of K for which the loop will be critically damped?
Chapter 17

The Nyquist stability


criterion
`I suppose there are two views about everything,' said Mark.
`Eh? Two views? There are a dozen views about everything until
you know the answer. Then there's never more than one.'

C. S. Lewis (1868 „1963), That hideous strength, 3

The Nyquist criterion is another tool that, just like the root locus, can be
used

ˆ to design a proportional controller,

ˆ to design the gain of a controller that has poles and zeros, once these are
known,

ˆ to see what happens to a closed loop control system with a known con-
troller, when the gain of the plant changes for some reason.

This criterion is better visualised in the Nyquist diagram, and to study the
Nyquist diagram it is convenient to study the polar diagram rst.

17.1 The polar diagram


In the Bode diagram, the frequency response of a plant G(s) is represented as a
function of frequency ω > 0; the gain |G(jω)|, in decibel, and the phase ∠G(jω),
are plotted separately (with a semilogarithmic scale). (Remember section 10.5.)
In the polar diagram, G(jω) is represented in the complex plane; i.e. Polar diagram shows
=[G(jω)] is plotted in the y axis as function of <[G(jω)] in the xaxis. Fre- G(jω) in the complex
quency is not explicitly shown. It is obvious that, given any point of a polar plane
diagram,

ˆ the gain |G(jω)| (in absolute value, not in dB) is its distance to the origin,

ˆ the phase ∠G(jω) is its phase.


Example 17.1. The polar diagram of G(s) = 1
s+1 is shown in Figure 17.1
together with its Bode diagram. Notice that

ˆ for low frequencies, lim G(jω) = 1, and so the polar diagram begins at Where the polar plot begins
ω→0+
1;

ˆ for high frequencies, lim G(jω) = 0, and so the polar diagram ends at Where the polar plot ends
ω→+∞
the origin;

ˆ for high frequencies, lim ∠G(jω) = −90◦ , and so the polar diagram
ω→+∞
approaches the origin from below, tangent to the imaginary axis, where
the phase is −90◦ , remaining always to the right of the imaginary axis
because the phase is never below −90◦ .

305
306 CHAPTER 17. THE NYQUIST STABILITY CRITERION

Figure 17.1: Bode diagram and polar plot for G(s) = s+1 .
1

Figure 17.2: Bode diagram and polar plot for G(s) = s2 +0.6s+1 .
1

Example 17.2. The polar diagram of G(s) = 1


s2 +0.6s+1 is shown in Figure 17.2
together with its Bode diagram. Notice that

ˆ for low frequencies, lim G(jω) = 1, and so the polar diagram begins at
ω→0+
1;

ˆ for high frequencies, lim G(jω) = 0, and so the polar diagram ends at
ω→+∞
the origin;

ˆ because ξ = 0.3 < 2 ,
there is a resonance peak, and thus the gain is
2

partly outside a unit radius circle;

ˆ for high frequencies, lim ∠G(jω) = −180◦ , and so the polar diagram
ω→+∞
approaches the origin from the left, tangent to the real axis, where the
phase is −180◦ , remaining always below the real axis because the phase is
never below −180◦ .

Example 17.3. The polar diagram of G(s) = is shown in Figure 17.3


1
s(s+1)
together with its Bode diagram. The behaviour for low frequencies can be
explained as follows.

ˆ Because lim |G(jω)| = +∞, the polar diagram begins at an innite


ω→0+
distance from the origin.

ˆ Because lim ∠G(jω) = −90◦ , the polar diagram begins vertically, from
ω→0+
below. These points are in the third quadrant, and have phases between
−180◦ and −90◦ . For arbitrarily large distances from the origin, the real
part is neglectable, and the imaginary part very large; thus, the phases
approach −90◦ .

Finding an asymptote of ˆ This can be seen more accurately calculating


the polar plot
17.2. THE NYQUIST DIAGRAM WHEN THERE ARE NO POLES ON THE IMAGINARY AXIS 307

Figure 17.3: Bode diagram and polar plot for G(s) = s(s+1) .
1

Figure 17.4: Left: Nyquist diagram of s+1 .


1
Right: Nyquist diagram of
s2 +0.6s+1 .
1

1
G(jω) =
jω(jω + 1)
1
=
−ω 2 + jω
−ω 2 − jω
=
(−ω + jω)(−ω 2 − jω)
2

−ω 2 − jω −1 −1
= 4 = 2 +j 3 (17.1)
ω + ω2 ω +1 ω +ω
−1
lim <[G(jω)] = lim+ 2 = −1 (17.2)
ω→0+ ω→0 ω + 1
−j
lim+ =[G(jω)] = lim+ 3 = −j∞ (17.3)
ω→0 ω→0 ω + ω

So (17.2)(17.3) show that the diagram begins with an asymptote given by


<[z] = −1, approaching the origin from below. The angle of the asymptote
is, as expected, −90◦ .

17.2 The Nyquist diagram when there are no poles


on the imaginary axis
The simplest description of the Nyquist diagram is that it consists in a transfer The Nyquist diagram also
function's polar diagram plus its complex conjugate (i.e. the polar diagram shows the complex conju-
turned upside down, so to say). gate of the frequency re-
sponse
Example 17.4. Figure 17.4 shows the Nyquist diagram of 1
s+1and s2 +0.6s+1
1
,
Matlab function
as plotted by Matlab function nyquist (and after command axis equal to
nyquist
make the scales of the xaxis and the y axis the same). Compare this with
Figures 17.1 and 17.2. Matlab command axis
equal
The formal denition is more complicated, but necessary for the Nyquist
stability criterion we are about to study. We will postpone the case of plants
with poles on the imaginary axis (either at 0, or pairs of complex conjugates)
to Section 17.4.
308 CHAPTER 17. THE NYQUIST STABILITY CRITERION

First notice that the curve showing the frequency response in the polar
diagram can be seen as the positive imaginary axis j×]0, +∞[ transformed by
the complex-valued function of complex value G(s). We say that the frequency
Mapping response curve is a mapping of the positive imaginary axis, using function
G(s).
G(−jω) = G(jω) Theorem 17.1. The complex conjugate of the frequency response G(jω) is the
mapping of the negative imaginary axis, G(−jω), ω > 0.
N (s)
Proof. Let G(s) = D(s) . Then

N (jω)
G(jω) =
D(jω)
N (jω) D(jω)
= (17.4)
D(jω) D(jω)
| {z }
∈ R

The numerator N (jω) D(jω) is a polynomial on ω :


ˆ Its real part will consist in

the independent term,


the term on (jω)2 = −ω 2 ,
the term on (jω)4 = ω 4 ,
the term on (jω)6 = −ω 6 ,
<[G(jω)] is even and so on, i.e. the terms on even powers of jω . Thus, <[N (jω) D(jω)]
is an even function of ω , and so is <[G(jω)]. That is to say, <[G(jω)] =
<[G(−jω)].
ˆ Its imaginary part will consist in

the term on jω ,
the term on (jω)3 = −jω 3 ,
the term on (jω)5 = jω 5 ,
=[G(jω)] is odd and so on, i.e. the terms on odd powers of jω . Thus, =[N (jω) D(jω)] is
an odd function of ω , and so is =[G(jω)]. That is to say, =[G(jω)] =
−=[G(−jω)].
Consequently,

G(jω) = <[G(jω)] + j=[G(jω)]


= <[G(jω)] − j=[G(jω)]
= <[G(−jω)] + j=[G(−jω)] = G(−jω) (17.5)

As a result, given a transfer function G(s), its polar plot plus its complex
conjugate are the mapping, using G(s), of j] − ∞, 0[∪j]0, +∞[. In fact we can
throw in the origin too, and map the entire imaginary axis jω, ω ∈] − ∞, +∞[,
since we are assuming no poles on the imaginary axis: this means that D(jω) 6= 0
whatever the value of ω (including ω = 0), and so G(0) = N (0)
D(0) is nite.
The Nyquist diagram is dened as the mapping, not of the imaginary axis
alone, but of a contour in C.
Contour in C Denition 17.1. A contour is a closed curve in C, oriented clockwise or
counter-clockwise, such that:
ˆ there is only a nite number of points of the curve where it is not dier-
entiable;
ˆ the curve can be completely traversed without passing twice by any point
(this precludes closed curves that cross themselves, for instance).
Denition 17.2. The Nyquist diagram of a transfer function G(s) that has
no poles on the imaginary axis is the mapping, using G(s), of the Nyquist
Nyquist contour contour, or Nyquist path, that consists of
17.3. THE NYQUIST CRITERION 309

Figure 17.5: The Nyquist contour (blue) in the complex plane. This contour is
mapped in a Nyquist diagram, when G(s) has no poles on the imaginary axis.

ˆ a straight line s = jω, ω ∈ [−r, +r], and

ˆ a semi-circle s = rejθ , θ ∈ [− π2 , + π2 ],

as r → +∞, and is clockwise oriented. See Figure 17.5.

Remark 17.1. As r → +∞, the semi-circle approaches innity.


If G(s) is strictly proper, this semi-circle of innite radius is mapped to the
origin. In fact,
bm sm + . . . + b0
lim G(s) = lim =0 (17.6)
|s|→+∞ |s|→+∞ an sn + . . . + a0

since n > m.
If n = m, the semi-circle of innite radius is mapped to a point other than
the origin. In fact,
bn sn + . . . + b0 bn
lim G(s) = lim n
= (17.7)
|s|→+∞ |s|→+∞ an s + . . . + a0 an

17.3 The Nyquist criterion


The Nyquist stability criterion is based upon a theorem that we will not prove.

Theorem 17.2. Let f (s) = fN (s)


be a complex-valued rational function of
fD (s)
complex variable s, and C a clockwise (counter-clockwise) contour in C that
ˆ does not pass on the poles of f (s),

ˆ encircles P poles of f (s),

ˆ encircles Z zeros of f (s).

Then the mapping of contour C by f (s) is a closed line f (C ) that encircles


Z − P times the origin, clockwise (counter-clockwise).
Remark 17.2. The mapped contour f (C ) need not be a contour. It may, for
instance, cross itself, or even have coincident lines.
Example 17.5. We can verify this theorem numerically as shown in Fig-
ures 17.6 and 17.7. On the left, a counter-clockwise complex contour is shown,
together with the zeros and poles of a transfer function, which will serve as f (s).
On the right, the contour mapped by the the transfer function is shown.
ˆ In Figure 17.6, top, the contour encircles Z = 0 zeros and P = 0 poles
of the transfer function. Thus, the mapped contour encircles Z − P = 0
times the origin, counter-clockwise.
310 CHAPTER 17. THE NYQUIST STABILITY CRITERION

ˆ In Figure 17.6, centre, the contour encircles Z = 0 zeros and P = 1 poles


of the transfer function. Thus, the mapped contour encircles Z − P =
−1 times the origin, counter-clockwise, i.e. it encircles the origin once,
clockwise.

ˆ In Figure 17.6, bottom, the contour encircles Z = 0 zeros and P = 2 poles


of the transfer function. Thus, the mapped contour encircles Z − P =
−2 times the origin, counter-clockwise, i.e. it encircles the origin twice,
clockwise.

ˆ In Figure 17.7, top, the contour encircles Z = 1 zeros and P = 2 poles


of the transfer function. Thus, the mapped contour encircles Z − P =
−1 times the origin, counter-clockwise, i.e. it encircles the origin once,
clockwise.

ˆ In Figure 17.7, centre, the contour encircles Z = 2 zeros and P = 4 poles


of the transfer function. Thus, the mapped contour encircles Z − P =
−2 times the origin, counter-clockwise, i.e. it encircles the origin twice,
clockwise.

ˆ In Figure 17.7, bottom, a dierent contour is used with the same transfer
function as above, showing that changing the shape of the contour is
irrelevant for the result. The number of encirclements, is, as expected, the
same: twice, clockwise.

The plots of Figure 17.6, top, can be drawn with the following code. The next
cases are similar.

s1 = 1+1i*(-1:0.01:1);
s2 = 1i+(1:-0.01:-1);
s3 = -1+1i*(1:-0.0025:-1);
s4 = -1i+(-1:0.01:1);
G = @(s) 1./(s+2);
% transfer function defined as a function handle for complex variables
figure, plot(real(s1),imag(s1), real(s2),imag(s2),...
real(s3),imag(s3), real(s4),imag(s4), -2,0,'x')
axis([-2 2 -2 2]), xlabel('Real axis'), ylabel('Imaginary axis')
title('1/(s+2)')
figure, plot(real(G(s1)),imag(G(s1)), real(G(s2)),imag(G(s2)),...
real(G(s3)),imag(G(s3)), real(G(s4)),imag(G(s4)), 0,0,'+')
axis([-0.5 1.5 -1 1]), xlabel('Real axis'), ylabel('Imaginary axis')
title('1/(s+2)')
The plots of Figure 17.7, bottom, use the contour

sr = 1.5*exp(1i*(-pi:pi/100:pi));

Nyquist criterion Theorem 17.3. Let G(s) = N (s)


be a transfer function with P unstable poles.
D(s)
Let N be the number of clockwise encirclements of its Nyquist diagram around
point −1. Then G(s) in closed loop, as seen in Figure 17.8, will have Z = N + P
unstable poles.

Proof. The characteristic equation of the closed loop is 1 + G(s) = 0. We will


apply Theorem 17.2 to function f (s) = 1 + G(s). The contour C will be the
Nyquist path. We know that the mapping of the Nyquist path using f (s) will
have a number of enrolments around the origin N given by N = Z − P ⇔ Z =
N + P . But:

ˆ Since G(s) is linear, f (s) is also linear. So, given a contour C , its mapping
by f (s) will be f (C ) = 1 + G(C ), i.e. the mapping by G(s) shifted to the
right by 1. Thus, the number of enrolments of f (C ) around the origin N
is also the number of enrolments of G(C ) around −1. And the mapping
G(C ) is the Nyquist plot of G(s).
17.3. THE NYQUIST CRITERION 311

Figure 17.6: Example 17.5 illustrates Theorem 17.2. Left: complex contour and
the zeros and poles of a transfer function. Right: the contour mapped by the
the transfer function (the origin is marked with a cross). Bottom right gure:
the two leftmost curves are coincident; the outside curve was enlarged to show
more clearly the shape of the mapped contour. Continues in Figure 17.7.
312 CHAPTER 17. THE NYQUIST STABILITY CRITERION

Figure 17.7: Figure 17.6 continued. Example 17.5 illustrates Theorem 17.2.
Left: complex contour and the zeros and poles of a transfer function. Right:
the contour mapped by the the transfer function (the origin is marked with a
cross).

Figure 17.8: Top: block diagram for the Nyquist criterion. Bottom: block
diagram for the Nyquist criterion, with a variable open loop gain K .
17.3. THE NYQUIST CRITERION 313

Figure 17.9: Nyquist diagram of model (17.8) of a boost converter, from Exam-
ple 17.6.

ˆ Z is the number of zeros of f (s) inside C . Since the Nyquist path covers
the entire right half of the complex plane, Z is the number of roots of
f (s) such that s > 0. The roots of f (s) are the roots of the closed loop
characteristic equation, i.e. the unstable poles of the closed loop.
N (s)
ˆ P is the number of poles of f (s) = 1 + G(s) = 1 + = N (s)+D(s)
D(s) D(s) inside
C . Since the Nyquist path covers the entire right half of the complex
plane, the poles of f (s) are the roots of D(s) such that s > 0, i.e. the
unstable poles of G(s).

Theorem 17.4. Let G(s) = N (s)


be a transfer function with P unstable poles.
D(s) Nyquist criterion when K
Let N be the number of clockwise encirclements of its Nyquist diagram around varies
point − K1
. Then G(s) controlled in closed loop by proportional controller K ,
as seen in Figure 17.8, will have Z = N + P unstable poles.
Proof. The characteristic equation of the closed loop is 1 + KG(s) = 0. We
will apply Theorem 17.2 to function f (s) = 1 + KG(s). The proof is similar to
that of the previous theorem, with the following change: given a contour C , its
mapping by f (s) will be f (C ) = 1 + KG(C ), i.e. the mapping by G(s) shifted
to the right by K1
. Thus, the number of enrolments of f (C ) around the origin
N is also the number of enrolments of G(C ) around − K 1
.
This result lets us use the Nyquist diagram of a transfer function to nd the
values of a proportional controller K that can stabilise it in closed loop, just as
we might do using Routh's criterion.
Example 17.6. A boost converter (a device that converts a DC voltage into a
larger DC voltage) is modelled by transfer function

−418040s + 9.523 × 108


C(s) = (17.8)
s2 + 884.6s + 2.015 × 106
The corresponding Nyquist diagram is shown in Figure 17.9. What values of a
proportional controller K can stabilise this transfer function in closed loop?
The poles of C(s) are −442.3 ± 1348.8j . They are both stable, thus P = 0.
We count the number of clockwise enrolments around the points on the real
axis, and build the following table:

−∞ −472 0 472 +∞
R
1
−K ∈ ] − ∞, −472[ ] − 472, 0[ ]0, 472[ ]472, +∞[
K∈ ]0, 0.0021[ ]0.0021, +∞[ ] − ∞, −0.0021[ ] − 0.0021, 0[
N 0 2 1 0
P 0 0 0 0
Z 0 2 1 0
(17.9)

From the table it is clear that there will be no closed loop unstable poles (P = 0)
if −0.0021 < K < 0 or if 0 < K < 0.0021. So the open loop will be stable for
314 CHAPTER 17. THE NYQUIST STABILITY CRITERION

Figure 17.10: Nyquist diagram of s−1 ,


1
from Example 17.7.

−0.0021 < K < 0.0021. (We can add K = 0 to the interval since there will be
no feedback and the output will be always zero. Control will be a failure, but
the output is stable.)

Example 17.7. Figure 17.10 shows the Nyquist diagram of s−1 .


What pro-
1

portional controllers can stabilise this plant in closed loop?


Counter-clockwise en- P = 1, and real points from −1 to 0 are encircled once counter-clockwise,
circlements are negative i.e. they are encircled clockwise −1 times. From table
clockwise encirclements
−∞ −1 0 +∞
R
1
−K ∈ ] − ∞, −1[ ] − 1, 0[ ]0, +∞[
K∈ ]0, 1[ ]1, +∞[ ] − ∞, 0[ (17.10)
N 0 −1 0
P 1 1 1
Z 1 0 1

we see that we must have K > 1.

What Nyquist diagram Remark 17.3. Remember that if, instead of the cases of Figure ??, the control
should be plot loop is dierent, the characteristic equation is not the same. Thus:

ˆ in case (b) of Figure 16.1, when a plant G(s) is controlled in closed loop
by a controller KC(s) with variable gain K , we must nd the Nyquist
diagram of C(s)G(s);

ˆ in case (c) of Figure 16.1, when a plant KG(s) with variable gain K is
controlled in closed loop by a controller C(s), we must nd the Nyquist
diagram of C(s)G(s);

ˆ in the case of Figure 16.10, when a plant G(s) is controlled in closed loop
by a proportional controller K , and there is in the feedback branch a
sensor H(s), we must nd the Nyquist diagram of G(s)H(s).

17.4 The Nyquist diagram when there are poles


on the imaginary axis
Nyquist contour for poles When there are poles on the imaginary axis, the Nyquist contour must be mod-
at the origin or imaginary ied with semi-circles with vanishing radius r0 → 0+ , as shown in Figure 17.11
poles for a situation in which there is a pole at the origin and a pair of complex con-
jugate imaginary poles. The number and location of the semi-circles depends,
of course, of the number and location of the poles on the imaginary axis. The
semi-circles are on the right side of the imaginary axis so as to always have
s > 0, so that only unstable poles of the transfer function are ever encircled.
These vanishing semi-circles near poles originate curves with a radius that
increases to innity as r0 → 0+ . Matlab function nyquist does not plot these
so-called curves at innity (only the polar plot and its complex conjugate),
though we can nd them numerically using small values for r0 .
17.4. THE NYQUIST DIAGRAM WHEN THERE ARE POLES ON THE IMAGINARY AXIS 315

Figure 17.11: The Nyquist contour (blue) in the complex plane, when there are
poles on the imaginary axis.

Example 17.8. Figure 17.12 shows the Nyquist diagrams of plants


s + 0.1
G1 (s) = (17.11)
s(s + 1)
s + 0.1
G2 (s) = (17.12)
s(s − 1)
s − 0.1
G3 (s) = (17.13)
s(s + 1)

as Matlab plots them, and then with the curves at innity added. The same
Figure shows the mapping of two approximations of the Nyquist path: one with
r = 10, r0 = 10
1
, and another with r = 100, r0 = 100
1
, which is of course a better
approximation of the Nyquist diagram. The rst approximation already shows
where the curves at innity will be; the second is quite clear.

To know without numerical calculations whether a curve in the Nyquist plot Finding curves at innity
caused by a pole at the origin turns clockwise or counter-clockwise, it suces
to see what happens with the only real point of the vanishing semi-circle of the
Nyquist path, → 0+ . See Figure 17.13.

Example 17.9. For transfer functions (17.11)(17.13), we have


+ 0.1
lim G1 (s)|s= = lim = +∞ (17.14)
→0+ →0+ ( + 1)
+ 0.1
lim G2 (s)|s= = lim = −∞ (17.15)
→0+ →0 + ( − 1)
− 0.1
lim G3 (s)|s= = lim+ = −∞ (17.16)
→0+ →0 ( + 1)

Thus:

ˆ The Nyquist diagram of G1 (s) will have a curve at innity on the right
side of the complex plane; we might, with some abuse of terminology, say
that the curve passes through +∞.

ˆ The Nyquist diagrams of G2 (s) and G3 (s) will have curves at innity on
the left side of the complex plane; we might, with some abuse of terminol-
ogy, say that in each diagram the curve passes through −∞.

Notice that multiple poles at the origin result in an increasingly large curve Multiple poles at the origin
at innity:

ˆ 1 pole at the origin 1


s originates a curve with 180◦ ;

ˆ 2 poles at the origin 1


s2 originate a curve with 360◦ ;
316 CHAPTER 17. THE NYQUIST STABILITY CRITERION

Figure 17.12: Nyquist diagrams of (17.11)(17.13). Top left: diagrams plot-


ted with nyquist. Top right: Nyquist diagrams, obtained adding the curves
at innity to the plots of nyquist. Middle left: Nyquist path with a nite
value of r = 10 and a non-vanishing value of r0 = 101
. Middle right: approx-
imations of the Nyquist diagrams, that map the contour on the left. Bottom
left: Nyquist path with a larger r = 100 and a smaller r0 = 100
1
. Bottom right:
approximations of the Nyquist diagrams, that map the contour on the left.

Figure 17.13: The Nyquist contour (blue) in the complex plane, when there is
a pole at the origin, evidencing the only vanishing real point → 0+ .
17.4. THE NYQUIST DIAGRAM WHEN THERE ARE POLES ON THE IMAGINARY AXIS 317

Figure 17.14: Approximations of the Nyquist diagrams of (17.17)(17.19). The


curve at innity cause by n poles at the origin has an angle given by n 180◦ .

ˆ 3 poles at the origin 1


s3 originate a curve with 540◦ ;

ˆ and in general n poles at the origin 1


sn originate a curve with n 180◦ .

Example 17.10. Figure 17.14 shows fairly good approximations of the Nyquist
plots of

s + 0.1
G1 (s) = (17.17)
s(s + 1)
s + 0.1
G2 (s) = 2 (17.18)
s (s + 1)
s + 0.1
G3 (s) = 3 (17.19)
s (s + 1)

obtained mapping the Nyquist path from Figure 17.12, bottom left (r = 100
and r0 = 100
1
).

Glossary
Oltre la porta si scopre un sepolcro a sette lati e sette angoli, illu-
minato prodigiosamente da un sole articiale. Nel mezzo, un altare
rotondo, ornato da vari motti o emblemi, del tipo nequaquam
vacuum. . .

Ne quà quà? Firmato Donald Duck?


È latino, hai presente? Vuol dire il vuoto non esiste.
Meno male, altrimenti sai che orrore.

Umberto Eco (1932 „2016), Il pendolo di Foucault, IV 29

contour contorno
curve at innity curva no innito
encirclement enrolamento
mapping mapeamento
318 CHAPTER 17. THE NYQUIST STABILITY CRITERION

Figure 17.15: Polar diagram of the plant from Exercise 1.

Figure 17.16: Polar diagram of G(s), from Exercise 2.

Exercises
1. Figure 17.15 shows the polar plot of a plant.
(a) What is the type of the plant?
(b) How many poles and zeros does the plant have?
2. Figure 17.16 shows the polar diagram of the second-order plant

ωn2
G(s) = , (17.20)
s2 + 2ζωn s + ωn2

where ζ ∈ {0.25, 0.5, 1}. Find the correspondence between curves A, B


and C, and the three possible values of ζ .
3. The closed loop in Figure 17.17 has the open-loop transfer function
K(s + 1)
G(s)H(s) = , K ≥ 0. (17.21)
s(s + 2)(s + 3)

(a) Plot its root locus.


(b) Plot its Nyquist diagram.
(c) Analyse the closed loop's stability for dierent values of K .
17.4. THE NYQUIST DIAGRAM WHEN THERE ARE POLES ON THE IMAGINARY AXIS 319

Figure 17.17: Control loop from Exercise 3.

Figure 17.18: Nyquist diagrams from Exercise 4.

4. Which of the two Nyquist diagrams of Figure 17.18 corresponds to transfer


function (s+1)(s+10)
−10
?

5. Figure 17.19 shows the Nyquist diagram of plant (s+1)(s+10) .


−20

(a) Is the plant stable in closed loop?


(b) If the plant is controlled in closed loop with a proportional controller
K , for which values of K will the loop be stable?
(c) If plant (s+1)(s+10)
−10
is controlled in closed loop with a proportional
controller K , for which values of K will the loop be stable?
6. The attitude θ of a space station is related to the thrust δ of two motors
that can be used to correct it by
Θ(s) 15
G(s) = = (17.22)
∆(s) s(s2 + 15s + 75)
The attitude will be controlled in closed loop with a proportional controller
K.
(a) Plot its Nyquist diagram.
(b) Apply Nyquist's criterion and nd the values of K for which the
control loop is stable.
(c) Conrm that these values of K stabilise the plant using the Routh-
Hurwitz criterion.
(d) Plot the root-locus of G(s) and relate it to the results you found.

Figure 17.19: Nyquist diagram of plant −20


(s+1)(s+10) from Exercise 5.
320 CHAPTER 17. THE NYQUIST STABILITY CRITERION
Chapter 18

Stability margins
In eo umine pons erat. Ibi præsidium ponit et in altera parte
uminis Q. Titurium Sabinum legatum cum sex cohortibus relinquit;
castra in altitudinem pedum XII vallo fossaque duodeviginti pedum
muniri iubet.

Caius Iulius Cæsar (100 BC „24 BC), Commentarii de bello Gallico, II 5, 6

Stability margins are another tool that, just like the root locus, can be used

ˆ to design a proportional controller,

ˆ to design the gain of a controller that has poles and zeros, once these are
known,

ˆ to see what happens to a closed loop control system with a known con-
troller, when the gain of the plant changes for some reason.

18.1 Stability margins for stable, minimum phase


systems
Let us consider, to start with, the simplest case, that of a plant G(s) = N (s)
D(s)
controlled in closed loop by a proportional controller K > 0, as in Figure 16.1,
case (a). We saw in Section 16.3 that closed loop poles must verify the charac-
teristic equation

|N (s)|

K
 =1
N (s) N (s) |D(s)|
1+K =0⇒K = −1 ⇒
D(s) D(s) ∠ K N (s) = π + 2kπ, k ∈ Z

D(s)
(18.1)

(where we made |K| = K because K > 0) and we know that marginally stable
poles are on the imaginary axis: s = jω, ω ∈ R. Thus, marginally stable closed
loop poles verify

|N (jω)|
K =1
|D(jω)|
⇔ 20 log10 K + 20 log10 |G(jω)| = 0 dB (18.2)
| {z } | {z }
K in dB gain in dB at frequency ω

and

N (jω)
∠ K = π + 2kπ
D(jω)
⇔ |{z}
∠K +∠G(jω) = π + 2kπ, k ∈ Z
0 rad
| {z }
. . . , 3π, π, −π, −3π, . . .

⇔ ∠G(jω) = 180◦ + k 360◦ , k ∈ Z (18.3)


| {z }
. . . , 540◦ , 180◦ , −180◦ , −540◦ , . . .

321
322 CHAPTER 18. STABILITY MARGINS

Figure 18.1: Top left: root locus of G1 (s) = s3 +10s21+40s+80 ; top right: Bode
diagram of s3 +10s320
2 +40s+80 ; a closed loop with controller K = 320 and plant

G1 (s) is marginally stable. Bottom left: root locus of G2 (s) = s3 +15ss+20


2 +70s+300 ;
150(s+20)
top right: Bode diagram of s3 +15s 2 +70s+300 ; a closed loop with controller K =

150 and plant G2 (s) is marginally stable.

In other words, ω must be both a gain crossover frequency and a phase


crossover frequency of KG(jω) (remember Denitions 10.9 and 10.10).
Figure 18.1 shows examples of this situation, for stable, minimum phase
plants. Notice that, in all cases, lower values of K result in stable closed loops,
and higher values of K in unstable closed loops. This is because there are closed
loop poles diverging to innity, which have positive real parts when the gain is
large enough. If there are three or more such poles, this is inevitable, as can be
seen from the angles of the asymptotes of the root locus; when there are only
two branches diverging to innity, they may or may not become unstable (since
the asymptotes have ±90◦ angles).
Thus, notice that
ˆ for lower values of K , when the closed loop is stable,

at the phase crossover frequency, the gain is now below 0 dB,


at the new, lower gain crossover frequency, the phase is above −180◦ ;
ˆ for higher values of K , when the closed loop is unstable,

at the phase crossover frequency, the gain is now above 0 dB,


at the new, higher gain crossover frequency, the phase is below −180◦ .
Let us now dene the following two quantities. We will do so remembering that
a plant may have more than one gain crossover frequency, and more than one
phase crossover frequency. (In the next section we will see what to do when
there are no crossover frequencies.)
Gain margin (GM) ˆ The gain margin is measured at a phase crossover frequency ωp , and is
given in decibel by

GM = −20 log10 G(jωp ) (18.4)

That is to say, GM gives us how much below 0 dB the gain is at frequency


ωp ; in other words,
it is positive if the gain at ωp is below 0 dB,
18.1. STABILITY MARGINS FOR STABLE, MINIMUM PHASE SYSTEMS 323

it is negative if the gain at ωp is above 0 dB.


See Figure 18.2. GM is given in absolute value by
1
GM = (18.5)
G(jωp )

ˆ The phase margin is measured at a gain crossover frequency ωg , and is Phase margin (PM)
given by

PM = ∠G(jωg ) + 180◦ + k 360◦ (18.6)

with k chosen so that 180◦ < PM ≤ −180◦ . If k = 0, PM gives us how


much above −180◦ the phase is at frequency ωg ; in other words,
it is positive if the phase at ωg is above −180◦ ,
it is negative if the phase at ωg is below −180◦ .
If k 6= 0, PM gives us how much above another angle geometrically equal
to −180◦ the phase is at frequency ωg . See Figure 18.2.
So the two following rules hold:
ˆ the closed loop is stable if GM> 0 and PM> 0;

ˆ the closed loop is unstable if GM< 0 and PM< 0.

Always remember that we nd the GM and PM of the open loop to learn about GM and PM of the open
the stability of the closed loop. In the next section, we will see that they hold loop determine closed loop
also when K and closed loop stability are related otherwise; we will only obtain stability
a formal proof in Chapter 17.
Remark 18.1. Remember that if, instead of case (a) of Figure 16.1, the control
loop is dierent, the characteristic equation is not the same. Thus:
ˆ in case (b) of Figure 16.1, when a plant G(s) is controlled in closed loop
by a controller KC(s) with variable gain K , we must nd the stability
margins of C(s)G(s);
ˆ in case (c) of Figure 16.1, when a plant KG(s) with variable gain K is
controlled in closed loop by a controller C(s), we must nd the stability
margins of C(s)G(s);
ˆ in the case of Figure 16.10, when a plant G(s) is controlled in closed loop
by a proportional controller K , and there is in the feedback branch a
sensor H(s), we must nd the stability margins of G(s)H(s).
Example 18.1. We want to control plant G(s) = 10
s(s+10)2 with a proportional
controller C(s) = 10. Will the closed loop be stable?
Writing the open loop as
1 10 10 100
C(s)G(s) = (18.7)
s s + 10 s + 10 10 × 10
| {z } | {z }
cut-o at 10 rad/s 1

we can easily plot the asymptotic Bode diagram in Figure 18.3, and see that:
ˆ there is one gain crossover frequency at ωgc = 1 rad/s;

ˆ at frequency ωgc , the phase of C(s)G(s) is close to −90◦ , per the asymp-
totes;
ˆ consequently the phase margin is PM = −90◦ + 180◦ = 90◦ ;

ˆ in reality ∠C(jωgc )G(jωgc ) is somewhat below, since the asymptotic phase


behaviour is only an approximation;
ˆ in reality PM is somewhat less than that;

ˆ there is one phase crossover frequency at ωpc = 10 rad/s;


324 CHAPTER 18. STABILITY MARGINS

Figure 18.2: Gain margin and phase margin. Top: both margins are positive.
Bottom: both margins are negative. (The gain and phase margin can have
opposite signs.)

Figure 18.3: Asymptotic Bode diagram of open loop C(s)G(s) = 10 s(s+10)


10
2,

from Example 18.1.


18.2. STABILITY MARGINS IN THE GENERAL CASE 325

Figure 18.4: Stability margins of open loop C(s)G(s) = 10 s(s+10)


10
2 , from Ex-

amples 18.1 and 18.2.

ˆ at frequency ωpc , the gain of C(s)G(s) is −20 dB, per the asymptotes;

ˆ remembering (11.90), we see that the gain value is in fact |C(jωgc )G(jωgc )| =
−20 − 3 − 3 = −26 dB, as shown in Figure 18.3;
ˆ consequently the gain margin is PM = 26 dB.

The easiest way of nding stability margins in Matlab is using function Matlab function margin
margin, which is similar to function bode.
Example 18.2. The margins of Example 18.1 are found as
>> s=tf('s'); figure, margin(10*10/(s*(s+10)^2))
and we obtain Figure 18.4. Function margin can also return the margins, if
used with output arguments.
Example 18.3. Since the gain margin of the last two examples is 26 dB, or,
in absolute value, 1026/20 = 19.95, we could still increase the gain up to 19.95
times, and the closed loop would still be stable. This is clear from the Bode
diagram in Figure 18.4: if the gain goes up less than 26 dB, we still have GM > 0
and PM > 0.
With controller C(s) = 10 × 19.95 = 199.5, the loop would be marginally
stable.

18.2 Stability margins in the general case


In this section we address the cases which were not covered in the previous one.
We will see that the rules about stability margins apply just the same.
ˆ If there

Stability margins in the polar diagram.


Example 18.4. Let

Glossary
Então duvida que se falasse latim?perguntou Henrique, sor-
rindo.
Eu duvido. Não sei como os homens se podessem entender com
aquella endiabrada contradança de palavras, com aquella desa-
nação que faz dar volta ao juizo de uma pessoa. Sabe o senhor o que
é uma casa desarranjada, onde ninguem se lembra onde tem as suas
326 CHAPTER 18. STABILITY MARGINS

coisas quando precisa d'ellas e passa o tempo todo a procural-as?


Pois é o que é o latim. Abre a gente um livro e põe-se a traduzir e vae
dizendo: As armas, o homem e eu, canto, de Troia, e primeiro, das
praias. Quem percebe isto! Ora agora peguem n'estas palavras e
em outras, que elles punham ás vezes em casa do diabo, e façam uma
coisa que se entenda! É quasi uma adivinha. Ora adeus! E depois
continuou elle, enthusiasmado com o riso de Henrique, suppondo-o
de approvaçãoe depois as dierentes maneiras de chamar a um ob-
jecto? Isso tambem tem graça. Nós cá dizemos por exemplo: reino
e reinos e está acabado; lá não senhor; diz-se regnum e regna e
regni e regno e regnis e até regnorum. Ora venham-me cá elogiar a
tal lingua!

Júlio Dinis (1839 „1871), A morgadinha dos canaviais, III

gain margin margem de ganho


phase margin margem de fase

Exercises
1. The distance d travelled by a robot controlled with a variable voltage
d(s) 1
u is given by G (s) = = 2 . This plant is controlled with a
u(s) s (s + 1)
proportional controller K . Find the gain K for which the phase margin
of the controlled loop is P M = 60◦ .

2. Plot the asymptotes of the Bode diagrams of the plants with the open-loop
transfer functions given below. Mark the gain and phase margins in your
plots. What can you say about the stability of the plants?
s2
(a) G1 (s) =
(s + 0.5) (s + 10)
10s
(b) G2 (s) =
(s + 10) (s2 + s + 2)
(s + 4) (s + 20)
(c) G3 (s) =
(s + 10) (s + 80)
3. Find the stability margins of the following plants, and take conclusions
about whether or not they are stable in closed loop:
2(s + 3)
(a) G1 (s) =
s(s + 1)(s + 2)
5(s + 2)
(b) G2 (s) =
(s + 1)(s2 + 2s + 4)
1
(c) G3 (s) =
s(s + 1)2
Chapter 19

The Nichols diagram


Bis über'n Kopf in's Tintenfaÿ
Tunkt sie der groÿe Nikolas.

Heinrich Hoffmann (1809 „1894), Der Struwwelpeter, Die Geschichte von


dem schwarzen Buben

The Nichols diagram. Stability margins. The N and M curves.


This chapter is still being written.
In the picture: National Pantheon, or Church of Saint Engratia, Lisbon
(source: http://www.panteaonacional.gov.pt/171-2/historia-2/), some-
when during its construction (16821966).

Glossary
And the Galaadites tooke the fordes of Iordan, by the which Ephraim
was to returne. And when there had come to the same one of the
number of Ephraim, eeing, and had said: I besech you let me passe:
The Galaadites said to him: Art thou not an Ephraite? Who saying:
I am not: they asked him: Say then Schibboleth, which is interpreted
an Eare of corne. Who answered, Sibboleth, not being able by the
same letter to expresse, an eare of corne. And immediatly being
apprehended they killed him in the very passage of Iordan.

Judges, xii 56, Douay-Rheims version (1609)

word in English word in Portuguese


palavra em inglês palavra em português

327
328 CHAPTER 19. THE NICHOLS DIAGRAM

Exercises
1. Plot the Nichols diagram of the plant in Exercise 3 from Chapter 18.

2. Repeat Exercise 2 from Chapter 17 using the Nichols plot.

3. Repeat Exercise 3 from Chapter 17 using the Nichols plot.

4. Prove that the M and N curves are circles in the Nyquist diagram. Follow
the following steps.

(a) Let the frequency response of a transfer function G(s) be given by


G(jω) = X(ω) + jY (ω), where X, Y ∈ R, and let the frequency
response of the closed loop with G(s) in the direct branch and unit
feedback be F (s). Find an expression for F (jω) as function of X and
Y.
(b) Show that

X2 + Y 2
|F (jω)|2 = (19.1)
(1 + X)2 + Y 2

(c) Let M = |F (jω)|, and show that, if M = 1, the curve degenerates


into a vertical straight line given by X = − 21 .
(d) Let M 6= 1, and rearrange terms in (19.1) to arrive at
2
M2 M2

X+ 2 +Y2 = (19.2)
M −1 (M 2 − 1)2
2

which is the equation of a circle with centre − MM2 −1 , 0 and radius
M 2 −1 .
M

(e) Let . . . ##########


Chapter 20

Steady-state errors
Einer der Männer feuerte auf sie. Der hellblaue Lichtblitz verfehlte
sie um mehrere Meter und schlug eine Stichamme aus der Wand,
und Katt begann Haken zu schlagen und sich auf fast noch un-
möglichere Weise zu bewegen. Der nächste Schuss verfehlte sie noch
mehr, aber nun eröneten auch die anderen Männer das Feuer, und
Anders hatte ja bereits gesehen, was für ausgezeichnete Schützen sie
waren.

Wolfgang Hohlbein (1953 . . . ), Heike Hohlbein (1954 . . . ), Anders,


Die tote Stadt, I 6

This chapter is still being written.


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon
(source: http://www.panteaonacional.gov.pt/171-2/historia-2/), some-
when during its construction (16821966).

Glossary
At the next peg the Queen turned again, and this time she said,
Speak in French when you can't think of the English for a thing
turn out your toes as you walkand remember who you are!

Lewis Carroll (1832 „1898), Through the Looking-Glass, II

word in English word in Portuguese


palavra em inglês palavra em português

329
330 CHAPTER 20. STEADY-STATE ERRORS

Figure 20.1: Step response from Exercise 3.

Exercises
1. Consider a unit feedback control system with transfer function in the direct
loop
s+2
G(s) = 10 . (20.1)
(s + 3)(s + 5)

For a unit step input signal u(t) = 1, t ≥ 0, what is the steady-state error
ess of the time response?

2. Consider a closed-loop system with unit feedback and transfer function in


the direct loop

Y (s) 8
G(s) = = . (20.2)
E(s) (s + 2)(s + 4)

(a) For the closed loop's unit step response, nd:


i. the peak time tp
ii. the maximum overshoot y(tp )
iii. the rise time tr
iv. the settling time ts
(b) For a unit ramp input signal r(t) = t, t ≥ 0, what is this plant's
steady-state error ess = lim r(t) − y(t)?
t→+∞

3. Consider a system with transfer function Y (s)/U (s) = G(s). The output
time response y(t) in closed loop for a step input in the reference r(t) = 10,
t ≥ 0, exhibits the steady-state error ess = 1 shown in Figure 20.1. For
m ≤ n, which of the following statements is true?
1 + b1 s + · · · + bm sm
A) G (s) = 10
1 + a1 s + · · · + an sn
1 + b1 s + · · · + bm sm
B) G (s) = 9
1 + a1 s + · · · + an sn
1 + b1 s + · · · + bm sm
C) G (s) = 10
s (1 + a1 s + · · · + an sn )
1 + b1 s + · · · + bm sm
D) G (s) = 9 .
s (1 + a1 s + · · · + an sn )
331

Figure 20.2: Model of a pen in a plotter printer from Exercise 4.

Figure 20.3: Step response of the model of a pen in a plotter printer from
Exercise 4.

4. Figure 20.2 shows a block diagram that models the pen in a plotter and
the corresponding control system, and Figure 20.3 shows its unit-step
response.
(a) Find from the step-response the system's damping coecient ξ and
natural frequency ωn .
(b) We want to improve the time response y(t), so as to have an overshoot
Mp ≤ 5% and a 2% settling time ts < 0.1 s. Find, if possible, a value
of gain K for these specications.

5. In the closed-loop system of Figure 20.4,


s+2
G(s) = (20.3)
s(s + 1)(s + 4)
H(s) = 1 (20.4)
K>0 (20.5)
(a) Find the range of values of K for which the closed-loop is stable.
(b) Find K so that the the steady-state error for a unit ramp input is
10%.

6. Consider the plant in Figure 20.5, where


1
G(s) = , K > 0. (20.6)
(s + 1)(s + 3)(s + 8)
(a) Plot its root-locus.
(b) For which values of K is the system stable?
(c) Can you nd a 5% steady-state error ess for a unit-step input, solely
by changing gain K ?
(d) Plot the Bode diagram of G(s) for K = 240.
332 CHAPTER 20. STEADY-STATE ERRORS

Figure 20.4: Control loop from Exercise 5.

Figure 20.5: Control loop from Exercise 6.


Chapter 21

Design of PID controllers

In this paper, the three principal control eects found in present con-
trollers are examined and practical names and units of measurement
are proposed for each eect. (. . . ) Formulas are given which enable
the controller settings to be determined from the experimental or
calculated values of the lag and unit reaction rate of the process to
be controlled. These units form the basis of a quick method for ad-
justing a controller on the job. The eect of varying each controller
setting is shown in a series of chart records. It is believed that the
conceptions of control presented in this paper will be of assistance in
the adjustment of existing controller applications and in the design
of new installations.

J. G. Ziegler (1909 „1997), N. B. Nichols (1914 „1997), Optimum


settings for automatic controllers, Transactions of the ASME, Nov. 1942

In this chapter we address design methods for controllers of the PID family.
A generic PID controller corresponds to a transfer function usually written in
one of three ways:

I
C(s) = P + + Ds (21.1)
s
1
C(s) = kp 1 + + Td s (21.2)
Ti s

1
C(s) = KP 1 + (1 + TD s) (21.3)
TI s | {z }
| {z } derivative part
integral part

(21.1) is the same as (15.31), but this notation avoids confusions with (21.2)
and (21.3). It is of course possible to rewrite a PID given in one of these three
forms in either of the other two (see Exercise 1).

333
334 CHAPTER 21. DESIGN OF PID CONTROLLERS

This chapter is still being written.

In the picture: National Pantheon, or Church of Saint Engratia, Lisbon


(source: http://www.panteaonacional.gov.pt/171-2/historia-2/), some-
when during its construction (16821966).
335

Glossary

Nay, ye shall know the truth. Já que vos perdoei, porque sois
We come from another world, ignorantes, condescendo tambem
though we are men such as ye; em vos dizer quem somos. So-
we come, I went on, from the mos Espiritos! Vivemos além,
biggest star that shines at night. por cima das nuvens, n'uma
Oh! oh! groaned the chorus of d'aquellas estrellas que vós vêdes
astonished aborigines. de noite brilhar. E viemos visi-
tar esta terra, mas em paz e para
Yes, I went on, we do, indeed;
alegria de todos!
and again I smiled benignly, as
I uttered that amazing lie. We Entre os indigenas correram
come to stay with you a little grandes ah! ah! Lentos e mara-
while, and to bless you by our vilhados.
sojourn. Ye will see, O friends, Eu prosegui, mais grave:
that I have prepared myself for
this visit by the learning of your Nós conhecemos todos os reis
language. e todas as gentes. E eu, que sou
It is so, it is so, said the chorus. a voz dos outros, conheço todas
as linguas.
Only, my lord, put in the old
gentleman, thou hast learnt it A nossa bem mal! Arriscou
very badly. com timidez o velho guerreiro.
I cast an indignant glance at him, Dardejei-lhe um olhar chamme-
and he quailed. jante que o estarreceu.

H. Rider Haggard (1856 „1925), King Solomon's mines, VII (transl. Eça
de Queiroz (1845 „1900), As minas de Salomão, V)

word in English word in Portuguese


palavra em inglês palavra em português

Exercises
1. Show that:

(a) to rewrite (21.2) in the form of (21.1), we must do

P = kp (21.4)
kp
I= (21.5)
Ti
D = kp Td (21.6)

(b) to rewrite (21.3) in the form of (21.1), we must do



TD
P = KP 1+ (21.7)
TI
KP
I= (21.8)
TI
D = KP TD (21.9)

(c) to rewrite (21.1) in the form of (21.2), we must do

kp = P (21.10)
P
Ti = (21.11)
I
D
Td = (21.12)
P
336 CHAPTER 21. DESIGN OF PID CONTROLLERS

(d) to rewrite (21.1) in the form of (21.3), we must do either



P + P 2 − 4DI
KP = (21.13)
√ 2
P + P 2 − 4DI
TI = (21.14)
2I
2D
TD = √ (21.15)
P + P 2 − 4DI
or in alternative

P− P 2 − 4DI
KP = (21.16)
√ 2
P − P 2 − 4DI
TI = (21.17)
2I
2D
TD = √ (21.18)
P − P 2 − 4DI

(e) to rewrite (21.3) in the form of (21.2), we must do



TD
kp = K P 1 + (21.19)
TI
Ti = TI + TD (21.20)
TI TD
Td = (21.21)
TI + TD

(f) to rewrite (21.2) in the form of (21.3), we must do either


q
1 + 1 − 4 TTdi
KP = kp (21.22)
q2
1 + 1 − 4 TTdi
TI = Ti (21.23)
2
2
TD = Td q (21.24)
1 + 1 − 4 TTdi

or in alternative
q
1− 1 − 4 TTdi
KP = kp (21.25)
q2
1 − 1 − 4 TTdi
TI = Ti (21.26)
2
2
TD = Td q (21.27)
1 − 1 − 4 TTdi

− 21 s + 1
2. Find a PI controller and a PID controller for plant G(s) = ,
s2 + s + 31
using the open-loop (reaction curve) Ziegler-Nichols method.
10
3. Find a PID controller for plant G (s) = 2, using the closed-loop
s (s + 1)
(critical gain) Ziegler-Nichols method.
4. Consider the multirotor drone in Figure 21.1. The four rotors exert an
upwards force F , due to which the drone hovers at height h, with a vertical
velocity w = ḣ. The system can be represented by the block diagram in
the same Figure and will be controlled in closed loop aiming at
ˆ a 2% settling time of 1 second or less,
ˆ a maximum overshoot of 4.3% or less, and
ˆ no steady-state error for a constant height reference.
337

Figure 21.1: Left: multirotor drone; centre: block diagram with the control
system of the drone.

(a) Find which specications cannot be satised with a proportional con-


troller C(s) = 1.
(b) Propose a controller structure, nd its parameters, and verify that
specications are satised.

5. A torque Tf is applied to a ship to control its roll θ, as seen in Figure 21.2.


Θ(s) 9
The corresponding transfer function is Gp (s) = = 2 .
Tf (s) s + 1.2s + 9
The system will be controlled in closed loop aiming at

ˆ a 2% settling time of 4 second or less,


ˆ a maximum overshoot of 4.3% or less, and
ˆ a steady-state error for a 0◦ reference of 10% or less.

Figure 21.2: Ship from Exercise 5.

(a) Find which specications cannot be satised with a proportional con-


troller C(s) = 1.
(b) Propose a controller structure, nd its parameters, and verify that
specications are satised.

6. Find PID controllers for the following plants:


1
(a) G1 (s) =
s+1
1
(b) G2 (s) =
(s + 1)2
1
(c) G3 (s) =
(s + 1)3
1
(d) G4 (s) =
(s + 1)4
1
(e) G5 (s) =
(s + 1)8
1
(f) G6 (s) =
(s + 1)(1 + 0.1s)(1 + 0.12 s)(1 + 0.13 s)
1
(g) G7 (s) =
(s + 1)(1 + 0.2s)(1 + 0.22 s)(1 + 0.23 s)
338 CHAPTER 21. DESIGN OF PID CONTROLLERS

1
(h) G8 (s) =
(s + 1)(1 + 0.5s)(1 + 0.52 s)(1 + 0.53 s)
1 − 0.1s
(i) G9 (s) =
(s + 1)3
1 − 0.2s
(j) G10 (s) =
(s + 1)3
1 − 0.5s
(k) G11 (s) =
(s + 1)3
1−s
(l) G12 (s) =
(s + 1)3
1 − 2s
(m) G13 (s) =
(s + 1)3
1 − 5s
(n) G14 (s) =
(s + 1)3
7. Find PID controllers for the following plants:

100 1 0.5
(a) G15 (s) = +
(s + 10)2 s + 1 s + 0.05
(s + 6)2
(b) G16 (s) =
s(s + 1)2 (s + 36)
1
(c) G17 (s) = 2
(s + 1)(s + 0.2s + 1)
22
(d) G18 (s) =
(s + 1)(s2 + 0.2 × 2s + 22 )
52
(e) G19 (s) =
(s + 1)(s2 + 0.2 × 5s + 52 )
102
(f) G20 (s) =
(s + 1)(s2 + 0.2 × 10s + 102 )
1
(g) G21 (s) = 2
s −1
1
(h) G22 (s) =
s(s + 1)
1
(i) G23 (s) =
s(s + 1)2
1
(j) G24 (s) =
s(s + 1)3
1
(k) G25 (s) =
s(s + 1)4
1
(l) G26 (s) =
s(s + 1)8
1
(m) G27 (s) =
s(s + 1)(1 + 0.1s)(1 + 0.12 s)(1 + 0.13 s)
1
(n) G28 (s) =
s(s + 1)(1 + 0.2s)(1 + 0.22 s)(1 + 0.23 s)
1
(o) G29 (s) =
s(s + 1)(1 + 0.5s)(1 + 0.52 s)(1 + 0.53 s)
1 − 0.1s
(p) G30 (s) =
s(s + 1)3
1 − 0.2s
(q) G31 (s) =
s(s + 1)3
1 − 0.5s
(r) G32 (s) =
s(s + 1)3
1−s
(s) G33 (s) =
s(s + 1)3
1 − 2s
(t) G34 (s) =
s(s + 1)3
1 − 5s
(u) G35 (s) =
s(s + 1)3
Chapter 22

Design of lead-lag controllers

This chapter is still being written.


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon
(source: http://www.panteaonacional.gov.pt/171-2/historia-2/), some-
when during its construction (16821966).

Glossary
᾿Ακούσαντες δὲ ὅτι τῇ ῾Εβραΐδι διαλέκτῳ προσεφώνει αὺτοις μᾶλλον
παρέσχον ἡσυχίαν.

Saint Luke the Evangelist (? „84), Acts of the Apostles, xxii 2

word in English word in Portuguese


palavra em inglês palavra em português

Exercises
s+5
1. Consider plant G(s) = .
(s + 0.5)(s2+ 0.6s + 1.09)
(a) Find a lead compensator C(s) for this plant that fullls the following
specications:
ˆ The gain margin must be innite.
ˆ The phase margin must be P M = 20◦ with a ±10% tolerance.
ˆ The steady state error cannot be aected.

339
340 CHAPTER 22. DESIGN OF LEAD-LAG CONTROLLERS

Figure 22.1: Antenna from Exercise 2.

(b) Find a lead compensator C(s) for this plant that puts a pair of poles
at −4 + 10j , and verify the 2%-settling time against the performance
expected.
2. The transfer function relating the voltage applied to the motor u(t) with
Θ(s) 1
the azimuth angle of an antenna θ(t) is G(s) = = ; see
U (s) s(10s + 1)
Figure 22.1. We want
ˆ an overshoot to a step in the reference angle of 16% or less;
ˆ a 2% settling time of 10 s or less;
ˆ no steady-state error for a constant reference.

(a) Find the region of the splane where closed loop poles can lie.
(b) Prove that you cannot fulll all specications using proportional con-
trol only.
(c) Propose a structure for the controller.
(d) Find the parameters of a controller of the lead-lag family and show
that all specications are thereby fullled.
(e) Do the same for a controller of the PID family.

3. Figure 22.2 shows a plane, together with the variation of its height h(t)
in metres when a 1◦ step is applied to angle of the elevators δ(t).
(a) Which of the plots AH in Figure 22.3 corresponds to the root locus
of transfer function H(s)
∆(s) when K > 0?

(b) Which of the plots AH in Figure 22.3 corresponds to the root locus
of transfer function H(s)
∆(s) when K < 0?

(c) Is a feedback loop with proportional control enough to ensure an


accurate tracking of a constant vertical velocity ḣ(t)?
(d) Knowing that a feedback loop with a proportional controller equal
to 1 leads to a steady state error of 0.9 when tracking a constant
vertical velocity ḣ(t) = 1 m/s, design a controller reducing this steady
state error to 0.3, without signicantly deteriorating the transient
response.

4. The transfer function relating the depth of facing performed by a lathe


(output) with the control action of the motor (input) is
2
Gp (s) = (22.1)
s(s + 1)(s + 5)
The desired specications are:
ˆ maximum overshoot of 10% or less;
ˆ steady-state error of 0.125 m or less for a constant velocity reference.

(a) Show that not all specications can be satised with a proportional
controller K = 1.
341

Figure 22.2: Airplane from Exercise 3 and the unit step response from its model.

(b) Propose a structure for the controller, nd its parameters, and verify
that specications are fullled.

5. The horizontal position x(t) of a robot is given by transfer function

X(s) 1.6
Gp (s) = = (22.2)
U (s) (s + 1)2

where u(t) is the control action. The desired specications are:

ˆ maximum overshoot of 10% or less;


ˆ phase margin of 50◦ or more;
ˆ steady-state error of 10% or less for a constant position reference.

(a) Show that not all specications can be satised with a proportional
controller K = 1.
(b) Propose a structure for the controller, nd its parameters, and verify
that specications are fullled.
342 CHAPTER 22. DESIGN OF LEAD-LAG CONTROLLERS

Figure 22.3: Possible root locus plots for the airplane from Exercise 3.
Chapter 23

Internal Model Control


Sir Humphrey: The Civil Service was united in its desire to make
sure that the Common Market didn't work. That's why we went
into it.
Hacker: What are you talking about?
Sir Humphrey: Minister, Britain has had the same foreign policy ob-
jective for at least the last 500 years: to create a disunited Europe.
In that cause we have fought with the Dutch against the Spanish,
with the Germans against the French, with the French and Italians
against the Germans, and with the French against the Germans and
Italians. Divide and rule, you see. Why should we change now, when
it's worked so well?
Hacker: That's all ancient history, surely?
Sir Humphrey: Yes, and current policy. We had to break the whole
thing up, so we had to get inside. We tried to break it up from
the outside, but that wouldn't work. Now that we're inside we can
make a complete pig's breakfast of the whole thing: set the Ger-
mans against the French, the French against the Italians, the Ital-
ians against the Dutch. . . The Foreign Oce is terribly pleased; it's
just like old times.

Antony Jay (1930 „2016), Jonathan Lynn (1943 . . . ), Yes, Minister, I 5


(The writing on the wall)

Internal Model Control (IMC) may be seen as a variation of closed-loop


control or as a design method for closed-loop controllers. It is the object of
Exercise 3 from Chapter 9, and is developed in this Chapter.

23.1 IMC as a variation of closed-loop control


IMC can be used when there is a good model of the system and a good inverse
model of the system (i.e. a model that receives the system's output y(t) as
input, and delivers the system's input u(t) as output). These are used in the
conguration shown in Figure 23.1, where

ˆ G(s) is the actual system to control,

ˆ G∗ (s) is the model of the plant,

ˆ G−1 (s) is the inverse model of the plant.

343
344 CHAPTER 23. INTERNAL MODEL CONTROL

Figure 23.1: Block diagram of IMC.

In this conguration,

E = R − Y − Ŷ
= R − D − GU + G∗ U
= R − D − GG−1 E + G∗ G−1 E (23.1)
−1 ∗ −1

⇒ E 1 + GG − G G =R−D
1 1
⇒E=R −D
(1 + GG−1 − G∗ G−1 ) (1 + GG−1 − G∗ G−1 )
GG−1 GG−1
Y = GG−1 E + D = R −1 ∗ −1
−D +D
1 + GG − G G 1 + GG−1 − G∗ G−1
GG−1 1 − G∗ G−1
=R −1 ∗ −1
+D
1 + GG − G G 1 + GG−1 − G∗ G−1
(23.2)

Notice that if the model is perfect, i.e. if G∗ (s) = G(s), then the error (23.1)
is

E(s) = R(s) − D(s) −G(s)U (s) + G∗ (s)U (s) = R(s) − D(s). (23.3)
| {z }
0

If the inverse model is perfect, then

Y (s) = D(s) + G(s)G−1 (s) E(s) = D(s) + R(s) − D(s) = R(s) (23.4)
| {z }
1

In other words, with perfect models, IMC achieves perfect disturbance rejection,
i.e. perfect robustness to disturbances. In practice, models are never perfect,
but IMC often works well enough if models are fairly good.
IMC is suitable when black-box models (direct and inverse) of the plant
are available. If models are transfer functions, then a proper G∗ (s) implies an
inverse model G−1 (s) which is not proper. Consequently, additional poles will
have to be included just as for PIDs and lead-lag controllers. To be more
precise, if G∗ (s) has n poles and m zeros and is strictly proper, then n − m + 1
poles have to be added to G−1 (s) so that it will become strictly proper.
Example 23.1. Consider the following case:
s+2
G(s) = (23.5)
(s2 + 0.18s + 1)(s + 0.1)
s+2
G∗ (s) = 2 (23.6)
(s + 0.2s + 1)(s + 0.1)
102 (s2 + 0.2s + 1)(s + 0.1)
G−1 (s) = (23.7)
(s + 2)(s + 10)2
Notice that:
ˆ the dominant pole of the model is −0.1;

ˆ the model also has two non-dominant complex conjugate poles with ξ =
0.1 and ωn = 1 rad/s;
ˆ we are assuming that the damping coecient ξ of the complex poles was
identied with a 10% error;
23.1. IMC AS A VARIATION OF CLOSED-LOOP CONTROL 345

Figure 23.2: Results of Example 23.1.

Figure 23.3: Results of Example 23.2.

ˆ two poles, one decade above ωn , were added to the inverse model, so that
it will be proper.

The output of the IMC system in Figure 23.1 in this case is shown in Figure 23.2
for a reference consisting of three steps.

Example 23.2. Consider the following case:

−s + 2
G(s) = (23.8)
(s2 + 0.18 ∗ s + 1)(s + 0.1)
2
G∗ (s) = 2 (23.9)
(s + 0.2 ∗ s + 1)(s + 0.1)
103 (s2 + 0.2 ∗ s + 1)(s + 0.1)
G−1 (s) = (23.10)
2(s + 10)3

The dierence from Example 23.1 is that there is a non-minimum phase zero. As
a consequence, there would be an unstable pole in the inverse model. The way
around this is to replace that pole by its steady-state gain; a third additional pole
has to be added for a proper inverse model. And, because this approximation
was used in the inverse model G−1 , it is better to use in G∗ as well, otherwise
results would be worst. The output of the IMC system in Figure 23.1 in this
case is shown in Figure 23.3 for the same reference of Example 23.1. Notice how
the eect of the non-mimimum phase zero which was not properly modelled is
now clearly felt. We will see in Example 23.3 how to improve upon this.
346 CHAPTER 23. INTERNAL MODEL CONTROL

23.2 IMC as a design method for closed-loop con-


trollers
Suppose that G∗ and G−1 are known as transfer functions. Then IMC is equiv-
alent to a usual closed-loop (see Figure 9.13) if

G−1 (s)
C(s) = . (23.11)
1 − G−1 (s)G∗ (s)

In fact, in that case,


Y CG
=
R 1 + CG
G−1 G
1−G−1 G∗
= G−1 G
1 + 1−G −1 G∗

−1
G G
= (23.12)
1 − G−1 G∗ + G−1 G
which is the same as (23.2).
Of course, if the inverse model G−1 (s) is the exact inverse of the model G∗ (s)
of the plant, then (23.11) becomes

G−1
C(s) = −1 ∗ (23.13)
1−G
| {zG}
1
| {z }
0

which makes no sense, and at best means that the control action U = CE =
G−1 E
lim should be very large (likely saturating the actuator in practice).
D→0 D
Still, fairly good models may be used with (23.11) resulting in acceptable con-
trollers.
Example 23.3. Plant (23.8) from Example 23.2 can be controlled in closed
loop using (23.11) found from (23.9)(23.9):
103 (s2 +0.2∗s+1)(s+0.1)
2(s+10)3
C(s) = 103 (s2 +0.2∗s+1)(s+0.1) 2
1− 2(s+10)3 (s2 +0.2∗s+1)(s+0.1)
103 (s2 +0.2∗s+1)(s+0.1)
2(s+10)3
= 103
1 − (s+10) 3

3 2
10 (s + 0.2 ∗ s + 1)(s + 0.1)
=
(s + 10)3 − 103
103 (s2 + 0.2 ∗ s + 1)(s + 0.1)
= (23.14)
s3 + 30s2 + 300s
This closed-loop controller actually performs better than the IMC from Exam-
ple 23.2, as you may see simulating both cases with Matlab. This may seem
surprising since we just proved equivalence for the general case. But cancelled
poles and zeros in (23.14) allow much better results numerical simulations
and in practice (23.11) also works better than Figure 23.1 if, of course, models
are known as transfer functions.

Glossary
I got o the plane in Recife (the Brazilian government was going to
pay the part from Recife to Rio) and was met by the father-in-law
of César Lattes, who was the director of the Center for Physical
Research in Rio, his wife, and another man. As the men were o
getting my luggage, the lady started talking to me in Portuguese:
You speak Portuguese? How nice! How was it that you learned
Portuguese?
23.2. IMC AS A DESIGN METHOD FOR CLOSED-LOOP CONTROLLERS 347

I replied slowly, with great eort. First, I started to learn Span-


ish. . . then I discovered I was going to Brazil. . . Now I wanted
to say, So, I learned Portuguese, but I couldn't think of the word
for so. I knew how to make big words, though, so I nished the
sentence like this: consequentemente, aprendi Português!
When the two men came back with the baggage, she said, Oh, he
speaks Portuguese! And with such wonderful words: consequente-
mente!

Richard P. Feynman (1918 „1988), Ralph Leighton (1949 . . . ), Surely


you're joking, Mr. Feynman! Adventures of a curious character, 4

Internal Model Control controlo por modelo interno

Exercises
1. Find a closed-loop controller for the plant of Example 23.1 using (23.11).
Compare its performance with the one shown in Figure 23.2.

2. Apply IMC to the plants of Exercises 6 and 7 from Chapter 21. Simulate
the results using Simulink for the references mentioned in each Exercise.

(a) Implement the simulation using the block diagram of Figure 23.1.
(b) Implement the simulation using (23.11) and a closed loop.
348 CHAPTER 23. INTERNAL MODEL CONTROL
Chapter 24

Delay systems
Abrupt and nerve-shattering the telephone rang. Ashley leapt up to
answer it. Captain Granforte barred his way.
Let him go, Captain, said George Harlequin. Let him do what he
wants.
Granforte stepped aside and Ashley stood with the receiver in his
hands, listening to the crackling, impersonal voices saying Pronto!
Pronto! Pronto! all the way up to Rome, and looking down at
the dead face of Vittorio d'Orgagna and the blood that spread out
over his white shirt-front. The `prontos' started again in descend-
ing scaleRome, Terracina, Naples, Castellammare, Sorrentoand
nally, Hansen came on.
Pronto! Hansen speaking.
This is Ashley. . . Sorrento.
Great to hear you, Ashley boy! Great, great! What's news?

Morris West (1916 „1999), The big story, 13

This chapter is still being written. In the picture below: National Pantheon,
or Church of Saint Engratia, Lisbon (source: http://www.panteaonacional.
gov.pt/171-2/historia-2/), somewhen during its construction (16821966).

24.1 Pure delays


Origin. Laplace transform. Frequency response. Bode, Nyquist and Nichols
diagrams. The example of hot water in the shower. Margins.
Theorem 24.1. The Laplace transform of delay θ is the negative exponential
e−θs , i.e. given a function f (t) with Laplace transform F (s),

L [f (t − θ)] = F (s)e−θs (24.1)

Proof. Since we are using the unilateral Laplace transform, and thus the integral
in
Z +∞
L [f (t − θ)] = f (t − θ)e−st dt (24.2)
0

begins at t = 0, it is clear from Figure 24.1 that we can multiply f (t − θ) by a


delayed Heaviside function, without changing the result:
Z +∞
L [f (t − θ)] = f (t − θ)H(t − θ)e−st dt (24.3)
0

Using variable change

τ =t−θ (24.4)
t = 0 ⇒ τ = −θ (24.5)
t = +∞ ⇒ τ = +∞ (24.6)
dτ = dt (24.7)

349
350 CHAPTER 24. DELAY SYSTEMS

Figure 24.1: A function of time, and the same function delayed.

this becomes

Z +∞
L [f (t − θ)] = f (τ )H(τ )e−s(t−θ) dτ (24.8)
−θ

and because H(t) = 0 for t < 0 this integral can begin in 0:

1
Z +∞ z }| {
L [f (t − θ)] = e −sθ
f (τ ) H(τ ) e−sτ dτ
0
Z +∞
= e−sθ f (τ )e−sτ dτ = F (s) e−sθ (24.9)
0
| {z }
L [f (t)]

24.2 Padé approximations


Origin. Poles and zeros. Margins (approximated). Use in controller design.

24.3 Smith predictor


Variation of IMC. What it does and does not.

24.4 Control of systems similar to delay sistems


Systems with non-minimum phase. Control design.
Systems with two signicantly dierent time constants. Cascade control has
already been mentioned in Exercise 4 from Chapter 9.
24.4. CONTROL OF SYSTEMS SIMILAR TO DELAY SISTEMS 351

This chapter is still being written. In the picture: National Pantheon, or


Church of Saint Engratia, Lisbon (source: http://www.panteaonacional.gov.
pt/171-2/historia-2/), somewhen during its construction (16821966).

Glossary
Padre nosso que estaes nos céus:dizia Engracia Ripa, deixando
correr um dos bugalhos de umas contas da terra sancta que tinha nas
mãos.Ora essa!Sancticado seja o vosso nome.Forte tractante!
Venha a nós o vosso reino.E uma pessoa com a sua áquella de que
era um home como se quer!Seja feita a vossa vontade.Safa!
Assim na terra como nos céus.Com que então setenta?
Entregadinhas!Ave Maria, gracia plena: respondeu a tia Jero-
nyma, que latinisava furiosamente á força de viver com o prior.
Como lh'o hei-de dizer?Domisteco.Foi o demo que o tentou.
Benedités tu. . .

Alexandre Herculano (1810 „1877), Lendas e narrativas, O Parocho da


aldeia, VIII

cascade control controlo em cascata


(pure) delay atraso (puro)
Smith predictor preditor de Smith

Exercises
1. Consider the irrigation canal in Figure 24.2. The water from a reservoir
enters the canal through a gate at height y ∈ [0 m, 1 m]. The gate is
actuated by a motor controller by voltage V ∈ [−10 V, +10 V]. The
velocity of the gate is given by

ẏ = ϕV (24.10)

and maximum velocity of the gate achieved by the motor is ±0.1 m/s.
We know from Fluid Mechanics that water dynamics in the canal is given
by Saint-Venant equations (a simplied version of the Navier-Stokes equa-
tions for this case), but this can be approximated by a rst order transfer
function with delay, relating water height h with gate height y . In this
canal,
h(s) 100
= e−20s (24.11)
y(s) 100s + 1
352 CHAPTER 24. DELAY SYSTEMS

(a) Draw the block diagram for this system, with input V and output h.
(b) Show that a proportional controller K for gate height y leads to a
closed loop transfer function given by

y(s) 0.01K
= (24.12)
yref (s) s + 0.01K

(c) Find the value of K achieving the smallest possible settling time for
a unit step reference, without saturation of the control action.
(d) Let K = 10. Show that h(s) and yref (s) are related by transfer
function
h(s) 0.1 × 100
G(s) = = e−20s (24.13)
yref (s) (s + 0.1)(100s + 1)

(e) Show that, using a (1,1) Padé approximation, G(s) above can be
approximated by

h(s) 100(1 − 10s)


G̃(s) = = (24.14)
yref (s) (10s + 1)2 (100s + 1)

(f) Plot the Bode diagram of G̃(s). (Take into account that this is a
non-minimum phase system.)
(g) Since G(s) is a system with delay a Smith predictor is actually a
better control architecture. The block diagram is given in Figure
24.3, where κ is a controller. Identify signals 1, 2, 3, 4 and 5, and
transfer functions 6, 7, 8, 9 and 10.

Gate

Reservoir
y
Canal
h

Onto the farms

Figure 24.2: Irrigation canal.

Figure 24.3: Smith predictor.

2. The angular velocity of the motor of a drone is ω(t) and depends on a


control action v(t):

1
G(s) = e−0.35s (24.15)
0.04s + 1
24.4. CONTROL OF SYSTEMS SIMILAR TO DELAY SISTEMS 353

(a) Comparing plant (24.15) with plant


1
G̃(s) = , (24.16)
0.04s + 1
what does the term e−0.35 change: only the gain, only the phase,
both gain and phase, or neither gain nor phase?
(b) Show that using a Padé approximation it is possible to approximate
(24.15) by
−s + 5.714
G(s) ≈ 2
(24.17)
0.04s + 1.229s + 5.714
(c) Use approximation (24.17) and the Routh-Hurwitz criterion to nd
the values that a proportional controller K can take, ensuring the
stability of the closed loop.
(d) Explain if the real range of values of K that stabilise plant (24.15)
is larger or smaller than the one you got using Padé approximation
(24.17).

3. Explain why a non-minimum phase zero makes a plant harder to control.


0.5
4. Consider a plant with the transfer function G(s) = e−2s . Find its
s (s + 1)
gain and phase margins.

5. Find PID controllers for the following plants both without, and with, a
Smith predictor, and compare performance.

(a) G1 (s) = e−s


1
(b) G2 (s) = e−s
1 + 0.1s
1
(c) G3 (s) = e−s
1 + 0.2s
1
(d) G4 (s) = e−s
1 + 0.5s
1
(e) G5 (s) = e−s
1 + 2s
1
(f) G6 (s) = e−s
1 + 5s
1
(g) G7 (s) = e−s
1 + 10s
1
(h) G8 (s) = e−s
(1 + 0.1s)2
1
(i) G9 (s) = e−s
(1 + 0.2s)2
1
(j) G10 (s) = e−s
(1 + 0.5s)2
1
(k) G11 (s) = e−s
(1 + 2s)2
1
(l) G12 (s) = e−s
(1 + 5s)2
1
(m) G13 (s) = e−s
(1 + 10s)2
354 CHAPTER 24. DELAY SYSTEMS
Part V

Practical implementation of
control systems

355
357

Who would be satised with a navigator or engineer, who had no


practice or experience whereby to carry on his scientic conclusions
out of their native abstract into the concrete and the real?

Saint John Henry Newman (1801 „1890), An essay in aid of a grammar of


assent, VIII 1, 2

In this part of the lecture notes:

Chapter 25 is an introduction to digital signals and systems.

Chapter 26 shows how to nd digital approximations of previously designed con-


trollers.

Chapter 27 presents tools for the study of digital closed loop control systems, and how
to use them to design digital controllers directly, rather then approximat-
ing a previous design.

Chapter 28 is about the eects of non-linearities in control systems.

Chapter 29 presents an overview of several practical issues of implementation.

Here is what you need to know beforehand to follow these chapters:

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4;

ˆ System theory, from Part II;

ˆ Filters, from Sections 12.2 and 12.3 of Chapter 12;

ˆ Control theory, from Part IV (though you may have skipped Chapters 19
and 23).
358
Chapter 25

Digital signals and systems


Τοῦ δὲ ποσοῦ τὸ μέν ἑστι διωρισμένον, τὸ δὲ συνεξές.

Aristotle (384 BC „322 BC), Kathegoriai, VI

Controllers designed with the methods from Part IV can be implemented in


many ways. All controllers until the mid-20th century used only mechanical,
pneumatic or electrical components, and can be found today in simple cases or
for special applications (remember Example 3.32).
Example 25.1. In the cicuit of Figure 25.1,
R1
VA = − e = −e (25.1)
R1
1
1
VB = − Cs e = − e (25.2)
R2 R2 Cs
R4 R4 R4 1
u = − VA − VB = 1+ e (25.3)
R3 R3 R3 R2 C s
|{z} |{z}
Kp Ti

This is, consequently, an implementation of a PI controller. If R4 and R2 are


potentiometers, the two parameters of the controller can be tuned sliding or
rotating two buttons.
Because (as we saw in Chapter 3) most systems nowadays include digital
signals, and because controllers are usually implemented using microprocessors,
computers (which of course have microprocessors), or Programmable Logic Con-
trollers (which are computers designed specically to implement controllers in
harsh environments, resisting to dust, vibrations, extreme temperatures, etc.),
which only handle digital signals, it is important to study the consequences
digital signals have for control performance. Remember that a digital signal

Figure 25.1: A PI controller implemented with OpAmps, resistors, and a capac-


itor.

359
360 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

Figure 25.2: A digital signal.

ˆ only exists in some time instants, i.e. is discrete in time;


ˆ only assumes values from a discrete set, i.e. is quantised in amplitude.
We will concentrate on the eects of discretisation (and thus speak mostly of dis-
crete signals and discrete signals, rather than digital signals and digital systems)
because
ˆ when a signal only assumes values in some time instants, derivatives no
longer exist;
ˆ whatever happens inbetween two sampling instants will only be known at
the next sampling instant. Thus, the eect of discretisation is similar to
that of a delay, and we know from Chapter 24 the problems this brings.
Notice, however, that, even if the sampling time Ts is constant, the delay
τ with which an event will be known will be variable. All we know is that
0 ≤ τ < Ts .
When time is discrete, time instants and signal values are numbered as in
Figure 25.2. Notice that
ˆ if there are n + 1 time instants, they are numbered from 0 to tn ;

ˆ yk is a shorthand for y(tk );

ˆ if the sampling time Ts is constant, then

t0 = 0 (25.4)
t1 = Ts (25.5)
t2 = 2Ts (25.6)
t3 = 3Ts (25.7)
..
. (25.8)
tk = k Ts (25.9)

and

y0 = y(t0 ) = y(0) (25.10)


y1 = y(t1 ) = y(Ts ) (25.11)
y2 = y(t2 ) = y(2Ts ) (25.12)
y3 = y(t3 ) = y(3Ts ) (25.13)
..
. (25.14)
yk = y(tk ) = y(k Ts ) (25.15)

It is because of (25.4) and (25.10) that it is reasonable to begin numbering


time instants at 0.
25.1. THE Z TRANSFORM 361

onstant in practice In practice, Ts is almost always constant, since this is much easier to implement
and it is fortunate that it be so, since the mathematical treament is much
simpler assuming a constant Ts , as we will always do in what follows.

25.1 The Z transform


We will now nd the Laplace transform of a discrete signal y(t), such as (25.10)
(25.15), that only assumes a value if t = k Ts , k ∈ Z+
0 . This signal is zero almost
everywhere. Remembering property (10.21) of the Dirac delta function, we write

y(t) = y(0)δ(t) + y(Ts )δ(t − Ts ) + y(2Ts )δ(t − 2Ts ) + y(3Ts )δ(t − 3Ts ) + . . . + y(k Ts )δ(t − k Ts ) + . . .
= y0 δ(t) + y1 δ(t − Ts ) + y2 δ(t − 2Ts ) + y3 δ(t − 3Ts ) + . . . + yk δ(t − k Ts ) + . . .
+∞
X
= yk δ(t − k Ts ) (25.16)
k=0

In this way, if we integrate y(t)


ˆ and t is not a multiple of Ts (more precisely, ∼ ∃k ∈ Z+
0 : t = k Ts ), the
integral is 0;
ˆ and t = 0, we get back y(0) = y0 ;

ˆ and t = Ts , we get back y(Ts ) = y1 ;

ˆ and t = 2Ts , we get back y(2Ts ) = y2 ;

ˆ and, in the general case, t = k Ts , k ∈ N, we get back y(k Ts ) = yk .

Theorem 25.1. The Laplace transform of a discrete signal yk is


"+∞ # +∞
X X k
L [y(t)] = L yk δ(t − k Ts ) = y k e − Ts s (25.17)
k=0 k=0

Proof. Applying (2.1) to y(t), and then (24.1),


Z +∞
+∞ X
L [y(t)] = yk δ(t − k Ts )e−st dt
0 k=0
+∞
X Z +∞
= yk δ(t − k Ts )e−st dt
k=0 |0 {z }
L [δ(t−k Ts )]
+∞
X
= yk L [δ(t)] e−k Ts s (25.18)
| {z }
k=0
1

This Laplace transform justies the following denitions:


Denition 25.1. The delay operator z −1 is given by Delay operator z −1

z −1 = e−Ts s (25.19)

Using this delay operator z −1 , we can write the Laplace transform (25.17)
of a discrete signal yk in a more simple way:
Denition 25.2. The Z transform of a discrete signal yk is its Laplace trans- Z [yk ]
form written with the delay operator z −1 :
+∞
X
Z [yk ] = yk z −k (25.20)
k=0

Here are some consequences of the denition of z −1 :


ˆ the delay operator z −1 = e−Ts s is a delay of one sampling time Ts ;

ˆ z −k = e−k Ts s is a delay of k sampling times Ts ;


362 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

Figure 25.3: Three discrete time signals from Examples 25.2, 25.3, and 25.4,
together with the continuous time functions that they discretise.

ˆ the forward operator z = eTs s is a forward shift in time of one sampling Forward operator z
time Ts ;
ˆ z k = ek Ts s is a forward shift in time of k sampling times Ts ;

ˆ because z and z −1 are dened with an exponential, neither is ever 0. Thus,


it is always possible to divide by z or by z −1 .
Example 25.2. The Z transform of the Heaviside function (see Figure 25.3)
h0 = 1 (25.21)
h1 = 1 (25.22)
h2 = 1 (25.23)
h3 = 1 (25.24)
..
. (25.25)
hk = 1, ∀ k ∈ Z+
0 (25.26)

is the sum of a geometric series:


+∞ +∞
X X k
Z [hk ] = z −k = z −1 = z 0 + z −1 + z −2 + z −3 + . . . (25.27)
k=0 k=0

The rst term is z 0 = 1, and the ratio is z −1 ; thus, the sum is


1 z
Z [hk ] = H(z) = −1
= (25.28)
1−z z−1

Example 25.3. The Z transform of the power function with base a 6= 0


x0 = a0 = 1 (25.29)
x1 = a = a 1
(25.30)
x2 = a 2
(25.31)
x3 = a 3
(25.32)
..
. (25.33)
k
xk = a , ∀ k ∈ Z+
0 (25.34)

is also the sum of a geometric series:


+∞ +∞ k
X X a
Z [xk ] = ak z −k = (25.35)
z
k=0 k=0

a 0
The rst term is = 1, and the ratio is z;
a
thus, the sum is

z

1 z 1
Z [xk ] = X(z) = a = = (25.36)
1− z z−a 1 − a z −1

Notice that (25.28) is a particular case of (25.36), for a = 1.


25.2. DISCRETE TRANSFER FUNCTIONS 363

Example 25.4. Function e−at can be discretised as xk = e−akTs , and its Z


transform is
+∞ +∞
X X k
Z [xk ] = e−akTs z −k = z −1 e−aTs (25.37)
k=0 k=0

The rst term is 1, and the ratio is z −1 e−aTs ; thus, the sum is

1 z
Z [xk ] = X(z) = = (25.38)
1 − z −1 e−aTs z − e−aTs

The Z transform, being a Laplace transform, enjoys the linearity property Z is linear
of L . This can also be shown from denition:

Theorem 25.2. The Z transform is a linear operator:


+∞
X
Z [a xk ] = a xk z −k = aZ [xk ] (25.39)
k=0
+∞
X
Z [xk + yk ] = (xk + yk ) z −k
k=0
+∞
X +∞
X +∞
X
= xk z −k + yk z −k = xk z −k + yk z −k
k=0 k=0 k=0
= Z [xk ] + Z [yk ] (25.40)

Theorem 25.3. The initial and nal values of a discrete signal xk are retrieved Initial value theorem
from its Z transform X(z) as Final value theorem

x0 = lim X(z) (25.41)


z→+∞
−1
(25.42)

lim xk = lim 1 − z X(z)
k→+∞ z→1

Proof. (25.41) is an obvious consequence of the denition:

lim X(z) = lim x0 + x1 z −1 + x2 z −2 + x2 z −2 + x3 z −3 + . . . = x0 (25.43)


z→+∞ z→+∞

To prove (25.42), we rst notice that since z −1 is a delay then z −1 X(z) is found
as follows:
+∞
X
X(z) = Z [xk ] = xk z −k (25.44)
k=0
+∞
X
⇒ z −1 X(z) = Z [xk−1 ] = xk−1 z −k (25.45)
k=0

We now subtract (25.45) from (25.44):

+∞
X +∞
X
−1 −k
X(z) − z X(z) = xk z − xk−1 z −k
k=0 k=0
+∞
X
−1
(xk − xk−1 ) z −k

⇔ X(z) 1 − z =
k=0
+∞
X n
X
⇒ lim X(z) 1 − z −1 = lim (xk − xk−1 ) z −k = lim

(xk − xk−1 )
z→1 z→1 n→+∞
k=0 k=0
= lim x0 − x−1 + x1 − x0 + x2 − x1 + x3 − x2 + x4 − x3 + . . . + xn−1 − xn−2 + xn − xn−
n→+∞

= lim xn − x−1 (25.46)


n→+∞ |{z}
0

We assume x−1 = 0 because the rst sample of the signal is x0 .


364 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

25.2 Discrete transfer functions


Because the time is discrete, there are no derivatives; it is impossible to calculate No derivatives in disc
time
f (t) − f (t − h)
0
f (t) = lim (25.47)
h→0 h
since h cannot be smaller than Ts , or f (t) will no longer be dened. That is
why, as we saw in Chapter 3, digital systems are not described by dierential
equations, but rather by dierence equations, that relate the successive values
of the input and the output. Operator z −1 is very useful to write dierence
equations.
Example 25.5. The model
Y (s) 1 1 3
= ⇒ y(t) = u(t) − y 0 (t) (25.48)
U (s) 2 + 3s 2 2
can be approximated as
1 3 y(t) − y(t − Ts ) 1 3 yk − yk−1
y(t) = u(t) − ⇒ yk = uk − (25.49)
2 2 Ts 2 2 Ts
using the smallest possible time interval. We will see below in Section 25.3 and
Chapter 26 that this is not the only possible approximation, or even the best;
but it suces to show how dierence equation (25.49) can be written using z −1 :
1 3 yk − yk−1
uk −
yk =
2 2 Ts
3 (z) 1 − z −1

1 Y
⇔ Y (z) = U (z) −
2 2 Ts
⇔ 2Ts Y (z) = Ts U (z) − 3Y (z) 1 − z −1

⇔ Y (z) 2Ts + 3 − 3z −1 = U (z)Ts


Y (z) Ts
⇔ = (25.50)
U (z) 2Ts + 3 − 3z −1

Discrete transfer function (25.50) is a dierential equation put under the form of a discrete transfer
function. While a discrete transfer function relates the Z transform of the
output (in the numerator) and the input (in the numerator), just like a contin-
uous time transfer function, is not unusual to abuse notation and write instead
yk Ts
= (25.51)
uk 2Ts + 3 − 3z −1
There are several ways of creating a discrete transfer function with Matlab:
ˆ tf will create a discrete transfer function in z if, after the vectors with
the coecients of the numerator and the denominator, the sampling time
is given;
ˆ tf will create a discrete transfer function in z −1 if this is requested by
option 'Variable';
ˆ z = tf('z') creates the forward operator z , for which the sampling time
may or may not be specied;
ˆ z_1 = tf([0 1],1,'Variable','z^-1')
creates the delay operator z −1 .
Simulink also has a block for discrete transfer functions.
Example 25.6. Transfer function
z+2 z −1 + 2z −2
G(z) = = (25.52)
3z 2 + 4z + 5 3 + 4z −1 + 5z −2
can be created as a function of z either as
>> tf([1 2],[3 4 5],0.5)
25.3. ZERO ORDER HOLD 365

Figure 25.4: Top row: a signal, discrete in time, and the continuous signals
obtained with a ZOH and a FOH. It is clear that the FOH easily over or un-
derestimates the signal. Bottom row: the same signal, corrupted by noise. The
ZOH is aected; the FOH provides wild outputs.

or as

>> z = tf('z',0.5);
>> (z+2)/(3*z^2+4*z+5)

As a function of z −1 , we either make (notice the leading zero)

>> tf([0 1 2],[3 4 5],0.5,'Variable','z^-1')

or

>> z_1 = tf([0 1],[1],0.5,'Variable','z^-1');


>> (z_1+2*z_1^2)/(3+4*z_1+5*z_1^2)

25.3 Zero order hold


The usual way of converting a discrete signal into a continuous one is the zero ZOH
order hold (ZOH), which we already met in Figure 3.13. It keeps the last
value of the discrete signal constant until there is a new value. The output of a
ZOH is a sequence of steps; i.e. a sequence of zero-order polynomials, that is to
say, a zero-order spline (hence the name).
A possible alternative would be a rst-order hold, that extrapolates the FOH
value from the last two previous samples, as seen in Figure 25.4. That Figure
also makes clear the reason why this is seldom done: any noise will make the
extrapolation far poorer than the result of a ZOH (and the electronics are of
course harder to implement).
Control loops with a digital controller and a continuous plant are often found
in practice. In that case, there must be a ZOH converting the digital control
action uk provided by the controller into a continuous signal u(t), as seen in
Figure 25.5. In that case, when discretising the plant, we have to nd uykk ,
and thus the eects of the ZOH must be accounted for. The resulting discrete
transfer function is usually denoted by HG(z) = uykk , to stress that it is not just
G(s) that is being discretised, but the ZOH too; the H stands for hold.
366 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

Figure 25.5: Control loop with a digital controller and a continuous plant.
Notice that the reference rk is discrete in time, just as the measured output
ŷk and the closed loop error ek . The plant output y(t) is continuous, and
the control action provided by the controller must be converted from a digital
signal uk into a continuous signal u(t) by a ZOH. The part of the loop within
the dashed line is what Theorem 25.4 is concerned with.

Theorem 25.4. A continuous plant G(s) = y(s)


with a ZOH at its input (as Z transform when the
u(s)
shown in Figure 25.5) has a discrete equivalent HG(z) = uykk given by a ZOH


z−1 G(s) G(s)
HG(z) = Z −1
= (1 − z )Z (25.53)
z s s
Proof. The output u(t) of the ZOH is given by a sequence of steps:

u(t) = uk , k Ts ≤ t < (k + 1)Ts (25.54)

This can be written as


+∞
X
u(t) = xk H t − k Ts − H t − (k + 1)Ts (25.55)
k=0

Thus
+∞
X 1 −k Ts s 1 −(k+1)Ts s
u(s) = L [u(t)] = uk e − e
s s
k=0
z −1
z −k z }| {
+∞
1 − e−Ts s
X z }| {
= uk e−k Ts s (25.56)
s }
k=0 | {z
| {z } due to the ZOH
Z [uk ]

and
1 − z −1

yk G(s)
= HG(z) = Z G(s) −1
= (1 − z )Z (25.57)
uk s s

25.4 Choosing the sampling time


The sampling time of a system must be appropriate to the plants and signals
involved. It cannot be too large, and should not be too short.
ˆ If the sampling time is too large, the behaviour of the system will not be
known. For instance, to study sea waves a sampling time of 10 s would
not do, since many waves have shorter periods. These would never be
measured.
ˆ It the sampling time is too short, there will be useless measurements,
and huge senseless data les. Furthermore, since experimental data is
always corrupted with some noise, short sample times mean that more
high frequency noise is being acquired. For instance, to study the tides a
sampling time of 10 ms would not do, since the tides take hours to rise
and fall (with periods of either 12 h or 24 h, depending on the zone of
Earth). Most of what would be measured would be high frequency noise
of the sensor.
Denition 25.3. If the sampling frequency is ωf = Ts ,

the Nyquist fre-
Nyquist frequency quency is ω2f = Tπs .
25.4. CHOOSING THE SAMPLING TIME 367

Figure 25.6: A sinusoid, sampled with dierent sampling periods. Notice how,
if the sampling frequency is too small, the frequency of the sinusoid is unrecog-
nisable. It seems to be lower than it is: this phenomenon is called aliasing.

Theorem 25.5. Let x(t) = sinωt be a sinusoid, and xt be a discrete signal


obtained sampling x(t) with sampling time Ts . If the frequency of the sinusoid
is above the Nyquist frequency, ω > Tπs , it cannot be found from the discrete
signal xt .

We will not present a formal proof, but this result is rather intuitive. It tells
us that we need at least two points per period to sample a sinusoid so that its Minimum sampling fre-
frequency will be recognisable. Otherwise, a phenomenon called aliasing will quency
occur, illustrated in Figure 25.6. Aliasing

However, this bare minimum of two sampling instants per period is most
undesirable: the amplitude of a sinusoid sampled in this way will surely be
wrong. Only with an exceptional luck would the crest and the through of the
sinusoid be sampled, as seen in the rst case of Figure 25.7. It would be very
likely that the sample instants would match phases other than ±90◦ , and thus
the amplitude of the sampled sinusoid will be some random value, below the true
one, as in the second and third cases of Figure 25.7. And, with an exceptional
lack of luck, the last situation of Figure 25.7, in which only the zero crossings
are hit, might arise.
In practice it is expedient to have 10 to 20 points per period. So, if the Rule of thumb for Ts
sinusoid has period T and frequency ω = 2π T , the sampling time Ts and the
sampling frequency ωs = 2π Ts should verify

T T 2π 2π
≤ Ts ≤ ⇔ ≤ Ts ≤ ⇔ 20ω ≥ ωs ≥ 10ω (25.58)
20 10 20ω 10ω

This is a heuristic rule; the lower limit for Ts ensures that the amplitude is
never underestimated by more than 5%, as seen in Figure 25.8, which depicts
the most unfavourable case possible. It may sometimes be convenient to have
an even higher sampling frequency.
Most signals, of course, are not sinusoidal. So rule (25.58) must be applied
to the fastest frequency (i.e. the smallest perior) found in the signal or at
least the fastest frequency we may be interested in.
368 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

Figure 25.7: A sinusoid of frequency ω is discretised using sampling frequency


2 . The rst sampling time can fall at any phase of the sinusoid, leading to very
ω

dierent discrete signals. Top row: very favourable situation, only possible with
exceptional luck. Middle rows: usual situations. Bottom row: very unfavourable
situation, only possible with exceptional lack of luck.

Figure 25.8: A sampling time Ts = 10 T


ensures that the amplitude A of a
sinusoid with period T (and frequency 2π T ) can be found from the discretised
signal with an error which never exceeds 5%. The situation depicted is the most
unfavourable one as to the phases that sampling instants fall on.
25.5. STABILITY AND CAUSALITY OF DISCRETE TRANSFER FUNCTIONS 369

Figure 25.9: Zones where poles are stable. Left: poles in s. Right: poles in z .

25.5 Stability and causality of discrete transfer


functions
Let us consider a plant with a pole given by s = a + jb. Because
1
z = e Ts s ⇔ s = log z (25.59)
Ts
the pole will be mapped to

z = eTs a+jTs b = e|{z}


Ts a
e|jTsb
{z } (25.60)
magnitude phase

We see that the pole in z will have


ˆ a magnitude that depends only on the real part of s,

ˆ a phase that depends only on the imaginary part of s.

Also,
ˆ if pole s is stable, i.e. if a < 0, pole z will have a magnitude eTs a < 1, i.e. Stable poles in z are inside
z will be inside the unit radius circle; the unit radius circle

ˆ if pole s is on the imaginary axis, i.e. if a < 0, pole z will have a magnitude
e0 = 1, i.e. z will be on the unit radius circle;
ˆ if pole s is unstable, i.e. if a > 0, pole z will have a magnitude eTs a > 1,
i.e. z will be outside the unit radius circle. Outside the unit radius
circle, poles in z are unsta-
In other words, ble

ˆ poles in s are stable to the left of the imaginary axis, and unstable to the
right;
ˆ poles in z are stable inside the unit radius circle, and unstable outside. Stable poles have |z| < 1
Additionally, Unstable poles have |z| > 1

ˆ simple poles in s on the imaginary axis are marginally stable: the same
applies to simple poles in z on the unit radius circle;
ˆ multiple poles in s on the imaginary axis are unstable: the same applies
to multiple poles in z on the unit radius circle.
See Figure 25.9.
Example 25.7. Transfer function G1 (z) = has a pole at z = −2; since
1
z+2
|z| = 2 > 1, this is an unstable pole, and G1 (z) is unstable.
Transfer function G2 (z) = z−1 1 has a pole at z = 12 ; since |z| = 12 < 1, this
2
is an stable pole, and G2 (z) is stable.
Figure 25.10 shows the unit step responses of G1 (z) and G2 (z), by which it
can be conrmed that the rst is stable and the second is not.
370 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

Figure 25.10: Unit step responses of G1 (z) (left) and G2 (z) (right) from Exam-
ple 25.7. The sample time (which is irrelevant for stability) was assumed to be
1 s.

Notice that what matters are poles in z ; even if a discrete transfer function Find poles in z, not in
is given as a ratio of two polynomials in z −1 , what matters for stability are the
roots of the denominator given as values of z .

Example 25.8. The roots of the denominator of G(z) = z −1 +6


z −2 +5z −1 +6 are z
−1
=
2 and z −1 = 3. Because this corresponds to z = 1
2 and z = 3 , we conclude that
1

G(z) is stable.

We saw in Chapter 11 that only those transfer functions having more poles
than zeros, i.e. which are proper, can be physically possible. The same happens
in z ; it is in fact even much clearer in z .

Example 25.9. Let


b2 z 2 + b1 z + b0
G(z) = (25.61)
a1 z + 1

This transfer function is not proper, since it has two zeros but only one pole.
The corresponding dierence equation is

b2 z 2 + b1 z + b0 yk
= ⇔
a1 z + 1 uk
(b2 z 2 + b1 z + b0 )uk = (a1 z + 1)yk ⇔
b2 uk+2 + b1 uk+1 + b0 uk = a1 yk+1 + yk ⇔
b2 b1 b0 1
yk+1 = uk+2 + uk+1 + uk − yk ⇔
a1 a1 a1 a1
b2 b1 b0 1
yk = uk+1 + uk + uk−1 − yk−1 (25.62)
a1 a1 a1 a1

The output yk depends on a future input, uk+1 .

This Example illustrates the following result:

Theorem 25.6. If a discrete transfer function has m zeros and n poles, such
that m > n, then the output yk depends from future inputs uk+1 , . . . , uk+m−n .

Causality A system is

ˆ causal, if its output does not depend from future inputs;


ˆ non-causal, if its output depends from future inputs.
So, discrete transfer functions that are not proper are non-causal. By extension,
continuous transfer functions that are not proper are called non-causal too.

Remark 25.1. The number of zeros and poles that matters is found in z , not in
1
z −2 + 1 z −1 + 1
z −1 . We might be tempted to say that H(z) = 3 3
1
3
has a polynomial
of order 2 in the numerator and a polynomial of order 0 in the denominator;
25.6. PRIMARY AND COMPLEMENTARY STRIPS IN S 371

Figure 25.11: Strips of the complex plane where s is represented that are mapped
onto the entire complex plane where z is represented.

of course, with 2 zeros and 0 poles it would not be causal. But its dierence
equation is

1 −2 1 −1 1 yk 1 1 1
z + z + = ⇒ yk = uk + uk−1 + uk−2 (25.63)
3 3 3 uk 3 3 3

and it is clear that the output depends on the current and on past inputs, not
1
+ 1 z+ 1 z 2
on anything future. We should have considered H(z) = 3 3 z2 3 and noticed
that the transfer function has in fact 2 poles and 2 poles, and thus no problems
of causality.

25.6 Primary and complementary strips in s


Since s = a + jb is mapped to z = eTs a ejTs b = eTs a cos(Ts b) + jeTs a sin(Ts b),
and the cosine and sine functions are periodical, it is clear that all points of the
form

2kπ
s=a+j b+ , k∈Z (25.64)
Ts

will be mapped to very same point



Ts a 2kπ Ts a 2kπ
z=e cos Ts b + + je sin Ts b +
Ts Ts
= eTs a cos (Ts b) + jeTs a sin (Ts b) (25.65)

This means that the complex plane where s is represented can be split into an
innite number of horizontal strips, of width 2πTs , as seen in Figure 25.11. Each Each strip in s mapped to
of them is mapped onto the entire complex plane where z is represented. the entire plan in z
The existence of innite points s mapped to the same value of z is a con-
sequence of Theorem 25.5. Many sinusoids, when sampled in time, result in
the same discrete signal, as seen in Figure 25.12. Of course, only one will be
properly sampled: the one with a frequency below the Nyquist frequency, i.e.
the one found inside the strip of the complex plane centred on the real axis,
from −j Tπs to +j Tπs . For this reason, this strip is called primary strip, and
the others, where sinusoids have frequencies that cannot be properly sampled,
are called complementary strips.
372 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS

Figure 25.12: Dierent sinusoids sampled with the same sampling time can
result in the same discrete signal.

Glossary
They were really getting quite fond of their strange pet and hoped
that Aslan would allow them to keep it. The cleverer ones were
quite sure by now that at least some of the noises which came out
of his mouth had a meaning. They christened him Brandy because
he made that noise so often.

C. S. Lewis (1868 „1963), The Magician's nephew, 14

complementary strip faixa complementar


delay operator operador de atraso
forward operator operador de avanço
primary strip faixa primária
Programmable Logic Controller (PLC) autómato programável (AP)
zero order hold retentor de ordem zero

Exercises
1. In a closed loop control system, the error e and the control action u are
electrical signals. Design analog circuits to implement:
(a) A proportional controller u
e = 10, using one OpAmp and two resis-
tors.
(b) A proportional controller ue = 0.5, using two OpAmps and four re-
sistors. Why is it that in this case one OpAmp is not enough?
(c) A PD controller e = 5 (1 + 0.1s).
u

(d) A PID controller ue = 5 1 + 2s


1
0.1s .

+

(e) A generic PID controller u
e = Kp 1 + T1i s + Td s .
(f) A lead controller u
e = s+0.1 .
50s+0.1

(g) A lag controller u


e = s+0.5 .
s+10

(h) A generic lead-lag controller u


e
s+b
= K s+p .
2. Discuss if a 100 ms sampling time is appropriate for the following systems,
and propose a dierent value when it is not:
25.6. PRIMARY AND COMPLEMENTARY STRIPS IN S 373

(a) A system with a 100 rad/s open-loop bandwidth.


(b) A system with a 5 rad/s open-loop bandwidth.
(c) A system with a 0.3 rad/s open-loop bandwidth.
(d) A tidal energy converter.
(e) The controller of the opening of the valves in the engine of a car.
(f) The controller of the opening of the valves in the diesel engine of a
ship running at 80 rpm.
2
3. Knowing that G(z) = (z−1) z −3
2 and that the sampling time is 100 ms, nd

x(t) for t = 0 s, 0.1 s, 0.2 s,. . . 2 s, when


(a) the input is a unit impulse;
(b) the input is a unit step;
(c) the input is u0 = 1, u1 = 2, and 0 otherwise.
z
4. Consider a signal with Z transform given by Z{x (t)} = X (z) = .
(z + 1) (z − 1)
Let Ts be the sampling time. Therefore:

A) x (t) = 1 − (−1)n Ts , n = 0, 1, 2, . . .
h i
B) x (t) = 1
2 1 − (−1)
n Ts
, n = 0, 1, 2, . . .
h i
C) x (t) = 2 1 − (−1)n Ts , n = 0, 1, 2, . . .
D) None of the above.
s+2
5. Consider signal x(t), such that X (s) = L {x(t)} = 2 .
(s + 1) (s + 3)
(a) Obtain X (z) = Z {x (t)} for a generic sampling time h.
(b) Do the same for h = 1 s.
(c) Do the same for a sampling frequency of 10 Hz.
5

2z z − 12
6. Consider a signal with Z transform given by Z{x (t)} = .
z − 12 z − 31

(a) Its inverse transform is:


k k
1 1
A) x (t) = + , k = 0, 1, 2, . . .
2 3
k k k
1 1 5
B) x (t) = + − , k = 0, 1, 2, . . .
2 3 12
k k k
5 1 1
C) x (t) = − − , k = 0, 1, 2, . . .
12 2 3
D) None of the above.
(b) Let h be the sampling period. From the transform denition, it can
be concluded that:
5 13 5 13
E) X (z) = 2 + z −1 + z −2 + · · · ⇒ x (0) = 2, x (h) = , x (2h) = , . . .
6 36 6 36
1 −1 1 −2 1 1
F) X (z) = 1 + z + z + · · · ⇒ x (0) = 1, x (h) = , x (2h) = , . . .
2 3 2 3
5 1 −1 1 −2 5 1 1
G) X (z) = − z − z + · · · ⇒ x (0) = , x (h) = − , x (2h) = − , . . .
12 2 3 12 2 3
H) None of the above.
z
7. Given X(z) = 2 determine x(kh), k = 0, 1, 2, . . . , where h
(z − 1) (z − 2)
is the sampling period.

8. Present a formal proof of Theorem 25.6, following the reasoning in Exam-


ple 25.9.
374 CHAPTER 25. DIGITAL SIGNALS AND SYSTEMS
Chapter 26

Digital approximations of
continuous systems
In this chapter

26.1 Using the Z transform


Z

26.2 Mapping poles and zeros


map

26.3 Backward rst order approximation


back

26.4 Forward rst order approximation


forward

26.5 The Tustin approximation


Tustin

26.6 Approximating controllers


This chapter is still being written. In the picture: National Pantheon, or
Church of Saint Engratia, Lisbon (source: http://www.panteaonacional.gov.
pt/171-2/historia-2/), somewhen during its construction (16821966).

375
376CHAPTER 26. DIGITAL APPROXIMATIONS OF CONTINUOUS SYSTEMS

Glossary
Pirenne leaned over the table to get a better view and Hardin contin-
ued: The message from Anacreon was a simple problem, naturally,
for the men who wrote it were men of action rather than men of
words. It boils down easily and straightforwardly to the unqualied
statement, when in symbols is what you see, and which in words,
roughly translated, is, `You give us what we want in a week, or we
take it by force.'

Isaac Asimov (1920 „1992), Foundation, II 5

word in English word in Portuguese


palavra em inglês palavra em português

Exercises
1. The PD controller C(s) = 8s + 32 has to be implemented with a sampling
time of 0.02 s. Find the dierence equation that should be implemented
in a microprocessor.

2. The roll of the ship from Exercise 5 of Chapter 21 is going to be controlled


with a PID controller C(s) = 2s + 11 + 1s , implemented with a sampling
time of 10 ms. Find the dierent digital implementations of the con-
troller that result from using dierent approximations, implement them
using Matlab commands, and verify which approximation is the best. The
9
system to be controlled is given by G(s) = 2 .
s + 1.2s + 9
Chapter 27

Study and control of digital


systems
Weston was pale and haggard from a night of calculations intricate
enough to tax any mathematician even if his life did not hang on
them.

C. S. Lewis (1868 „1963), Out of the silent planet, 21

This chapter is still being written.

27.1 Block diagrams


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

27.2 Pole placement


This chapter is still being written.

27.3 Steady state errors

377
378 CHAPTER 27. STUDY AND CONTROL OF DIGITAL SYSTEMS

27.4 Root locus


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

27.5 Jury and Routh-Hurwitz criteria


This chapter is still being written.

27.6 Frequency responses


In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:
http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).

27.7 Studying stability from frequency responses

Glossary
But I think I've learnt to manage these donkeys, Fred. I leant
forward and quietly gave the order to turn left into Peter's large
hairy ear. Zur linken Zeite, mein Freund.
Peter veered to the left, barging into Paul and very nearly unseating
Fred. We would have left the track altogether and started across the
Forest had I not quickly murmured to him in German to go right
again and then straight on.
It's quite simple, I explained to Fred. Mr. Mattock said that Aunt
Lot was always muttering in German. That's how she talked to the
donkeys. We'll be all right from now on.
You mean you'll be all right, grumbled Fred. My subject's His-
tory, not German. You'll have to talk for us both.

John Pudney (1909 „1977), Spring adventure, 1

word in English word in Portuguese


palavra em inglês palavra em português
27.7. STUDYING STABILITY FROM FREQUENCY RESPONSES 379

Figure 27.1: Block diagram of Exercise 1.

Figure 27.2: Block diagram of Exercise 2.

Exercises
1. Consider the system shown in Figure 27.1 with sampling period h. Is the
Y (z) G(z) Y (z) G(z)
closed-loop transfer function given by = , by = ,
R(z) 1 + G(z)H(z) R(z) 1 + GH(z)
or by neither of these transfer functions?

2. Consider the system shown in Figure 27.2 with sampling period h. Which
of the following transfer functions corresponds to this closed-loop?

Y (z) G1 G2 (z)
(a) =
R(z) 1 + G1 G2 (z)
Y (z) G1 (z)G2 (z)
(b) =
R(z) 1 + G1 G2 (z)
Y (z) G1 G2 (z)
(c) =
R(z) 1 + G1 (z)G2 (z)
Y (z) G1 (z)G2 (z)
(d) =
R(z) 1 + G1 (z)G2 (z)

3. The discretised transfer function relating the voltage u(t) applied to the
motor with the azimuth angle θ(t) of the antenna in Exercise 2 of Chap-
0.003z + 0.003
ter 22 is HG(z) = 2 , with a sampling time of 0.25 s.
z − 1.975z + 0.975
Figure 27.3 shows the Bode diagram of the open loop formed by the plant
30.361(z − 0.882)
and by controller C(z) = .
z − 0.286
(a) Is the closed loop stable?
(b) Can this controller follow constant angle references?

4. The discretised transfer function relating the depth of facing (output)


performed by the lathe of Exercise 4 from Chapter 22 with the control

Bode Diagram
100

50
Magnitude (dB)

−50

−100
−90

−135
Phase (deg)

−180

−225

−270
−3 −2 −1 0 1 2
10 10 10 10 10 10
Frequency (rad/s)

Figure 27.3: Bode diagram of Exercise 3.


380 CHAPTER 27. STUDY AND CONTROL OF DIGITAL SYSTEMS

action of the motor (input) is


0.0477(z + 1.65)(z + 0.0788)
Gp (z) = (27.1)
(z − 1)(z − 0.4966)(z − 0.0302)
with a 0.7 s sampling time.
(a) Knowing that the bandwidth of the closed loop was estimated as
0.622 rad/s, explain if the sampling time is reasonable or not.
(b) Find the values of a proportional controller that stabilises this plant.
5. A helium-lled spherical balloon is to be designed so that its weight is
compensated by its hydrostatic lift, and thus its height h(t) will be given
by
h(s) 1
G(s) = = (27.2)
u(s) s(10s + 1)
where u(t) is the command action of the vertical thrust of its propellers.
(a) Find the dierential equation that models the plant, considering only
a mass m, a buoyancy B , a weight W , a drag D and a propulsion T .
(b) Let m = 300 kg, let the drag coecient be β = 30 N s/m, and let the
densities of the uids be ρair = 1 kg/m3 and ρHe = 0.2 kg/m3 . Find
the radius of the balloon.
(c) Let T (t) = 30u(t). Prove G(s) and nd its discrete equivalent, as-
suming a 0.8 s sampling time and a zero-order hold.
(d) Study the stability of the discrete closed-loop using the root-locus
method.
(e) Find a digital controller that ensures closed-loop poles at 0.9 rad/s
and 0.266 ± 0.33j rad/s.
(f) Check if this controller achieves or not a 10 dB attenuation for a
0.02 rad/s disturbance.
(g) Study the closed loop's stability using the Nyquist diagram.
6. The transfer function of a robot is
1.6
G(s) = (27.3)
(s + 1)2
(a) Find the values of proportional controllers that stabilise the plant.
(b) Show that if there is a zero-order hold with 0.1 s sampling time in
the control loop then the transfer function of the plant is HG(z) =
0.0075z + 0.007
.
z 2 − 1.81z + 0.8187
(c) Plot the root locus of HG(z).
(d) Find the values of proportional controllers that stabilise the discrete
plant.
(e) Compare the values of the proportional controller that can be used
in both the continuous and the discrete cases.
7. Consider an inverted pendulum, that deviates from the vertical by an angle
φ(t), and is controlled by a control action u(t) that moves the base of the
pendulum sidewards (see Figure 27.4). The corresponding (linearised)
transfer function is
Φ(s) 5s 5s
G(s) = = = 3 (27.4)
U (s) (s − 5)(s + 5)(s + 0.2) s + 0.2s2 − 25s − 5

(a) Show that the discrete equivalent of (27.4), when a zero-order hold
with a 200 Hz sampling frequency is applied at the input of the plant,
is
6.2482 × 10−5 (z − 1)(z + 1)
HG(z) = (27.5)
(z − 1.025)(z − 0.999)(z − 0.9753)
(b) Figure 27.5 shows the Nyquist plot of (27.5). Show that (27.5) cannot
be stabilised with a proportional controller.
27.7. STUDYING STABILITY FROM FREQUENCY RESPONSES 381

Figure 27.4: Inverted pendulum in the Laboratory of Control and Robotics; its
parameters are not those of transfer function (27.4).

Nyquist Diagram Nyquist Diagram


−4
x 10
5
0.1
4
0.08
3
0.06

0.04 2
Imaginary Axis

Imaginary Axis

0.02 1

0 0

−0.02 −1
−0.04 −2
−0.06
−3
−0.08
−4
−0.1
−5
−0.2 −0.15 −0.1 −0.05 0 −0.05 −0.04 −0.03 −0.02 −0.01 0
Real Axis Real Axis

Figure 27.5: Nyquist diagram of (??); right plot: detail of the left plot.
382 CHAPTER 27. STUDY AND CONTROL OF DIGITAL SYSTEMS
Chapter 28

Non-linearities in control
systems
This chapter concerns the eects of non-linearities in control systems. Non-
linearities can stem:
ˆ From the plant. We saw in Chapter 8 that soft non-linearities can be
linearised, but of course that is only an approximation.
ˆ From the actuator. While the actuator is often considered as part of
the plant, it is better to consider it a separate model not only if it can be
easily replaced but also if it is the source of non-linear behaviour. One
particular non-linearity, saturation, is inevitable in any actuator, since no
actuator can provide an arbitrarily large control action (this would always
require innite energy). At most, this non-linearity can be neglected if it
is certain that in no case the controller will ever require a control action
too large for the actuator. In mechatronic systems, mechanical parts of-
ten originate non-linearities such as dead zones (remember Figure 8.5) or
backlash (remember Figure 4.16).
ˆ From the sensor. As we saw in Chapter 13, there are sensors with non-
linear transductions, which can be accounted for (in which case it is as if
they did not exist) or linearised.
ˆ From the control law itselft. Design strategies of non-linear control
laws fall outside the scope of these Lecture Notes; only one particular case
of one particular strategy (that of reset control) will be presented below
in Chapter 29.
The study of their eect is easier in continuous time (i.e. using transfer functions
in s, not in z ); in any case, the eects of non-linearities are similar in discrete
time as well.

28.1 Non-linearities and responses in time


The eect of non-linearities in time responses of open-loop control systems is
fairly easy to determine. In closed-loop, because the eect of the non-linearity is
fed back, this is not that easy, but can be done using the equivalent gain Keq , Equivalent gain
dened as the ratio between the output y and the input x of the non-linearity
(having hence no dimensions):
y
Keq = (28.1)
x
Example 28.1. Consider the non-linearity described in Figure 28.1, combining
a dead-zone with saturation:

0, if − 1 < x < 1



x, if − 3 ≤ x ≤ −1 ∨ 1 ≤ x ≤ 3

y= (28.2)


 −3, if x < −3
3, if x > 3

383
384 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Figure 28.1: Non-linearity (left) and its equivalent gain (right).

Figure 28.2: Control loop with one non-linearity.

The equivalent gain, also shown in the Figure, is

if − 1 < x1
0
x,
0, if − 1 < x1
 

 x , if − 3 ≤ x ≤ −1 ∨ 1 ≤ x ≤ 3
 
y = x−3 = 1, if − 3 ≤ x ≤ −1 ∨ 1 ≤ x ≤ 3
 , if x < −3  3 , if x < −3 ∨ x > 3

 3x


x , if x > 3 |x|

(28.3)
Notice that, for input x = 0, the equivalent gain was, of course, extended by
continuity.
Equivalent gain and root- If a closed-loop conguration such as the one seen in Figure 28.2 can be
locus found, in which the non-linearity aects the error, then the equivalent gain
must be combined with a means of studying the inuence of the gain in closed-
loop stability, such as the root-locus diagram and the Routh-Hurwitz criterion,
to assess the inuence of the non-linearity in the control loop.
Example 28.2. In the control system of Figure 28.3,
s+5
G(s) = (28.4)
s2
The root-locus of (28.4) is given in Figure 28.4. We now consider two cases,
both shown in Figure 28.5:
ˆ When the reference is r = 1, the initial value of the error is e(0) = 1 (and
then the error decreases). The control action never saturates, so we always
have Keq = 1. The response is oscillatory, with an overshoot only slightly
larger than what might be expected from the position of the closed loop
poles. (Remember that the discrepancy is not surprising since the closed
loop is not a second order system without zeros.)
28.1. NON-LINEARITIES AND RESPONSES IN TIME 385

Figure 28.3: Control loop of Examples 28.2 and 28.3 (top), and equivalent gain
of the saturation (bottom).
386 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Figure 28.4: Root locus of (28.4) from Example 28.2.

ˆ When the reference is r = 5, the initial value of the error is e(0) = 5, the
control action saturates at u(0) = 1, and so Keq = 51 = 0.2. In Figure 28.4
we see that this corresponds to a more oscillatory behaviour, as expected
from the poles closer to the imaginary axis; the overshoot is somewhat
lower than, but in line with, the expected value.

Example 28.3. If in the control system of Figure 28.3 the system is rather
s+5
G(s) = (28.5)
s(s2 + 0.25s + 1)

with the root-locus given in Figure 28.6, the values of the gain ensuring closed-
loop stability are found as follows:
s+5
y(t) K s3 +0.25s2 +s
= s+5
r(t) 1 + K s3 +0.25s2 +s
Ks + 5K
= (28.6)
s3 + 0.25s2 + s(K + 1) + 5K

s3 1 K +1
s2 0.25 5K
5K (28.7)
s K +1− 0.25
1 5K

( (
1
K + 1 − 20K > 0 K < 19 = 0.0526
⇒ (28.8)
5K > 0 K>0

We now consider two cases as well, both shown in Figure 28.7:

Limit cycle ˆ When the reference is r = 1, the initial value of the error is e(0) = 1.
The control action is limited to 1, so the equivalent gain is 11 , and thus
the system becomes unstable. However, in the Figure we see that the
amplitude of the oscillations does not grow indenitely, as might be ex-
pected. This is because of the saturation. As the error grows, since the
control action is limited to [−1, 1], the equivalent gain becomes smaller,
and the loop eventually falls back into the zone of stability. As the er-
ror decreases, the equivalent gain increases, and the control loop becomes
unstable again. Because of this switching between a stable and an unsta-
ble situation, around the limit of stability, the oscillations end up with a
constant amplitude. This is called a limit cycle.
28.1. NON-LINEARITIES AND RESPONSES IN TIME 387

Figure 28.5: Example 28.2: reference 1 (top) and reference 5 (bottom).


388 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Figure 28.6: Root locus of (28.5) from Example 28.3.

ˆ When the reference is r = 100, the initial value of the error is e(0) =
100. The control action is limited to 1, so the equivalent gain is 100
1
, and
the system is stable. As the error becomes smaller, the equivalent gain
increases, the system becomes unstable, and we have a limit cycle again.

Notice that the amplitude of the oscillations is the same in both cases of Fig-
ure 28.7. We will see below how it can be found. But there is a signicant
dierence between the two cases. When r = 1, the amplitude of the oscillations
of the limit cycle is so large in relation to r that the situation is in practice as bad
as if the loop were unstable. When r = 100, the amplitude of the oscillations,
not being neglectable, may in some cases be tolerable. Hence the importance of
estimating limit cycles, and their amplitudes, caused by non-linearities.

Remark 28.1. Complex conjugate poles on the imaginary axis can also orig-
inate oscillations with a constant amplitude, but a limit cycle is caused by a
non-linearity instead.

28.2 Describing function


To better study limit cycles, which originate oscillations, it is necessary to study
the inuence of non-linearities in the frequency response of control loops. This
is at rst sight impossible: if there is a non-linearity, the output of the control
system for a sinusoidal input (i.e. reference) is no longer a sinusoid with the same
period of the input. Hence it is impossible to speak about a gain and a phase, as
A describing function has when linear systems are studied. But it is possible to nd an approximate gain
an approximate gain and and an approximate phase, using a Fourier series expansion, if the non-linear
an approximate phase output y(t) for a sinusoidal input u(t) = U sin(ωt) (hence with period T = 2π ω )
is

ˆ periodic, with period T :


n o
T = inf T̃ : y(t + T̃ ) = y(t), ∀t (28.9)

(in other words, T is shortest period of time after which y(t) repeats itself);

ˆ even, in the sense that



T
y t+ = −y(t), ∀t (28.10)
2

Fourier series expansion Theorem 28.1. Let f (x) be a limited, periodic function, with period 2π , and
a nite number of maxima, minima and discontinuities. Then the Fourier series
28.2. DESCRIBING FUNCTION 389

Figure 28.7: Example 28.3: reference 1 (top), reference 100 (centre), reference
consisting of three steps (bottom).
390 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

f(x) given by
+∞
a0 X
f(x) = + ak cos kx + bk sin kx (28.11)
2
k=1
1 2π
Z
ak = f (x) cos kx dx (28.12)
π 0
1 2π
Z
bk = f (x) sin kx dx (28.13)
π 0
converges in the domain of f and veries
lim f (τ ) + lim+ f (τ )
τ →x− τ →x
f(t) = (28.14)
2
Proof. The proof can be found in any textbook of Calculus.
Corollary 28.1. Suppose that f (x) has an arbitrary period T , and that ω =
2π 2π
. Then function g(x) = f
T x
has period 2π , and we

T ⇔ T = ω 2π x =f ω
can write
x +∞
a0 X
g(x) = f = + ak cos kx + bk sin kx (28.15)
ω 2
k=1
1 2π
Z
ak = f (x) cos kx dx (28.16)
π 0
1 2π
Z
bk = f (x) sin kx dx (28.17)
π 0
Making t = x
ω ⇔ x = ωt ⇒ dx = ω dt, we get
+∞
a0 X
f(t) = + ak cos kωx + bk sin kωx (28.18)
2
k=1
Z 2π
ω ω
ak = f (t) cos kωt dt (28.19)
π 0
Z 2π
ω ω
bk = f (t) sin kωt dt (28.20)
π 0
In our case, from (28.10), (28.19) and the denition of ω comes

2 T
Z
a0 = y(t) dt
T 0
Z T2 Z T
2 2
= y(t) dt + y(t) dt = 0 (28.21)
T 0 T T2
| {z }
R T /2
− 0 y(t) dt

and so we make

y(t) ≈ a1 cos ωt + b1 sin ωt (28.22)

We now make use of the following lemma:


Lemma 28.1.

p A
A cos(x) + B sin(x) = A2 + B 2 sin x + arctan (28.23)
B
Proof.

p A
A2 + B 2 sin x + arctan
B
p A p A
= A2 + B 2 sin x cos arctan + A2 + B 2 cos x sin arctan
B B
p B p A
= A2 + B 2 sin x √ + A2 + B 2 cos x √ (28.24)
A2 + B 2 A2 + B 2
28.2. DESCRIBING FUNCTION 391

Figure 28.8: On-o non-linearity.

From (28.22) and (28.23), we conclude that, if we let



Z Z T
ω ω 2 2πt
a= y(t) cos ωt dt = y(t) cos dt (28.25)
π 0 T 0 T
Z 2π Z T
ω ω 2 2πt
b= y(t) sin ωt dt = y(t) sin dt (28.26)
π 0 T 0 T
then the approximate gain of the non-linearity is given by

a2 + b2
gdf = (28.27)
U
and the approximate phase is given by
a
ϕdf = arctan (28.28)
b
These approximate gain and phase depend on ω and so dene a complex function
of input amplitude U and frequency ω which is called describing function:

N (U, ω) = gdf (ω)ejϕdf (ω)



a 2 + b2 a a
= cos arctan +j sin arctan
U | {z b} | {z b}
b √ a

a2 +b2 a2 +b2

b + ja
= (28.29)
U
Example 28.4. Let us nd the describing function of the static two-valued Describing function of on-
non-linearity represented in Figure 28.8, known as on-o (the higher output o
standing for on, the lower for o ):
(
M, if x ≥ 0
y= (28.30)
−M, if x < 0

When the input is (considering only one period)



2πt
x(t) = U sin , 0 ≤ t ≤ 2π (28.31)
T

the output is
(
M, 0 ≤ t ≤ T2
y(t) = (28.32)
−M, T2 < t < T
392 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Replacing (28.31)(28.32) in (28.25)(28.26),


Z T Z T !
2 2 2πt 2πt
a= M cos dt + −M cos dt
T 0 T T
2
T
T T
2M T 2πt 2 T 2πt
= sin − sin =0 (28.33)
T 2π T 0 2π T T
| {z } | 2
{z }
0−0 0−0
T
!
Z Z T
2 2 2πt 2πt
b= M sin dt + −M sin dt
T 0 T T
2
T
T T !
2M T 2πt 2 T 2πt
= − cos − − cos
T 2π T 0 2π T T
2

−2 2
M z }| { z }| { 4M
=− cos π − cos 0 − (cos 2π − cos π ) = (28.34)
π | {z } | {z } | {z } | {z } π
−1 1 1 −1

Thus, we can assume for input (28.31) an approximate output given by



4M 2πt
ỹ(t) = sin , 0 ≤ t ≤ 2π (28.35)
π T

this being the Fourier series truncated after the rst term, as seen in Figure 28.8;
and the describing function is
4M 2πt

π sin 4M
N (U, ω) = T
= (28.36)
U sin 2πt
T
πU

Compare this result with what you get from (28.29).

N (U ) of static non- Remark 28.2. Notice that, as is clear from Figure 28.8, the input x(t) and
linearities does not depend the truncated Fourier series of the output ỹ(t) are in phase, always; this is an
on ω obvious consequence of the non-linearity being static. Thus the phase of the
describing function is always 0◦ , and there is in fact no dependency at all from
ω . This happens with all static non-linearities, not just on-o.

Describing function of a Example 28.5. Let us nd the describing function of the dynamic non-linearity
reset integrator called reset integrator (or Clegg integrator), with which the output y(t) of
C(t), which is an integral, is reset to zero whenever the input u(t) is zero. By
convention, this is represented as

0
1
y(s) = u(s) (28.37)
s
Let the input be
u(t) = sin ωt, t > 0 (28.38)
which has a frequency ω = 2π T and a period T = ω ; the amplitude is 1, without

loss of generality, since for this non-linearity the amplitude of the output is
linear with respect to the amplitude of the input. Without reset, the output
would be given by

1 1
y(t) = − cos ωt (28.39)
ω ω
(where the integration constant ensures y(0) = 0) and, with reset, by

 1 − 1 cos ωt, kT ≤ t < kT + T , k ∈ N0

y(t) = ω ω
1 1 T
2 (28.40)
 − − cos ωt, kT + ≤ t < (k + 1)T, k ∈ N0

ω ω 2
as seen in Figure 28.9.
28.2. DESCRIBING FUNCTION 393

0 π t
2π 3π 4π

−1

−2

sin t, input of C(s) = 1s


output of controller C(s) without reset
output of controller C(s) with reset

Figure 28.9: Eects of reset control on the control action for controller C(s) = 1
s

Using (28.19)(28.20), the rst coecients of the Fourier series of (28.40)


are
Z π Z 2π
ω ω 1 ω ω 1
a= − cos ωt cos ωt dt + − − cos ωt cos ωt dt
π 0 ω π ωπ ω
Z ωπ Z 2π Z 2π
1 1 ω 1 ω
= cos ωt dt − cos ωt dt − cos2 ωt dt
π 0 π ω π π 0
ωπ 2π Z 2π
1 1 1 1 ω
1 ω 1 + cos 2ωt
= sin ωt − sin ωt − dt
π ω 0 π ω π π 0 2
| {z } ω
| {z }
0 0

1 t 1 ω
1
=− + sin 2ωt =− (28.41)
π 2 4ω 0 ω
Z π Z 2π
ω ω 1 ω ω 1
b= − cos ωt sin ωt dt + − − cos ωt sin ωt dt
π 0 ω π ωπ ω
Z ωπ Z 2π Z 2π
1 1 ω 1 ω
= sin ωt dt − sin ωt dt − sin ωt cos ωt dt
π 0 π ωπ π 0
ωπ 2π Z 2π
1 1 1 1 ω
1 ω 1
= − cos ωt − − cos ωt − sin 2ωt dt
π ω 0 π ω π π 0 2
ω

1 1 1 1 ω
4
=− (−1 − 1) + (1 + 1) − − cos 2ωt = (28.42)
ωπ ωπ 2π 2ω 0 ωπ
| {z }
0

Hence, applying (28.29) the describing function is found as


4 1
N (U, ω) = − j (28.43)
ωπU ωU
and according to (28.27)(28.28), the corresponding (approximations of) gain
and phase are
r √
16 1 16 + π 2
gdf (U, ω) = 2 2 2
+ 2 2 = (28.44)
ω π U ω U ωπU

16 + π 2
gdf (1, 1) = ≈ 4 dB (28.45)
π
− 1 π
ϕdf (U, ω) = arctan 4ωU = − arctan ≈ −38◦ , ∀ U (28.46)
ωπU
4

The Bode diagram of N (U, ω) is compared in Figure 28.10 with that of 1s . It


is clear that the phase margin increases, that the slope of the gain is the same,
and that there is a gain oset.
394 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

dB
44
40

ω
10−2 102
−36
−40

10−2 102
ω
−38
−90

transfer function 1s , without reset


describing function of 1s , with reset

Figure 28.10: Bode diagram of controller C(s) = s,


1
with and without reset
control

N (U, ω) of dynamic non- Remark 28.3. Notice that this non-linearity has a describing function depend-
linearities depends on ω ing from ω , since it is dynamic. But, because the amplitude of the output is
linearly dependent on the amplitude of the input (it is determined by an in-
tegral, which is linear if there is no reset), N (U, ω) does not depend on input
amplitude U .

Just as Laplace transforms are in practice found from tables, so are de-
scribing functions. Table 28.1 gives describing functions of some common non-
linearities.

28.3 Predicting limit cycles


If a non-linearity causes a limit cycle in a control loop such as the one in Fig-
ure 28.2, the oscillations will take place also when the input is a step ending in
0, as seen in the bottom plot of Figure 28.7 from Example 28.3.
Consequently, since r = 0 and y 6= 0,
1
y = GN e = GN (−y) ⇒ y(1 + GN ) = 0 ⇒ G = − (28.47)
N
Limit cycle if G = − N1 We can thus expect a limit cycle whenever
1
G(jω) = − (28.48)
N (U, ω)

Plot − N1 on the Nyquist The best way to see this for a static non-linearity is to plot − N (U
1
) on the polar
diagram plot of G(s) (or on the Nyquist diagram, considering only the polar plot), and
verify if there are intersections:

Frequency and amplitude ˆ the frequency ω for which there is an intersection will be the frequency of
of the limit cycle the limit cycle;

ˆ the amplitude U for which there is an intersection is the amplitude of the


limit cycle.

In the case of a dynamic non-linearity, dierent curves − N (U,ω)


1
for several values
of ω have to be drawn; a limit cycle will exist if there is an intersection between
G(jω) and the curve − N (U,ω)
1
for the same value of frequency ω .
Two things must be had into account:
28.3. PREDICTING LIMIT CYCLES 395

Describing functions

Table 28.1: Table of describing functions


396 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Figure 28.11: Block diagram of Example 28.6 and Exercise 5.

ˆ The describing function is an approximation. Thus, the amplitude and


frequency of the limit cycle found from (28.48) are approximations too.
Good approximation if ˆ The approximation will be good if in the control loop of Figure 28.2 G(s)
G(s) is low pass is a low pass lter with a cut-o frequency such that the frequency of
the limit cycle is is the pass band, and its integer multiples are in the
rejection band. (Remember that the describing function is a truncated
Fourier series.)
Example 28.6. The plant in Figure 28.11 includes a linear part
1.4
G(s) = 2 (28.49)
s (s + 1)
and a backlash non-linearity with A = 1.1 and k = 1. To verify if there is a
limit cycle we plot curve − N1 over the Nyquist diagram of G(s) and look for
intersections with the polar diagram. Figure 28.12 shows there are two. To nd
their values of frequency ω and amplitude X , we must solve
1.4 1
=−
2 X i
jω (jω + 1) X X
h
2− 1.1 2− 1.1 2− 1.1
1
2 1−
2
π arcsin X + X cos arcsin X − 4j 1.1(X−1.1)
π X2
1.1 1.1 1.1

(28.50)

This is better found numerically with Matlab; we nd that


(
X = 1.37 ↔ ω = 0.31 rad/s
(28.51)
X = 4.72 ↔ ω = 0.76 rad/s

Remark 28.4. Sometimes solutions for (28.48) can be found analytically. This
Finding limit cycles for is easier if the non-linearity is static. In that case, − N1 is real and negative, and
static non-linearities ω is a phase crossover frequency.
(28.50) is one of those cases where a numerical solution has to be sought.
Some of the limit cycles found from (28.48) are never found in practice
because they are unstable. The ones actually found are those which are stable.
The Nyquist diagram is used to tell them apart:
Stable limit cycle ˆ Suppose that, when the amplitude of the limit cycle increases, curve − N
1

enters a zone of the Nyquist plane where the number of encirclements


is such that the Nyquist stability criterion proves that the closed loop
in unstable. In that case, the amplitude increases even more. Likewise,
when the amplitude of the limit cycle decreases, curve − N1 will enter a
zone of the Nyquist plane where the number of encirclements is such that
the Nyquist stability criterion proves that the closed loop in stable. Thus,
the amplitude will decrease even more. Whichever case happens, the limit
cycle will disappear.
Unstable limit cycle ˆ Suppose that, when the amplitude of the limit cycle increases, curve − N
1

enters a zone of the Nyquist plane where the number of encirclements is


such that the Nyquist stability criterion proves that the closed loop in
stable. In that case, the amplitude will stop increasing and will rather
decrease. Likewise, when the amplitude of the limit cycle decreases, curve
− N1 will enter a zone of the Nyquist plane where the number of encir-
clements is such that the Nyquist stability criterion proves that the closed
28.3. PREDICTING LIMIT CYCLES 397

Figure 28.12: Nyquist diagram of (28.49) and − N1 for the backlash in Fig-
ure 28.11.
398 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Figure 28.13: Simulink implementation of Figure 28.11 for Examples 28.6


and 28.7.

Figure 28.14: Output of the control system in Figure 28.11 for Example 28.7.

loop in unstable. Thus, the amplitude will stop decreasing and will rather
increase. Whichever case happens, the amplitude of the limit cycle will
remain roughly the same.
This is better seen through an example.
Example 28.7. Simulating the closed loop of Example 28.6 as shown in Fig-
ure 28.13, we obtain the result in Figure 28.14, with a limit cycle of frequency
188.76−180.48 = 0.76 rad/s and an amplitude quite close to the expected one,

22.34 − 17.66 = 4.68.


This is because, of the two limit cycles, this one is stable. Notice that
G(s) has no unstable poles. Consequently, by the Nyquist stability criterion,
gains corresponding to no encirclements of the Nyquist plot lead to stable closed
loop, and one or more encirclements correspond to an unstable closed loop. The
Nyquist diagram in Figure 28.12 closes on the right, as is clear from
1.4
lim G(s) = lim+ 2 = +∞ (28.52)
s→0+ s→0 s (s + 1)

So we see that, at the intersection in the upper right corner of the lower plot,
corresponding to X = 4.72 and ω = 0.76 rad/s:
ˆ If the amplitude X increases, the diagram leaves the encirclement. This
is a stable zone of the plane. Thus the amplitude will decrease back to
X = 4.72.
ˆ If the amplitude X decreases, the diagram enters the encirclement. This
is an unstable zone of the plane. Thus the amplitude will increase back
to X = 4.72.
The same Figure shows that, at the intersection in the lower left corner of
the lower plot, corresponding to X = 1.37 and ω = 0.31 rad/s:
ˆ If the amplitude X increases, the diagram enters the encirclement. This
is an unstable zone of the plane. Thus the amplitude will increase away
from X = 1.37, approaching the limit cycle with X = 4.72.
28.3. PREDICTING LIMIT CYCLES 399

Figure 28.15: Block diagram of Exercise 1.

ˆ If the amplitude X decreases, the diagram leaves the encirclement. This is


a stable zone of the plane. Thus the amplitude will keep decreasing away
from X = 1.37.

This limit cycle is thus unstable, and will not be observed in practice.

Glossary
He was not loved, Guy knew, either by his household or in the town.
He was accepted and respected but he was not simpatico. Grän von
Gluck, who spoke no word of Italian and lived in undisguised con-
cubinage with her butler, was simpatica. Mrs. Garry was simpatica,
who distributed Protestant tracts, interfered with the shermen's
methods of killing octopuses and lled her house with stray cats.
Guy's uncle, Peregrine, a bore of international repute whose dreaded
presence could empty the room in any centre of civilization, Uncle
Peregrine was considered molto simpatico. The Wilmots were gross
vulgarians; they used Santa Dulcina purely as a pleasure resort,
subscribed to no local funds, gave rowdy parties and wore indecent
clothes, talked of `wops' and often left after the summer with their
bills to the tradesmen unpaid; but they had four boisterous and
ill-favoured daughters whom the Santa-Dulcinesi had watched grow
up. Better than this, they had lost a son bathing here from the
rocks. The Santa-Dulcinesi participated in these joys and sorrows.
They observed with relish their hasty and unobtrusive departures
at the end of the holidays. They were simpatici. Even Musgrave
who had the Castelletto before the Wilmots and bequeathed it his
name, Musgrave who, it was said, could not go to England or Amer-
ica because of warrants for his arrest, `Musgrave the Monster', as
the Crouchbacks used to call him he was simpatico. Guy alone,
whom they had known from infancy, who spoke their language and
conformed to their religion, who was open-handed in all his deal-
ings and scrupulously respectful of all their ways, whose grandfather
built their school, whose mother had given a set of vestments embroi-
dered by the Royal School of Needlework for the annual procession
of St Dulcina's bones Guy alone was a stranger among them.

Evelyn Waugh (1903 „1966), Sword of Honour (Men at arms), 1 I

describing function função de descrição


equivalent gain ganho equivalente
limit cycle ciclo limite

Exercises
1. Figure 28.15 shows two non-linear elements (a relay and a dead zone) in
series. To which of the following single systems is this equivalent?

(a) A dead zone with A = 0.5.


(b) A relay with M = 0.5.
(c) A relay with M = 1.
(d) None of the above.
400 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS

Figure 28.16: Block diagram of Exercise 2.

Figure 28.17: Options of Exercise 2.

2. Figure 28.16 shows two non-linear elements (a relay and a dead zone) in
parallel. To which of the single systems in Figure 28.17 is this equivalent?

3. Repeat the calculations of Example 28.3, when the plant of the diagram
in Figure 28.3 is
s2 + 7s + 10
G(s) = 3 (28.53)
s + 0.25s2 + s
4. The plant in Figure 28.18 includes a backlash non-linearity with 2A = 0.5
3
and B = 1, C = 1. Let G(s) = 2 . Use the describing function
s (s + 1)
method to verify if this plant has a limit cycle. If it does, nd its frequency
and amplitude.
5. The plant in Figure 28.11 includes a backlash non-linearity with A = 1
1.5
and k = 1. Let G(s) = 2 . Use the describing function method
s (s + 1)
to verify if this plant has a limit cycle. If it does, nd its frequency and
amplitude.
6. Consider the plant in Figure 28.19.
(a) Let R = 0, A = 4, k = 1 and K1 = 20. Find the frequency and the
amplitude of the limit cycle.
(b) Is this limit cycle stable or unstable?
(c) Increasing gain K1 , how does the limit cycle change?

7. The plant in Figure 28.20 includes a saturation non-linearity with M = 1.


Use the describing function method to verify if this plant has a limit cycle.
If it does, nd its frequency and amplitude.

Figure 28.18: Block diagram of Exercise 4.


28.3. PREDICTING LIMIT CYCLES 401

Figure 28.19: Block diagram of Exercise 6.

Figure 28.20: Block diagram of Exercise 7.

8. The plant in Figure 28.21 includes a dead zone non-linearity with A = 1


and K = 1. Use the describing function method to verify if this plant has
a limit cycle. If it does, nd its frequency and amplitude.
e−2s
9. Repeat Exercise 7 when the transfer function is G(s) = s(s+2) instead.

10. Repeat Exercise 7 when the transfer function is G(s) = 100


s(s+2)(s+3) instead.

Figure 28.21: Block diagram of Exercise 8.


402 CHAPTER 28. NON-LINEARITIES IN CONTROL SYSTEMS
Chapter 29

Other aspects of controller


design and implementation
Metido tenho a maõ na consciencia,
E naõ fallo senaõ verdades puras,
Que m'ensinou a viua experiencia.

Luís Vaz de Camões (1524? „1580), Rimas de Luis de Camões,Soneto 87


(1598 edition)

Strictly proper systems. Placing extra poles. PID as PI+D. Windup. Reset.
Modelling errors. Robustness. Gain modelling. Waterbed eect. The small gain
theorem.
This chapter is still being written.
In the picture: National Pantheon, or Church of Saint Engratia, Lisbon
(source: http://www.panteaonacional.gov.pt/171-2/historia-2/), some-
when during its construction (16821966).

Glossary
Listen to me for a moment, said the steady voice of Moreau; and
then say what you will.
Well? said I.
He coughed, thought, then shouted: Latin, Prendick! bad Latin,
schoolboy Latin; but try and understand. Hi non sunt homines;
sunt animalia qui nos habemus vivisected. A humanising process.
I will explain. Come ashore.

403
404CHAPTER 29. OTHER ASPECTS OF CONTROLLER DESIGN AND IMPLEMENTATION

H. G. Wells (1866 „1946), The Island of Doctor Moreau, XIII

word in English word in Portuguese


palavra em inglês palavra em português

Exercises
1. Question.
Part VI

System identication

405
407

`Somewhere to run,' suggested Paul.


`Why, God bless my soul, they've got the whole park! How did you
manage yesterday for the heats?
`We judged the distance by eye.'

Evelyn Waugh (19035 „1966), Decline and fall, 1 VIII

In this part of the lecture notes:

Chapter 30 addresses general questions related to system identication.

Chapter 31 is about the identication of transfer functions from time responses.

Chapter 32 concerns the identication of transfer functions from frequency responses.

Chapter 33 shows how to identify non-linearities.

Here is what you need to know beforehand to follow these chapters:

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4;

ˆ System theory, from Part II;

ˆ Filters, from Sections 12.2 and 12.3 of Chapter 12;

ˆ Discrete transfer functions, from Chapter 25, Sections 26.1 to 26.5 of


Chapter 26, and Sections 27.1, 27.2 and 27.6 of Chapter 27.

For Chapter 33, you also need to know the following:

ˆ Soft non-linearities, from Section 8.3 of Chapter 8;

ˆ Hard non-linearities, from Chapter 28;

ˆ Delays, from Chapter 24.


408
Chapter 30

Overview and general issues


Je n'ay jamais jugé d'une mesme chose exactement de mesme, je ne
puis juger d'un ouvrage en le faisant ; il faut que je fasse comme
les peintres & que je m'en eloigne, mais non pas trop. De combien
donc ? Devinez.

Blaise Pascal (1623 „1662), Pensées diverses I, 12/37

We already saw in Section 3.3 that system identication is the obtention of


models from experimental data. More generally, it is the obtention of models
for a plant from its behaviour. In some cases, a controller can be obtained iden-
tifying its model from its desired behaviour, determined analytically from the
plant to control and the specications to be followed. But the usual case is, in-
deed, the identication of a model for a plant from its behaviour experimentally
determined, and that will be the situation presumed by default in what follows.
The models we address are transfer functions; we will not consider the identi- Identication of transfer
cation of NN and fuzzy models, mentioned in Figures 3.18 and 3.19, which are functions
beyond our scope. This chapter sums up some general questions before entering
into particular methods and algorithms.

30.1 Types of data, types of identication meth-


ods, and types of models
The experimental data always consists of responses in time. Chapter 31 ad-
dresses identication methods directly from time responses.
It is possible to obtain from time responses a frequency response: this is
obvious if the responses in time that we have are responses to sinusoids, but
from other types of time responses a frequency response can be obtained as well.
In Chapter 32 we will see identication methods from frequency responses.
As we saw in Section 3.2 and in Chapter 13, nowadays experimental data
is nearly always a digital signal, and thus sampled in time. We will address
some graphical methods that seem to implicitly require an analogical signal.
Remember that:

ˆ if the sampling time was well chosen, according to the criteria in Sec-
tion 25.4, the digital signal will reproduce the analogical signal with ac-
curacy;

ˆ tting a curve (this includes a straight line, of course) or nding a slope


can be done numerically with a set of points.

Even though signals are almost always digital, some identication methods Continuous and discrete
provide a continuous transfer function, while others provide a discrete transfer identied models
function. If the desired transfer function is of the other type, a conversion using
the Tustin approximation or a pole-zero match is then performed.
The identication methods addressed in this part presume SISO models. If How to deal with MIMO
the plant is linear, this poses no restriction at all: plants

ˆ if there are several outputs, each of them is identied separately, i.e. the
MIMO plant is treated as several MISO plants;

409
410 CHAPTER 30. OVERVIEW AND GENERAL ISSUES

Figure 30.1: How to identify a MIMO plant as several MISO plants (top), and
a linear MISO plant as several SISO plants (bottom).

ˆ if there are several inputs, since the plant is linear, the output is a linear
combination of SISO plants. Consequently:
all inputs are set to zero, save one of them, and a model for the
relation between that input and the output is found;
the step above is repeated for each input;
the model of the MISO plant is the sum of the SISO models found.
All this is illustrated in Figure 30.1. But if there are non-linearities the above
method fails. We will address the identication of non-linearities only for SISO
models, in Chapter 33.
Identication methods can be performed using data as it becomes available.
Identication in real time This is called real time identication, and if it works as expected the model
obtained gets more accurate with time, as more data becomes available. (Obvi-
ously, if the model becomes worst, the identication is a failure.) Identication
Oine identication can also be carried out only after all data becomes available, using a batch of
measured values all at once. This is called oine identication.
If there is a model based The case where there already is a model of the plant based upon rst prin-
upon rst principles ciples has been mentioned in Section 3.3. Remember that:
ˆ in this case, identication from experimental data can be used to conrm,
or correct, the values of the parameters of a model for which the structure
is known;
ˆ experimental data can also be used to conrm (or not) the said structure
of the model. It may show that some neglected phenomenon (say, a non-
linearity, or a friction force) is after all so signicant that, for the model
to have the desired accuracy, additional details must be included (a non-
linearity, or additional poles or zeros, etc.).
If there is no model available before identication, then a model structure must
be found before model parameters are identied; or, in other identication meth-
ods, both the model structure and its parameters are found simultaneously.
Identication in closed Some plants have to be identied when they are already controlled in closed
loop loop. This may happen for several reasons:
ˆ it is somehow impossible to turn o or disconnect the controller;

ˆ without control, outputs may reach unacceptable values (e.g. some temper-
ature may become so high that the plant will be damaged; some pressure
may rise to values that endanger operators' lives; forces will be applied in
a structure that will yield);
ˆ the plant is marginally stable or unstable, and without control outputs will
reach saturation values so fast that almost no data at all can be recorded.
Such plants usually have the problem of unacceptable values too.
In this case, a known controller C must be used, and what is identied is the
closed loop transfer function F . If the closed loop is the one from Figure 9.13,
plant G is found as
CG
F = ⇒ F + F CG = CG
1 + CG
⇒ F = CG(1 − F )
F
⇒G= (30.1)
C(1 − F )
Dierent congurations of the closed loop are dealt with similarly.
30.2. COMPARING MODEL PERFORMANCE 411

30.2 Comparing model performance


Model accuracy has already been mentioned a few times. It is the dierence
between the experimental outputs and those of the model for the same inputs.
Of course, a model can be accurate for some cases and inaccurate for others
(hopefully less relevant). Some models are good during the transient regime
but not in steady-state; for others, it is the other way round. Some models
reproduce step responses but not those of other inputs, or the plant's frequency
response; with other models the reverse can be true. It is surely desirable, Trade-o between accu-
but seldom possible, to have a model which is always accurate. Or perhaps racy and simplicity
increasing the accuracy of the model requires a model structure which is too
complicated (with too many poles and zeros). Quite often, it is better to have
a manageable model with a moderate number of zeros and poles than a very
accurate model which is very complicated and dicult to study and simulate.
What is to be considered too complicated depends on the case.
The following performance indexes are often used to measure accuracy. For
each of them, two expressions are given: one for analogical signals, another for
digital signals. The experimental variable is y , and the variable that approxi-
mates y is ŷ . In the digital case, there are N + 1 samples, numbered from 0 to
N . The analogical case is given for time varying from 0 to tf ; should the signal
depend on frequency (say, from ωl to ωh ), the dierence in the calculations is
obvious.

ˆ Mean absolute error (MAE): MAE

Z tf
1
MAE(y(t) − ŷ(t)) = |y(t) − ŷ(t)| dt (30.2)
tf 0
N
1 X
MAE(yk − ŷk ) = |yk − ŷk | (30.3)
N +1
k=0

ˆ Mean square error (MSE): MSE

Z tf
1
MSE(y(t) − ŷ(t)) = (y(t) − ŷ(t))2 dt (30.4)
tf 0
N
1 X
MSE(yk − ŷk ) = (yk − ŷk )2 (30.5)
N +1
k=0

ˆ Root mean square error (RMS): RMS

s Z tf
1
RMS(y(t) − ŷ(t)) = (y(t) − ŷ(t))2 dt (30.6)
tf 0
v
u N
u 1 X
RMS(yk − ŷk ) = t (yk − ŷk )2 (30.7)
N +1
k=0

ˆ Coecient of determination (R2 ): R2


Z tf
(y(t) − ŷ(t))2 dt
2
R (y(t) − ŷ(t)) = 1 − Z tf
0
Z tf 2 (30.8)
1
y(t) − y(t) dt dt
0 tf 0
| {z }
average value of y
N
X
(yk − ŷk )2
k=0
R2 (yk − ŷk ) = 1 − N N
(30.9)
X 1 X 2
yk − yk
N +1
k=0 k=0
| {z }
average value of y
412 CHAPTER 30. OVERVIEW AND GENERAL ISSUES

ˆ Variance accounted for (VAF): VAF

σ 2 (y − ŷ)
VAF(y − ŷ) = 1 − (30.10)
σ 2 (y)

Variance Here σ 2 (x) is the variance of x, be it continuous or discrete. Notice that


σ 2 (y − ŷ) = MSE(y − ŷ).
The best model according to one criterion may not be the best according to
another, and the best performance index depends on the case. Very often it is
a good idea to take a look at several of them. Notice that:
ˆ MAE and RMS have the same units as y ;

ˆ MSE has units of y 2 ;

ˆ R2 and VAF have no dimensions;

There is no error if ˆ MAE, MSE and RMS are 0 if there is no error;


MAE=MSE=RMS=0 and
R2 =VAF=1 ˆ R2 and VAF are 1 if there is no error;

ˆ VAF is often given as a percentage.

The performance indexes above do not help to solve the trade-o between ac-
curacy and simplicity mentioned above. For that purpose, the following ones are
employed. Data is assumed to be discrete in time; models have K parameters.
AIC ˆ Akaike Information Criterion (AIC):
correction for
small data sets
z }| {
2K(K + 1)
AIC(yk − ŷk ) = N log MSE(yk − ŷk ) + 2K +
N −K −1
N
= N log MSE(yk − ŷk ) + 2K (30.11)
N −K −1
| {z }
correction for
small data sets

The correction for small data sets can be neglected if N K ; say, if


N > 40K . Indeed, the value of N −K−1
N
is
only 1.053 if K = 1 and N = 40K (and so neglecting it correspond
to an error of about 5%),
even lower, if K > 1,
also lower, if N > 40.
BIC ˆ Bayesian Information Criterion (BIC):
BIC(yk − ŷk ) = N log MSE(yk − ŷk ) + K log N (30.12)

This expression has no correction for small data sets, and so applies only
if N K . Compared with the AIC, the BIC favours models with less
parameters.
ˆ Normalised AIC and BIC, needed to compare models found from data
with dierent lengths N :

AIC(yk − ŷk )
nAIC(yk − ŷk ) = (30.13)
N
BIC(yk − ŷk )
nBIC(yk − ŷk ) = (30.14)
N

The lower the value of the AIC or of the BIC, the better the model is considered;
the values themselves have no signicance, and only serve to compare dierent
models. Given n models with outputs i ŷk , i = 1, . . . , n, it is possible to nd
from their values of the AIC or of the BIC a probability of each model being
the best. (Dening precisely in which sense this probability is to be understood
Akaike weights falls outside our scope.) This probability is given by the Akaike weights for
30.2. COMPARING MODEL PERFORMANCE 413

Table 30.1: Values of the AIC, BIC, and corresponding weights for four models
of plant (30.17).
G1 (s) G2 (s) G3 (s) G4 (s)
AIC −0.98 −0.98 −4635.0 −4630.1
w(AIC) 0.0% 0.0% 92.2% 7.8%
BIC 15.8 15.8 −4618.2 −4613.3
w(BIC) 0.0% 0.0% 92.2% 7.8%

warz weights the AIC, or the Schwarz weights for the BIC:
AICi − min AICm
!
m=1...n
exp −
2
wi (AIC) = !, i = 1 . . . n (30.15)
n
X AICp − min AICm
m=1...n
exp −
p=1
2
BICi − min BICm
!
m=1...n
exp −
2
wi (BIC) = !, i = 1 . . . n (30.16)
n
X BICp − min BICm
m=1...n
exp −
p=1
2

Example 30.1. Consider the unit step response of plant


10
G(s) = (30.17)
s2 + 0.6s + 1
sampled with Ts = 0.01 s from 0 s to 20 s, comprising thus N = 2001 points.
Suppose that four models were somehow obtained from this response:
11
G1 (s) = (30.18)
s2
+ 0.6s + 1
9
G2 (s) = 2 (30.19)
s + 0.6s + 1
10
G3 (s) = 2 (30.20)
s + 0.5s + 1
10
G4 (s) = 2 (30.21)
s + 0.726s + 1
All these models have the same number of parameters: 2 poles and the gain,
with no zeros, i.e. K1 = K2 = K3 = K4 = 3. Figure 30.2 compares the desired
unit step response with those of the models, and gives the corresponding values
of the MSE. The corresponding values of the AIC, the BIC, the Akaike weights,
and the Schwarz weights are given in Table 30.1. Notice that:
ˆ Since K is the same for all models, it is unsurprising that ranking the
models using the MSE and the AIC gives the very same result.
ˆ For the same reason, even though the values of the AIC and the BIC are
dierent, the ranking and even the weights are the same.
ˆ Since G1 (s) and G2 (s) have the same MSE and the same K , the AIC and
the BIC are also equal for these two models.
Suppose that two additional models are also obtained:
10(s + 11.2705)
G5 (s) = (30.22)
(s2
+ 0.6s + 1)(s + 11)
10(s + 11.01 × 100 × 50)
G6 (s) = 2 (30.23)
(s + 0.6s + 1)(s + 11)(s + 100)(s + 50)
G5 (s) has 3 poles, 1 zero, and the gain, i.e. K5 = 5; while G6 (s) has 5 poles,
1 zero, and the gain, i.e. K6 = 7. Figure 30.3 compares the desired unit step
response with those of the new models, and gives the corresponding values of the
MSE. The MSE is lower for G6 (s), but this model is clearly the more complex.
Table 30.1 shows that:
414 CHAPTER 30. OVERVIEW AND GENERAL ISSUES

Figure 30.2: Unit step responses of plant (30.17) and of four models thereof.

Figure 30.3: Unit step responses of plant (30.17) and of two models thereof.

ˆ the lowest AIC is that of G5 (s), which results in a very high probability
of being the best;

ˆ G5 (s) is neither the model with less parameters nor the model with lower
MSE;

ˆ that the BIC favours G5 (s) even more; in fact, a slightly higher MSE of
G5 (s) could make Akaike weights attribute a higher probability for G6 (s),
while the Schwarz weights would still favour G5 (s);

ˆ G3 (s) and G4 (s), which had signicant weights when there were only four
models, are now considered highly improbable.

30.3 Noise
All experimental data is more or less corrupted by noise. Explicit consideration
of noise in models and in the identication process leads to models of a type
called stochastic models, addressed below in Part VIII. Here we address the way
to try to eliminate it from data.
SNR Suppose that a signal y is corrupted with noise yn , so that the measured
30.3. NOISE 415

Table 30.2: Values of the AIC, BIC, and corresponding weights for six models
of plant (30.17).
G1 (s) G2 (s) G3 (s) G4 (s) G5 (s) G6 (s)
AIC already given in Table 30.1 −5620.7 −5617.7
w(AIC) 0.0% 0.0% 0.0% 0.0% 81.6% 18.4%
BIC already given in Table 30.1 −5592.7 −5578.6
w(BIC) 0.0% 0.0% 0.0% 0.0% 92.9% 0.1%

Figure 30.4: Bode diagram of (30.27), when n = 1 and Ts = 1 s.

value ỹ is
ỹ = y + yn (30.24)
Then the signal to noise ratio (SNR) is dened as

RMS(y)
SNR = (30.25)
RMS(yn )

The SNR is often given in dB, i.e. as

RMS(y)
20 log10 SNR = 20 log10 (30.26)
RMS(yn )

When SNR< 1 (i.e. below 0 dB) noise is larger than the signal itself. It is
obviously desirable that SNR 1 (i.e. 20 log10 SNR 0 dB).
To eliminate noise, a lter is applied. Oine identication can use non-
causal lters.
Example 30.2. A centred moving average lter of order 2n + 1 is a digital Centred moving average
low-pass lter given by

z −n + . . . + z −1 + 1 + z + . . . + z n
F (z) = (30.27)
2n + 1
It has a zero phase until the rejection band, thus introducing no phase distortion.
Its gain is almost constant in a large passband. See Figure 30.4.
When a too small sampling time was employed, data should be subsampled, Subsampling
i.e. only the measurements at regular intervals are kept. This corresponds to a
low pass ltering of a signal. When there is so much experimental data that the
computational eort of using it all would be excessive, there are two options:
ˆ subsample the data, which eliminates high frequency behaviour (since sub- Truncating and subsam-
sampling has the eect of a low pass lter); pling eliminate low and
high frequencies respec-
ˆ truncate the data, which eliminates low frequency behaviour (which is not tively
captured in a shorter time range).
416 CHAPTER 30. OVERVIEW AND GENERAL ISSUES

The discussion above presumes that it is known what in the measured values
is the signal and what is the noise. Sometimes this is not clear at the outset or
by a mere inspection of the data. It is necessary to have some previous estimate
of the bandwidth of the plant to known what is to be ltered. Remember that:

ˆ noise with frequencies inside that bandwidth can only be eliminated dam-
aging the response of the plant itself;

ˆ lters attenuate but seldom, if ever, completely eliminate;

ˆ any behaviour of the plant (or of the noise) that is ltered cannot be
expected to be modelled acurately.

Noise is not everything that has to be eliminated from data: initial conditions
must be set to zero; remember Example 8.1. Some identication methods require
normalising all variables involved, but since the methods we are dealing with
are for transfer function models, which are linear, this should not make any
dierence.
The results of identication methods must be critically analysed rather than
accepted without reserve. It often happens that identication methods provide
models with unnecessary poles and zeros, that is to say:

ˆ poles and zeros that cancel out, or nearly cancel out and only do not
because of slight numerical dierences (these can be removed in Matlab
Matlab's command using function minreal);
minreal
Range of frequencies where
ˆ poles and zeros with frequencies outside the range of frequencies where
good results can lie
experimental data can lead to acceptable results.

Remember from what we saw in Chapter 25 that a signal measured from time
0 to time tf with sampling frequency Ts cannot carry information outside fre-
quency range
π π
≤ω≤ (30.28)
tf Ts

which corresponds to a bare minimum of two points per period; and that in
practice, since we need at least some 10 points to sample a period of a sinusoid
with an error in its amplitude below 5%, it is better to consider the narrower
frequency range
2π 2π
10 ≤ω≤ (30.29)
tf 10Ts

instead. Eliminating the poles and zeros of a model that fall outside this range
of frequencies is also a sort of ltering, since less frequencies are being considered
in the end.

30.4 Pseudo-inverse of a matrix


In system identication, it often happens that there are more data points than
model parameters to be identied, leading to overdetermined systems. Under
ideal conditions an exact model, no noise, no measurement errors, etc. ,
this would not preclude an exact solution. Of course, in practice, this is not the
case. So:

ˆ either only as many data points as model parameters to identify are used,
which is likely a waste of much information,

ˆ or an approximate solution is found, in which case a least-squares solution


is the almost universal choice.

The least-squares solution of a linear problem can be found using the pseudo-
inverse of a matrix. To dene it, some results are needed.
30.4. PSEUDO-INVERSE OF A MATRIX 417

Denition 30.1. Let x be a n × 1 vector. Given a scalar function of vectorial


d
variable f (x), derivative f (x) is dened as
dx


 
 ∂x1 f (x) 
 ∂ 
f (x) 
 
d ∂x (30.30)

f (x) =  2
..
 
dx 

 . 

 ∂ 
f (x)
∂xn

Lemma 30.1.

n
 
∂ X
bk xk 
 ∂x1 k=1

  
n b1
 
 ∂ X 
d
 bk xk   b2 
bT x =  ∂x2 (30.31)
 
= . =b

  .. 
k=1
dx 
..
 
.

bn
 
n
 
 ∂ X 
 bk xk 
∂xn
k=1

Lemma 30.2. Let C be a square n × n matrix. Then

    
C11 C12 ··· C1n x1
d d   C21
 C22 ··· C2n   x2 
xT Cx =

 x1 x2 ··· xn  . .. .. ..   .. 
  
dx dx   .. . . .   . 
Cn1 Cn2 ··· Cnnxn
 
" n x1
n n
#
d   x2 
 Xx C X X
= xk Ck2 · · · xk Ckn   .. 

k k1
dx  k=1 . 

k=1 k=1

xn
n n
   n n

∂ XX X X
xk Ckl xl   C1l xl + xk Ck1 
 ∂x1

l=1 k=1
  l=1 k=1

n X n n n
   
 ∂ X  X X 
 xk Ckl xl  
  C2l xl + xk Ck2 
∂x2
 
= l=1 k=1
 =  l=1 k=1

.. ..
   
. .
   
   
n X n n n
   
 ∂ X  X X 
 x C x
k kl l
  C x + nl l x C  k kn
∂xn
l=1 k=1 l=1 k=1
 X n 
2 Cm1 xm 
 m=1   
 n
 X 
 C11 C12 ··· C1n
2 C m2 xm   C21 C22 ··· C2n 
=  m=1  = 2  .. .. .. ..  (30.32)
   
 ..   . . . . 
.
 

 X n

 Cn1 Cn2 ··· Cnn
 
2 Cmn xm
m=1

Lemma 30.3. Given any matrix B, the product BT B is a symmetric matrix.


418 CHAPTER 30. OVERVIEW AND GENERAL ISSUES

Proof. Let B be a n × m matrix. Then


  
B11 B21 · · · Bn1 B11 B12 · · · B1m
 B12 B22 · · · Bn2   B21 B22 · · · B2m 
BT B =  . .. .. ..   .. .. .. .. 
  
 .. . . .  . . . . 
B1m B2m · · · Bnm Bn1 Bn2 · · · Bnm
 n n n

X X X
 Bk1 Bk1 Bk1 Bk2 · · · Bk1 Bkm 
 k=1 k=1 k=1

 n n n

X X X 
 Bk2 Bk1 Bk2 Bk2 · · · Bk2 Bkm 
(30.33)
 
= k=1 k=1 k=1

.. .. . .


 . . . . .
.


 n n n

X X X 
 B B km k1 B B ···
km k2 B B 
km km
k=1 k=1 k=1

Thus, in the m × m resulting matrix, both element l, c and element c, l are given
n
X
by Bkl Bkc .
k=1

We are now in condition to prove the following.


Theorem 30.1. Let A be a m × n matrix, and b a m × 1 vector. The solution
in the least-squares sense of problem

Ax = b (30.34)

is the n × 1 vector x given by

x = A+ b (30.35)

Pseudo-inverse where the n × m matrix A+ is the pseudo-inverse (or Moore-Penrose inverse)


of matrix A, given by
−1 T
A+ = AT A A (30.36)

Proof. The error is the m × 1 vector

ε = b − Ax (30.37)

and the least-squares solution minimises the MSE, that is


n
1X 2 1
MSE = εk = εT ε
n n
k=1
1
= (b − Ax)T (b − Ax)
n
1 T
b − xT AT (b − Ax)

=
n
1 T
b b − bT Ax − xT AT b + xT AT Ax (30.38)

=
n
Because MSE is a scalar, we know immediately that both bT Ax and xT AT b =
(bT Ax)T are equal. Thus
1 T
MSE = b b − 2bT Ax + xT AT Ax (30.39)

n
We apply (30.31), (30.32) and (30.33) to get
d
MSE = 0
dx
T
⇔ 0 − 2 bT A + 2AT Ax = 0
⇔ AT Ax = AT b
−1 T
⇔ x = AT A A b (30.40)
| {z }
A+
30.4. PSEUDO-INVERSE OF A MATRIX 419

Glossary
Cornelius, do you and your lawfully wedded spouse speak any lan-
guage other than English?
What is English? I speak the language taught to me by my father
and mother, who were taught by their fathers and mothers before
them. It has been the language of our ancestors for nearly two
thousand years. As to its origins, who can be sure?

Paul Dehn (1912 „1976), Escape from the Planet of the Apes

centred moving average média móvel centrada


coecent of determination coeciente de determinação
mean absolute error erro absoluto médio
mean square error erro quadrático médio
oine identication identicação em diferido
real time identication identicação em tempo real
root mean square error raiz do erro quadrático médio, valor ecaz do erro
signal to noise ratio razão sinalruído, relação sinalruído
stochastic model modelo estocástico
variance accounted for variância contabilizada

Exercises
1. Plot the Bode diagram of (30.27) for dierent values of n. For each case,
nd the passband and the largest gain in the rejection band.
420 CHAPTER 30. OVERVIEW AND GENERAL ISSUES
Chapter 31

Identication from time


responses
Oh ! avec les chires on prouve tout ce qu'on veut !
Et avec les faits, mon garçon, en est-il de même ?

Jules Verne (1828 „1905), Voyage au centre de la Terre, VI

This chapter concerns identication methods from responses in time. The


most frequently used inputs for this purpose are:
ˆ steps, not necessarily of unit amplitude (remember the passing comments
in Section 10.1);
ˆ squares waves, in lieu of a step (remember the passing comments in Sec-
tion 10.4);
ˆ triangle waves, in lieu of a ramp (remember the passing comments in
Section 10.4).
Responses to sinusoidal inputs are usually obtained to nd the frequency re-
sponse. They can, however, be used as responses to any other signal. Responses
to impulses are seldom attempted and never really attained: as we saw in Sec- No experimental impulse
tion 10.1, an impulse is a mathematical abstraction, and in practice the best responses
approximation is a pulse. Things being so, it is better to explicitly consider a
square wave instead.

31.1 Identication of the order of the model


The characteristics of the time response can be used to estimate the number of
poles and zeros that a model needs to have. Remember in particular the results
from Section 11.6.
The following observations apply to step responses; similar considerations
for other types of responses are found in a similar manner.
ˆ If there is an overshoot, the plant has at least two poles.

ˆ An overshoot is frequently the result of a pair of complex conjugate poles.

ˆ An overshoot can also be caused by a zero with a frequency which is low


when compared with the frequency of the poles.
ˆ Oscillations (which are not the same as an overshoot: an overshoot can
occur without being followed by oscillations) are either the result of a pair
of complex conjugate poles, or a limit cycle caused by a non-linearity.
ˆ An undershoot implies a non-minimum phase zero.

ˆ The dierence between the numbers of zeros and poles can be found from
the way the step response behaves for t = 0, according to Theorem 11.3.
This becomes dicult if noise is so signicant that this behaviour in a
short period of time is hard to assess.

421
422 CHAPTER 31. IDENTIFICATION FROM TIME RESPONSES

ˆ The signal can be dierentiated to better see how the behaviour for t = 0
is. But remember that dierentiating amplies high-frequency noise.
ˆ If the output settles at a steady state value y∞ , there are no poles at the
origin, and the gain of the plant K is the ratio between that steady state
value and the amplitude of the step u∞ :
y∞
K= (31.1)
u∞
ˆ If the plant is marginally stable, or is unstable because of two or more
poles at the origin (integrations), the response can be dierentiated one
or more times, until a steady state is found. The number of dierentiations
is the number os poles at the origin. But it is never too often repeated
that dierentiating amplies high-frequency noise.

31.2 Identication from analytical characteristics


of the response
Once a desired model structure is known, its parameters, or at least some of
them, may be found from characteristics of the response. Remember in partic-
ular the results from Sections 11.1 to 11.3 and 11.6.
The following observations apply to step responses; similar considerations
for other types of responses are found in a similar manner.
ˆ The gain of the plant is found from (31.1).

ˆ The pole of a (stable) rst order model, or a (stable) dominant real pole of
a model with more poles and zeros, can be found from the settling time,
or from any other point given by (11.12)(11.18) or in the general case
by (11.11). The slope at t = 0, given by (11.19), can be used to nd
the gain. Since the response at t = 0 is linear with time, this slope can
be found tting a straight line with least squares during a short interval.
This corresponds to a low pass ltering of noise.
ˆ The two real poles of an overdamped second order model without zeros
can be found as follows:
the dominant pole is found as if it were the only one;
the other pole is found from the inection point using (11.54).
ˆ The coecients of an underdamped second order model without zeros can
be found as follows:
the damping factor is found from the maximum overshoot using
(11.72);
the natural frequency is then found from the settling time using
(11.73) and the particular values given immediately after;
the frequency of the oscillations ωn 1 − ξ 2 can be used to conrm
p

these two values or to correct one of them once the other is known.
Example 31.1. An electrical motor can be modelled as
θ(s) 10
= (31.2)
U (s) s(1 + 0.15s)
and its unit step response is shown in Figure 31.1. A linear regression easily
shows that the response is going to innity linearly (not exponentially, as when
there is an unstable pole; not quadratically, as when there are two poles at the
origin; etc.) and thus that there is one pole at the origin. As an alternative,
the derivative of θ(t) can be numerically calculated (with a rst order nite
dierence) and plotted, and, as seen also in Figure 31.1, it easy to establish for
θ̇(s)
U (s) a rst order model with steady state gain 10 and time constant 0.15:

θ̂(s) 10
= (31.3)
U (s) 1 + 0.15s
From this, (31.2) comes immediately.
31.3. IDENTIFICATION BY MINIMISATION OF ERROR 423

Figure 31.1: Left: unit step response of (31.2), from Example 31.1. Right: its
rst derivative.

31.3 Identication by minimisation of error


Identifying a model as described in the previous section consists in nding pa-
rameters from the values of only some of the measured outputs. Most of the
measured values are wasted; this is the price to pay for fairly simple calculations.
Using all the measured outputs may lead to more accurate results.
Example 31.2. The response of model G(s) = to a step of amplitude K
b
s+a
is y(t) = bK
a (1 − e ), as we saw in (11.11).
−at

From the values of y(t) for large t, we can get steady state gain ab . Then we
calculate
bK
log y(t) − = −at (31.4)
a
and a linear regression on t gives a. See Exercise 4 of Chapter 11.
While in the Example above the calculations are still fairly simple, this is
not the case for models with more than one pole.
Example 31.3. An overdamped second order model with poles which are not
too close may still be identied in a likewise manner. Consider the unit step
response of
1
G(s) = (31.5)
(s + 1)(s + 10)
which is given by (see Table 2.1)
1 1
10e−t − e−10t (31.6)

y(t) = +
10 10(−9)
and has a steady state given by limt→+∞ y(t) = 10
1
, as seen in Figure 31.2.
Suppose that our model uses the correct structure
1
10 p1 p2
Ĝ(s) = (31.7)
(s + p1 )(s + p2 )
and already includes the correct steady-state gain 10 1
easily read in Figure 31.2.
Plotting

1
log −(y(t) − ) = log 90 10e−t − e−10t = log 90 + log 10e−t − e−10t

10
(31.8)
gives us a practically straight line, since the faster pole (which is −10, as we
saw in Section 11.6) has a vanishing eect that can only be seen near t = 0.
The slope shown in Figure 31.2 gives us the pole p1 = −1.
As to the other pole, it could be found from the inection point using (11.54),
but it is quite hard to nd it using a method similar to the one used for p1 ,
since we now know that

p2 1 1 −t −p2 t

y(t) = 1+ p2 e − e ⇒
10 p2 1 − p2
(10y(t) − 1)(1 − p2 ) = p2 e−t − e−p2 t ⇒
−p2 t = log p2 e−t − (10y(t) − 1)(1 − p2 ) (31.9)

424 CHAPTER 31. IDENTIFICATION FROM TIME RESPONSES

Figure 31.2: Left: unit step response of (31.5), from Example 31.3. Right: plot
of (31.8).

This expression has p2 on both sides, and so we would have to nd some value
p2 with which the right hand side of 31.9 is a straight line for small values of
t, with slope −p2 . Searching for this value can be done by trial and error until
p2 = 10 is found, but there are better methods than that.

Remark 31.1. The method of Example 31.3 can be used for other plants with
a dominant real negative pole.

In the general case, nding the parameters of a continuous model that pro-
vide the best t between its response and the experimental data is a non-linear
problem. Consequently, optimisation methods such as the Nelder-Mead simplex
search method (implemented in Matlab with function fminsearch), or meta-
Metaheuristics for identi- heuristic methods (of which genetic algorithms and particle swarm optimisation
cation are well known examples) can be used. We will not study such methods, but
once you learn them in a course on that subject you can apply them easily in
identication:

ˆ The objective is to minimise one of the performance indexes (30.2)(30.10),


or a linear combination thereof.

ˆ An initial estimate of the parameters is provided if available; otherwise,


random values are used to begin with.

ˆ Some algorithms use only one initial estimate; others use several dierent
sets of values.

ˆ These algorithms are iterative, and in each iteration the time response
of the plant for the parameters currently being evaluated is found and
compared with the experimental data.

ˆ In this way, identication can be performed with responses to any input,


not just steps.

Metaheuristics do not This strategy can work for complicated problems, but can also get stuck because
guarantee the optimal of numerical problems, and these algorithms do not ensure that the parameters
result, and not even good they nd actually correspond to the minimum value of the performance index.
results The problem is far easier if discrete models
Identifying parameters of
−1
models in z
yk b0 + b1 z −1 + . . . + bm z −m
= ⇒
uk 1 + a1 z −1 + . . . + an z −n
yk = b0 uk + b1 uk−1 + . . . + bm uk−m − a1 yk−1 − . . . − an yk−n (31.10)
31.3. IDENTIFICATION BY MINIMISATION OF ERROR 425

Figure 31.3: Output of (31.14) for a sinusoidal output and normally distributed
error.

are used instead, since we can arrange data and parameters to be identied as

n+m+1 rows
θ
z }| {
columns

y
n+m+1
A
b0
z }| { z }| {  b1 
yk uk uk−1 ··· uk−m −yk−1 ··· −yk−n  .. 
 
 . 
yk−1  uk−1 uk−2 ··· uk−m−1 −yk−2 · · · −yk−n−1   
yk−2  = uk−2
    bm 
uk−3 ··· uk−m−2 −yk−3 · · · −yk−n−2   
.. .. .. .. .. .. .. ..  a1 
   
. . . . . . . .  . 
 
 .. 
an
(31.11)

and then solve for θ . We need y and A to have at least n + m + 1 rows, and
thus n + m + max{n, m} samples of uk and yk are needed. Likely there will be
more, and Aθ = y will be overdetermined. A solution in the least-squares sense
is then found, as seen in Section 30.4:

θ = A+ y (31.12)

Example 31.4. Consider plant

2 + 3z −1
G z −1 = (31.13)

1 + 0.5z −1 − 0.4z −2

with sample time Ts = 1 s, which, allowing for additive noise at the output,
corresponds to the dierence equation

yk = −0.5yk−1 + 0.4yk−2 + 2uk + 3uk−1 + ek


⇔ yk = a1 (−yk−1 ) + a2 (−yk−2 ) + b0 uk + b1 uk−1 + ek , (31.14)
a1 = 0.5, a2 = −0.4, b0 = 2, b1 = 3

Its output is tabulated in Table 31.1 and shown in Figure 31.3 for a sinusoidal
input, when the error is normally distributed with variance 0.001.
Suppose we know that the model has two poles and one zero, i.e. we know
that it is given by (31.14), and want to know the values of parameters a1 , a2 ,
b0 and b1 . We know that there will be an error, and since we cannot measure
it or estimate it the best we can do is to replace it by its expected value, which
426 CHAPTER 31. IDENTIFICATION FROM TIME RESPONSES

Table 31.1: Input and output data of Figure 31.3.


t[s] 0 1 2 3 4 5 6
input 0.0000 0.7071 1.0000 0.7071 0.0000 −0.7071 −1.0000
output 0.0007 1.4237 3.4108 3.2732 1.8618 −1.0272 −2.8700
t[s] 7 8 9 10 11 12 13
input −0.7071 0.0000 0.7071 1.0000 0.7071 0.0000 −0.7071
output −3.3999 −1.5776 0.8401 3.0635 3.2140 1.7455 −1.0050
t[s] 14 15 16 17 18 19 20
input −1.0000 −0.7071 0.0000 0.7071 1.0000 0.7071 0.0000
output −2.9193 −3.3469 −1.6351 0.8849 3.0279 3.2467 1.7052

we assume to be E[ek ] = 0. We can write

y20 = a1 (−y19 ) + a2 (−y18 ) + b0 u20 + b1 u19 (31.15)


y19 = a1 (−y18 ) + a2 (−y17 ) + b0 u19 + b1 u18 (31.16)
y18 = a1 (−y17 ) + a2 (−y16 ) + b0 u18 + b1 u17 (31.17)
..
.
y2 = a1 (−y1 ) + a2 (−y0 ) + b0 u2 + b1 u1 (31.18)
y1 = a1 (−y0 ) + a2 (−y−1 ) + b0 u1 + b1 u0 (31.19)
y0 = a1 (−y−1 ) + a2 (−y−2 ) + b0 u0 + b1 u−1 (31.20)

We can now replace values, assuming that before t = 0 s both input and output
were 0 (if we could not assume this, we would just discard the last two equations
right away):

1.7052 = −3.2467a1 − 3.0279a2 + 0.0000b0 + 0.7071b1 (31.21)


3.2467 = −3.0279a1 − 0.8849a2 + 0.7071b0 + 1.0000b1 (31.22)
3.0279 = −0.8849a1 + 1.6351a2 + 1.0000b0 + 0.7071b1 (31.23)
..
.
3.4108 = −1.4237a1 − 0.0007a2 + 1.0000b0 + 0.7071b1 (31.24)
1.4237 = −0.0007a1 + 0.0000a2 + 0.7071b0 + 0.0000b1 (31.25)
0.0007 = 0.0000a1 + 0.0000a2 + 0.0000b0 + 0.0000b1 (31.26)

The last equation being clearly impossible which is a result of the output
being nothing but noise without depending from the parameters in any way
, we discard it; the other 20 equations can be easily put in the form of (31.11).
Solving for θ ,
  
a1 0.4969
a2  −0.4024
θ=  
 b0   2.0114  (31.27)
b1 2.9812

31.4 Deconvolution
We know from (10.25) that the output of a transfer function is given by the
convolution of its impulse response with the input. If signals are discretised in
time, we can approximate the integral in (10.25)
Z t
y(t) = g(t − τ )u(τ ) dτ (31.28)
0

using a rectangular forward approximation (illustrated in Figure 31.4):

k−1
X
yk = Ts ui gk−1−i (31.29)
i=0
31.4. DECONVOLUTION 427

Figure 31.4: Rectangular forward approximation of an integral, consisting of


the areas of the rectangles built from the highlighted points.

Data to be identied, from t = 0 to tf = N Ts , can be arranged in matrixes:


N rows N ×N matrix N rows
y U g
z }| {
 z }| { z }| {
y1 u0 0 0 ··· 0 g0
 y2 
 
 u1
 u0 0 ··· 0 
 g1 

  = Ts  u2
 y3   u1 u0 ··· 0   g2 
 
(31.30)
 ..   .. .. .. .. ..   .. 
 .   . . . . .  . 
yN uN −1 uN −2 uN −3 ··· u0 gN −1

The impulse response g is found as g = U−1 y. Since U is square, there is no


need to use a pseudo-inverse, and, because it is triangular, the solution can be
found solving the equations line by line:
1 y1
g0 = (31.31)
u0 Ts

1 y2
g1 = − u1 g0 (31.32)
u0 Ts

1 y3
g2 = − u2 g0 − u1 g1 (31.33)
u0 Ts
..
.

1 yk + 1
gk = − uk g0 − uk−1 g1 − . . . − u1 gk − 1 (31.34)
u0 Ts
..
.

1 yN
gN −1 = − uN −1 g0 − uN −2 g1 − . . . − u1 gN − 2 (31.35)
u0 Ts

On the other hand, we can force (31.30) to be overdetermined by calculating Filtering noise in deconvo-
the impulse response gk in less time instants than the N time instants for which lution
this is possible:

N ×1 N ×K
K×1
z}|{ z}|{
(31.36)
z}|{
y = Ts U g , K<N

In this case the impulse response vector g must be found in a least-squares


sense:
1 +
g= U y (31.37)
Ts
This alternative is useful to lter high-frequency noise.
428 CHAPTER 31. IDENTIFICATION FROM TIME RESPONSES

Since a convolution nds the response to an arbitrary input from the input
and the impulse response, and now the impulse response is determined from
an arbitrary input and its response, this operation (31.31)(31.35) or (31.37) is
called deconvolution.
Once the impulse response of the model is found, it can be used in several
dierent ways.
ˆ It can be used to nd the model's response to an arbitrary input, by
convolution.
ˆ It can in particular be used to nd the model's response to sinusoids, so
as to obtain the model's frequency response.
ˆ The Laplace transform of the impulse response can be found numerically.
We know from Theorem 10.1 that the result is the transfer function of the
model. Since we will only have numerical values, and not an analytical
expression, this may not be very useful. But instead of the Laplace trans-
form (with s ∈ C) we can just nd the Fourier transform (2.87), thereby
obtaining the model's frequency response without the cumbersome and
tedious intermediate step of sinusoidal inputs.
ˆ The impulse response can be used to obtain the parameters of a model,
either using (31.11) or using a simplied formulation as in the following
Example, which is possible because the impulse is dierent from zero in
one time instant only.
Example 31.5. Consider model
b0 + b1 z −1 + b2 z −2
G(z) = ⇒
1 + a1 z −1 + a2 z −2
yk = b0 uk + b1 uk−1 + b2 uk−2 − a1 yk−1 − a2 yk−2 (31.38)
Replacing the impulse
1
u0 = (31.39)
Ts
uk = 0, ∀k 6= 0 (31.40)
in (31.38), the output yk will be the impulse response gk :
1
g0 = b0 (31.41)
Ts
1
g1 = b1 − a1 g0 (31.42)
Ts
1
g2 = b2 − a1 g1 − a2 g0 (31.43)
Ts
g3 = −a1 g2 − a2 g1 (31.44)
g4 = −a1 g3 − a2 g2 (31.45)
..
.
There are 5 unkowns (2 on the denominator and 3 on the numerator), which
can be found with at least 5 values of the impulse response, corresponding to
the 5 equations above.
Using more values of gk , and thus more equations, the solution of the overde-
termined system will once more be found in a least-squares sense (and be more
robust to noise).
Remark 31.2. (31.41)(31.45) can be arranged in matrix form, collecting the
terms on numerator coecients bk on one side and all the other terms on the
other:
    
b0 1 0 0 0 0 ··· g0
b1  a1 1
   0 0 0 · · · g1 
 
1 b2  a2 a1
  1 0 0 · · · g2 
 
 0  =  0 a2 a1 1 0 · · ·  (31.46)
Ts    g3 
 
0 0 0 a2 a1 1 · · · g4 
 
.. .. .. .. .. .. .. ..
   
. . . . . . . .
31.4. DECONVOLUTION 429

Table 31.2: Unit step response of Exercise 2.


time output time output time output
0.0 0.0000 0.7 0.1225 1.4 0.4900
0.1 0.0025 0.8 0.1600 1.5 0.5625
0.2 0.0100 0.9 0.2025 1.6 0.6400
0.3 0.0225 1.0 0.2500 1.7 0.7225
0.4 0.0400 1.1 0.3025 1.8 0.8100
0.5 0.0625 1.2 0.3600 1.9 0.9025
0.6 0.0900 1.3 0.4225 2.0 1.0000

This is not as useful as (31.11) or (31.30), since the coecients are in the matrix,
but gives a better idea of the general case.

Glossary
Though it be appointed in the afore written preface, that al thinges
shalbe read and sõg in the churche, in the Englishe tongue, to thende
t
y the congregacion maie be therby edied: yet it is not meant, but
when men saye Matins and Euensong priuately, they maye saie the
same in any language that they themselues do understande.

Thomas Cranmer (attrib.; 1489 „1556), The booke of the common prayer
and administracion of the Sacramentes, and other rites and ceremonies of the
Churche: after the use of the Churche of England (1549), The preface

deconvolution desconvolução
genetic algorithms algoritmos genéticos
metaheuristic meta-heurística
Nelder-Mead simplex search method método do simplex, método de Nelder-
Mead
particle swarm optimisation otimização por enxame de partículas
pseudo-inverse matrix matriz pseudo-inversa

Exercises
1. Find numerically the unit step response of
1
G(s) = (31.47)
(s + 0.1)(s2 + 0.3s + 1)

for the rst 60 s, using a sampling time you nd appropriate. Use the
method of Example 31.3 to nd the dominant pole from the response.

2. Find a model for a plant with the unit step response y(t) in Table 31.2.

3. Consider the data from Exercise 4 of Chapter 11.

(a) Find discrete models for this plant, using (31.11). Try dierent num-
bers of zeros and poles, and see how some performance index changes.
(b) Find the plant's impulse response, using (31.37) with dierent values
of K . Explain the dierent results obtained.

4. Repeat Exercise 3 using the data from Exercise 2 instead.

5. Find an expression similar to (31.46) for the case in which plant (31.38)
has 3 zeros and poles, 4 zeros and poles, and so on. What happens if there
are more poles than zeros?
430 CHAPTER 31. IDENTIFICATION FROM TIME RESPONSES
Chapter 32

Identication from frequency


responses
He thought he saw an Albatross
That uttered round the lamp:
He looked again, and found it was
A Penny-Postage-Stamp.
You'd best be getting home, he said:
The nights are very damp!

Lewis Carroll (1832 „1898), Sylvie and Bruno, 12

This chapter concerns identication methods from frequency responses.

32.1 Finding frequency response data


A frequency response to identify can be found in dierent ways.
ˆ Sinusoids of dierent frequencies are used as inputs. After the transient
regime dies o, gain and phase are determined comparing the input and
output sinusoids.
ˆ The Fourier transform of an impulse response, obtained by deconvolution,
is numerically calculated, as mentioned in Section 31.4.
ˆ A controller design method provides a particular frequency response for a
controller, desirable for the plant to be controller. (See e.g. Exercise 2.)
ˆ A frequency response is established using one of the methods studied below
in Part VIII.
ˆ Instead of using sinusoids as inputs, a chirp is used.
A chirp is a sinusoid with a time-varying frequency. An up-chirp begins Chirp
with a low frequency ω0 , which increases with time until frequency ωf , reached Up-chirp
at nal time tf . A down-chirp begins with a high frequency ω0 , which decreases Down-chirp
with time until frequency ωf , reached at nal time tf . More formally:
Denition 32.1. A chirp is a signal u(t), dened from t = 0 to t = tf , given
by

u(t) = A sin (ω(t)t) (32.1)

Example 32.1. In the case of an up-chirp with a frequency increasing linearly


with time, (32.1) becomes
ωf − ω0
ω(t) = ω0 + t, ω0 < ωf (32.2)
tf
Example 32.2. In the case of an down-chirp with a frequency decreasing ex-
ponentially with time, (32.1) becomes
tt
ωf f
ω(t) = ω0 , ω0 > ωf (32.3)
ω0

431
432 CHAPTER 32. IDENTIFICATION FROM FREQUENCY RESPONSES

Figure 32.1: Left: responses to chirps of a rst order plant. Right: responses to
chirps of a second order plant. Top: responses of rst and second order plants
to a chirp in the [0.01, 1] rad/s frequency range. Bottom: responses of rst and
second order plants to a chirp in the [1, 100] rad/s frequency range.

Using a chirp instead of several sinusoids with dierent frequencies to obtain Replacing sinusoids w
the frequency response of a plant has the major advantage of being faster. The chirp
major drawback is that, of course, a steady-state is never reached. Consequently,
measurements of both gain and amplitude cannot but be approximations. How-
ever, if the rate of frequency increase is low enough, this approximation may be
acceptable.

Example 32.3. Figure 32.1 shows the response of


1
G1 (s) = (32.4)
s+1
1
G2 (s) = 2 (32.5)
s +s+1

to two exponential up-chirps: one in frequency range [0.01, 1] rad/s, another in


frequency range [1, 100] rad/s. Notice the resonance peak of the underdamped
(ξ = 0.25) second order plant. Also notice that steady state responses are never
reached. For instance:

ˆ at ω = 100 rad/s, |G(100j)| = 0.01, but the amplitude of the output is


still at about 0.3, when the amplitude of the input is 1;

ˆ the maximum gain of G2 (s) is 0.5 1 − 0.252 = 0.48, according to (11.80),
i.e. 48% above the low frequency range, but the maximum amplitude of
the chirp response reaches 1.63.

Clearly this chirp would have had to last longer to explore the frequency response
in this way.

Remark 32.1. It is dicult to tell, before identication, how fast or slow the
transient regime of a plant may be, and consequently how much time a chirp
ought to take to sweep any particular range of frequencies. Still, responses such
as those in Figure 32.1 can even so be used in identication, with the advantage
of having explored the system's response at many frequencies, but using instead
the techniques we will study in Part VIII.
32.2. IDENTIFICATION FROM THE BODE DIAGRAM 433

32.2 Identication from the Bode diagram


We studied how a Bode diagram can be built from poles, zeros and gain in
Section 11.4. A reverse reasoning can lead us from the Bode diagram to the
poles, zeros and gain of the model. In particular:

ˆ A constant gain and a phase of 0◦ or ±180◦ at low frequency mean that


there are neither poles nor zeros at the origin.

ˆ In that case, if the phase is 0◦ , the gain is positive; if it is ±180◦ , the gain
is negative.

ˆ A negative slope of −20n dB/decade and a phase of −90◦ × n at low


frequency mean that there are n poles at the origin.

ˆ A positive slope of 20n dB/decade and a phase of 90◦ × n at low frequency


mean that there are n zeros at the origin.

ˆ Remember that the phase is periodic and so a phase of θ is the same as a


phase of θ ± 360◦ k, k = 1, 2, . . ..

ˆ A negative slope of −20n dB/decade and a phase of −90◦ × n at high


frequency mean that there are n poles more than zeros.

ˆ A positive slope of 20n dB/decade and a phase of 90◦ ×n at high frequency


mean that there are n zeros more than poles.

ˆ A decrease of the slope of the gain of −20n dB/decade and a decrease of


the phase of −90◦ × n at some frequency mean that there are n poles at
that frequency.

ˆ An increase of the slope of the gain of 20n dB/decade and an increase of


the phase of 90◦ × n at some frequency mean that there are n zeros at
that frequency.

ˆ Pairs of complex conjugate poles with damping coecient ξ < can be
2
2

detected from the resonance peak, and (11.80) can be used to nd ξ ; then
(11.79) can be used to nd ωn .

ˆ Gain slopes can be estimated by eye, or analytically determined with a


linear regression. In the later case, care must be taken to choose wisely
the frequencies to include.

Review Section 11.4 for further insights. See Exercises 10 to 12 of Chapter 11.
Notice that this method can be applied if all that is known about the fre- If only the gain is known
quency response is the gain. This may happen because the phase was not regis-
tered, or is more aected by noise than the gain. However, it will be impossible
to determine if poles are stable or unstable, and if zeros are minimum phase or
non-minimum phase. Only with the phase can that be known. Unless there is
some reason to suppose otherwise, stable poles and minimum phase zeros are
presumed.
Something similar happens if all that is known about the frequency response If only the phase is known
is the phase (a more rare occurrence than knowing only the gain).

32.3 Levy's method


Levy's method ts a transfer function to a frequency response using least squares.

Theorem 32.1. Let a plant's frequency response G(jωp ) be known at f fre-


quencies, i.e. p = 1, 2, . . . , f . The model
m
X
bk sk
N (s) k=0
Ĝ(s) = = n (32.6)
D(s) X
k
1+ ak s
k=1
434 CHAPTER 32. IDENTIFICATION FROM FREQUENCY RESPONSES

with parameters to be determined


T
(32.7)

b = b0 · · · bm
T
(32.8)

a = a1 · · · an

What Levy's method min- which minimises quadratic error


imises
f
X 2
ε= G(jωp ) − Ĝ(jωp ) D(jωp )

p=1
f
X 2
= G(jωp )D(jωp ) − N (jωp ) (32.9)

p=1

is found solving

A B b e
= (32.10)
C D a g
f
X
A= Ap (32.11)
p=1
f
X
B= Bp (32.12)
p=1
f
X
C= Cp (32.13)
p=1
f
X
D= Dp (32.14)
p=1
f
X
e= ep (32.15)
p=1
f
X
g= gp (32.16)
p=1

where the elements in line l and column c of matrixes Ap , Bp , Cp and Dp are


given by

Ap;l,c = −< (jωp )l < [(jωp )c ] − = (jωp )l = [(jωp )c ] ,


l = 0...m ∧ c = 0...m (32.17)


= < (jωp )l < [(jωp )c ] < [G(jωp )] + = (jωp )l < [(jωp )c ] = [G(jωp )]

Bp;l,c
− < (jωp )l = [(jωp )c ] = [G(jωp )] + = (jωp )l = [(jωp )c ] < [G(jωp )] ,

l = 0...m ∧ c = 1...n (32.18)


= −< (jωp )l < [(jωp )c ] < [G(jωp )] + = (jωp )l < [(jωp )c ] = [G(jωp )]

Cp;l,c
− < (jωp )l = [(jωp )c ] = [G(jωp )] − = (jωp )l = [(jωp )c ] < [G(jωp )] ,

l = 1...n ∧ c = 0...m (32.19)



2 2
< (jωp )l < [(jωp )c ] + = (jωp )l = [(jωp )c ] ,

Dp;l,c = < [G(jωp )] + = [G(jωp )]
l = 1...n ∧ c = 1...n (32.20)

and the elements of vectors ep and gp are given by

ep;l,1 = −< (jωp )l < [G(jωp )] − = (jωp )l = [G(jωp )] ,


l = 0...m (32.21)
2 2

= −< (jωp )l < [G(jωp )] + = [G(jωp )] ,

gp;l,1
l = 1...n (32.22)
32.3. LEVY'S METHOD 435

Proof. Error (32.9) is given by

ε = |GD − N |2
2
= <[G] + j=[G] <[D] + j=[D] − <[N ] + j=[N ]

2
= <[G]<[D] − =[G]=[D] − <[N ] + j <[G]=[D] + =[G]<[D] − =[N ]

2 2
= <[G]<[D] − =[G]=[D] − <[N ] + <[G]=[D] + =[G]<[D] − =[N ]
(32.23)
To minimise ε, we want its derivatives in order to coecients ak and bk to be
zero.
Let us suppose that there is only one frequency ωp . First we nd
d<[G] d<[G] d=[G] d=[G]
= = = =0 (32.24)
dai dbi dai dbi
d<[N ]
=0 (32.25)
dai
m
d<[N ] d X
bk < (jωp )k = < (jωp )i (32.26)

=
dbi dbi
k=0
d=[N ]
=0 (32.27)
dai
m
d=[N ] d X
bk = (jωp )k = = (jωp )i (32.28)

=
dbi dbi
k=0
( n
)
d<[D] d X
k
= < (jωp )i (32.29)

= 1+ ak < (jωp )
dai dai
k=1
d<[D]
=0 (32.30)
dbi
( n
)
d=[D] d X
k
= = (jωp )i (32.31)

= 1+ ak = (jωp )
dai dai
k=1
d=[D]
=0 (32.32)
dbi
(Notice that j k can only assume four values: ±1 and ±j . In the rst case, there
will be a real part, and the imaginary part is zero; in the later case, there will
be an imaginary part, and the real part is zero.) Consequently,
∂ε
= 2 <[G]<[D] − =[G]=[D] − <[N ] <[G]< (jωp )i − =[G]= (jωp )i

∂ai

+ 2 <[G]=[D] + =[G]<[D] − =[N ] <[G]= (jωp )i + =[G]< (jωp )i

(32.33)
∂ε
= 2 <[G]<[D] − =[G]=[D] − <[N ] − < (jωp )i

∂bi

+ 2 <[G]=[D] + =[G]<[D] − =[N ] − = (jωp )i (32.34)

Equaling to zero,
∂ε
= 0 ⇔ <[D] =[G]2 + <[G]2 < (jωp )i +

∂ai

=[D] =[G]2 + <[G]2 = (jωp )i +


<[N ] =[G]= (jω)i − <[G]< (jωp )i +


=[N ] − =[G]< (jωp )i − <[G]= (jωp )i (32.35)

=0
∂ε
= 0 ⇔ <[G]<[D] − =[G]=[D] − <[N ] < (jωp )i +

∂bi

<[G]=[D] + =[G]<[D] − =[N ] = (jωp )i = 0 (32.36)

436 CHAPTER 32. IDENTIFICATION FROM FREQUENCY RESPONSES

The m + 1 equations given by (32.35) and the n equations given by (32.36) form
linear system (32.10), with matrixes and vectors dened by (32.17)(32.22).
Considering f frequencies instead of only one, we arrive at (32.11)(32.16).

Why the error is dened as Remark 32.2. Notice that error was dened as in (32.9) so that the minimisa-
it was tion problem should be linear on coecients b and a. That is why the denom-
inator D(jωp ) is used as a sort of weighting function. Otherwise, the problem
would not have as solution a system of linear equations such as (32.10).
High frequencies are given Remark 32.3. Using D(jωp ) is used as a weighting function in error ε gives
more weight more weight to high frequencies, since D(jωp ) is a polynomial and thus its
absolute value must increase with frequency ω . If Levy's method is applied,
and the performance of the resulting model is poor at low frequencies, this
Use weights to improve low eect can be counteracted, weighting the contributions of dierent frequencies
frequencies results in (32.11)(32.16) with weights that increase the inuence of low frequencies.
Alternative formulation of Remark 32.4. Instead of summing matrixes Ap , Bp , Cp and Dp , and vectors
Levy's method ep and gp , they can be stacked. In that case, instead of (32.10)(32.16), the
coecients in b and a will be found solving
   
A1 B1 b= e1
 C1 D1   g1 
  a  
 A2 B2   e2 
   
 C2 D2   g2 
(32.37)
 .. ..   .. 
   
 . .   . 
   
Af Bf  ef 
Cf Df gf
| {z } | {z }
H v

This overdetermined system will have a solution in least squares sense:

[b a]T = H+ v (32.38)

What to do if there are Remark 32.5. Model (32.6) is of type 0. If the frequency data corresponds to
poles at the origin a model with poles at the origin, the eect of such poles must be removed from
the data. Once the model is identied, the poles at the origin are then added.
Zeros at the origin cause no problem.
Example 32.4. The frequency response G(jω) of
5s + 10
G(s) = (32.39)
s(s2 + 0.2s + 1)

is sampled in 31 logarithmically spaced frequencies in [0.1, 100] rad/s. The


numbers of zeros and poles m = 1 and n = 3 can be easily from the Bode
diagram. Levy's method identies
0.02341s − 6.569
Ĝ(s) = (32.40)
0.002116s3 − 1.317s2 − 0.1569s − 1
because a model of type 0 is presumed. This is shown in Figure 32.2.
Since there is obviously a pole at the origin, we should nd the frequency
response of this pole and subtract it from G(jω):
1
Gcorrection (s) = (32.41)
s
20 log10 |G∗ (jω)| = 20 log10 |G(jω)| − 20 log10 |Gcorrection (jω)| (32.42)
∠G∗ (jω) = ∠G(jω) − ∠Gcorrection (jω) (32.43)

From frequency response G∗ (jω), Levy's method with m = 1 and n = 2 identi-


es
5s + 10
Ĝ(s) = (32.44)
s2 + 0.2s + 1
from which (32.39) is immediately recovered, as shown in Figure 32.3.
32.4. MATSUDA'S METHOD 437

Figure 32.2: Frequency response of G(s), given by (32.39), and frequency re-
sponse of identied model Ĝ(s), given by (32.40).

Figure 32.3: Left: frequency response G∗ (jω), given by (32.42)(32.43), and


frequency response of identied model Ĝ(s), given by(32.40). Right: frequency
response of G(s), given by (32.39), and frequency response of the identied
model, which is the same.

Remark 32.6. If, in the example above, the model should have k poles at the
origin, then
1
Gcorrection (s) = (32.45)
sk
Remark 32.7. Levy's method requires knowing in advance the number of zeros
and poles needed in the model. The inspection of the Bode diagram should be
used beforehand for this purpose.

32.4 Matsuda's method


Matsuda's method identies a model from the gain of the frequency behaviour
of a plant. Stable poles and minimum phase zeros are assumed. This method
relies on continued fractions.
Denition 32.2. A continued fraction is an entity, dened from two se- Continued fractions
quences ak and bk , with the form
b1
a0 + b2
(32.46)
a1 + b3
a2 + b4
a3 +
a4 +...

Instead of writing continued fractions as in (32.46), they are usually notated,


for the benet of clarity, using either
ˆ the Abramowitz notation: Abramowitz notation

b1 b2 b3 b4
a0 + ··· (32.47)
a1 + a2 + a3 + a4 +

ˆ the Pringsheim notation: Pringsheim notation


+∞
b1 b2 b3 b4 bk
a0 ; , , , , · · · = a0 , (32.48)
a1 a2 a3 a4 ak k=1
438 CHAPTER 32. IDENTIFICATION FROM FREQUENCY RESPONSES

Remark 32.8. Just as a series


P+∞
k=1 ak is built from a sequence ak , so a
continued fraction is built from two sequences ak and bk , and just as series may
or may not converge, continued fractions may converge or not.
Continued fraction expan- Every x0 ∈ R\Z can be written as
sion of real numbers
1 1
x0 = bx0 c + 1 = bx0 c + (32.49)
x0 −bx0 c
x1
|{z}
1
x0 −bx0 c

and applying this repeatedly we nd that


+∞
1 1
x0 = bx0 c + 1 = bx0 c; (32.50)
bx1 c + bx2 c+ bx 1 bxk c k=1
3 c+...

1
xk = , k∈N (32.51)
xk−1 − bxk−1 c

If x0 ∈ Q, the continued fraction expansion above will terminate (that is to say,


sooner or later one of the xk will be integer, and thus all the following coecients
xn , n > k will be zero). If x0 is irrational, all the xk will be dierent from zero.
Whatever the case, the continued fraction can be truncated after some terms,
Continued fractions as ap- providing a rational approximation of x0 which is the best possible for the order
proximations of magnitude of the denominator; that is to say, no other fraction closer to x0
can be found with a denominator of the same order of magnitude.
Evaluating a continued Terminating continued fractions can be evaluated beginning with its last
fraction (innermost) fraction, but it is more expedient to use the following result whether
the continued fraction terminates or not.
Theorem 32.2. Let ak and bk be two sequences dening a continued fraction
given by (32.46)(32.48), and let

P−1 = 1 (32.52)
P0 = a0 (32.53)
Pk = ak Pk−1 + bk Pk−2 , k ∈ N (32.54)
Q−1 = 0 (32.55)
Q0 = 1 (32.56)
Qk = ak Qk−1 + bk Qk−2 , k ∈ N (32.57)

Then Rk = Pk
Qk is the value of the continued fraction, truncated after k terms.
Proof. This is proved by mathematical induction. For k = 1,
P1 a1 a0 + b1 b1
R1 = = = a0 + (32.58)
Q1 a1 + 0 a1
To prove the inductive step, notice that adding a further pair of coecients
means that the last denominator ak will be added a new fraction abk+1
k+1
. So, if in
ak Pk−1 +bk Pk−2 bk+1
Rk = Pk
Qk = ak Qk−1 +bk Qk−2 we replace ak with ak + ak+1 ,

bk+1
ak + ak+1 Pk−1 + bk Pk−2
Rk+1 =
bk+1
ak + ak+1 Qk−1 + bk Qk−2
Pk
z }| {
ak+1 (ak Pk−1 + bk Pk−2 ) +bk+1 Pk−1 Pk+1
= = (32.59)
ak (ak Qk−1 + bk Qk−2 ) +bk+1 Qk−1 Qk+1
| {z }
Qk

Remark 32.9. By computing the Pk and Qk in this way, additional terms


can be added to the truncated continued fraction without having to begin the
computation anew.
Just as series can be used to dene functions by letting the terms of the
summed sequence depend on t, so can continued fractions.
32.5. OUSTALOUP'S METHOD 439

Theorem 32.3. If function f0 (t) is known at t0 , t1 , t2 , . . . tp , it can be inter-


polated by continued fraction
p
t − t0 t − t1 t − t2 t − tk
f0 (t) ≈ f0 (t0 ) + · · · = f0 (t0 );
f1 (t1 )+ f2 (t2 )+ f3 (t3 )+ fk+1 (tk+1 ) k=0
(32.60)
t − tk
fk+1 (t) = , k ∈ N0 (32.61)
fk (t) − fk (tk )
Proof. Let p ≥ k+1. The continued fraction (32.60), evaluated at tk+1 , becomes
tk+1 − t0 tk+1 − t1 tk+1 − tk−2 tk+1 − tk−1 tk+1 − tk
f0 (t0 ) + ···
f1 (t1 )+ f2 (t2 )+ fk−1 (tk−1 )+ fk (tk )+ fk+1 (tk+1 ) + 0
tk+1 − t0 tk+1 − t1 tk+1 − tk−2 tk+1 − tk−1 tk+1 − tk
=f0 (t0 ) + ··· −tk
f1 (t1 )+ f2 (t2 )+ fk−1 (tk−1 )+ fk (tk )+ f (t tk+1
+1)−f (t ) k k k k

tk+1 − t0 tk+1 − t1 tk+1 − tk−2 tk+1 − tk−1


=f0 (t0 ) + ···
f1 (t1 )+ f2 (t2 )+ fk−1 (tk−1 )+ fk (tk+1 )
tk+1 − t0 tk+1 − t1 tk+1 − tk−2 tk+1 − tk−1
=f0 (t0 ) + ··· −tk
f1 (t1 )+ f2 (t2 )+ fk−1 (tk−1 )+ f (t tk+1
)−f (t
k−1 k+1 k−1 k−1 )

tk+1 − t0 tk+1 − t1 tk+1 − tk−2


=f0 (t0 ) + ··· (32.62)
f1 (t1 )+ f2 (t2 )+ fk−1 (tk+1 )
And so on, until
tk+1 − t0 tk+1 − t1
f0 (t0 ) +
f1 (t1 )+ f2 (tk+1 )
tk+1 − t0 tk+1 − t1
=f0 (t0 ) + −t1
f1 (t1 )+ f (ttk+1)−f (t
1 k+1 1 1)

tk+1 − t0
=f0 (t0 ) +
f1 (tk+1 )
tk+1 − t0
=f0 (t0 ) + tk+1 −t0
f0 (tk+1 )−f0 (t0 )

=f0 (tk+1 ) (32.63)


Remark 32.10. Notice that points tk do not need to be ordered. The same
points, ordered in dierent manners, lead to dierent interpolating continued
fractions.
(32.60) interpolates a real function of a real variable; Matsuda's identication Matsuda's method
method is a generalisation for complex variables. Given a frequency behaviour
G(jω), known at frequencies ω0 , ω1 , . . . ωN , which do not need to be ordered,
N
s − ω0 s − ω1 s − ω2 s − ωk−1
G(s) ≈ d0 (ω0 ) + . . . = d0 (ω0 );
d1 (ω1 )+ d2 (ω2 )+ d3 (ω3 )+ dk (ωk ) k=1
(32.64)
d0 (ω) = |G(jω)| (32.65)
ω − ωk−1
dk (ω) = , k = 1, 2, . . . N (32.66)
dk−1 (ω) − dk−1 (ωk−1 )
Remark 32.11. Models obtained with (32.64) have zeros and N2 poles,
N
2
which means that they will be causal only if N is even (and thus the number of
frequencies, which is N + 1, is odd).

32.5 Oustaloup's method


Oustaloup's method identies a model from the phase of the frequency behaviour
of a plant. Stable poles and minimum phase zeros are assumed. Proving the
method is exceedingly tedious; we will only state the result.
Suppose we want to nd a transfer function
m
Y s
1+
bk
Ĝ(s) = G0 k=1
n , G0 > 0 (32.67)
Y s
1+
ak
k=1
440 CHAPTER 32. IDENTIFICATION FROM FREQUENCY RESPONSES

with the phase behaviour φi at frequencies ωi , i = 1 . . . f ; that is to say, we


want that
m
Y jωi
1+
bk
arg Ĝ(jωi ) = arg k=1
n = φi , i = 1 . . . f (32.68)
Y jωi
1+
ak
k=1

Let C be a f × (m + n + 1) matrix given by


tan φ1 1 − tan φ1 −1 tan φ1 1 − tan φ1 ...
 
2 3 4 5 6
ω2 ω2
 tan φ2 ω1 − tan φ2 ω1 − ω 2
tan φ2 ω 2 ω2
− tan φ2 ω 2
... 
 
ω1 ω1 ω1 ω1
C= .. .. .. .. .. .. ..
 
. . . . . . .

 ... 
 2 3 4 5 6 
ωf ωf ωf ω ωf ω
tan φf ω1 − tan φf ω1 − ω1 tan φf ωf1 ω1 − tan φf ωf1 ...
(32.69)
and let s be a (m + n + 1) × 1 vector such that Cs = 0. Because in practice there
will be a solution only if there is no noise and the model structure is correct, we
make
2
s = arg min kCsk (32.70)
s

instead. We then nd the m + n roots yk , k = 1 . . . m + n of a polynomial built


with the elements of s as coecients:
m+n
X
(−1)k sk y m+n−k = 0 (32.71)
k=0

Then for each k = 1, . . . , m + n we make


ω1
ak = , if yk > 0 (32.72)
yk
ω1
bk = − , if yk < 0 (32.73)
yk
and thus obtain the m + n poles and zeros of model (32.67). Notice that, while
the total number of poles and zeros is in fact m + n, it is possible that the
number of poles and the number of zeros are not n and m.

Glossary
Every concept that can ever be needed, will be expressed by exactly
one word, with its meaning rigidly dened and all its subsidiary
meanings rubbed out and forgotten. Already, in the Eleventh Edi-
tion, we're not far from that point. But the process will still be
continuing long after you and I are dead. Every year fewer and
fewer words, and the range of consciousness always a little smaller.
George Orwell (1903 „1950), Nineteen Eighty-Four, I5
chirp chirp
continued fraction fração contínua
down-chirp chirp descendente
up-chirp chirp ascendente

Exercises
1. Find a model for the frequency response in Table 32.1 using every method
in this chapter.
2. A controller is wanted for plant
s+1
G(s) = (32.74)
s3 + 2.2s2 + 100.4s + 20
You want a constant phase margin of 45◦ in [1, 10] rad/s.
32.5. OUSTALOUP'S METHOD 441

Table 32.1: Frequency response of Exercise 1.


f [Hz] gain [dB] phase [◦ ]
f [Hz] gain [dB] phase [◦ ]
1.0 3.7 −48.1
0.1 7.1 −6.35
1.2 2.7 −53.3
0.2 7.0 −12.6
1.5 1.4 −59.1
0.3 6.7 −18.5
2.0 −0.6 −65.9
0.4 6.4 −24.1
2.5 −2.3 −70.3
0.5 6.0 −29.2
3.0 −3.7 −73.4
0.6 5.6 −33.8
4.0 −6.0 −77.4
0.7 5.1 −38.0
5.0 −7.9 −79.8
0.8 4.6 −41.8
7.0 −10.8 −82.7
0.9 4.1 −45.1
10.0 −13.8 −84.9

(a) Find the frequency response of G(s) in a suitable frequency range.


(b) Find the desirable phase of the frequency response of the controller.
Sample it at suitable frequency values.
(c) Use Oustaloup's identication method to design a controller. The
phase margin will never be really constant in the desired range, but
may be within a narrow band centred on the desired value. Use a
suitable performance index to verify the inuence on results of the
frequency values chosen to sample the desired controller behaviour.
3. Consider plant
5s
G(s) = (32.75)
s3 + s2 + 0.2s + 1
(a) Find its frequency response in some set of frequency values you nd
appropriate.
(b) Use Levy's method to identify a transfer function from that frequency
response.
(c) Repeat this for dierent sets of frequency values, and for dierent
model structures (with more, and less, poles and zeros than those of
G(s)).
(d) Use Matsuda's method and Oustaloup's method to identify models
from the gain and the phase of a frequency response that had good
results with Levy's method.
4. Figure 32.4 shows the Bode diagram of a LTI system. Find its transfer
function.

Figure 32.4: Bode diagram of Exercise 4.

5. Figure 32.5 shows the Bode diagram of a LTI system. Find its transfer
function.
442 CHAPTER 32. IDENTIFICATION FROM FREQUENCY RESPONSES

Figure 32.5: Bode diagram of Exercise 5.

6. Figure 32.6 shows steady state responses of a LTI system to sinusoidal


inputs with amplitude 1.

ˆ Find its transfer function, assuming that it has no non-minimum


phase zeros, from the asymptotes of the Bode diagram.
ˆ Do the same, using Matsuda's method.
ˆ Could you use Levy's method? If so, how?

Figure 32.6: Time responses of Exercise 6.


Chapter 33

Identication of
non-linearities
This chapter concerns the identication of non-linearities, already studied above
in Chapter 28 as to their inuence in control systems.

33.1 Identication from a time response


Static non-linearities are fairly easy to identify from time responses in open loop:
just check what output corresponds to each input. If dierent outputs turn out
to exist for the same input, then the non-linearity is not static.
All non-linearities, static or dynamic, prevent the output of a plant with a Non-linear systems do not
sinusoidal input from becoming sinusoidal too in steady state: remember that have sinusoidal outputs for
Theorem 10.4 was established assuming that the system is linear. So, if a stable sinusoidal inputs
system has a sinusoidal input, and the output never becomes sinusoidal, there
clearly is a non-linearity involved, even if it is not easy to see which. Review
Example 10.12.
Remember that, because of the above, non-linear systems have no frequency
response; describing functions are only approximations. For this reason, non-
linearities are identied from time responses. If such time responses are in closed
loop, non-linearities can be found

ˆ from unexpected stable or unstable responses, indicating an equivalent


gain in the closed loop caused by a non-linearity (see Section 28.1);

ˆ from limit cycles, if they exist.

33.2 Identication from a limit cycle


We saw in Sections 28.2 and 28.3 that a closed loop with a non-linearity will
have a limit cycle if the curve of the frequency response of the linear part and
the curve of − N1 intersect, as expressed by condition (28.48):

1
G(jω) = − (33.1)
N (U, ω)

The amplitude of the limit cycle will be U and its frequency ω . Additionally,
the limit cycle should be stable to be observed.
If a limit cycle is observed, the describing function N of the non-linearity
can be found from the measured values of U and ω .

Example 33.1. Consider the situation of Examples 28.6 and 28.7. The plant Calculations of the limit
has already been identied in open loop as cycle, backwards

1.4
G(s) = 2 (33.2)
s (s + 1)

When controlling the plant in closed loop, a limit cycle is found with frequency
0.76 rad/s and amplitude 4.68. Since there are no marginally stable poles, this

443
444 CHAPTER 33. IDENTIFICATION OF NON-LINEARITIES

Figure 33.1: Block diagram of Exercise 1.

means that there is a non-linearity. If it can be ascertained that the non-linearity


is due to backlash, then
1.4 1
2 =− 4.68 i
jω (jω + 1)
4.68
2− 4.68
h
2− A 2− A
k
2 1− 2
π arcsin 4.68 + A
4.68 cos arcsin 4.68 − 4kAj (4.68−A)
π 4.682
A A A

(33.3)

Compare this with (28.50). There are two unknowns, both of them real numbers.
The real and the imaginary parts of (33.3) provide a system of equations to nd
them.

33.3 Identication of a pure delay


In Chapter 24, we saw that a pure delay is a non-linear element when using con-
tinuous transfer functions, and in Chapter 25 we saw that it is a linear element
when using discrete transfer functions. Whatever the case, its identication is
done in the same way:
ˆ In the case of a time response, the system should rst be brought to steady
state, and then a change in the input applied. A step is not necessary, as
long as it is possible to measure the time to a change in the output.
ˆ In the case of a frequency response, since

∠e−θjω = ∠ [cos(−θω) + j sin(−θω)]


= ∠ [cos(θω) − j sin(θω)]
− sin θω
= arctan = −θω (33.4)
cos θω
a delay can be expected if the phase decreases at high frequencies while
the gain has a constant slope. It is identied tting a straight line by
minimum squares to the phase values at high frequency. Do not forget
The phase of the delay in that, as we saw in Chapter 24, phase (33.4) appears in a Bode diagram as
the Bode diagram is expo- an exponential, because of the semi-logarithmic scale of frequencies.
nential
In Chapter 39 we will see additional techniques that may be used to identify a
pure delay.

Exercises
1.5
1. The control system in Figure 33.1 includes plant G(s) = 2 and an
s (s + 1)
actuator with backlash. A limit cycle with period 7.757 s and amplitude
5.45 is observed. Find A and k .
3
2. The control system in Figure 33.2 includes plant G(s) = 2 and
s (s + 1)
the represented non-linearity, with C = 1. A limit cycle with 0.882 rad/s
and amplitude 2.155 is observed. Find A and B .
3. The control system in Figure 33.3 includes the represented non-linearity,
with k = 1. A limit cycle with 0.39 Hz and amplitude 10.2 is observed.
Find A and K1 .
33.3. IDENTIFICATION OF A PURE DELAY 445

Figure 33.2: Block diagram of Exercise 2.

Figure 33.3: Block diagram of Exercise 3.


446 CHAPTER 33. IDENTIFICATION OF NON-LINEARITIES
Part VII

Fractional order systems

447
449

`I just take the train from platform nine and three-quarters at eleven
o'clock,' he read.
His aunt and uncle stared.
`Platform what?'
`Nine and three-quarters.'
`Don't talk rubbish,' said Uncle Vernon, `there is no platform nine
and three-quarters.'

J. K. Rowling (1965 . . . ), Harry Potter and the Philosopher's Stone, 6

In this part of the lecture notes:

Chapter 34 introduces fractional order systems from their frequency responses and the
corresponding identication methods.

Chapter 35 shows how fractional derivatives are the origin of fractional order systems.

Chapter 36 concerns the time responses of fractional order systems and the corre-
sponding identication methods.

Here is what you need to know beforehand to follow these chapters:

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4;

ˆ System theory, from Part II;

ˆ Filters, from Sections 12.2 and 12.3 of Chapter 12;

ˆ System identication, from Chapters 30 to 32.


450
Chapter 34

Fractional order systems and


their frequency responses
Bien que la notion de dérivation non entière date du début du
XIXème siècle à travers les travaux de CAUCHY, elle reste néan-
moins une énigme dans le domaine de la physique appliquée et no-
tamment en automatique.
Alain Oustaloup (1950 . . . ), La commande CRONE: commande robuste
d'ordre non entier, Avant-propos
In this chapter we take a look at frequency responses that need to be mod-
elled with fractional powers of s.

34.1 Frequency responses that require fractional


order systems
We know from Chapter 11 that the frequency response of
G(s) = sk , k ∈ Z (34.1)
is
G(jω) = (jω)k (34.2)
20 log10 |G(jω)| = 20k log10 ω (34.3)
arg G(jω) = k 90 ◦
(34.4)
At both high and low frequencies, given a transfer function
bm sm + bm−1 sm−1 + . . . + b1 s + b0
G(s) = (34.5)
sn + an−1 sn−1 + . . . + a1 s + a0
there will be one term that is increasingly larger than all others, and that is
why, in both cases:
ˆ the gain is linear with a slope which is an integer multiple of 20 dB/decade;

ˆ the phase is constant and equal to an integer multiple of 90◦ .


As we saw in Sections 11.4 and 32.2, at low frequencies these values give us
the number of poles or zeros at the origin, and at high frequencies n − m (the
dierence between the number of poles and zeros).
Frequency responses with other gain slopes or constant values for phases re-
quire transfer functions with non-integer powers of the Laplace transform vari-
able s, called fractional transfer functions. Such is the case of the response
in Figure 34.1, which has, at high frequencies, a gain slope of −10 dB/decade,
and a phase of 45◦ . It is easy to see that such a frequency response can be
obtained with transfer function
1
G1 (s) = 1 (34.6)
s2 + 1
1
G1 (jω) = 1 (34.7)
(jω) 2 + 1

451
452CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

12
Figure 34.1: Frequency response of 1
s+1 .

since, for high frequencies, ω 1 and


1
G1 (jω) ≈ (jω)− 2 (34.8)
− 21
20 log10 |G1 (jω)| ≈ 20 log10 ω = −10 log10 ω (34.9)
− 21
∠G1 (jω) ≈ ∠j = −45 ◦
(34.10)

and also by transfer function


12
1
G2 (s) = (34.11)
s+1
21
1
G2 (jω) = (34.12)
jω + 1

since, for high frequencies,


1
G2 (jω) ≈ (jω)− 2 (34.13)

as well.
Notice, however, that the frequency responses of G1 (s) and G2 (s) are not the
same. (Figure 34.1 actually corresponds to G2 (jω), given by (34.12).) Transfer
functions G1 (s) and G2 (s) belong to two dierent types of fractional transfer
functions.

Denition 34.1. A fractional order transfer function is a transfer function with


non-integer powers of the Laplace transform variable s and can be:

Implicit fractional transfer ˆ implicit, given by:


function α
b0 + b1 s + . . . + bm sm

G(s) =
a0 + a1 s + . . . + an sn
 m α
X
k
 b k s 
 k=0
 , α ∈ R+ \N (34.14)

= n


X
ak sk
 
k=0

Explicit fractional transfer ˆ explicit, in which case it is the ratio of two linear combinations of powers
function of s, and may be

Commensurable fractional commensurable, if all powers of s are integer multiples of some α ∈


transfer function R+ \N, and thus the transfer function is a ratio of two polynomials
34.2. FREQUENCY RESPONSES OF FRACTIONAL ORDER SYSTEMS 453

in sα :
b0 + b1 sα + . . . + bm smα
G(s) =
a0 + a1 sα + . . . + an snα
Xm
bk skα
k=0
= n (34.15)
X

ak s
k=0

non-commensurable, if it cannot be put in the form of (34.15): Non-commensurable frac-


tional transfer function
b0 + b1 sβ1 + . . . + bm sβm
G(s) =
a0 + a1 sα1 + . . . + an sαn
Xm
b0 + bk sβk
k=1
= n , αk , βk > 0, ∃k αk ∈
/ N ∨ βk ∈
/N (34.16)
X
αk
a0 + ak s
k=1

By contrast with these, transfer functions given by (9.3) may be called integer
order transfer functions.
Remark 34.1. (34.16) reduces to (34.15) if it turns out that all the βk in
the numerator and all the αk in the denominator are integer multiples of some
commensurability order α. Both (34.14) and (34.15) reduce to integer order
transfer functions if condition α ∈
/ N is relaxed.
Remark 34.2. Non-integer transfer functions would be a better name, since Fractional orders can be
fractional orders may in fact be irrational, but the name fractional stuck. irrational

Remark 34.3. Implicit fractional transfer functions have this name because
fractional powers of s are only implicitly found in (34.14). They are explicitly
seen in (34.15)(34.16).
We know that, as (2.45) shows, the Laplace transforms of derivatives orig- Where do fractional pow-
inate integer powers of s. We will defer to the next chapter the study of frac- ers of s come from?
tional order derivatives that originate fractional powers of s, and proceed with
the study of frequency responses of fractional transfer functions.

34.2 Frequency responses of fractional order sys-


tems
We must study separately each of the types of fractional order transfer functions
in Denition 34.1.
Theorem 34.1. The gain and the phase of an implicit fractional transfer func- Frequency response of an
tion G(s) given by implicit fractional transfer

α function
G(s) = [Gi (s)] (34.17)

are the gain and the phase of the integer transfer function Gi (s) scaled by α,
i.e.

20 log10 |G(jω)| = 20α log10 |Gi (jω)| (34.18)


∠G(jω) = α∠Gi (jω) (34.19)

Proof. This is a straightforward result of the properties of the logarithm.


Example 34.1. The frequency response of (34.12) shown in Figure 34.1 is the
frequency response of 1
s+1 with the values of gains and phases halved.
A commensurable fractional transfer function G(s) can be written as the Frequency response of a
product of simpler terms with only one or two powers of s. From their fre- commensurable fractional
quency responses it is possible to nd that of G(s), as done in Section 11.4 for transfer function
integer transfer functions. In addition to (11.84)(11.155), the other frequency
responses that now serve as building blocks are the following:
454CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

ˆ sα , a fractional power of s with α > 0: Frequency response of

G(jω) = (jω)α (34.20)


20 log10 |G(jω)| = 20α log10 ω dB (34.21)
∠G(jω) = 90 α ◦
(34.22)

sα , a fractional power of with α > 0:


1 1 1
Frequency response of sα ˆ s

1
G(jω) = (34.23)
(jω)α
20 log10 |G(jω)| = −20α log10 ω dB (34.24)
∠G(jω) = −90◦ α (34.25)

Frequency response of ˆ 1
α , a rst-order polynomial on sα in the denominator with α, a ∈ R+ :
1 ( as ) +1
α
( as ) +1
1
G(jω) =
( jω
a )
α +1
1
= ω α (34.26)
cos απ
2 + j sin απ
2 a +1
1
|G(jω)| = q 2
α 2α 2
1 + ωa cos απ + ωa απ

2 sin 2
1
=r ω 2α ω α (34.27)
απ
1+ +2 cos
a a 2

| {z }
ζ(ω)

20 log10 |G(jω)| ≈ 0 dB, ω a (34.28)



∠G(jω) ≈ 0 , ω a (34.29)

1
20 log10 |G(ja)| = 20 log10
cos απ απ
2 + j sin 2 + 1

1
= 20 log10
1 + 2 cos απ + cos2 απ + sin2 απ

2 2 2
1
= 20 log10 p
2 + 2 cos απ
2
απ
= −10 log10 2 + 2 cos (34.30)
2
απ απ απ
− sin 2 −2 sin 4 cos 4
∠G(ja) = arctan απ = arctan
1 + cos 2 2 cos απ απ
4 cos 4
π
= −α ± 2kπ, k ∈ Z (34.31)
4
20 log10 |G(jω)| ≈ 20α log10 a − 20α log10 ω dB, ω a (34.32)
∠G(jω) ≈ −90◦ α, ω a (34.33)

Notice that the gain may decrease monotonously or it may rst go up,
have a peak value, and then decrease, depending on the value of α. Indeed,
equaling the derivative of (34.27) to zero,

d 1
p =0
dω ζ(ω)
d
dω ζ(ω)
⇔ p =0
−2ζ(ω) ζ(ω)
2αω 2α−1 2αω α−1 απ
⇔ 2α
+ cos =0
a aα ω 2α απ
⇔ = − cos (34.34)
a 2
Notice that the left hand side of the equation is always positive, while
the right hand side will be positive if cos απ
2 < 0. So (34.34) will have a
34.2. FREQUENCY RESPONSES OF FRACTIONAL ORDER SYSTEMS 455

solution when
π απ 3π
+ 2kπ < < + 2kπ, k ∈ Z+0 ⇔
2 2 2
⇔ 4k + 1 < α < 4k + 3, k ∈ Z+
0 (34.35)
In other words, the gain will have a peak when 1 < α < 3∨5 < α < 7∨9 < When the gain of
1
α
( as ) +1
α < 11 ∨ . . .. (We known that this point where the derivative is equal to has a peak
zero is a maximum, and not a minimum or a saddle point, because the
gain is constant for low frequencies and decreases for high frequencies.)
The frequency at which there is a peak is found from (34.34):
απ α1
ωpeak = a − cos (34.36)
2
The peak of the gain is found replacing this in (34.27):
1
max |G(jω)| = q
ω απ
+ 2 − cos απ cos απ

1 + cos2 2 2 2
1 1
=p = (34.37)
1 − cos2 απ
2
sin απ 2

The phase may decrease monotonously or increase monotonously, depend-


ing on the value of α. Indeed, the derivative of the phase
1
∠G(jω) = ∠ απ ω α
+ j sin απ

cos 2 2 a +1
S(ω)
z }| {
ω α απ
sin
= − arctan a
ω α 2 απ (34.38)
1+ cos
| a {z 2 }
C(ω)

is given by
αω α−1 α α απ αω α−1
aα sin απ
2 (1+( ωa ) 2 )−( a ) sin
cos απ ω
2 aα cos απ
2
d (1+C(ω))2
∠G(jω) = − 2


S(ω)
1 + 1+C(ω)
(34.39)
Notice that the denominator is always positive, and the numerator is a
fraction with a denominator which cannot be negative. So, supposing that
the derivative exists, its sign σ is

d
σ ∠G(jω) (34.40)

αω α−1 απ αω 2α−1 απ απ αω 2α−1 απ απ
=σ − α
sin − sin cos + sin cos
| a{z } 2 | a2α 2 2 {z a2α 2 2}
∈R+ 0

This means that the sign of the derivative is that of − sin απ


2 . Conse- When the phase of
1
α
( as ) +1
quently: goes up or down

the phase will decrease from 0◦ to α4 360◦ − α90◦ if


απ
2kπ < < (2k + 1)π, k ∈ Z+
0 ⇔
2
4k < α < 4k + 2, k ∈ Z+
0 (34.41)
that is to say, if 0 < α < 2 ∨ 4 < α < 6 ∨ 8 < α < 10 ∨ . . .;
the phase will increase from 0◦ to 1 + α4 360◦ − α90◦ if

απ
(2k − 1)π < < 2kπ, k ∈ Z+ ⇔
2
4k − 2 < α < 4k, k ∈ Z+ (34.42)
that is to say, if 2 < α < 4 ∨ 6 < α < 8 ∨ 10 < α < 12 ∨ . . .;
456CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

Figure 34.2: Bode diagram of 1


α , α > 0.
( as ) +1

the phase will remain constant and equal to 0◦ if


απ
= 2kπ, k ∈ Z+ ⇔
2
α = 4k, k ∈ Z+ (34.43)

that is to say, if α ∈ {4, 8, 12, 16 . . .}, since in that case the derivative
is equal to 0;
the phase will have a discontinuity and jump from 0◦ to ±180◦ if
απ
= (2k + 1)π, k ∈ Z+
0 ⇔
2
α = 2 + 4k, k ∈ Z+
0 (34.44)

that is to say, if α ∈ {2, 6, 10, 14 . . .}, since in that case, when ω =


2 2
a rad/s, the denominator (1 + C(ω)) in (34.39) is equal to (1 + C(a)) =
1 + cos 2 = 0, and so the derivative is innite at that point.
απ

The two most common cases are 0 < α ≤ 1 and 1 < α < 2 (as we will
see in Chapter 36, no other cases can be stable). They correspond to the
Bode diagrams in Figure 34.2.
α
Frequency response of ˆ as + 1, a rst-order polynomial on sα in the numerator with α, a ∈ R+ :
s α

a +1 α

G(jω) = +1
a
απ
απ ω α
= cos + j sin +1 (34.45)
2 2 a
20 log10 |G(jω)| ≈ 0 dB, ω a (34.46)

∠G(jω) ≈ 0 , ω a (34.47)
απ απ
20 log10 |G(ja)| = 20 log10 cos + j sin + 1

r 2 2
απ
= 20 log10 2 + 2 cos
2
απ
= 10 log10 2 + 2 cos (34.48)
2
1 + cos απ
2 2 cos απ απ
4 cos 4
∠G(ja) = arctan απ = arctan
− sin 2 −2 sin 4 cos απ
απ
4
π
= α ± 2kπ, k ∈ Z (34.49)
4
20 log10 |G(jω)| ≈ 20α log10 ω − 20α log10 a dB, ω a (34.50)
∠G(jω) ≈ 90◦ α, ω a (34.51)

The corresponding Bode diagram is that of 1


α , upside down.
( as ) +1

Frequency response of ˆ 2α
1
s α
, a second order polynomial on sα in the denominator with
1 ( as ) +2ζ ( a ) +1
2α α
( as ) +2ζ ( as ) +1
34.2. FREQUENCY RESPONSES OF FRACTIONAL ORDER SYSTEMS 457

Figure 34.3: Frequency behaviour of 2α


1
s α
.
( as ) +2ζ ( a ) +1

α, a ∈ R+ :
1
G(jω) = (34.52)
jω 2α jω α

a + 2ζ a +1
20 log10 |G(jω)| ≈ 0 dB, ω a (34.53)

∠G(jω) ≈ 0 , ω a (34.54)
20 log10 |G(jω)| ≈ 40α log10 a − 40α log10 ω dB, ω a (34.55)
∠G(jω) ≈ −180◦ α, ω a (34.56)

While it is simple to nd the conditions in which the gain has a resonance
peak if α = 1, when the order is fractional it is more expedient to nd
such conditions numerically. Figure 34.3 shows the combinations of values
of α and ζ for which there are zero, one or two resonance frequencies (that
is to say, for which the gain plot of the Bode diagram has zero, one or two
local maxima).
2α α
ˆ as + 2ζ as + 1, a second order polynomial on sα in the numerator Frequency response of
with α, a ∈ R+ : s 2α s α

a + 2ζ a +1
2α α
jω jω
G(jω) = + 2ζ +1 (34.57)
a a
20 log10 |G(jω)| ≈ 0 dB, ω a (34.58)

∠G(jω) ≈ 0 , ω a (34.59)
20 log10 |G(jω)| ≈ 40α log10 ω − 40α log10 a dB, ω a (34.60)
∠G(jω) ≈ 180◦ α, ω a (34.61)

The corresponding Bode diagram is that of 2α


1
s α
, upside down.
( as ) +2ζ ( a ) +1
ˆ In any of the cases above, if a ∈ R− , the gain behaviour remains the same,
and the phase behaviour is symmetrical.
As to a non-commensurable fractional transfer function G(s), if is can be Frequency response of a
written as a product of the terms above, its frequency response can be found in non-commensurable frac-
the same manner. Otherwise the only option is to compute G(jω). tional transfer function

Example 34.2. Figure 34.4 shows the Bode diagram of


1
s2 + 1
G(s) = 2 (34.62)
s s 0.7
3

10−5 + 1 105 + 1
458CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

Figure 34.4: Bode diagram of (34.62), from Example 34.2.

which can be found from the frequency responses of its three constituent rst
order polynomials in fractional powers of s. Notice that:

ˆ At ω = 10−5 rad/s, the phase goes down towards −60◦ , and the gain
slopes down at −13.33 dB/decade.

ˆ At ω = 1 rad/s, the phase godes up 45◦ , towards −15◦ , and the gain bends
up 10 dB/decade, ending with a still downwards slope of −3.33 dB/decade.

ˆ At ω = 105 rad/s, the phase goes down 63◦ , ending at −78◦ , and the
gain bends down −14 dB/decade, ending with a downwards slope of
−17.33 dB/decade.

ˆ All this is in accord with the powers of s found in G(s).

34.3 Identication from the Bode diagram


Just as an integer model can be found from a Bode diagram by observation, so
can a fractional model. The dierence is that, with fractional models, all gain
slopes and all phases are possible. If the model is implicit or commensurable,
only a nite set of values will be found:

ˆ gain slopes will have k20α dB/decade, k ∈ Z;

ˆ phases will have kα90◦ , k ∈ Z.

If the model is non-commensurable, any values can be found.


Fractional orders close to When slopes are close to integer multiples of 20 dB/decade, and phases
integers are hard to iden- are close to integer multiples of 90◦ , it is dicult to distinguish a fractional
tify order. And, after all, if that is the case, there may be no reason why the model
Why this should not be a should have a fractional order: the increase in model accuracy obtained with
problem a fractional order may not compensate the diculty of using a more dicult
mathematical concept.

Example 34.3. Consider the frequency response in Figure 34.5:


ˆ At low frequencies, the gain is constant and the phase is 0◦ . The plant
behaves as a gain.

ˆ At high frequencies, the gain has a slope of −10 dB and the phase is −45◦ .
1
The plant behaves like s− 2 .

ˆ The asymptotes of the gain for low and high frequencies are shown in the
gure, and intersect at 10 rad/s. It is also at that frequency that the phase
is halfway between its low and high frequency values.
34.4. LEVY'S METHOD EXTENDED 459

Figure 34.5: Frequency response of Example 34.3.

unting for the corner Beware of the temptation of writing the model as
ency
k1
G(s) = 1 (34.63)
s + 10
2

as if the plant were of integer order, and then nding the numerator k1 from
the value of the gain for low frequencies. As (34.30)(34.31) show, the actual
model should be
k2
G(s) = 21 (34.64)
s
10 +1

Since the order is not 1, (34.63) can never be the same as (34.64). The numerator
k2 is now found from the low frequency gain (20 dB for ω ≈ 0) as

k2
20 = 20 log10 21 ⇒ k2 = 10 (34.65)
0
10 +1

10
Thus, G(s) = 21 .
s
10 +1

34.4 Levy's method extended


Levy's method can be extended to identify implicit and commensurable frac-
tional transfer functions.
Theorem 34.2. Let a plant's frequency response G(jωp ) be known at f fre- Levy's method for implicit
quencies, i.e. p = 1, 2, . . . , f . The implicit fractional model given by fractional order models

 m α
X
k
α  bk s
N α (s) b0 + b1 s + . . . + bm sm

α
 k=0 
Ĝ(s) = Ĝi (s) = α = n
=

n

D (s) 1 + a1 s + . . . + an s X 
1+ ak sk
 
k=1
(34.66)

which minimises quadratic error What Levy's method min-


imises
f 2
X α1
ε= G (jωp )D(jωp ) − N (jωp ) (34.67)

p=1

1
is found identifying integer model Ĝi (s) from G α (jωp ) using Levy's method.
Proof. This is a straightforward consequence of (34.18)(34.19).
460CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

Theorem 34.3. Let a plant's frequency response G(jωp ) be known at f fre- Levy's method for c
quencies, i.e. p = 1, 2, . . . , f . The model mensurate fractional o
models
m
X

bk s
N (s) k=0
Ĝ(s) = = n (34.68)
D(s) X

1+ ak s
k=1

with parameters to be determined


T
(34.69)

b = b0 · · · bm
T
(34.70)

a = a1 · · · an

What Levy's method min- which minimises quadratic error


imises
f
X 2
ε= G(jωp ) − Ĝ(jωp ) D(jωp )

p=1
f
X 2
= G(jωp )D(jωp ) − N (jωp ) (34.71)

p=1

is found solving

A B b e
= (34.72)
C D a g
f
X
A= Ap (34.73)
p=1
f
X
B= Bp (34.74)
p=1
f
X
C= Cp (34.75)
p=1
f
X
D= Dp (34.76)
p=1
f
X
e= ep (34.77)
p=1
f
X
g= gp (34.78)
p=1

where the elements in line l and column c of matrixes Ap , Bp , Cp and Dp are


given by

Ap;l,c = −< (jωp )lα < [(jωp )cα ] − = (jωp )lα = [(jωp )cα ] ,

l = 0...m ∧ c = 0...m (34.79)


lα cα lα cα

Bp;l,c = < (jωp ) < [(jωp ) ] < [G(jωp )] + = (jωp ) < [(jωp ) ] = [G(jωp )]
− < (jωp )lα = [(jωp )cα ] = [G(jωp )] + = (jωp )lα = [(jωp )cα ] < [G(jωp )] ,

l = 0...m ∧ c = 1...n (34.80)


lα cα lα cα

Cp;l,c = −< (jωp ) < [(jωp ) ] < [G(jωp )] + = (jωp ) < [(jωp ) ] = [G(jωp )]
− < (jωp )lα = [(jωp )cα ] = [G(jωp )] − = (jωp )lα = [(jωp )cα ] < [G(jωp )] ,

l = 1...n ∧ c = 0...m (34.81)



2 2
< (jωp )lα < [(jωp )cα ] + = (jωp )lα = [(jωp )cα ] ,

Dp;l,c = < [G(jωp )] + = [G(jωp )]
l = 1...n ∧ c = 1...n (34.82)
34.4. LEVY'S METHOD EXTENDED 461

and the elements of vectors ep and gp are given by

ep;l,1 = −< (jωp )lα < [G(jωp )] − = (jωp )lα = [G(jωp )] ,


l = 0...m (34.83)
2 2

= −< (jωp )lα < [G(jωp )] + = [G(jωp )] ,

gp;l,1
l = 1...n (34.84)

Proof. The proof is similar to that of Theorem 32.1. Error (34.71) is given by

ε = |GD − N |2
2
= <[G] + j=[G] <[D] + j=[D] − <[N ] + j=[N ]

2
= <[G]<[D] − =[G]=[D] − <[N ] + j <[G]=[D] + =[G]<[D] − =[N ]

2 2
= <[G]<[D] − =[G]=[D] − <[N ] + <[G]=[D] + =[G]<[D] − =[N ]
(34.85)

To minimise ε, we want its derivatives in order to coecients ak and bk to be


zero.
Let us suppose that there is only one frequency ωp . First we nd

d<[G] d<[G] d=[G] d=[G]


= = = =0 (34.86)
dai dbi dai dbi
d<[N ]
=0 (34.87)
dai
m
d<[N ] d X
bk < (jωp )kα = < (jωp )iα (34.88)

=
dbi dbi
k=0
d=[N ]
=0 (34.89)
dai
m
d=[N ] d X
bk = (jωp )kα = = (jωp )iα (34.90)

=
dbi dbi
k=0
( n
)
d<[D] d X

= < (jωp )iα (34.91)

= 1+ ak < (jωp )
dai dai
k=1
d<[D]
=0 (34.92)
dbi
( n
)
d=[D] d X

= = (jωp )iα (34.93)

= 1+ ak = (jωp )
dai dai
k=1
d=[D]
=0 (34.94)
dbi

(Notice that j kα can now assume any value, and will, in the general case, have
both a real part and an imaginary part is zero. This makes matrixes and vectors
(34.79)(34.84) more complicated than in the integer case.) Consequently,

∂ε
= 2 <[G]<[D] − =[G]=[D] − <[N ] <[G]< (jωp )iα − =[G]= (jωp )iα

∂ai

+ 2 <[G]=[D] + =[G]<[D] − =[N ] <[G]= (jωp )iα + =[G]< (jωp )iα

(34.95)
∂ε
= 2 <[G]<[D] − =[G]=[D] − <[N ] − < (jωp )iα

∂bi

+ 2 <[G]=[D] + =[G]<[D] − =[N ] − = (jωp )iα (34.96)

462CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

Equaling to zero,

∂ε
= 0 ⇔ <[D] =[G]2 + <[G]2 < (jωp )iα +

∂ai

=[D] =[G]2 + <[G]2 = (jωp )iα +


<[N ] =[G]= (jω)iα − <[G]< (jωp )iα +


=[N ] − =[G]< (jωp )iα − <[G]= (jωp )iα (34.97)

=0
∂ε
= 0 ⇔ <[G]<[D] − =[G]=[D] − <[N ] < (jωp )iα +

∂bi

<[G]=[D] + =[G]<[D] − =[N ] = (jωp )iα = 0 (34.98)

The m + 1 equations given by (34.97) and the n equations given by (34.98) form
linear system (34.72), with matrixes and vectors dened by (34.79)(34.84).
Considering f frequencies instead of only one, we arrive at (34.73)(34.78).

Remark 34.4. Remarks on Theorem 32.1 apply here too. In particular, if the
model should have a0 = 0 in the denominator, the frequency response of sα
must be subtracted rst, just as was done for the integer case.

Remark 34.5. Notice that in the fractional case not only n and m (which
are integer) must be xed in advance, but also α (which has the additional
disadvantage of not being an integer). Reasonable ranges for these parameters
may be found by inspection of the Bode diagram.

Glossary
Lo anterior se reere a los idiomas del hemisferio austral. En los
del hemisferio boreal (de cuya Ursprache hay muy pocos datos en
el Onceno Tomo) la célula primordial no es el verbo, sino el adje-
tivo monosilábico. El sustantivo se forma por acumulación de adje-
tivos. No se dice luna : se dice aéreo-claro sobre oscuro-redondo o
anaranjado-tenue-del cielo o cualquier otra agregación. En el caso
elegido la masa de adjetivos corresponde a un objeto real; el hecho
es puramente fortuito.

Jorge Luis Borges (1899 „1986), Tlön, Uqbar, Orbis Tertius, II

commensurate fractional transfer function função de transferência fra-


cionária comensurável
explicit fractional transfer function função de transferência fracionária ex-
plícita
implicit fractional transfer function função de transferência fracionária im-
plícita
integer order transfer function função de transferência de ordem inteira
fractional order transfer function função de transferência de ordem fra-
cionária

Exercises
1. Establish a correspondence between Bode diagrams a and b in Figure 34.6,
polar plots A and B in Figure 34.7, and the following transfer functions:

1
G1 (s) = (34.99)
s(s + 1)1.5 (s
+ 2)
64.47 + 12.46s
G2 (s) = (34.100)
0.598 + 39.96s1.25
34.4. LEVY'S METHOD EXTENDED 463

a b

Figure 34.6: Bode diagrams of Exercise 1.

Figure 34.7: Polar plots of Exercise 1.


464CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

Figure 34.8: Polar plots of Exercise 2.

2. Establish a correspondence between polar plots A to D in Figure 34.8,


Bode diagrams a to d in Figure 34.9, and the following transfer functions:
1
G1 (s) = (34.101)
s1.3 + 1
1
G2 (s) = (34.102)
s(s1.3 + 1)
1
G3 (s) = 0.6 1.3 (34.103)
s (s + 1)
s1.1 + 2
G4 (s) = 1.9 (34.104)
s +1

3. Figure 34.10 shows the Bode diagram of a LTI system. Find its transfer
function.

4. Figure 34.11 shows the Bode diagram of a LTI system. Find its transfer
function.
34.4. LEVY'S METHOD EXTENDED 465

a b

c d

Figure 34.9: Bode diagrams of Exercise 2.


466CHAPTER 34. FRACTIONAL ORDER SYSTEMS AND THEIR FREQUENCY RESPONSES

Figure 34.10: Bode diagram of Exercise 3.

Figure 34.11: Bode diagram of Exercise 4.


Chapter 35

Fractional order derivatives


Students of mathematics early encounter the dierential operators
d/dx, d2 /dx2 , d3 /dx3 , etc., and some doubtless ponder whether it
is necessary for the order of dierentiation to be an integer. Why
1 1
should there

not√be a d 2 /dx 2 operator, for instance? Or d−1 /dx−1
or even d 2 /dx 2 ? It is to these and related questions that the
present work is addressed. It will come as no surprise to one versed
in the calculus that the operator d−1 /dx−1 is nothing but an indef-
inite integral in disguise, but fractional orders of dierentiation are
more mysterious because they have no obvious geometric interpre-
tation along the lines of the customary introduction to derivatives
and integrals as slopes and areas. The reader who is prepared to dis-
pense with a pictorial representation, however, will soon nd that
fractional order derivatives and integrals are just as tangible as those
of integer order and that a new dimension in mathematics opens to
him when the order q of the operator dq /dxq becomes an arbitrary
parameter. Nor is this a sterile exercise in pure mathematicsmany
problems in the physical sciences can be expressed and solved suc-
cintly by recourse to the fractional calculus.

Keith B. Oldham (1929 . . . ), Jerome Spanier (1930 . . . ), The


Fractional Calculus: Theory and Applications of Dierentiation and
Integration to Arbitrary Order, Preface

In this chapter, fractional derivatives are introduced. They are at the origin
of fractional order transfer functions, and generalise the concept of derivative
to orders that do not need to be integer numbers. In fact, at the same time,
they also generalise the concept of integral, since the Fundamental Theorem of
2
Calculus shows we can identify dfdt(t) with f (t) dt, d dtf 2(t) with f (t) dtdt,
R RR

and so on.

35.1 Gamma function


Before generalising derivatives to arbitrary orders, it is necessary to generalise
the factorial to arbitrary orders. This is done with the Gamma function.

Denition 35.1. For x ∈ R+ , function Γ is dened as Denition of Γ


Z +∞
Γ(x) = e−y y x−1 dy (35.1)
0

Lemma 35.1.
Z +∞ +∞
e−y dy = −e−y 0 = 1 (35.2)

Γ(1) =
0

Theorem 35.1.

Γ(x + 1) = xΓ(x) (35.3)

467
468 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

Proof.

Z +∞ +∞
Z +∞
e−y y x dy = −e−y y x y=0 − −e−y xy x−1 dy (35.4)

Γ(x + 1) =
0 | {z } |0 {z }
0
xΓ(x)

Γ(n) = (n − 1)! Remark 35.1. From (35.2) and from (35.3) it can be easily seen that

Γ(2) = 1 × Γ(1) = 1 × 1 = 1 = 1! (35.5)


Γ(3) = 2 × Γ(2) = 2 × 1 = 2 = 2! (35.6)
Γ(4) = 3 × Γ(3) = 3 × 2 = 6 = 3! (35.7)
Γ(5) = 4 × Γ(4) = 4 × 6 = 24 = 4! (35.8)
..
.
Γ(n) = (n − 1)!, n ∈ N (35.9)

It is this property that makes function Γ a generalisation of the factorial, in


spite of the shift in the argument.

Theorem 35.2.
lim Γ(x) = +∞ (35.10)
x→0+

Proof.

+∞ 1 1 1
1 yx
Z Z Z
1
Γ(x) = e−y y x−1 dy > e−y y x−1 dy > e−1 y x−1 dy = =
0 0 0 e x y=0 ex
(35.11)
1
and since lim = +∞ the result follows.
x→0+ ex

Iterating (35.3), we get

Γ(x+2)
z }| {
Γ(x+1)
z }| { n−1
Y
Γ(x + n) = (x + n − 1) (x + n − 2) . . . (x + 1) xΓ(x) = Γ(x) (x + k), n ∈ N
| {z }
k=0
Γ(x+n−1)
| {z }
Γ(x+n)
(35.12)
This expression allows dening the Γ function for negative arguments:

Denition 35.2. For x ∈ R− \Z− , function Gamma is dened as


Γ(x − bxc)
Γ(x) = (35.13)
−bxc−1
Y
(x + k)
k=0

In this way, by construction, (35.3) and (35.12) remain valid for all x ∈ R.
The evolution of Γ(x) around x = 0 is shown in gure 35.1. From the gure it
is clear that all non-positive integers are poles of function Γ. In other words:

Theorem 35.3.
lim Γ(x) = ∞, n ∈ Z−
0 (35.14)
x→n

Proof. This is a consequence of (35.10) and (35.13).

Below we will need the following results:

Theorem 35.4. For any n ∈ Z,

Γ(x)Γ(−x + 1) = (−1)n Γ(−x − n + 1)Γ(x + n) (35.15)


35.1. GAMMA FUNCTION 469

Figure 35.1: The Γ function.

Proof. If n = 0, the equality is obvious. For positive values of n, the equality is


proved by mathematical induction. Using (35.3) twice, (35.15) is seen to hold
for n = 1:
Γ(x + 1)
Γ(x)Γ(−x + 1) = (−xΓ(−x)) = −Γ(−x)Γ(x + 1) (35.16)
x
The inductive step is proved applying (35.16) to the right hand side of (35.15):

Γ(x)Γ(−x + 1) = (−1)n Γ(−x − n + 1)Γ(x + n)


= (−1)n [−Γ(−x − n)Γ(x + n + 1)]
= (−1)n+1 Γ (−x − (n + 1) + 1) Γ (x + (n + 1)) (35.17)

For negative values of n, the equality is also proved by mathematical induction,


in a similar manner. Using (35.3) twice, (35.15) is seen to hold for n = −1:
Γ(−x + 2)
Γ(x)Γ(−x + 1) = (x − 1)Γ(x − 1) = −Γ(−x + 2)Γ(x − 1) (35.18)
−x + 1
The inductive step is proved applying this to the right hand side of (35.15):

Γ(x)Γ(−x + 1) = (−1)n Γ(−x − n + 1)Γ(x + n)


= (−1)n [−Γ(−x − n + 2)Γ(x + n − 1)]
= (−1)n+1 Γ (−x − (n − 1) + 1) Γ (x + (n − 1)) (35.19)

Corollary 35.1. From (35.12) and (35.15) we obtain


n−1
Y Γ(x + n) Γ(−x + 1)
(x + k) = = (−1)n (35.20)
Γ(x) Γ(−x − n + 1)
k=0
n−1 n−1
Y Y Γ(−x + n) Γ(x + 1)
(x − k) = (−1)(−x + k) = (−1)n =
Γ(−x) Γ(x − n + 1)
k=0 k=0
(35.21)

Thanks to this generalisation of the factorial, combinations of a things, b at Combinations of a things,


a time, usually dened for integer non-negative arguments as b at a time

a a!
= , a, b ∈ Z+
0 (35.22)
b b!(a − b)!
can be generalised as

a Γ(a + 1)
= (35.23)
b Γ(b + 1)Γ(a − b + 1)

which makes sense if a, b, a − b ∈ R\Z− . Replacing (35.15) in (35.23), we obtain

(−1)b Γ(b − a)

a
= (35.24)
b Γ(b + 1)Γ(−a)
470 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

which makes sense also if a ∈ Z− ∧ b ∈ Z+


0 . (But notice that, if b − a ∈ Z

or if a = 0, it may be that (35.23) makes sense, while (35.24) never does.)


Furthermore,

ˆ when n ∈ Z− ∧ a ∈
/ Z− ,

∈R\{0}
z }| {
a Γ(a + 1)
lim = =0 (35.25)
b→n b lim Γ(b + 1) lim Γ(a − b + 1)
b→n b→n
| {z } | {z }
∞ ∈R\{0}

ˆ when n ∈ Z− ∧ a ∈
/ Z− ,

∈R\{0}
z }| {
a Γ(a + 1)
lim = =0 (35.26)
a−b→n b lim Γ(b + 1) lim Γ(a − b + 1)
b→a−n a−b→n
| {z } | {z }
∈R\{0} ∞

ˆ when m, n ∈ Z− ∧ |m| > |n|,

∈R\{0}
z }| {
b
(−1) lim Γ(b − a)
a b−a→n−m∈N
lim = =0 (35.27)
(a,b)→(m,n) b lim Γ(b + 1) lim Γ(−a)
b→n a→m
| {z } | {z }
∞ ∈R\{0}

Putting all this together, combinations are dened as follows.

Denition 35.3.

Γ(a + 1)
 , if a, b, a − b ∈
/ Z−
Γ(b + 1)Γ(a − b + 1)





a

= (−1)b Γ(b − a)
b , if a ∈ Z− ∧ b ∈ Z+ 0



 Γ(b + 1)Γ(−a)



0, if [(b ∈ Z− ∨ b − a ∈ N) ∧ a ∈ / Z− ] ∨ (a, b ∈ Z− ∧ |a| > |b|)

(35.28)

Later in this chapter, we will need the following results:

Theorem 35.5.

a a a+1
+ = (35.29)
b b−1 b

for all a, b ∈ R for which the combinations above exist.

Proof. From (35.23),



a a Γ(a + 1) Γ(a + 1)
+ = + (35.30)
b b−1 Γ(b + 1)Γ(a − b + 1) Γ(b)Γ(a − b + 2)
(a − b + 1)Γ(a + 1) bΓ(a + 1)
= +
Γ(b + 1) (a − b + 1)Γ(a − b + 1) bΓ(b) Γ(a − b + 2)
| {z } | {z }
Γ(a−b+2) Γ(b+1)

(a − b + 1 + b)Γ(a + 1) Γ(a + 2) a+1
= = =
Γ(b + 1)Γ(a − b + 2) Γ(b + 1)Γ(a − b + 2) b
35.2. TWO APPARENTLY SIMPLE EXAMPLES 471

and, from (35.24),

(−1)b Γ(b − a) (−1)b−1 Γ(b − 1 − a)



a a
+ = +
b b−1 Γ(b + 1)Γ(−a) Γ(b)Γ(−a)
Γ(b−a)
z }| {
(−1) (b − a − 1)Γ(b − a − 1) −b(−1)b Γ(b − 1 − a)
b
= +
Γ(b + 1)Γ(−a) bΓ(b) Γ(−a)
| {z }
Γ(b+1)
b
(−1) (b − a − 1 − b)Γ(b − a − 1) (−1)b Γ(b − a − 1)
= =
Γ(b + 1)Γ(−a) Γ(b + 1)Γ(−a − 1)

a+1
= (35.31)
b

It is easy to see that in (35.29) it is impossible to use simultaneously two dierent


branches of (35.28).
Theorem 35.6.

a
=1 (35.32)
0

a
=1 (35.33)
a

for all a ∈ R for which the combinations above exist.


Γ(a+1)
Proof. (35.32) is obtained from (35.23) because Γ(1)Γ(a+1) = 1, and from (35.24)
0
(−1) Γ(−a)
because Γ(1)Γ(−a) = 1; the last branch of (35.28) never applies.
Γ(a+1)
(35.33) is obtained from (35.23) because Γ(a+1)Γ(a−a+1) = 1; the last two
branches of (35.28) never apply.

35.2 Two apparently simple examples


Since fractional derivatives generalise to arbitrary orders both derivatives and
integrals, it is expedient to denote them in a same way. So let us introduce a
functional operator D, associated to an order n ∈ Z, as follows: Operator D
Denition 35.4.
 n
d f (t)
 , if n ∈ N
 dtn


n
c Dt f (t) =
f (t), if n = 0 (35.34)
 Z t
n+1
f (t) dt, if n ∈ Z−

c Dt


c
n
n d f (t)


 (−1) , if n ∈ N

 dtn
n
t Dc f (t) =
f (t), if n = 0 (35.35)
 Z c
n+1
f (t) dt, if n ∈ Z−

t Dc


t

Remark 35.2. The recursion used to dene the n ∈ Z− branches means that
Z x Z x
n
c Dx f (t) = ··· f (t) dt · · · dt, n ∈ Z− (35.36)
c c
| {z }
|n| integrations
Z c Z c
n
x Dc f (t) = ··· f (t) dt · · · dt, n ∈ Z− (35.37)
x x
| {z }
|n| integrations

Remark 35.3. When n ∈ Z+


0 , operator D is local, and hence subscripts c and
n
When D is local or non-
t are useless. Thus, for instance, 0 Dt2 f (t) = −∞ Dt2 f (t). But, when n ∈ Z− , the local
operator is no longer local; changing the value of c will, in general, change the
result.
472 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

Of course, Dn f (t), n ∈ N only makes sense if f is n times dierentiable,


and c Dt−n f (t), n ∈ N only makes sense if f is n times integrable.
Thanks to D, two cases in which it seems obvious what a fractional derivative
should be can be easily presented.
Derivatives of eλt Example 35.1. From
eλt
n
−∞ Dt f (t) = = λn eλt , n ∈ Z− (35.38)
λ−n
..
.
t t t
eλt
Z Z Z
f (t) dtdtdt = (35.39)
−∞ −∞ −∞ λ3
Z t Z t
eλt
f (t) dtdt = (35.40)
−∞ −∞ λ2
Z t
eλt
f (t) dt = (35.41)
−∞ λ
f (t) = eλt , λ 6= 0 (35.42)
df (t)
= λeλt (35.43)
dt
d2 f (t)
= λ2 eλt (35.44)
dt2
d3 f (t)
= λ3 eλt (35.45)
dt3
..
.
Dn f (t) = λn eλt , n ∈ N (35.46)
we are tempted to write
α λt
−∞ Dt e = λα eλt , λ > 0 (35.47)
even when α ∈/ Z. Notice that λ should now be positive to prevent the appear-
ance of complex quantities.
Derivatives of tλ Example 35.2. From
tλ−n Γ(λ + 1) λ−n
n
0 Dt g(t) = −n−1
= t , n ∈ Z−
Y Γ(λ − n + 1)
(λ + 1 + k)
k=0
(35.48)
..
.
Z tZ tZ t
tλ+3
g(t) dtdtdt = (35.49)
0 0 0 (λ + 1)(λ + 2)(λ + 3)
tZ t
tλ+2
Z
g(t) dtdt = (35.50)
0 0 (λ + 1)(λ + 2)
t
tλ+1
Z
g(t) dt = (35.51)
0 λ+1
/ Z−
g(t) = tλ , t ∈ R+ , λ ∈ (35.52)
dg(t)
= λtλ−1 (35.53)
dt
d2 g(t)
= λ(λ − 1)tλ−2 (35.54)
dt2
d3 g(t)
= λ(λ − 1)(λ − 2)tλ−3 (35.55)
dt3
..
.
n−1
Y Γ(λ + 1) λ−n
Dn g(t) = tλ−n (λ − k) = t , n ∈ N, n ≤ λ
Γ(λ − n + 1)
k=0
(35.56)
35.3. THE GRÜNWALD-LETNIKOFF DEFINITION OF FRACTIONAL DERIVATIVES 473

(where the last equalities in (35.48) and (35.56) are a result of (35.20)(35.21))
we are tempted to write

Γ(λ + 1) λ−α
α λ
0 Dt t = t , t ∈ R+ , λ ∈
/Z (35.57)
Γ(λ − α + 1)

also when α ∈
/ Z.

Remark 35.4. Notice how in these two examples of apparently simple gener-
alisation of D to non-integer orders the lower limit of integration is in one case
c = −∞ and in the other c = 0.

35.3 The Grünwald-Letniko denition of frac-


tional derivatives

To generalise derivatives to non-integer orders, let us rst remember what they


are for integer ones.

Denition 35.5. The derivative of function f (t) is given by Denition of derivative

df (t) f (t) − f (t − h)
D1 f (t) = = lim (35.58)
dt h→0 h

Notice that h in (35.58) can be positive or negative. Restricting h to positive


values, we will have the left-side derivative; restricting h to negative values, we
will have the right-side derivative. If f is dierentiable at t, the left-side and
right-side derivatives coincide.

Theorem 35.7. The derivative of order n ∈ N of function f (t) is given by Derivative of order n

n
X n
(−1)k f (t − kh)
dn f (t) k
Dn f (t) = = lim k=0 (35.59)
dtn h→0 hn

Proof. This is proved by mathematical induction. For n = 1, (35.59) becomes


1 1
(−1)0 f (t − 0) + (−1)1 f (t − h)
0 1
1
D f (t) = lim (35.60)
h→0 h1
474 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

which is equal to (35.58). The inductive step is proved as follows:


n n
X
k n X
k n
(−1) f (t − kh) (−1) f (t − kh − h)
k k
k=0 k=0

DDn f (t) = lim hn hn
h→0 h
n n+1
X n X n
(−1)k f (t − kh) − (−1)k−1 f (t − kh)
k k−1
k=0 k=1
= lim
h→0 hn+1
1
z }| {
n
0 n X
k n
(−1) f (t − 0h) + (−1) f (t − kh)+
0 k
k=1
n
X n
+ (−1)k f (t − kh)+
k−1
k=1
n+1 n
+(−1) f (t − (n + 1)h)
n
| {z }
1
= lim
h→0 hn+1
1
z
}| {
n+1
(−1)0 f (t − 0h)+
0
n
X n+1
+ (−1)k f (t − kh)+
k
k=1
n+1
+(−1)n+1 f (t − (n + 1)h)
n+1
| {z }
1
= lim
h→0 hn+1
n+1
X
k n+1
(−1) f (t − kh)
k
k=0
= lim (35.61)
h→0 hn+1
where we used (35.29) and (35.32)(35.33).
Since (35.28) generalises combinations for non-integer arguments, we are
easily tempted to generalise (35.59) for an order α ∈ R as
?
X α
(−1)k f (t − kh)
k
k=0
Dα f (t) = lim (35.62)
h→0 hα
and all that is left is to know what the upper limit of the summation should be.
In fact, for integer orders,
ˆ the upper limit in (35.59) is n;

ˆ it might as well be +∞ that the denition would not change. All the extra
terms would be zero, thanks to the rst branch of (35.28) and to (35.10).
For non-integer orders, it is unclear what it should be, but, since we want
D−1 f (t) = f (t) dt, we make α = −1 in (35.62); then, using (35.24) we get
R

?
X −1
(−1)k f (t − kh)
k
k=0
D−1 f (t) = lim
h→0 h−1
?
X (−1)k Γ(k + 1)
= lim h (−1)k f (t − kh) (35.63)
h→0 Γ(k + 1)Γ(1)
k=0
Rt −1
If this is to be a Riemann
t−c integral c f (t) dt = c Dt f (t), the upper limit of the
summation must be h , and h must be restricted to positive values. Thus,
we arrive at
35.4. THE RIEMANN-LIOUVILLE DEFINITION OF FRACTIONAL DERIVATIVES 475

nwald-Letniko deni-
of fractional deriva- Denition 35.6.
b t−c
h c
X
k α
(−1) f (t − kh)
k
k=0
α
c Dt f (t) = lim (35.64)
h→0+ hα

Remark 35.5. If we make α = 0 in (35.64) or in (35.68), we get


1 0
1 z }| {
z }| { b t−c
h c
z }| {
0 X 0
(−1)0 f (t − 0) + (−1)k f (t − kh)
0 n
0 k=1
c Dt f (t) = lim+ = f (t)
h→0 h0
|{z}
1
(35.65)

and so we will obtain f (t) back.

Remark 35.6. Only when α ∈ N does the summation have a nite number of D is non-local in the gen-
terms. In other words, α ∈ N is the only case in which (35.64) does not depend eral case
on c. That is to say, D is a non-local operator (depending on what happens
to f (t) between the integration limits c and t), except for the case of natural But D is local for positive
d2 d3
order derivatives ( dt
d
, dt 2 , dt3 and so on) and the case α = 0. In this respect,
integer orders
fractional derivatives look like the integrals, not the derivatives, we are used to
from Calculus; and this irrespective of the sign of α.

Theorem 35.8. D is a linear operator: D is a linear operator

α
c Dt [af (t) + bg(t)] = ac Dtα f (t) + bc Dtα g(t), a, b ∈ R (35.66)

Proof.

b t−c
h c
X
k α
(−1) (af (t) + bg(t))
k
α k=0
c Dt (af (t) + bg(t)) = lim
h→0+ hα
b t−c
h c b t−c
h c
X
k α X
k α
(−1) f (t) (−1) g(t)
k k
k=0 k=0
= a lim + b lim
h→0+ hα h→0+ hα
= a c Dtα f (t) α
+ b c Dt g(t) (35.67)

Remark 35.7. If the order of the terminals is reversed, as in (35.35), then


(35.64) is replaced by

b c−t
h c
X
k α
(−1) f (t + kh)
k
k=0
α
t Dc f (t) = lim+ (35.68)
h→0 hα

35.4 The Riemann-Liouville denition of fractional


derivatives
While the Grünwald-Letniko denition is the most straightforward denition of
fractional derivatives, there is an alternative denition which is sometimes use-
ful. It is based upon two results for integer order derivatives that are extended
for the non-integer case:

Theorem 35.9. If all the derivatives exist, the equality Law of exponents

m n
c Dt c Dt f (t) = c Dtm+n f (t) (35.69)
476 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

holds in each of the three following cases:

m, n ∈ Z+
0 (35.70)
m, n ∈ Z−
0 (35.71)
+
m∈Z ∧n∈Z −
(35.72)

Proof. The rst two cases wherein (35.69) holds are obvious consequences of
denition (35.34). The third case can be easily proven by mathematical induc-
tion from the fact that dierentiation is the left inverse operator of integration,
that is to say, D1 c Dt−1 f (t) = f (t).
Remark 35.8. If none of (35.70)(35.72) holds, that is to say, if m ∈ Z− ∧ n ∈
Z+ , then, when calculating c Dtm c Dtn f (t), integration constants appear, related
to initial conditions at t = c. This means that (35.69) will only hold if all the
integration constants are equal to zero.
Cauchy's formula Theorem 35.10. The indenite integral of order n ∈ N of function f (t) is
given by
n integrations
z Z x }| { Z
x x
(x − t)n−1
Z
D
c x
−n
f (t) = · · · f (t) dt · · · dt = f (t) dt (35.73)
c c c (n − 1)!
Z c Z c Z c
(t − x)n−1
D
x c
−n
f (t) = · · · f (t) dt · · · dt = f (t) dt (35.74)
x x x (n − 1)!
| {z }
n integrations

Proof. For n = 1, both (35.73) and (35.74) are trivial. The proof proceeds by
mathematical induction and is based upon Dirichlet's equality for a function of
two variables x1 and x2 :
Z x Z x1 Z xZ x
f (x1 , x2 ) dx2 dx1 = f (x1 , x2 ) dx1 dx2 (35.75)
c c c x2

If f does not depend on x1 , but on x2 alone (see the integration area in g-
ure 35.2),
Z x Z x1 Z xZ x
f (x2 ) dx2 dx1 = f (x2 ) dx1 dx2 (35.76)
c c c x2
Z x Z x Z x
= f (x2 ) dx1 dx2 = f (x2 )(x − x2 ) dx2
c x2 c

Clearly, this is a particular case of (35.73), when n = 2. The inductive step is


proved applying it to (35.73):
Z x Z xZ x
−n (x − t)n−1
D
c x f (t) dx = f (t) dt dx
c c c (n − 1)!
Z xZ x
(x − t)n−1
= f (t) dx dt
c t (n − 1)!
Z x Z x
(x − t)n−1
= f (t) dx dt
c t (n − 1)!
Z x x
(x − t)n

= f (t) dt
c n! x=t
Z x
(x − t)n
= f (t) dt (35.77)
c n!

When the indenite limit of integration comes rst, (35.76) becomes (see the
integration area in gure 35.2)
Z cZ c Z c Z x2
f (x2 ) dx2 dx1 = f (x2 ) dx1 dx2 (35.78)
x x1 x x
Z c Z x2 Z c
= f (x2 ) dx1 dx2 = f (x2 )(x2 − x) dx2
x x x
35.4. THE RIEMANN-LIOUVILLE DEFINITION OF FRACTIONAL DERIVATIVES 477

Clearly, this is a particular case of (35.74), when n = 2. The inductive step is


proved applying it to (35.74):
Z c Z cZ c
−n (t − x)n−1
x Dc f (t) dx = f (t) dt dx
x x x (n − 1)!
Z cZ t
(t − x)n−1
= f (t) dx dt
x x (n − 1)!
Z c Z t
(t − x)n−1
= f (t) dx dt
x x (n − 1)!
Z c t
(t − x)n

= f (t) − dt
x n! x=x
Z c
(t − x)n
= f (t) dt (35.79)
x n!

x2 x2
x1 = x2 x1 = x2

x c

c x

x1 x1
c x x c

Figure 35.2: Left: integration area of (35.76); right: integration area of (35.78).

Generalising the law of exponents (35.69) for positive values of α, and


Cauchy's formula (35.73)(35.74) for negative values of α, we arrive at the
following:
Denition 35.7 (Riemann-Liouville fractional derivatives).
 Z t
(t − τ )−α−1
f (τ ) dτ, if α ∈ R−




 c Γ(−α)
α
c Dt f (t) = f (t), if α = 0 (35.80)
ddαe


α−dαe
f (t), if α ∈ R+

 D
dtdαe c t

 Z c
(τ − t)−α−1

 f (τ ) dτ, if α ∈ R−

 t Γ(−α)
α
t Dc f (t) = f (t), if α = 0 (35.81)
 dαe
 (−1)dαe d

Dα−dαe f (t), if α ∈ R+

dtdαe t c
Remark 35.9. Notice that, if α ∈ Z, (35.80) reduces to (35.34) and (35.81)
reduces to (35.35); in particular, if α ∈ N, we will have
α
d f (t)
α
c Dt f (t) = (35.82)
dtα
α
f (t)d
α
t Dc f (t) = (−1)α (35.83)
dtα

The Riemann-Liouville and Grünwald-Letniko denitions of fractional deriva-RL and GL denitions


tives give the same result, provided that the function satises the conditions for give the same result
the application of both the denitions. We will not prove this result, which
is very dicult to arrive at. You can, however, implement numerically both
denitions, and check that the results are the same (up to the numerical error
resulting from the approximations, of course).
Theorem 35.11. If f (t) has max{0, bαc} continuous derivatives, and Dmax{0,dαe} f (t)
is integrable, then c Dtα f (t) exists according to both the Riemann-Liouville and
Grünwald-Letniko denitions, which provide the same result.
478 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

35.5 Properties of fractional derivatives


It is because of the following result that dierential equations with fractional
derivatives originate fractional transfer functions.
L [Dα f (t)] Theorem 35.12. The Laplace transform of D is
s F (s), if α ∈ R−
 α

 F (s), if α = 0


L [0 Dtα f (t)] = dαe−1
X (35.84)

F (s) − sk 0 Dtα−k−1 f (0), if α ∈ R+




k=0

Proof. This is easily proved using the Riemann-Liouville denition. The result
is trivial for α = 0. For α < 0,
Z t
1
L [0 Dtα f (t)] = L (t − τ )−α−1 f (τ ) dτ (35.85)
Γ(−α) 0

By (2.78) this is equal to


1
L [0 Dtα f (t)] = L t−α−1 L [f (t)] (35.86)

Γ(−α)
Using the Laplace transform of the power function
Γ(λ + 1)
L tλ = , λ > −1 (35.87)
sλ+1
this becomes
1 Γ(−α)
L [0 Dtα f (t)] = L [f (t)] = sα L [f (t)] (35.88)
Γ(−α) s−α
For α > 0, h i
α−dαe
L [0 Dtα f (t)] = L Ddαe 0 Dt f (t) (35.89)

According to (2.45) and (2.47), this becomes


dαe−1
α−dαe
X
L [0 Dtα f (t)] =sdαe α−dαe
s F (s) − sk Ddαe−k−1 0 Dt f (0) (35.90)
k=0

which is the expression in (35.84).


Theorem 35.13. When input
u(t) = A sin(ωt) (35.91)

is applied to a stable fractional system G(s), the output, after the transient
regime has passed away, is

y(t) = |G(jω)|A sin(ωt + ∠G(jω)) (35.92)

That is to say, the frequency response of a fractional transfer function may be


found replacing s with jω , as is the case for integer transfer functions; i.e. it can
be obtained evaluating G(s) at the positive imaginary semiaxis, s = jω, ω ∈ R+ .
Proof. The proof is similar to that of Theorem 10.4. The dierences are that
stability conditions and vanishing terms in the response are as we will study
below in Chapter 36.
How Riemann integrals Let us take a nal look at the Grünwald-Letniko denition of Dα and show
are recovered with the GL that, if α ∈ Z− , the result is in fact equal to a Riemann integral. It is worthwhile
denition to repeat that, though the upper limit of the summation in (35.64) is diverging
to +∞, if α ∈ N then all terms with k > α will be zero, and thus (35.64) reduces
to (35.59) when h > 0. In other words, (35.64) will be a right derivative of f .
If f is dierentiable, the right and left side derivatives will be equal, and no
problem arises from restricting h to positive values.
As to higher order integrals, we need the following result.
35.6. APPLICATIONS OF FRACTIONAL DERIVATIVES 479

Lemma 35.2.
b x−c
h c
X (kh)n−1
−n
c Dx f (t) = lim h f (x − kh) (35.93)
h→0+ (n − 1)!
k=0

Proof. Apply the denition of the Riemann integral


Z x b x−c
h c
X
f (t) dt = lim hf (x − kh) (35.94)
c h→0+
k=0

to (35.73).
We can now show using the Grünwald-Letniko denition that c Dt−n f (t) is
in fact equal to
Z x Z x
··· f (t) dt · · · dt (35.95)
|c c
{z }
n integrations

If we make α = −n < −1, n ∈ N in (35.64), we get, according to (35.24) and


(35.20),
b t−c
h c
−n
X (−1)k Γ(k + n)
c Dt f (t) = lim+ hn (−1)k f (t − kh)
h→0 Γ(k + 1)Γ(n)
k=0
n−1
Y
b t−c (k + i)
X h c
n i=1
= lim h f (t − kh) (35.96)
h→0+ (n − 1)!
k=0

Whatever the value of n ∈ N,


n−1
Y n−2
X
(k + i) = k n−1 + ai k i (35.97)
i=1 i=0

where ai ∈ N. Thus (35.96) becomes


b t−c
h c
−n
X (hk)n−1
c Dt f (t) = lim+ h f (t − kh)
h→0 (n − 1)!
k=0
b t−c
 
n−2 n−1−i X h c i
X i! ai h (hk)
+  lim h f (t − kh) (35.98)
i=0
h→0+ (n − 1)! i!
k=0

According to (35.93), the limits inside the summation with index i would be
n−1−i
the integrals of f of order i + 1 if it were not for the fraction i! a(n−1)!
ih
. Since
h n−1−i
→ 0, these fractions converge to zero and thus the entire summation is
equal to zero: all that is left is the rst limit, which, again according to (35.93),
is indeed the nth order integral of f , as we might expect.

35.6 Applications of fractional derivatives


Fractional derivatives have many applications in practice. They can be used for
controller design, for solving physical problems (as in Exercise 3), and they can
model physical systems.
Example 35.3. The stress-strain model for an elastic material is
σ(t) = Eε(t) (35.99)

where σ is the stress, ε is the strain, and E is Young's modulus. For a viscous
material,
dε(t)
σ(t) = η (35.100)
dt
480 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

where η is viscosity.
Inbetween elasticity and viscosity lies viscoelasticity. The behaviour of the Viscoelasticity
material may be modelled as
1 1
σ(t) = Eτ 2 0 Dt2 ε(t) (35.101)

where τ is a time constant. Actually the fractional order can change according
to whether the viscoelastic behaviour is closer to elasticity or viscosity.
Diusion Heat diusion and mass diusion are also areas of application of fractional
order models, as in Example 36.5 of Chapter 36.

Glossary
And behold, when ye shall come unto me, ye shall write them and
shall seal them up, that no one can interpret them; for ye shall write
them in a language that they cannot be read. And behold, these
two stones will I give unto thee, and ye shall seal them up also, with
the things which ye shall write. For behold, the language which ye
shall write, I have confounded; wherefore I will cause in my own due
time that these stones shall magnify to the eyes of men, these things
which ye shall write.

Joseph Smith Jr. (1805 „1844), The Book of Mormon, Book of Ether, iii
22-24

combinations of a things, b at a time combinações de a, b a b


cycloid cicloide
fractional derivative derivada fracionária
tautochrone curve curva tautócrona

Exercises
1. Consider a commensurable transfer function G(s) given by
m
X
bk skα
k=0
G(s) = n (35.102)
X

ak s
k=0

and consider an integer transfer function


m
X
bk sk
k=0
G̃(s) = n (35.103)
X
k
ak s
k=0

built with the same numerator and denominator coecients. Show that
the frequency response G(jω):
(a) can be obtained calculating G̃(j α ω α );
(b) can be obtained evaluating G̃(s) over the ray s = j α ω α , ω ∈ R+ ,
shown in gure 35.3.

2. Prove (35.87) from the denition of L .


Tautochrone curve 3. Consider a mass m at rest on a frictionless curve surface dened by curve
y(x), as seen in gure 35.4. For convenience, the nal point of the curve
is set to (x, y) = (0, 0). The initial height of the mass is h and it slides
down to the end of the curve, under the inuence of gravity acceleration
g , with an ever increasing velocity V . Our objective is to nd the shape
35.6. APPLICATIONS OF FRACTIONAL DERIVATIVES 481

=[σ] =[σ]

απ απ
2 2
<[σ] <[σ]

Figure 35.3: Ray where G̃(s) is evaluated to obtain G(jω); left: 0 < α < 1;
right: 1 < α < 2.

m
h

Figure 35.4: The tautochrone curve, the cycloid.

of the curve such that the time T that the mass takes to reach the bot-
tom of the curve be constant, irrespective of the value of h. Such curve
is thereby called tautochrone (from the Greek words ταὐτός, same, and
χρόνος, time).
(a) Find an expression for the total mechanical energy of the mass at
any height y .
(b) Show that
(35.104)
p
V = 2g(h − y)
at any height y .
(c) Let ` be the distance travelled along the curve by the mass, from
height y to the end of the curve, given by
s 2
Z y
dx
`(y) = 1+ dy (35.105)
0 dy
Show that T (h) is given by
Z h
1 d`(y)
T (h) = p dy (35.106)
0 2g(h − y) dy
(d) If the curve is tautochrone, T (h) does not depend on h. Knowing
that


1
Γ = π (35.107)
2
show from the Riemann-Liouville denition of D that
r
− 12 d`(y) 2gT 2
0 Dy = (35.108)
dy π
(e) Apply a 1
2 order derivative to both sides of the last result and show
that √
d`(y) 2gT − 1
= y 2 (35.109)
dy π }
| {z
a
482 CHAPTER 35. FRACTIONAL ORDER DERIVATIVES

Take into account that, according to the law of exponents,


1
− 21
0 Dt 0 Dt f (t)
2
= f (t) (35.110)

(f) From this last result, show that


r
y
a2
Z
x(y) = − 1 dv (35.111)
0 v

(g) Show that this last result is equivalent to parametrisation

x(θ) = rθ + r sin θ (35.112)


y(θ) = r − r cos θ (35.113)

which is that of a cycloid, the curve described by a circle rolling on


2 2

π2 .
a horizontal straight line, with radius r = a2 = gT
Chapter 36

Time responses of fractional


order systems
After studying the frequency responses of fractional order transfer functions,
and the fractional derivatives that originate them, this chapter addresses their
responses in time.

36.1 The Mittag-Leer function


Just as we needed to generalise the factorial with the Gamma function, we now
need to generalise the exponential function with a more general function, called
Mittag-Leer function.
Denition 36.1 (Mittag-Leer functions). The one-parameter and the two-
parameter Mittag-Leer functions are dened as
+∞
X tk
Eα (t) = = Eα,1 (t), α > 0 (36.1)
Γ(αk + 1)
k=0
+∞
X tk
Eα,β (t) = , α, β > 0 (36.2)
Γ(αk + β)
k=0

The two-parameter Mittag-Leer function will be referred to below simply as


the Mittag-Leer function.
Some particular values of these functions include
+∞ +∞
X tk X tk
E1 (t) = E1,1 (t) = = = et (36.3)
Γ(k + 1) k!
k=0 k=0
E1 (at) = E1,1 (at) = e at
(36.4)
+∞ +∞
X t2k X t2k
E2 (t) = E2,1 (t2 ) = = = cosh(t) (36.5)
Γ(2k + 1) (2k)!
k=0 k=0
+∞ +∞
X t2k 1 X t2k+1 sinh(t)
E2,2 (t2 ) = = = (36.6)
Γ(2k + 2) t (2k + 1)! t
k=0 k=0
+∞
X 0k tβ−1
t β−1
E1,β (0) = t β−1
= (36.7)
Γ(k + β) Γ(β)
k=0

Lemma 36.1. The (integer) derivatives of 1


1∓t are given by

1 k!(±1)k
Dk = , k ∈ Z+
0 (36.8)
1∓t (1 ∓ t)k+1
Proof. This is proved by mathematical induction. For k = 0 the equality is
obvious, and the inductive step is proved as follows:

d k!(±1)k (k + 1)!(±1)k+1
k+1
= (−k − 1)k!(±1)k (1 ∓ t)−k−2 = (36.9)
dt (1 ∓ t) (1 ∓ t)k+2

483
484CHAPTER 36. TIME RESPONSES OF FRACTIONAL ORDER SYSTEMS

+∞
1
Corollary 36.1. The MacLaurin series of
X
is (±t)k .
1∓t
k=0

Proof. When t = 0 the derivative of order k reduces to k!(±1)k , and replacing


this in
+∞ k k
X t d
f (t) = f (0) (36.10)
k! dtk
k=0

we obtain
+∞
X k!
(±1)k tk (36.11)
k!
k=0

The series converges for |t| < 1; otherwise its terms do not converge to 0 when
k → +∞.
k
Eα,β (±atα )
Theorem 36.1. The Laplace transform of tαk+β−1 d d(±atα )k
, 0 is
k ∈ Z+
k α
k!sα−β

αk+β−1 d Eα,β (±at )
L t = (36.12)
d(±atα )k (sα ∓ a)k+1
Proof. First we notice that
+∞ +∞ +∞
(±z)k tαk
Z Z X
−t β−1 α −t β−1
e t Eα,β (±zt ) dt = e t dt
0 0 Γ(αk + β)
k=0
+∞ Z +∞
X (±z)k
= e−t tαk+β−1 dt
Γ(αk + β) 0
k=0 | {z }
Γ(αk+β)
1
= (36.13)
1∓z
Dierentiating the rightmost and the leftmost members of (36.13) k ∈ Z+
0 times,
Z +∞
k!(±1)k dk
= e−t tβ−1 Eα,β (±ztα ) dt
(1 ∓ z)k+1 dz k 0
Z +∞
dk
= e−t tβ−1 (±tα )k E (±ztα ) dt
α )k α,β
(36.14)
0 d(±zt
We now replace t with st (and thus dt with s dt) and get
Z +∞
k!(±1)k k α α
k αk αk d Eα,β (±zs t )
= e −st β−1 β−1
s t (±1) s t s dt (36.15)
(1 ∓ z)k+1 0 d(±zsα tα )k
Rearranging the terms and replacing zsα with a (and thus z with sα ),
a

Z +∞
k! dk Eα,β (±atα )
k+1
= e−st tαk+β−1 dt (36.16)
sβ sαk 1 ∓ saα d(±atα )k

0

By comparison with (2.1), the right hand member can be seen to be the Laplace
k!s−β sα k!sα−β
transform in (36.12). The left hand member is α(k+1) k+1 = (sα ∓a)k+1 .
s (1∓ saα )
Corollary 36.2. Making k = 0 in (36.12),
sα−β
L tβ−1 Eα,β (±atα ) = α (36.17)

s ∓a
Corollary 36.3. Making α = β in (36.17),
1
L tα−1 Eα,α (±atα ) = (36.18)

sα ∓ a
Corollary 36.4. Making α = 1 in (36.17),
s1−β
L tβ−1 E1,β (±at) = (36.19)

s∓a
36.2. TIME RESPONSES OF SIMPLE FRACTIONAL ORDER TRANSFER FUNCTIONS 485

Corollary 36.5. Making a = 0 in (36.19),


tβ−1

1
L tβ−1 E1,β (0) = L (36.20)

= β
Γ(β) s

roximation of E for The inverse Laplace transforms corresponding to the relations above become
t easier to evaluate for |t| → +∞ using the following approximations, given here
without proof:
1 1−β t1/α
Eα,β (t) ≈ t α e (36.21)
α
n
dn Eα,β (t) X ak,n (α, β) 1−(2n−k)α−β+2(n−k) 1/α
≈ t α et (36.22)
dtn αn+1
k=0

Inverse Laplace transforms can be found in the usual way.

Example 36.1. Suppose we want to calculate the inverse Laplace transform of


4s1/2 − 1
. We apply a partial fraction expansion, and then (36.18):
s + s1/2 − 2

4s1/2 − 1

1 3
L −1
=L −1
+
s + s1/2 − 2 s1/2 − 1 s1/2 + 2
1 1 1 1
= t− 2 E 21 , 12 (t 2 ) + 3t− 2 E 21 , 12 (−2t 2 ) (36.23)

Example 36.2. Suppose we want to calculate the inverse Laplace transform of


√ √
s + s2/3 − 2s1/3 − 2 1 s1/3
√ √ = √ + √ (36.24)
s4/3 − 2s − 2s1/3 + 2 s1/3 − 2 s − 2
We will solve this in two ways.

ˆ If we are aware of the equality above, we can apply (36.18)(36.19) to the


right-hand side of (36.24) and get

s1/3 √ 1 √

1 2 1
L −1 √ + √ = t− 3 E 1 , 1 ( 2t 3 ) + t− 3 E1, 2 ( 2t) (36.25)
1/3
s − 2 s− 2 3 3 3

ˆ But if we simply apply a partial fraction expansion to the left-hand side


of (36.24), we are led to
" √ √ #
s + s2/3 − 2s1/3 − 2
L −1
√ √ =
s4/3 − 2s − 2s1/3 + 2
 √ √ 
√ 1 3 3 √ 1 3 3
1
1
3 3 21/6
− 2 − 2 j 3 3 21/6
− 2 + 2 j
3×21/6
L −1  √ + 1/3 1/6
+ √ + √ =
1/3
s − 2 s − 2 1/3
s −2 −5/6 1/3
(−1 + 3) s − 2 −5/6 (−1 − 3)
2 √ 1 1 2 1 1
t− 3 E 31 , 31 ( 2t 3 ) + 1 t− 3 E 31 , 13 (2 6 t 3 )+
3×2 6
√ !
1 3 3 2
5 √ 1
√ 1 − − j t− 3 E 13 , 13 2− 6 (−1 + 3)t 3 +
3 3 26 2 2
√ !
1 3 3 2
5 √ 1
√ 1 − + j t− 3 E 13 , 13 2− 6 (−1 − 3)t 3 (36.26)
3 3 26 2 2

This far more complicated expression, however, turns out to be equal to


(36.25): its imaginary parts cancel out. While it is not trivial to prove
this analytically, the reader can easily check numerically that it is so.

36.2 Time responses of simple fractional order


transfer functions
The Laplace transforms above can be used to nd the following impulse, unit Impulse, step and ramp re-
sponses
486CHAPTER 36. TIME RESPONSES OF FRACTIONAL ORDER SYSTEMS

step and unit ramp responses:


tα−1

1
L −1
L [δ(t)] = (36.27)
sα Γ(α)


1
L −1 α L [H(t)] = (36.28)
s Γ(α + 1)
tα+1

1
L −1 α L [t] = (36.29)
s Γ(α + 2)

1
L −1 α L [δ(t)] = tα−1 Eα,α (±atα ) (36.30)
s ∓a

1
L −1
L [H(t)] = tα Eα,α+1 (±atα ) (36.31)
sα ∓ a

1
L −1
L [t] = tα+1 Eα,α+2 (±atα ) (36.32)
sα ∓ a
tα(k+1)−1 dk Eα,α (±atα )

1
L −1 α k+1
L [δ(t)] = , k ∈ Z+0 (36.33)
(s ∓ a) Γ(k + 1) d(±atα )k
tα(k+1) dk Eα,α+1 (±atα )

1
L −1 α k+1
L [H(t)] = , k ∈ Z+0 (36.34)
(s ∓ a) Γ(k + 1) d(±atα )k
tα(k+1)+1 dk Eα,α+2 (±atα )

1
L −1 L [t] = , k ∈ Z+0 (36.35)
(sα ∓ a)k+1 Γ(k + 1) d(±atα )k
Because of (36.21), when t → +∞, the following approximations can be used
instead of (36.30)-(36.32):
tα−1

1 1−α 1/α
L −1
L [δ(t)] ≈ (±atα ) α eta
sα ∓ a α
1 1/α
= α−1 eta (36.36)
(±a) α α
tα 1 ta1/α

1
L −1
L [H(t)] ≈ e
sα ∓ a α ±atα
1 ta1/α
= e (36.37)
±aα
tα+1

1 −1−α 1/α
L −1 α L [t] ≈ (±atα ) α eta
s ∓a α
1 1/α
= α+1 eta (36.38)
(±a) α α
(36.22) can likewise be used to approximate (36.33)-(36.35).
Time responses of other fractional transfer functions can be found from these
using the convolution theorem (10.25), normally evaluated numerically.
2
Example 36.3. The impulse response of G(s) = 1 1 can be found
(s 2 + 1)(s 3 + 4)
from

1 1 1
L −1
1 = t− 2 E 12 , 12 (−t 2 ) (36.39)
s +1
2

1 2 1
L −1 1 = t− 3 E 13 , 13 (−4t 3 ) (36.40)
s +4
3

and is equal to
Z t E 1 1 (−√t − τ ) E 1 1 (−4 √
3
τ)
2 2,2 3,3
L −1
1 1 L [δ(t)] = 2 √ √
3

(s 2 + 1)(s 3 + 4) t−τ τ 2
0
(36.41)

36.3 Stability of fractional systems


Just as an integer transfer function is stable when all its poles lie in the left-
hand complex half-plane, a similar condition must be veried for the stability
of fractional transfer functions.
36.3. STABILITY OF FRACTIONAL SYSTEMS 487

Theorem 36.2. System G(s) = N (s)


D(s) is stable if

π
∀ s : D(s) = 0, |∠s| > (36.42)
2
restricting ∠s to [−π, +π] rad.

We will not prove this theorem in the general case; only in the form it takes
for the particular case of commensurable transfer functions:

Corollary 36.6. Let σk , k = 1 . . . n be the roots of the polynomial Matignon's theorem

n
X
A(σ) = ak σ k (36.43)
k=0

built with the denominator coecients of transfer function


m
X
bk skα
k=0
G(s) = n (36.44)
X

ak s
k=0

Then G(s) is stable if and only if


π
|∠σk | > α , ∀ k (36.45)
2
restricting ∠σk to [−π, +π] rad.

Proof. If A(σ) has no roots with multiplicity higher than one, G(s) can be
written as a partial fraction expansion:
n
X ρk
G(s) = (36.46)
sα − σk
k=1

Applying (36.30), it is seen that the impulse response of (36.46) is given by


n
X
y(t) = ρk tα−1 Eα,α (σk tα ) (36.47)
k=1

The asymptotic behaviour (36.21) shows that for t large enough this will become
n n
X 1 1−α α 1 X ρk 1−α 1/α
y(t) ≈ ρk tα−1 (σk tα ) α e(σk t ) α = σ α etσk (36.48)
α α k
k=1 k=1
h i
1/α
This response will tend to zero if < σk < 0. Since

h
1/α
i h i ∠σk ∠σk
< σk = < (|σk |ej∠σk )1/α = < |σk |1/α cos + j sin (36.49)
α α

the condition above will be satised if cos ∠σ


α < 0 ⇔ | α | > 2 . Since α is
k ∠σk π

positive, the result follows.


If A(σ) has roots with multiplicity higher than one, (36.46) is replaced with
nd X
mk
X ρk,q
G(s) = (36.50)
(sα − σk )q
k=1 q=1

where nd is the number


Pnd of dierent roots and mk is the multiplicity of root σk
(which means that k=1 mk = n). Thus (36.47) is replaced by
nd X
mk
X tαq−1 dq−1 Eα,α (σk tα )
y(t) = ρk,q (36.51)
Γ(q) d(σk tα )q−1
k=1 q=1
488CHAPTER 36. TIME RESPONSES OF FRACTIONAL ORDER SYSTEMS

and, according to (36.22), the asymptotic response (36.48) will become


nd X
mk q−1
X tαq−1 X ar,q−1 (α, α) 1−(2q−r−3)α+2(q−r−2) α 1/α
y(t) ≈ ρk,q q
(σk tα ) α e(σk t )
Γ(q) r=0 α
k=1 q=1
nd X q−1
mk X
X ρk,q ar,q−1 (α, α) 1−(2q−r−3)α+2(q−r−2) 1/α
= σk α
t−(q−r−3)α+2(q−r−2) etσk
αq Γ(q)
k=1 q=1 r=0
(36.52)
Since the exponential tends to zero faster thanh the
i power function tends to
1/α
innity, all terms will again tend to zero if < σk < 0.

The regions where the σ may lie in the case of a stable commensurable
transfer function are shown in gure 36.1.

=[σ] =[σ]

απ απ
2 2
<[σ] <[σ]

Figure 36.1: In grey: regions of the complex plane where the roots of A(σ)
may lie in the case of a stable commensurate transfer function, according to
Matignon's theorem; left: 0 < α < 1; right: 1 < α < 2.

Remark 36.1. For integer systems we reach the usual criterion of stability: all
poles must have a negative real part.
Orders α>2 make plants Orders α > 2 make the system necessarily unstable.
unstable
Example 36.4. Figure 36.2 shows four applications of Matignon's theorem.

36.4 Identication from time responses


Identication from time responses is done as for the integer case, when using
a model continuous in time. The Mittag-Leer function cannot be inverted
as easily as the exponential, which means that numerical solutions, using the
Nelder-Mead simplex search method or metaheuristic methods, are the usual
solution.
Example 36.5. In a few cases, analytical calculations to identify a fractional
model are possible. Consider the heat equation
∂T (x, t) ∂ 2 T (x, t)
=d (36.53)
∂t ∂x2
which describes the transmission of heat by conduction along one dimension x,
as seen in gure 36.3 for the case of a semi-innite body with a plane surface
at x = 0. T (x, t) is the temperature at point x and at time instant t; d is a
parameter called diusivity. Assume a uniform initial temperature T0 in the
body at time t = 0 and a constant surface temperature Tsf . Using variable
change θ = T − T0 , (36.53) and the border conditions can be rewritten as
∂θ(x, t) ∂ 2 θ(x, t)
=d (36.54)
∂t ∂x2
θ(x, 0) = 0 (36.55)
θ(0, t) = Tsf − T0 (36.56)
36.4. IDENTIFICATION FROM TIME RESPONSES 489

Transfer function σ α σ in the complex plane Stable

1 2 ± 2j 1
Yes
s2/3 − 4s1/3 + 8 3

1 2 ± 2j 1
No (on the limit)
s − 4s1/2 + 8 2

1 2 ± 2j 2
No
s4/3 − 4s2/3 + 8 3

s4/3 − 2 −2 ± 2j 4
Yes
s8/3 + 4s4/3 + 8 3

Figure 36.2: Stability of four plants veried by Matignon's theorem

Applying the Laplace transform to the time derivative,


∂ 2 Θ(x, s)
sΘ(x, s) = d 2

∂x
√ √s
s
Θ = k1 ex d + k2 e−x d (36.57)

for indeed
s x√ ds s −x√ ds
r r
∂Θ(x, s)
= k1 e − k2 e (36.58)
∂x d d
∂ 2 Θ(x, s) s √s s √s
2
= k1 ex d + k2 e−x d (36.59)
∂x d d

Because lim Θ(x, s) < +∞ (which means that the temperature inside the


x→−∞
body cannot grow innitely), it is necessary that k2 = 0. Hence the solution
must verify √s
Θ = k1 ex d (36.60)
where Θ = L [θ].
An estimate of the age of the Earth estimate was arrived at by Lord Kelvin Age of the Earth
from the heat equation, and redone by Heaviside using fractional derivatives in
a manner similar to the following. From (36.60) we get

s x√ ds
r
∂Θ(x, s) 1 1
= k1 e = s 2 √ Θ(x, s) (36.61)
∂x d d
Using an inverse Laplace transform (with zero initial conditions) and making
x = 0 we conclude that the temperature gradient at the surface must verify
∂θ(0, t) 1 1
= √ 0 Dt2 θ(0, t) (36.62)
∂x d
We now assume that the radius of the Earth is large enough for the planet to
be compared to a semi-innite solid; that its temperature, when it was formed,
490CHAPTER 36. TIME RESPONSES OF FRACTIONAL ORDER SYSTEMS

Tsf

Figure 36.3: The heat conduction problem.

was θ(0, 0) = 3900 ◦ C, which is the temperature of molten rock; and that
its surface has a constant temperature of 0 ◦ C. It immediately follows from
(36.75), proved in Exercise 7, that an expression for the temperature gradient
at the surface when the Earth was formed is

∂θ(0, 0) 1 3900 ◦ C
=√ √ (36.63)
∂x d πt

Assuming that the expression found is valid in the future, knowing that d =
1.178 × 10−6 m2 /s and that nowadays the temperature gradient at the surface
of the Earth is 1 ◦ C for every 27.43 m (as measured in the 19th century), we
can now estimate the age of the Earth: rather than making t = 0 in (36.63),
substituting numerical values and solving in order to t we get t = 3.0923 ×
1015 s = 98 × 106 years.
Actually, the currently accepted age for the Earth is 4.54 × 109 years: Lord
Kelvin's estimate is faulty because it does not take into account heat production
due to radioactive decay, unsuspected at the time. Of course, as the Earth is
heated from inside, it takes longer to cool down that it otherwise would.

Example 36.6. Fractional order models in heat conduction can be experimen-


tally veried using an apparatus depicted in Figure 36.4, where the length of the
rod is very large in comparison with its diameter. Using one such apparatus,
and turning the heater on and o repeatedly, a sequence of step responses was
obtained, also shown in the Figure. The response is a piecewise function; while
exponentials can be tted to the successive pieces, the t is far more accurate
using the Mittag-Leer function with α = 0.5.

Figure 36.4: Top: experimental apparatus to measure heat conduction in a semi-


innite solid. Bottom: experimental response to a sequence of steps, obtained
turning the heater on and o (source: DOI 10.1115/1.2833910).
36.5. FINAL COMMENTS ABOUT MODELS OF FRACTIONAL ORDER 491

36.5 Final comments about models of fractional


order
Many dynamic systems can be modelled accurately using integer derivatives
only. Fractional order models should be used as an alternative in identication
only if either

ˆ the nature of the system is such that a fractional order model can be
expected (presence of diusion, or viscoelasticity, or another phenomenon
known to lead to such models); or

ˆ the experimental data clearly corresponds to the behaviour of a fractional


order plant.

Even in such cases, it is possible that a mathematically simpler integer order


model can achieve enough accuracy to be preferred. Fractional order models
should be chosen over integer order ones when they are simpler for a similar
accuracy, or only they achieve the necessary accuracy. In this respect, fractional
order models can be compared with integer order models as in Figure 36.5.

Figure 36.5: Left: integer order models. Right: fractional order models.
(Source: Wikimedia. Credit for the idea in this Figure goes to Professors
YangQuan Chen, Igor Podlubny and Blas Vinagre.)

Exercises
1. Use Matignon's theorem to nd whether the following transfer functions
are stable.
1
G1 (s) = 1/2
(36.64)
s − 6s + 18
1
G2 (s) = 4/3
(36.65)
s − 6s2/3 + 18
s4/3 − 2
G3 (s) = (36.66)
s8/3 + 6s4/3 + 18
1
G4 (s) = (36.67)
s2/3 − 6s1/3 + 18
492CHAPTER 36. TIME RESPONSES OF FRACTIONAL ORDER SYSTEMS

Table 36.1: Unit step response of Exercise 6.


t 0 1 2 3 4 5 6 7 8 9 10
y(t) 0.0000 1.0000 1.4142 1.7321 2.0000 2.2361 2.4495 2.6458 2.8284 3.0000 3.1623

2. Explain whether or not the plant from Exercise 4 of Chapter 34 is stable.


3. Find analytically the impulse and step responses of a plant with transfer
function G(s) = 1 10 .
s 2 +100

4. Show that the impulse response of G(s) = 1


3
1 is
(s 2 +1)(s 3 +11)
√ √
Z t E 12 , 12 (− t − τ ) E 31 , 13 (−11 3 τ )
g(t) = 3 √ √3
dτ (36.68)
0 t − τ τ2
Hint: use inverse Laplace transforms and the convolution theorem.
5. Find the analytic expression of the output of the plant from Exercise 3 of
Chapter 34, when the input is a ramp with slope −10.
6. The unit step response of a LTI system is tabulated in Table 36.1. Sketch
a plot of this unit step response, nd the transfer function of this plant,
and
√ plot its Bode diagram. Hint: notice that the tabulated value for 2 s
is 2. Can you recognise the tabulated values for 1, 4 and 9 s? What
about the other time instants?
7. Prove that
Γ(λ + 1) λ−α
α λ
0 Dt t = t , λ > −1 (36.69)
Γ(λ − α + 1)
in the following way:
(a) Show from the denition of the Laplace transform that
Γ(λ + 1)
L tλ = , λ > −1 (36.70)
sλ+1

(b) Show from (35.84) that, when α < 0,

Γ(λ + 1)
L α λ
= sα = sα−λ−1 Γ(λ + 1), λ > −1 (36.71)

0 Dt t
sλ+1

(c) Use (36.70) again to prove (36.69) for α < 0.


(d) Use this result for α < 0 together with the Riemann-Liouville deni-
tion (35.80) to show that, if α > 0,

α λ ddαe α−dαe λ ddαe Γ(λ + 1)


0 Dt t = dαe 0 Dt t = dαe
tλ−α+dαe
dt dt Γ(λ − α + dαe + 1)
(36.72)
(e) Use that result together with (35.56) to obtain

α λ Γ(λ + 1) Γ(λ − α + dαe + 1)


0 Dt t = tλ−α+dαe−dαe
Γ(λ − α + dαe + 1) Γ(λ − α + dαe + 1 − dαe)
(36.73)
(f) Having proved (36.69) for both positive and negative values of α,
show as a corollary that, making λ = 0,
k
α
0 Dt k = t−α (36.74)
Γ(1 − α)

(g) Knowing that Γ 1
π , show as well, using (36.74), that

2 =
1 k
0 Dt
2
k=√ (36.75)

Part VIII

Stochastic systems

493
495

Or du hasard il n'est point de science.


S'il en estoit, on auroit tort
De l'appeler hasard, ni fortune, ni sort,
Toutes choses tres-incertaines.

Jean de la Fontaine (1621 1695), Fables, 2 XIII (L'astrologue qui se laisse


tomber dans un puits)

In this part of the lecture notes:

Chapter 37 introduces stochastic processes and systems, and the tools to characte-
terise them.

Chapter 38 introduces the important concept of spectral density; it is yet another tool
to characterise stochastic processes and systems, but is so important that
it deserves a chapter on its own.

Chapter 39 is about the identication of stochastic models.

Chapter 40 presents design methods for lters for stochastic systems.

Chapter 41 describes dierent types of models for digital stochastic systems and how
to identify them from data.

Chapter 42 concerns the design of controllers for stochastic systems.

Here is what you need to know beforehand to follow these chapters:

ˆ Probability and Statistics, up to the usual level of an undergraduate course


on the subject;

ˆ The Laplace and Fourier transforms, from Chapter 2;

ˆ Transfer functions, from Sections 4.1 and 4.2 of Chapter 4;

ˆ System theory, from Part II;

ˆ Filters, from Sections 12.2 and 12.3 of Chapter 12;

ˆ Discrete transfer functions, from Chapter 25, Sections 26.1 to 26.5 of


Chapter 26, and Sections 27.1, 27.2 and 27.6 of Chapter 27;

ˆ System identication, from Chapters 30 to 32.


496
Chapter 37

Stochastic processes and


systems
Ah, the evening when I took those seventy gülden to the gaming ta-
ble was a memorable one for me. I began by staking ten gülden upon
passe. For passe I had always had a sort of predilection, yet I lost
my stake upon it. This left me with sixty gülden in silver. After a
moment's thought I selected zerobeginning by staking ve gülden
at a time. Twice I lost, but the third round suddenly brought up the
desired coup. I could almost have died with joy as I received my one
hundred and seventy-ve gülden. Indeed, I have been less pleased
when, in former times, I have won a hundred thousand gülden. Los-
ing no time, I staked another hundred gülden upon the red, and
won; two hundred upon the red, and won; four hundred upon the
black, and won; eight hundred upon manque, and won. Thus, with
the addition of the remainder of my original capital, I found myself
possessed, within ve minutes, of seventeen hundred gülden. Ah,
at such moments one forgets both oneself and one's former failures!
This I had gained by risking my very life. I had dared so to risk,
and behold, again I was a member of mankind!
I went and hired a room, I shut myself up in it, and sat counting
my money until three o'clock in the morning. To think that when I
awoke on the morrow, I was no lacquey! I decided to leave at once
for Homburg. There I should neither have to serve as a footman nor
to lie in prison. Half an hour before starting, I went and ventured a
couple of stakesno more; with the result that, in all, I lost fteen
hundred orins. Nevertheless, I proceeded to Homburg, and have
now been there for a month.
Fyodor Dostoyevsky (1821 „1881), The Gambler, XVII (transl. C. J.
Hogarth)
Many systems have inputs with values that cannot be measured, but which
can be described as random variables with a known distribution. Such systems
are called stochastic systems. Stochastic system

37.1 Stochastic processes


Denition 37.1. A stochastic process is a process that generates a signal Stochastic process
X(t) that depends on time t and is in each time instant a random variable.
While we may want to make a distinction between the particular random vari-
able corresponding to time t which is X(t), the signal X(t) that assumes those
successive values, and the process {X(t)} that may originate dierent signals
consisting of random values X(t), the process itself is often denoted by X(t) as
well.
Remark 37.1. A more general denition of a stochastic process as a math-
ematical entity can be given, but the above suces for our purpose, which is
the study of stochastic systems in time and the identication of models for such
systems.

497
498 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

Figure 37.1: One dimensional random walk, as a function of time.

Figure 37.2: Two dimensional random walk. Left: the x and y coordinates as
functions of time. Right: the movement on the plane, beginning at (0, 0) and
following the random walks in the left plot.

Continuous and discrete A stochastic process is either


stochastic processes
ˆ continuous, if t ∈ R+
0;

ˆ discrete, if t = k Ts , where Ts > 0 is the sample time and k ∈ Z+


0 is the
sample. In this case, sample k corresponding to value X(k Ts ) is usually
denoted as Xk .
Random walk Example 37.1. A random walk is a discrete stochastic process given by
X0 = 0 (37.1)
Xk+1 = Xk + xk , k = 0, 1, 2, 3 . . . (37.2)
1
P (xk = +1) = (37.3)
2
1
P (xk = −1) = (37.4)
2
More precisely, if the probabilities of variation xk being −1 and +1 are equal as
in (37.3)(37.4), we have an unbiased random walk. When these probabilities
are dierent, we have a biased random walk.
Figure 37.1 shows an unbiased random walk with 50 instants. Two random
walks can be used to dene the movement of a particle on a plane, as shown
in Figure 37.2 for 1000 instants. Three random walks dene a movement in
three-dimensional space, which can be used to model the random movement of
Brownian motion a particle in suspension in a uid. This movement is called Brownian motion.
Notice that a random walk only assumes integer values. Just as time samples
can correspond to multiples of an arbitrary sample time Ts , these integer values
assumed by the random walk can correspond to multiples of some unit of length.

Example 37.2. Brownian motion can be better modelled replacing the unbi-
ased random walk by a stochastic process which is also discrete in time but
continuous in amplitude:
ˆ in each time instant, the particle travels a distance d which is a random
number, following a normal distribution with zero mean and variance σ 2 ;
37.1. STOCHASTIC PROCESSES 499

Figure 37.3: Simulation of Brownian motion as in Example 37.2, beginning at


(0, 0), for 1000 time samples.

ˆ the direction θ in which this movement takes place is uniformly distributed


in [0, 2π[ (or any other geometrically equivalent interval of angles).
Notice that a travel with distance d and angle θ is the same as a travel with
distance −d and angle θ +π . Figure 37.3 shows one such simulation of Brownian
motion.
Denition 37.2. The random value X(t) assumed by a stochastic process is
characterised by a probability distribution, given either by Probability distribution

ˆ the probability mass function (PMF) fX (x), if the variable assumes PMF
values in a discrete set, in which situation each of the N possible outcomes
xk , k = 1, 2 . . . N has a probability P X(t) = xk which veries
(37.5)

0 ≤ P X(t) = xk ≤ 1, ∀k = 1, 2 . . . N
N
X
(37.6)

P X(t) = xk = 1
k=1
(37.7)

fX (x) = P X(t) = x

ˆ the probability distribution function (PDF) fX (x), if the variable as- PDF
sumes values in a continuous set, in which situation each possible outcome
x has a probability
(37.8)

P X(t) = x = 0, ∀x
since there are innitely many outcomes. The PDF is dened so that
fX (x) ≥ 0, ∀x (37.9)
Z x2
(37.10)

P x1 ≤ X(t) ≤ x2 = fX (x) dx, x1 < x2
x1
Z +∞
fX (x) dx = 1 (37.11)
−∞

Denition 37.3. The cumulative distribution function (CDF) of a prob- CDF


ability distribution is a function FX (x) such that
P (X(t) ≤ x) = FX (x) (37.12)
Notice that:
ˆ For a PMF fX (x), the CDF is given by the sum of all probabilities up to
x, and will be discontinuous at every possible outcome xk .
N
X
FX (x) = fX (xk ), x1 , x2 , . . . , xk ≤ x < xk+1 , xk+2 , . . . , xN (37.13)
k=1

ˆ For a PDF fX (x), as a consequence of (37.10), the CDF is its indenite


integral.
Z x
FX (x) = fX (x) dx (37.14)
−∞
dFX (x)
fX (x) = (37.15)
dx
500 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

A stochastic process may have a time-varying probability distribution, in


Stationarity which case it is said to be non-stationary. A stochastic process with a prob-
ability distribution that remains the same is stationary.
If it is possible to characterise the probability distribution of a stochastic
Ergodicity process from measurements, the process is said to be ergodic. Obviously, if
the probability distribution keeps changing with time, the statistical proper-
ties of the probability distribution cannot be found from measurements, since
measurements of dierent distributions are mixed up, and the process is not
ergodic. On the other hand, it is possible to devise stationary processes that
Only stationary processes are not ergodic, as the one in the next example. In other words, stationarity
can be ergodic is a necessary, but not sucient, condition for ergodicity. In what follows we
We assume stationary, er- assume ergodic and hence stationary stochastic processes; at least, it is
godic stochastic processes assumed that changes in the probability distribution are slow enough for this to
be possible, in which case we have a quasi-stationary stochastic process.
Example 37.3. Consider a stochastic process given by
X(t) = A sin(t + θ) (37.16)

where θ is a random constant uniformly distributed in [0, 2π], and A is a random


constant with a normal distribution. X(t) will be in each instance a sinusoid,
and is stationary because A and θ are constants and thus do not have a distri-
bution varying with time; in fact, because these are constants, X(t) will even be
deterministic, i.e. we can predict future values without any uncertainty, if there
is no noise. We can nd the values of A and θ from measurements of a particular
instance of X(t), but since they are random they will not have the same value
in other instances. Consequently, knowing A and θ from one instance of X(t)
will tell us nothing about the values they will have when X(t) takes place again
(say, after stopping and restarting). Thus, this stochastic process, even though
stationary and even deterministic, is not ergodic.
Remark 37.2. Examples 37.1 and 37.2 show Matlab simulations, that use
pseudo-random number generators. As you surely know, the outputs
of such algorithms are not really random, but follow a specied distribution.
Matlab pseudo-random Among others, the following Matlab commands are useful for this purpose:
number generators
ˆ rand(a,b) returns an a × b matrix of numbers uniformly distributed in
[0, 1];
ˆ randi(n,a,b) returns an a × b matrix of natural numbers uniformly dis-
tributed in {1, 2, . . . , n};.
ˆ rand(a,b) returns an a×b matrix of numbers following a standard normal
distribution (i.e. with mean 0 and standard deviation 1);
ˆ all these functions, if arguments a and b are not provided, return only one
number.

37.2 Characterisation of stochastic processes


Several statistical properties are of interest when studying probability distribu-
tions and stochastic processes:
ˆ expected value;

ˆ variance;

ˆ standard deviation;

ˆ autocorrelation;

ˆ autocorrelation coecient;

ˆ autocovariance.

For each of them, we will:


ˆ dene it for a stochastic process;
37.2. CHARACTERISATION OF STOCHASTIC PROCESSES 501

ˆ provide a numerical approximation of the denition to estimate it from


a signal that measures a particular instance of the stochastic process.
These expressions can be applied to any signal, not just in the presence
of a stochastic process.

Denition 37.4. The expected value E[X(t)] of a stochastic process X(t) is Expected value
the centroid of its distribution:
Z +∞
E[X(t)] = x fX (x) dx, for a PDF (37.17)
−∞
N
X
E[X(t)] = xk fX (xk ), for a PMF (37.18)
k=1

To estimate the expected value of a stochastic process from the values ob- Mean
served up to time t, the mean of the observed values X(t) is used.

Denition 37.5. The mean of a signal continuous in time, for measurements


from t = 0 to t = tnal , is
Z tnal
1
X(t) = x(t) dt (37.19)
tnal 0

Denition 37.6. The mean of a signal sampled in time with sampling time Ts ,
for n + 1 measurements from t = 0 to t = Ts n, is
n
1 X
X(t) = Xk (37.20)
n+1
k=0

The discrete time case is more often found in practice.

Remark 37.3. Since


lim X(t) = E[X(t)] (37.21)
t→+∞

it is usual to use E[X(t)] and X(t) interchangeably.

Denition 37.7. The variance σX


2
is the average of the squares of the devia- Variance
tions:
h i
2
2
σX = E (X(t) − E[X(t)]) (37.22)

Theorem 37.1. For a stationary stochastic process,


h i
2 2
σX = E (X(t) − E[X(t)])
h i
2
= E X 2 (t) − 2X(t)E[X(t)] + (E[X(t)])
constants constant
z }| { h z }| { i
2 2
= E X (t) − E[X(t) 2E[X(t)]] + E (E[X(t)])
| {z } | {z }
2E[X(t)]E[X(t)]
(E[X(t)])2
2 2
= E X 2 (t) − (E[X(t)]) = X 2 (t) − X(t) (37.23)

Corollary 37.1.
2
2
X 2 (t) = X(t) + σX (37.24)

The variance of a stochastic process is estimated from observed values apply-


ing (37.19)(37.20) to (37.23), i.e. approximating the variance of the distribution
by the variance of the observed values.

ˆ In the continuous case, for measurements from t = 0 to t = tnal :


Z tnal Z tnal 2
1 1
2
σX = x2 (t) dt − x(t) dt (37.25)
tnal 0 tnal 0
502 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

ˆ In discrete time with sampling time Ts , for n + 1 measurements from t = 0


to t = Ts n:
n n
!2
1 X 2 1 X
2
σX = Xk − Xk (37.26)
n+1 n+1
k=0 k=0

Denition 37.8. The standard deviation σX is the square root of the vari- Standard deviation
ance:
q
σX = 2
σX (37.27)

Example 37.4. The more samples of a process we have, the better our esti-
mation of its mean and variance is. Consider a uniform distribution X in [0, 1],
which has, applying (37.17) and (37.23),
(
1, if 0 ≤ x ≤ 1
fX (x) = (37.28)
0, otherwise
Z 1
1
E[X] = x dx = (37.29)
0 2
Z 1 2
1 1 1 1
2
σX = x2 dx − = − = (37.30)
0 2 3 4 12

Matlab's commands In three instances of 10 samples of this stochastic process, the mean and the
mean and var variance are
>> for k=1:4, X=rand(1,10); disp(['mean ' num2str(mean(X))...
', variance ' num2str(var(X))]), end
mean 0.62386, variance 0.11961
mean 0.66021, variance 0.10946
mean 0.58731, variance 0.086137
mean 0.39782, variance 0.13008
Means and variances do not stray much from the expected values, but are much
closer to them with 100 samples:
>> for k=1:4, X=rand(1,100); disp(['mean ' num2str(mean(X))...
', variance ' num2str(var(X))]), end
mean 0.49027, variance 0.080127
mean 0.46436, variance 0.071762
mean 0.49628, variance 0.084483
mean 0.49745, variance 0.078337
And even more with 1000:
>> for k=1:4, X=rand(1,1000); disp(['mean ' num2str(mean(X))...
', variance ' num2str(var(X))]), end
mean 0.50516, variance 0.081755
mean 0.48485, variance 0.082201
mean 0.49836, variance 0.082948
mean 0.4916, variance 0.083498

Remark 37.4. Notice how the estimates of the mean and the variance are
random variables themselves. That is why, in the previous example, several
instances of each were found for the same number of samples. If they are
updated in real time, their time-changing values will be stochastic processes
too.
Autocorrelation Denition 37.9. The autocorrelation RX (t1 , t2 ) of a stochastic process de-
pends on two time instants t1 and t2 and is given by

RX (t1 , t2 ) = E [X(t1 )X(t2 )] (37.31)

Autocorrelation has several important properties.


37.2. CHARACTERISATION OF STOCHASTIC PROCESSES 503

Lemma 37.1. Autocorrelation is an even function:


RX (t1 , t2 ) = E [X(t1 )X(t2 )] = E [X(t2 )X(t1 )] = RX (t2 , t1 ) (37.32)
Remark 37.5. For a stationary stochastic process,
RX (t1 , t2 ) = RX (t1 + ∆t, t2 + ∆t), ∀t1 , t2 , ∆t (37.33)
Since ∆t can take any value, we can make ∆t = −t1 and conclude that
RX (t1 , t2 ) = RX (0, t2 − t1 ), ∀t1 , t2 (37.34)
In other words, for a stationary process the autocorrelation only depends on the
time interval between two instants τ = t2 − t1 :
RX (τ ) = E [X(t)X(t + τ )] (37.35)
The following result is a consequence of (37.35).
Theorem 37.2. Autocorrelation as a function of τ is an even function: RX (τ ) = RX (−τ )
RX (τ ) = E [X(t)X(t + τ )] = E X(t + τ )X(t) = E [X(t0 )X(t0 − τ )] = RX (−τ )

| {z }
t0
(37.36)

Remark 37.6. (37.36) can also be seen as a consequence of (37.32) and (37.34):
since RX (t1 , t2 ) in fact only depends on τ = t2 − t1 , then
RX (τ ) = RX (t2 − t1 ) = RX (t1 , t2 ) = RX (t2 , t1 ) = RX (t1 − t2 ) = RX (−τ )
(37.37)
Theorem 37.3. For τ = 0,
2
2
RX (0) = E [X(t)X(t)] = X 2 (t) = X(t) + σX (37.38)
The last equality is taken from (37.24).
To estimate the autocorrelation, the expected value in (37.35) is estimated
using a mean, as in (37.19)(37.20):
ˆ In the continuous case, for measurements from t = 0 to t = tnal :
Z tnal −τ
1
RX (τ ) = x(t)x(t + τ ) dt (37.39)
tnal − τ 0

Notice that we cannot integrate from 0 to tnal , as in (37.19) or (37.25),


because the second measurement would be out of range. Values of τ so
large that they are close to tnal will lead to bad estimations of RX (τ ),
because measurements will be few. In practice it is often a good idea to
make 0 ≤ τ ≤ 13 tnal or 0 ≤ τ ≤ 12 tnal . Because RX (τ ) is an even function,
we will know its values for − 13 tnal ≤ τ ≤ 31 tnal or − 12 tnal ≤ τ ≤ 12 tnal .
ˆ In discrete time with sampling time Ts , for n + 1 measurements from t = 0
to t = Ts n:
n−ν
1 X
RX (ν) = Xk Xk+ν (37.40)
n−ν+1
k=0

Notice that in the discrete case it is usual to give the autocorrelation


depending on the number of samples ν between t1 and t2 , rather than the
time τ = Ts ν .
Remark 37.7. If τ tnal , or ν n, (37.39)-(37.40) can be approximated as Parzen (biased) estimator
Z tnal −τ of RX (τ )
1
RX (τ ) = x(t)x(t + τ ) dt (37.41)
tnal 0
n−ν
1 X
RX (ν) = Xk Xk+ν (37.42)
n+1
k=0

These biased approximations with a constant denominator are the so-called


Parzen estimator of the autocorrelation.
504 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

Figure 37.4: Top: autocorrelation of e0.05t . Bottom: autocorrelation of e−0.05t .

Example 37.5. The autocorrelation can be numerically found from (37.40) as


follows:
Ts = 0.01; tfinal = 100;
t = 0 : Ts : tfinal;
x = exp(0.05*t);
N = length(t)-1; % there are N+1 points; the first is labelled 0
M = floor(N*.5); % number of points for which Rx is found
Rx = zeros(1,M);
for k = 0 : M-1
Rx(k+1) = sum( x(1:N-k+1).*x(1+k:N+1) ) / (N-k+1);
end
figure,subplot(2,1,1),plot(t,x),xlabel('t'),ylabel('x')
subplot(2,1,2),plot((0:M-1)*Ts,Rx),xlabel('t'),ylabel('R_x'),xlim([0,tfinal])
The result of the example above, for X(t) = e0.05t , is shown in Figure 37.4
together with that of X(t) = e−0.05t . Values are given only for τ ≥ 0, but
remember that the function is even. Notice how the largest value is that for
RX (0).
Figure 37.5 shows the result for two random signals. There are negative
values of RX (τ ) now; no value has an absolute larger than RX (0).
Figure 37.6 shows the result for two periodic functions. In these cases RX (0)
has the largest absolute value, which recurs with the period of the function.
This example suggests the following result.
Theorem 37.4. The maximum absolute value of the autocorrelation is found
at τ = 0:
|RX (τ )| ≤ RX (0), ∀τ (37.43)
37.2. CHARACTERISATION OF STOCHASTIC PROCESSES 505

Figure 37.5: Top: autocorrelation of uniformly distributed values in [0, 1]. Bot-
tom: autocorrelation of standard normally distributed values.
506 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

Figure 37.6: Top: autocorrelation of sin(t). Bottom: autocorrelation of a square


wave with frequency 0.5 rad/s.
37.2. CHARACTERISATION OF STOCHASTIC PROCESSES 507

Figure 37.7: Nothing is more similar to a signal than itself. The gures show
how the product X(t)X(t + τ ), used to calculate the autocorrelation RX (τ ) =
E [X(t)X(t + τ )], is found.

2
Proof. Since (X(t + τ ) ± X(t)) ≥ 0, its expected value is also non-negative:
h i
2
E (X(t + τ ) ± X(t)) ≥ 0
h i
2 2
⇒E (X(t + τ )) ± 2X(t)X(t + τ ) + (X(t)) ≥ 0
h i h i
2 2
⇒E (X(t + τ )) ± E [2X(t)X(t + τ )] + E (X(t)) ≥ 0
h i h i
2 2
⇒ E (X(t + τ )) ± E [2X(t)X(t + τ )] + E (X(t)) ≥ 0
| {z } | {z } | {z }
2RX (τ )
RX (0) RX (0)

⇒2RX (0) ± 2RX (τ ) ≥ 0 (37.44)

where the last result was obtained applying (37.38). From these two inequalities,
( (
RX (0) + RX (τ ) ≥ 0 RX (τ ) ≥ −RX (0)
⇒ ⇒ −RX (0) ≤ RX (τ ) ≤ RX (0)
RX (0) − RX (τ ) ≥ 0 RX (0) ≥ RX (τ )
(37.45)

This range can actually be narrowed down further, as seen below in (37.55).
Meanwhile, it is possible to better understand why (37.43) is true with the
following reasoning:
ˆ RX (τ ) is the expected value of the product X(t)X(t + τ ).

ˆ When τ = 0, then X(t) is multipled by X(t) itself. The result is positive


everywhere. Furthermore, wherever |X| is large, it is multiplied by a large
value, which is itself.
ˆ When τ 6= 0, then X(t)X(t + τ ) may be negative for some values of τ . Nothing is more similar to
Even where this is not so, large values of |X| will be multiplied by smaller a signal than itself
values. Thus, |RX (τ )| < RX (0). This is illustrated in Figure 37.7.
ˆ The only exception of the above occurs when the signal is periodic and Autocorrelation of periodic
τ is such that local maxima and minima are again aligned. In that case, signals
RX (0) is obtained again. This is illustrated in Figure 37.8.
ˆ If the periodic signal is symmetric around zero, a time shift of half period
will, so to say, turn the signal upside down. This happens for instance for
X(t) = sin(t), since

sin(t + (2k + 1)π) = − sin(t), k ∈ Z (37.46)

In cases such as this, −RX (0) recurs whenever X(t) and X(t + τ ) are in
phase opposition.
The reasoning above also justies the following results.
Theorem 37.5. If X(t) is not periodic,
|RX (τ )| < RX (0), ∀τ 6= 0 (37.47)

If X(t) is periodic with period T , then RX (τ ) = RX (0) if and only if τ is a


multiple of T , i.e. τ = kT, k ∈ Z.
If X(t) is not only periodic but also symmetric, then RX (τ) = −RX (0) if
and only if τ is a multiple of T plus half period, i.e. τ = k + 21 T, k ∈ Z.
508 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

Figure 37.8: Left: how RX (0) recurs in the autocorrelation when τ is a multi-
ple of the period. Centre: how −RX (0) recurs in the autocorrelation when a
periodic signal is symmetrical. Right: periodic signal with zero mean for which
it is impossible that RX (τ ) = −RX (0).

Proof. If X(t) is periodic,


X(t + kT ) = X(t), k ∈ Z
⇒ X(t)X(t + kT ) = X 2 (t)
⇒ RX (kT ) = RX (0) (37.48)
| {z } | {z }
E[X(t)X(t+kT )] E[X(t)X(t)]

If X(t) is symmetric,

1
X t+ k+ T = −X(t), k ∈ Z
2

1
⇒ X(t)X t + k + T = −X 2 (t)
2

1
⇒ RX k+ T = −RX (0) (37.49)
2 | {z }
| {z } −E[X 2 (t)]
E [X(t)X (t+(k+ 21 )T )]

As to the necessity of the conditions, suppose that RX (τ ) = RX (0) for some


value of τ . This means that X(t)X(t + τ ) = X 2 (t) ⇒ X(t + τ ) = X(t), and,
since this must be true for all values of t, we conclude that τ is a period of X(t).
The reasoning for the cases when RX (τ ) = −RX (0) is similar.
Autocovariance Denition 37.10. The autocovariance CX (t1 , t2 ) of a stochastic process is
dened similarly to the autocorrelation, but using deviations from the mean:
h i
CX (t1 , t2 ) = E (X(t1 ) − E[X]) (X(t2 ) − E[X]) (37.50)

Remark 37.8. In this denition it is assumed that X is ergodic, and hence


stationary; and thus E[X] is constant. This means that CX will, just like RX ,
depend only on τ = t2 − t1 :
h i
CX (τ ) = E (X(t) − E[X]) (X(t + τ ) − E[X]) (37.51)

Remark 37.9. The autocovariance CX (t1 , t2 ) of X(t) is the autocorrelation


of X(t) − E[X], which has zero mean. This is another way to show that it
only depends on τ if X(t) is ergodic. It also shows immediately that CX (τ ) =
CX (−τ ).
Furthermore, the code from Example 37.5 can be used to nd the autoco-
variance, provided that the mean is subtracted from the signal.
Relation between autocor-
relation and covariance Lemma 37.2.
h i
CX (τ ) = E (X(t) − E[X]) (X(t + τ ) − E[X])
= E X(t)X(t + τ ) − X(t)E[X] − X(t + τ )E[X] + E[X]2

= E [X(t)X(t + τ )] − E [X(t)E[X]] − E [X(t + τ )E[X]] + E E[X]2


E[X] E[X]
z }| { z }| {
= E [X(t)X(t + τ )] − E[X] E [X(t)] − E[X] E [X(t + τ )] +E[X]2
| {z } | {z } | {z }
RX (τ ) E[X]2 E[X]2

= RX (τ ) − E[X] 2
(37.52)
37.2. CHARACTERISATION OF STOCHASTIC PROCESSES 509

Corollary 37.2. If X = 0 then RX (τ ) = CX (τ ).


Corollary 37.3. From (37.52), (37.38) and (37.24),
CX (0) = RX (0) − E[X]2
= E[X 2 ] − E[X]2
= E[X]2 + σX
2
− E[X]2 = σX
2
(37.53)

Corollary 37.4. Since CX (τ ) is the autocorrelation of X(t) − X , it veries


(37.43), and thus, from (37.53),
2
|CX (τ )| ≤ CX (0) = σX , ∀τ (37.54)
Theorem 37.6. The autocorrelation is limited by Autocorrelation is bounded
2 2
2
X − σX 2
≤ RX (τ ) ≤ X + σX = X 2 = RX (0), ∀τ (37.55)
Proof. From (37.52) we know that
RX (τ ) = CX (τ ) + E[X]2 (37.56)
So, from (37.54),
2 2
−σX ≤CX (τ ) ≤ σX
2 2 2
2
⇒ −σX 2
+ X ≤ CX (τ ) + X ≤ σX +X (37.57)
| {z }
RX (τ )

Concerning the upper limit, see (37.24) and (37.38).


Remark 37.10. This shows that if X(t) has a mean value then RX (τ ) also has Mean value of RX (τ )
2
a mean value. This mean value is in fact X . This is clear from (37.55) for a
constant signal (which has σX
2
= 0).
The limits in (37.55) show that autocorrelation can be normalised. Autocorrelation coecient

Denition 37.11. The autocorrelation coecient ρX (τ ), that veries −1 ≤


ρX (τ ) ≤ 1, is given by
2
RX (τ ) − X CX (τ )
ρX (τ ) = 2 = 2 (37.58)
σX σX
Remark 37.11. Some authors call autocorrelation to the autocorrelation co-
ecient.
Consider a signal in discrete time given by Autocorrelation and auto-
T covariance matrices
X = X0 X1 X2 · · · Xn
T
(37.59)

= X(0) X(Ts ) X(2Ts ) · · · X(nTs )
We can arrange in matrices the values of its autocorrelation
 
RX (0) RX (1) RX (2) ··· RX (n)
 RX (−1)
 RX (0) RX (1) · · · RX (n − 1)

RX = 
 RX (−2) R X (−1) R X (0) · · · RX (n − 2)
.. .. .. .. ..

. . . . .
 
 
RX (−n) RX (−n + 1) RX (−n + 2) · · · RX (0)
 
X0 X0 X0 X1 X0 X2 · · · X0 Xn
 X1 X0 X1 X1 X1 X2 · · · X1 Xn 
 
= E  X2 X0 X2 X1 X2 X2 · · · X2 Xn 
 
 .. .. .. .. .. 
 . . . . . 
Xn X0 Xn X1 Xn X2 · · · Xn Xn
 
X(0)X(0) X(0)X(Ts ) X(0)X(2Ts ) ··· X(0)X(nTs )
 X(Ts )X(0)
 X(T s )X(Ts ) X(T s )X(2Ts ) ··· X(Ts )X(nTs ) 
= E  X(2Ts )X(0) X(2Ts )X(Ts ) X(2Ts )X(2Ts )
 ··· X(2Ts )X(nTs ) 
.. .. .. .. ..

. . . . .
 
 
X(nTs )X(0) X(nTs )X(Ts ) X(nTs )X(2Ts ) ··· X(nTs )X(nTs )
= E XXT (37.60)

510 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

and the values of its autocovariance


 
CX (0) CX (1) CX (2) ··· CX (n)
 CX (−1)
 C X (0) CX (1) ··· CX (n − 1)

CX = 
 CX (−2) CX (−1) CX (0) ··· CX (n − 2)
.. .. .. .. ..

. . . . .
 
 
CX (−n) CX (−n + 1) CX (−n + 2) ··· CX (0)
 
ρX (0) ρX (1) ρX (2) ··· ρX (n)
 ρX (−1)
 ρ X (0) ρX (1) ··· ρX (n − 1)

2  ρX (−2)
= σX  ρ X (−1) ρX (0) ··· ρX (n − 2)
.. .. .. .. ..

. . . . .
 
 
ρX (−n) ρX (−n + 1) ρX (−n + 2) · · · ρX (0)
 
X0 X0 X0 X1 X0 X2 · · · X0 Xn
 X1 X0
 X1 X1 X1 X2 · · · X1 Xn 

= E  X2 X0
 X2 X1 X2 X2 · · · X2 Xn 
 .. .. .. .. .. 

 . . . . . 
Xn X0 Xn X1 Xn X2 ··· Xn Xn
 
(X(0) − X)(X(0) − X) (X(0) − X)(X(Ts ) − X) (X(0) − X)(X(2Ts ) − X) ··· (X(0) − X)(X(nTs ) − X)
 (X(Ts ) − X)(X(0) − X) (X(Ts ) − X)(X(Ts ) − X) (X(Ts ) − X)(X(2Ts ) − X) ··· (X(Ts ) − X)(X(nTs ) − X) 
 
= E  (X(2Ts ) − X)(X(0) − X) (X(2Ts ) − X)(X(Ts ) − X) (X(2Ts ) − X)(X(2Ts ) − X) ··· (X(2Ts ) − X)(X(nTs ) − X) 

.. .. .. .. ..

.
 
 . . . . 
(X(nTs ) − X)(X(0) − X) (X(nTs ) − X)(X(Ts ) − X) (X(nTs ) − X)(X(2Ts ) − X) · · · (X(nTs ) − X)(X(nTs ) − X)
h T i
(37.61)

=E X−X X−X

RX = RTX Since RX (τ ) = RX (−τ ) and CX (τ ) = CX (−τ ), matrices RX and CX are


CX = CTX symmetric. The farther from the main diagonal, the poorer the estimations will
be, as already mentioned about RX (τ ).

37.3 Relations between stochastic processes


Since we are studying systems, we often have to study two stochastic processes
Joint probability distribu- simultaneously: an input and an output. In this situation, their joint proba-
tion bility distribution is needed.
Joint PDF Denition 37.12. The joint probability distribution function (joint PDF)
fXY (x, y), of two variables that assume values in a continuous set is dened so
that

fX,Y (x, y) ≥ 0, ∀x, y (37.62)



P x1 ≤ X(t) ≤ x2 ∧ y1 ≤ Y (t) ≤ y2 = P x1 ≤ X(t) ≤ x2 | y1 ≤ Y (t) ≤ y2 P y1 ≤ Y (t) ≤ y2

= P y1 ≤ Y (t) ≤ y2 | x1 ≤ X(t) ≤ x2 P x1 ≤ X(t) ≤ x2
Z y2 Z x2
= fXY (x, y) dx dy, x1 < x2 , y1 < y2
y1 x1
(37.63)
Z +∞ Z +∞
fXY (x, y) dx dy = 1 (37.64)
−∞ −∞

Joint PMF Denition 37.13. The joint probability mass function (joint PMF) fXY (x, y),
of two variables that assume values in a discrete set is dened so that

fXY (x, y) = P X(t) = x ∧ Y (t) = y

= P X(t) = x | Y (t) = y P (Y (t) = y)
(37.65)

= P Y (t) = y | X(t) = x P (X(t) = x)
0 ≤ fXY (x, y) ≤ 1, ∀x, y (37.66)
XX
fXY (x, y) = 1 (37.67)
x y
37.3. RELATIONS BETWEEN STOCHASTIC PROCESSES 511

t CDF Denition 37.14. The joint cumulative distribution function (joint CDF)
of two probability distributions is a function FXY (x, y) such that

FXY (x, y) = P (X(t) ≤ x ∧ Y (t) ≤ y)


= P (X(t) ≤ x | Y (t) ≤ y) P (Y (t) ≤ y)
= P (Y (t) ≤ y | X(t) ≤ x) P (X(t) ≤ x) (37.68)

The joint CDF of a joint PDF is given by


Z y Z x
FX,Y (x, y) = fX,Y (x, y) dx dy (37.69)
−∞ −∞
∂ 2 FX,Y (x, y)
fX,Y (x, y) = (37.70)
∂x∂y
and the joing CDF of a joint PMF is given by
Ny Ny
X X
FX,Y (x, y) = fX,Y (xk , ym ), (37.71)
m=1 k=1
x1 , x2 , . . . , xk ≤ x < xk+1 , xk+2 , . . . , xNx
y1 , y2 , . . . , xm ≤ y < ym+1 , ym+2 , . . . , yNy

Just as we did when we had only one stochastic process, each of the following
statistical properties will be
ˆ dened for two stochastic processes;

ˆ numerically approximated from the denition to be estimated from two


signals that measure particular instances of the stochastic processes. Again,
these expressions can be applied to any signals, not just in the presence
of stochastic processes.
Denition 37.15. The cross-correlation, or simply correlation, RXY (t1 , t2 ) Correlation
of two stochastic processes depends on two time instants t1 and t2 and is given
by

RXY (t1 , t2 ) = E [X(t1 )Y (t2 )] (37.72)

Remark 37.12. The autocorrelation RX (t1 , t2 ) is the correlation of a signal


with itself RXX (t1 , t2 ).
Remark 37.13. For stationary stochastic processes,
RXY (t1 , t2 ) = RXY (t1 + ∆t, t2 + ∆t), ∀t1 , t2 , ∆t (37.73)

Since ∆t can take any value, we can make ∆t = −t1 and conclude that

RXY (t1 , t2 ) = RXY (0, t2 − t1 ), ∀t1 , t2 (37.74)

In other words, for stationary processes the correlation only depends on the
time interval between two instants τ = t2 − t1 :

RXY (τ ) = E [X(t)Y (t + τ )] , ∀t (37.75)

While this is similar to what happens with the autocorrelation, the corre-
lation, unlike the autocorrelation, is not an even function in the general case.
Figure 37.9 illustrates why.
Additionally, the order of the signals X(t) and Y (t) matters. RXY (τ ) = RY X (−τ )
Theorem 37.7.

RXY (τ ) = E [X(t)Y (t + τ )] = E Y (t + τ )X(t) =
| {z }
t0
0 0
= E [Y (t )X(t − τ )] = RY X (−τ ) (37.76)

Theorem 37.8.
(37.77)
p p
− RX (0)RY (0) ≤ RXY (τ ) ≤ RX (0)RY (0), ∀τ
512 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

Figure 37.9: Top: in autocorrelation, a signal is correlated with itself, so it does


not matter which of the two is shifted in time. Bottom: in the correlation of
two dierent signals, the product depends on which signal is being shifted in
time.

Proof. The proof diers from that of (37.43): a similar reasoning would lead
to more conservative boundaries for RXY (τ ). This time it has to be argued
that the expected value E[x] is a norm, and consequently, the Cauchy-Schwartz
inequality, which in the general case states that a norm veries
2
|hu, vi| ≤ hu, ui hv, vi (37.78)

gives, for the expected value,


2
E[ab] ≤ E a2 E b2 (37.79)

Consequently,
2 h i h i
2 2
E [X(t)Y (t + τ )] ≤ E (X(t)) E (Y (t + τ ))

= E [X(t)X(t)] E [Y (t + τ )Y (t + τ )] (37.80)
| {z } | {z }
RX (t−t)=RX (0) RY (t+τ −(t+τ ))=RY (0)

and the result follows immediately.


Once more, narrower limits can be found, given below in (37.91).
Remark 37.14. Notice that, while (37.43) shows that RX (τ ) has its maximum
value at τ = 0, (37.77) shows no such thing for RXY (τ ). Its maximum value
can be anywhere.
Example 37.6. Let X(t) = sin(2πt) and Y (t) = cos(2πt), and remember that
nothing is more similar to a signal than itselft. Obviously, RXY (τ ) will have a
maximum when the two sinusoids are in phase, i.e. for τ = 43 + 2kπ, k ∈ Z.
When τ = 0, the sinusoids are not in phase, and there is no maximum. See
Figure 37.10.
Estimating a correlation is similar to estimating an autocorrelation. The
same comments apply on how τ cannot get close to tnal , or ν close to n:
ˆ In the continuous case, for measurements from t = 0 to t = tnal :
Z tnal −τ
1
RXY (τ ) = x(t)y(t + τ ) dt (37.81)
tnal − τ 0

ˆ In discrete time with sampling time Ts , for n + 1 measurements from t = 0


to t = Ts n:
n−ν
1 X
RXY (ν) = Xk Yk+ν (37.82)
n−ν+1
k=0
37.3. RELATIONS BETWEEN STOCHASTIC PROCESSES 513

Figure 37.10: Correlation of X(t) = sin(2πt) and Y (t) = cos(2πt). When τ = 34 ,


signals X(t) and Y (t + 34 ) are in phase, and their correlation has a maximum.

Figure 37.11: Correlation of two independent random signals with normal dis-
tribution.

ˆ If τ tnal , or ν n, (37.81)-(37.82) can be approximated with biased


estimations as in (37.41)(37.42).
ˆ Adapting the Matlab code from Example 37.5 for the correlation of two
signals is obvious.
ˆ The correlation can also be found in Matlab using function xcorr (the Matlab function xcorr
x stands for cross ), using option 'unbiased', as in the next example.
Option 'biased' returns the biased a estimation as in (37.41)(37.42).
Of course, this function can also be used for the autocorrelation, if given
the same signal twice.
Example 37.7. The correlation of two independent random signals with normal
distribution can be found as
figure,plot(xcorr(randn(1,1000),randn(1,1000),'unbiased'))
and is shown in Figure 37.11. There are 1000 points in each signal; xcorr
returns 1999 points and τ = 0 is found halfway through, in the 1000th point.
The result should be zero everywhere, and is in fact close to zero save for large
values of |τ |. That is because very few points are left to calculate the correlation;
never forget that results can only be trusted when |τ | tnal .
Denition 37.16. The covariance CXY (t1 , t2 ) of two stochastic processes is Covariance
the correlation of their deviations from the mean:
h i
CXY (t1 , t2 ) = E (X(t1 ) − E[X]) (Y (t2 ) − E[Y ]) (37.83)

Remark 37.15. Since the covariance is a correlation, then


ˆ for stationary processes it depends only on the time delay τ :
h i
CXY (τ ) = E (X(t) − E[X]) (Y (t + τ ) − E[Y ]) (37.84)

ˆ it is not in general even, but

CXY (τ ) = CY X (−τ ) (37.85)


514 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

ˆ it is estimated numerically in the same way.


Relation between cor
Lemma 37.3. tion and covariance

h i
CXY (τ ) = E (X(t) − E[X]) (Y (t + τ ) − E[Y ])
= E [X(t)Y (t + τ ) − X(t)E[Y ] − E[X]Y (t + τ ) + E[X]E[Y ]]
= E [X(t)Y (t + τ )] − E [X(t)E[Y ]] − E [E[X]Y (t + τ )] + E [E[X]E[Y ]]
= E [X(t)Y (t + τ )] −E[X]E[Y ] − E[X]E[Y ] + E[X]E[Y ]
| {z }
RXY (τ )

= RXY (τ ) − E[X]E[Y ] (37.86)

Corollary 37.5. If either X = 0 or Y = 0, then CXY (τ ) = RXY (τ ).


Covariance is bounded
Theorem 37.9.

−σX σY ≤ CXY (τ ) ≤ σX σY , ∀τ (37.87)

Proof. Again, the covariance is a correlation:


h i
CXY (τ ) = E (X(t) − E[X]) (Y (t + τ ) − E[Y ]) = R(X−X)(Y −Y ) (τ ) (37.88)

Thus, it veries (37.77):


q q
− RX−X (0)RY −Y (0) ≤ R(X−X)(Y −Y ) (τ ) ≤ RX−X (0)RY −Y (0) (37.89)
| {z }
CXY (τ )

(37.38) shows that RX−X (0) = σX


2
, so

q q
− 2 σ2 ≤ C
σX Y XY (τ ) ≤
2 σ2
σX Y (37.90)

and the result follows immediately.

Correlation is bounded Corollary 37.6. From (37.86) and (37.87),

E[X]E[Y ] − σX σY ≤ CXY (τ ) + E[X]E[Y ] ≤ E[X]E[Y ] + σX σY (37.91)


| {z }
RXY (τ )

Correlation coecient Correlation (and covariance) can be normalised just like the autocorrelation
(and the autocovariance).

Denition 37.17. The correlation coecient ρXY (τ ), that veries −1 ≤


ρXY (τ ) ≤ 1, is given by

RXY (τ ) − X Y CXY (τ )
ρXY (τ ) = = (37.92)
σX σY σX σY

Remark 37.16. A scalar ρXY is sometimes given as correlation coecient.


This is understood to be ρXY (0).

The correlation coecient is returned by Matlab function xcorr using op-


tion 'coeff'.
Correlation and covari- Matrices with the values of the correlation
ance matrices
37.4. OPERATIONS WITH STOCHASTIC PROCESSES 515
 
RXY (0) RXY (1) RXY (2) ··· RXY (n)
 RXY (−1)
 RXY (0) RXY (1) ··· RXY (n − 1)

RXY =  RXY (−2)
 RXY (−1) RXY (0) ··· RXY (n − 2)
.. .. .. .. ..

. . . . .
 
 
RXY (−n) RXY (−n + 1) RXY (−n + 2) ··· RXY (0)
 
X0 Y0 X0 Y1 X0 Y2 · · · X0 Yn
 X1 Y0 X1 Y1 X1 Y2 · · · X1 Yn 
 
= E  X2 Y0 X2 Y1 X2 Y2 · · · X2 Yn 
 
 .. .. .. .. .
.. 
 . . . . 
Xn Y0 Xn Y1 Xn Y2 · · · Xn Yn
 
X(0)Y (0) X(0)Y (Ts ) X(0)Y (2Ts ) ··· X(0)Y (nTs )
 X(Ts )Y (0)
 X(T s )Y (Ts ) X(Ts )Y (2Ts ) ··· X(Ts )Y (nTs ) 
=E
 X(2Ts )Y (0) X(2Ts )Y (Ts ) X(2Ts )Y (2Ts ) ··· X(2Ts )Y (nTs ) 
.. .. .. .. ..

. . . . .
 
 
X(nTs )Y (0) X(nTs )Y (Ts ) X(nTs )Y (2Ts ) ··· X(nTs )Y (nTs )
= E XYT (37.93)

and the covariance


 
CXY (0) CXY (1) CXY (2) ··· CXY (n)
 CXY (−1)
 CXY (0) CXY (1) ··· CXY (n − 1)

CXY =  CXY (−2)
 CXY (−1) CXY (0) ··· CXY (n − 2)
.. .. .. .. ..

. . . . .
 
 
CXY (−n) CXY (−n + 1) CXY (−n + 2) · · · CXY (0)
 
ρXY (0) ρXY (1) ρXY (2) ··· ρXY (n)
 ρXY (−1)
 ρ XY (0) ρXY (1) ··· ρXY (n − 1)

 ρXY (−2)
= σX σY  ρ XY (−1) ρXY (0) ··· ρXY (n − 2)
.. .. .. .. ..

. . . . .
 
 
ρXY (−n) ρXY (−n + 1) ρXY (−n + 2) ··· ρXY (0)
| {z }
ρXY
 
(X0 − X)(Y0 − Y ) (X0 − X)(Y1 − Y ) (X0 − X)(Y2 − Y ) ··· (X0 − X)(Yn − Y )
 (X1 − X)(Y0 − Y ) (X1 − X)(Y1 − Y ) (X1 − X)(Y2 − Y ) ··· (X1 − X)(Yn − Y ) 
 
= E  (X2 − X)(Y0 − Y ) (X2 − X)(Y1 − Y ) (X2 − X)(Y2 − Y ) ··· (X2 − X)(Yn − Y ) 

.. .. .. .. ..

.
 
 . . . . 
(Xn − X)(Y0 − Y ) (Xn − X)(Y1 − Y ) (Xn − X)(Y2 − Y ) · · · (Xn − X)(Yn − Y )
 
(X(0) − X)(Y (0) − Y ) (X(0) − X)(Y (Ts ) − Y ) (X(0) − X)(Y (2Ts ) − Y ) ··· (X(0) − X)(Y (nTs ) − Y )
 (X(Ts ) − X)(Y (0) − Y ) (X(Ts ) − X)(Y (Ts ) − Y ) (X(Ts ) − X)(Y (2Ts ) − Y ) ··· (X(Ts ) − X)(Y (nTs ) − Y ) 
 
= E  (X(2Ts ) − X)(Y (0) − Y ) (X(2Ts ) − X)(Y (Ts ) − Y ) (X(2Ts ) − X)(Y (2Ts ) − Y ) ··· (X(2Ts ) − X)(Y (nTs ) − Y ) 

.. .. .. .. ..

.
 
 . . . . 
(X(nTs ) − X)(Y (0) − Y ) (X(nTs ) − X)(Y (Ts ) − Y ) (X(nTs ) − X)(Y (2Ts ) − Y ) · · · (X(nTs ) − X)(Y (nTs ) − Y )
h T i
(37.94)

=E X−X Y−Y

can be found as in the case of RX and CX . But, unlike them, matrices RXY
and CXY are not symmetric. The matrix denoted by ρXY in (37.94) is the Correlation coecient ma-
correlation coecient matrix. trix

37.4 Operations with stochastic processes


Theorem 37.10. Let X(t) and Y (t) be stochastic processes with correlation
coecient ρXY = ρXY (0). Then

E [X(t) + Y (t)] = E [X(t)] + E [Y (t)] (37.95)


2
σX+Y = 2
σX + σY2 + 2ρXY σX σY (37.96)
E [X(t) − Y (t)] = E [X(t)] − E [Y (t)] (37.97)
2
σX−Y = 2
σX + σY2 − 2ρXY σX σY (37.98)
E [X(t)Y (t)] = E [X(t)] E [Y (t)] + ρXY σX σY (37.99)
516 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

Proof. (37.95) and (37.97) have already been used and can be proved from the
fact that the limit of the mean is the expected value, as stated in (37.21).
Assuming continuous time,
Z tnal
1
E[X(t) ± Y (t)] = lim x(t) ± y(t) dt
tnal →+∞ tnal 0
Z tnal Z tnal
1 1
= lim x(t) dt ± lim y(t) dt = E[X(t)] ± E[Y (t)]
tnal →+∞ tnal 0 tnal →+∞ tnal 0
(37.100)

The discrete time case is similar.


(37.99) is an obvious consequence of denition (37.92) when τ = 0:
RXY (0)
z }| {
E[X(t)Y (t)] −X Y
ρXY = (37.101)
σX σY
(37.96) and (37.98) are obtained from

E (X(t) ± Y (t))2 = E (X(t))2 ± 2X(t)Y (t) + (Y (t))2


= E (X(t))2 + E (Y (t))2

±2 E [X(t)Y (t)]
| {z } | {z } | {z }
2
E[X(t)]2 +σX E[X(t)]E[Y (t)]+ρXY σX σY 2
E[Y (t)]2 +σY
(37.102)

where we made use of (37.24) and (37.99). Thus

E (X(t) ± Y (t))2 = E[X(t)]2 + σX2


± 2E[X(t)]E[Y (t)] ± 2ρXY σX σY + E[Y (t)]2 + σY2

2
2
= σX + σY2 ± 2ρXY σX σY + E[X(t)] ± E[Y (t)]
| {z }
2
E[X(t)±Y (t)]

(37.103)

Applying (37.24) once more,


2
E (X(t) ± Y (t))2 = E[X(t) ± Y (t)] + σX2
+ σY2 ± 2ρXY σX σY (37.104)

| {z }
2
σX±Y

Example 37.8. The following commands show what happens for two uncorre-
lated signals with normal distribution:
>> X = randn(1,10000);
>> Y = randn(1,10000);
>> rho = xcorr(X,Y,0,'coeff')
rho =
0.0068
>> % this is the correlation coefficient for tau=0; it should be zero
>> meanX = mean(X), meanY = mean(Y) % these should be zero
meanX =
-0.0078
meanY =
0.0139
>> varX = var(X), varY = var(Y) % these should be one
varX =
1.0198
varY =
1.0156
>> S = X+Y;
>> mean(S), meanX+meanY % these should be the same
ans =
0.0061
ans =
0.0061
37.4. OPERATIONS WITH STOCHASTIC PROCESSES 517

>> var(S), varX+varY+2*rho*sqrt(varX*varY) % these should be the same


ans =
2.0495
ans =
2.0493
>> D = X-Y;
>> mean(D), meanX-meanY % these should be the same
ans =
-0.0216
ans =
-0.0216
>> var(D), varX+varY-2*rho*sqrt(varX*varY) % these should be the same
ans =
2.0212
ans =
2.0214
>> P = X.*Y;
>> mean(P), meanX*meanY+rho*sqrt(varX*varY) % these should be the same
ans =
0.0070
ans =
0.0069

Example 37.9. Variables X and S of the previous example are correlated,


since S was obtained from X .
>> rhoXS = xcorr(X,S,0,'coeff')
rhoXS =
0.7102
>> meanS = mean(S); varS = var(S);
>> S2 = X+S;
>> mean(S2), mean(X)+mean(S) % these should be the same
ans =
-0.0016
ans =
-0.0016
>> var(S2), varX+varS+2*rhoXS*sqrt(varX*varS) % these should be the same
ans =
5.1231
ans =
5.1229

Glossary
E o senhor extraterrestre
viu-se um pouco atrapalhado.
Quis falar mas disse pi,
estava mal sintonizado.

Carlos Paião (1957 „1988), O Senhor Extraterrestre

autocorrelation autocorrelação
autocorrelation coecient coeciente de autocorrelação
autocovariance autocovariância
bias viés
biased enviesado
Brownian motion movimento Browniano
correlation correlação
correlation coecient coecient correlação
covariance covariância
cross correlation correlação cruzada
518 CHAPTER 37. STOCHASTIC PROCESSES AND SYSTEMS

cumulative distribution function função de distribuição acumulada


ergodicity ergodicidade
ergodic process processo ergódico
expected value valor esperado
joint probability distribution distribuição conjunta de probabilidades
mean média
probability distribution distribuição de probabilidades
probability distribution function função densidade de probabilidade
probability mass function função de probabilidade
pseudo-random number generator gerador de números pseudo-aleatórios
quasi-stationarity quase-estacionaridade
random walk passeio aleatório
standard deviation desvio padrão
stationarity estacionaridade
stochasticity estocasticidade
stochastic process processo estocástico
variance variância

Exercises
1. Question.
Chapter 38

Spectral density
In the last chapter, stochastic processes and systems were characterised using
dierent statistical properties. These were often functions of time. Among
them were the autocorrelation and the crosscorrelation; assuming ergodicity,
they depended on a time dierence.
The bilateral Fourier transforms of the autocorrelation and the crosscorre-
lation, which of course depend on frequency, turn out to be very important
functions. To see why, rst we must study the Fourier transform better.

38.1 The bilateral Fourier transform


Denition 38.1. The bilateral Fourier transform is the Fourier transform, as
in (2.87), corresponding to the bilateral Laplace transform (2.2); that is to say,

Z +∞
F [f (t)] = f (t)e−jωt dt (38.1)
−∞

We will need an explicit expression for the inverse Fourier transform, which
we already met in Example 2.25. To nd it, we rst need a result about function
δ(t), which we met in Remark 10.2.
Integral form of δ(t)
Lemma 38.1.
Z +∞
ejωt dω = 2πδ(t) (38.2)
−∞

Proof.

e−jΩt d(−Ω)
R0
+∞
z }| {
Z +∞ Z 0 Z +∞
jωt jωt
e dω = e dω + ejωt dω
−∞ −∞ 0
Z +∞ Z +∞
= e −jωt
dω + ejωt dω (38.3)
0 0

These integrals have integrands which are limited but do not vanish at innity,
since

Z +∞ Z +∞ Z +∞ Z +∞
−jωt jωt

e dω + e dω = cos(−ωt) + j sin(−ωt) dω + (cos ωt + j sin ωt) dω
0 0 0 0
(38.4)

519
520 CHAPTER 38. SPECTRAL DENSITY

It is possible to limit them with a subterfuge:


vanishes at +∞ vanishes at +∞
Z +∞ Z +∞ z }| { Z +∞ z }| {
−jωt
ejωt
dω = lim+ e| {z } e−ωε dω + e jωt
e−ωε dω
−∞ ε→0 0 0
|{z}
limited limited
Z +∞ Z +∞
= lim e−jωt e−jω(−jε) dω + ejωt ejω(jε) dω
ε→0+ 0 0
 
Z +∞ Z +∞
−j(t−jε)ω
= lim+  |e {z } dω + e|j(t+jε)ω
{z } dω

ε→0 0 0
vanishes at +∞ vanishes at +∞
+∞ +∞ !
1 1
= lim+ e−j(t−jε)ω
+ ej(t+jε)ω
ε→0 −j(t − jε)ω=0 j(t + jε) ω=0

j −j
0 − e0 + 0 − e0

= lim+
ε→0 t − jε | {z } t + jε | {z }
−1 −1

j j jt + ε − jt + ε 2ε
= lim − = lim = lim 2
ε→0+ t + jε t − jε ε→0+ t2 + ε2 ε→0+ t + ε2
(38.5)

Consequently,

ˆ if t 6= 0,
Z +∞

ejωt dω = lim+ =0 (38.6)
−∞ ε→0 t2 + ε2

ˆ if t = 0,
Z +∞
2ε 2
ejωt dω = lim+ = lim+ = +∞ (38.7)
−∞ ε→0 ε2 ε→0 ε

This is the same as (10.15)(10.16), so all that is left is to see if a relation similar
to (10.17)(10.18) holds. Thus we calculate
Z +∞ Z +∞
2ε 1 dt
dt = 2 (38.8)
t + ε2
2 t 2
+1 ε

−∞ −∞
ε

Using variable change

t
τ= (38.9)
ε
t = −∞ ⇒ τ = −∞ (38.10)
t = +∞ ⇒ τ = +∞ (38.11)
dt
dτ = (38.12)
ε
we obtain
Z +∞ Z +∞
2ε 1 +∞
π π
2 2
dt = 2 2
dτ = 2 [arctan τ ]τ =−∞ = 2 − − = 2π
−∞ t + ε −∞ τ + 1 2 2
(38.13)

Since this integral is 2π larger than (10.17), the result follows.

We can now nd an explicit expression for F −1 [F (s)].

Inverse Fourier transform Theorem 38.1. Let f (t) be a function with bilateral Fourier transform F [f (t)] =
F (s). Then
Z +∞
1
f (t) = F (jω)ejωt dω (38.14)
2π −∞
38.1. THE BILATERAL FOURIER TRANSFORM 521

Proof. This can be shown replacing the denition of the bilateral Fourier trans-
form (38.1) in (38.14), and applying (38.2) when needed:
Z +∞ Z +∞
1
f (t) = f (τ )e−jωτ dτ ejωt dω
2π −∞ −∞
Z +∞ Z +∞
1
= f (τ )ejω(t−τ ) dω dτ
2π −∞ −∞
Z +∞ Z +∞
1
= f (τ ) ejω(t−τ ) dω dτ
2π −∞ −∞
| {z }
2πδ(t−τ )
Z +∞
= f (τ )δ(t − τ ) dτ (38.15)
−∞

We now apply (10.21), and, since t − τ = 0 ⇔ τ = t, conclude that this integral


is in fact f (t).
With the inverse Fourier transform, we can prove two important results,
both known either as Parserval's theorem or Plancherel theorem.
Theorem 38.2. Let f (t) be a function with bilateral Fourier transform F [f (t)] =Parseval's theorem
F (jω). Then
Z +∞ Z +∞ Z +∞ Z +∞
1 2 1
|f (t)|2 dt = f (t)f (t) dt = |F (jω)| dω = F (jω)F (jω) dω
−∞ −∞ 2π −∞ 2π −∞
(38.16)
Proof. The proof uses (38.14) to obtain the complex conjugate of f (t):
F (−jω)e−jωt dω
1
R +∞
2π −∞
z }| {
Z +∞ Z +∞ Z +∞
1
f (t)f (t) dt = f (t) F (jω)ejωt dω dt
−∞ −∞ 2π −∞
Z +∞ Z +∞
1
= f (t)F (−jω)e−jωt dt dω
2π −∞ −∞
Z +∞ Z +∞
1
= F (−jω) f (t)e−jωt dt dω (38.17)
2π −∞ −∞
| {z }
F (jω)

Theorem 38.3. Let f (t) and g(t) be functions with bilateral Fourier transforms Generalised Parseval's
F [f (t)] = F (jω) and F [g(t)] = G(jω). Then theorem
Z +∞ Z +∞
1
f (t)g(t) dt = F (jω)G(jω) dω (38.18)
−∞ 2π −∞
Proof. The proof uses (38.14) to obtain both f (t) and the complex conjugate
of g(t):
G(−jΩ)e−jΩt dΩ
1
R +∞
2π −∞
z }| {
Z +∞ Z +∞ Z +∞ Z +∞
1 1
f (t)g(t) dt = F (jω)ejωt dω G(jΩ)ejΩt dΩ dt
−∞ −∞ 2π −∞ 2π −∞
(38.19)
Now we need (38.2) switching variables t and ω :
Z +∞
ejtω dt = 2πδ(ω) (38.20)
−∞

Replacing this in (38.19),


2πδ(ω−Ω)
zZ }| {
Z +∞ Z +∞ Z +∞ +∞
1 1 j(ω−Ω)t
f (t)g(t) dt = F (jω)G(−jΩ) e dt dΩ dω
−∞ 2π −∞ −∞ 2π −∞
| {z }
δ(ω−Ω)
(38.21)
522 CHAPTER 38. SPECTRAL DENSITY

Figure 38.1: Left: a function in time which is zero when t < 0, for which a
unilateral transform makes sense. Right: a cross-correlation of two signals, that
exists for both τ > 0 and τ < 0, and for which only a bilateral transform makes
sense.

Applying (10.21) and taking into account that ω − Ω = 0 ⇔ Ω = ω ,


Z +∞ Z +∞ Z +∞
1
f (t)g(t) dt = F (jω) G(−jΩ)δ(ω − Ω) dΩ dω (38.22)
−∞ 2π −∞ −∞
| {z }
G(−jω)

Remark 38.1. (38.16) can be seen as a particular case of (38.18) for f (t) =
g(t).

38.2 Denition and properties of the spectral den-


sity
PSD Denition 38.2. The power spectral density (PSD) SX (jω) of a signal
X(t) is the bilateral Fourier transform of its autocorrelation:

SX (jω) = F [RX (τ )]
Z +∞
= RX (τ )e−jωτ dτ (38.23)
−∞

CSD Denition 38.3. The cross-spectral density (CSD) SXY (jω) of two signals
X(t) and Y (t) is the bilateral Fourier transform of their correlation:

SXY (jω) = F [RXY (τ )]


Z +∞
= RXY (τ )e−jωτ dτ (38.24)
−∞

The reason why the bilateral transform is used for the PSD and the CSD,
while we have used unilateral transforms until now, should be clear:

ˆ We have been using unilateral transforms for time responses, that may
not be dened for t < 0, or are equal to 0 for t < 0. See Figure 38.1.

ˆ RX (τ ) and RXY (τ ) exist both for τ > 0 and τ < 0.

ˆ RXY (τ ) 6= RXY (−τ ) in the general case, and so values for both τ > 0 and
τ < 0 must be considered when calculating the Fourier transform. See
Figure 38.1.

ˆ While RX (τ ) = RX (−τ ), and thus we might think a unilateral transform


would suce in this case, since RX is a particular case of RXY when
the two signals are the same, it is convenient to always use a bilateral
transform.

Remark 38.2. Spectral densities are sometimes given as Laplace transforms,


not Fourier transforms. The conversion is straightforward:
38.2. DEFINITION AND PROPERTIES OF THE SPECTRAL DENSITY 523

ˆ From L to F :

s = jω (38.25)
2
s = −ω 2
(38.26)
3
s = −jω 3
(38.27)
4
s =ω 4
(38.28)
5
s = jω 5
(38.29)
..
.

ˆ From F to L :
s js
ω= = 2 = −js (38.30)
j j
2
ω = −s2
(38.31)
3
s
ω3 = − = js3 (38.32)
j
ω 4 = s4 (38.33)
5
s
ω5 = = −js5 (38.34)
j
..
.

When given as Fourier transforms, and thus functions of frequency ω , spectral


densities are often written as SX (ω) and SXY (ω), ommitting the imaginary unit
j.

The PSD has several important properties.

Theorem 38.4.
Z +∞
1
X 2 (t) = SX (ω) dω (38.35)
2π −∞

Proof. Inverting denition (38.23),

RX (τ ) = F −1 [SX (ω)]
Z +∞
1
= SX (ω)ejωt dω (38.36)
2π −∞

In particular,
Z +∞
1
RX (0) = jω0
SX (ω) e|{z} dω (38.37)
2π −∞
1

and we know from (37.38) that RX (0) = X 2 (t).

Theorem 38.5. A PSD is an even function of ω : SX (ω) = SX (−ω)

SX (ω) = SX (−ω) (38.38)

Proof. The PSD is a Fourier transform:


Z +∞
SX (−ω) = RX (τ )e−j(−ω)τ dτ (38.39)
−∞

Now we apply variable change

t = −τ ⇔ τ = −t (38.40)
τ = −∞ ⇔ t = +∞ (38.41)
τ = −∞ ⇔ t = −∞ (38.42)
dτ = −dt (38.43)
524 CHAPTER 38. SPECTRAL DENSITY

to get
Z −∞
SX (−ω) = RX (−t)ejω(−t) (−dt) (38.44)
+∞

We know from (37.36) that RX (−t) = RX (t), and so


Z +∞
SX (−ω) = RX (t)e−jωt dt = F [RX (t)] = SX (ω) (38.45)
−∞

The PSD only has even Remark 38.3. Because the PSD is even, and rational, it must be a function
powers of ω or s of even powers of ω if given as a Fourier transform, or of s if given as a Laplace
transform: ω 0 = 1, ω 2 , ω 4 , etc.. There can be no terms in s, s3 , etc.. These
missing odd powers of s are the ones that correspond to imaginary parts in the
The PSD is real valued Fourier transform: jω , (jω)3 = −jω 3 , (jω)5 = jω 5 , etc.. Thus, the PSD, when
given as a Fourier transform, has no imaginary part.
Terms in ω 2 , because of (38.31), correspond to Laplace transforms with pairs
of symmetric poles or zeros: one in the left side of the complex plane and one
in the right side. The same will happen for terms in ω 6 , ω 10 , and so on.
We saw that the correlation, unlike the autocorrelation, is not in the general
case an even function. Consequently, neither is the CSD, its Fourier transform,
an even function in the general case; i.e. it can include odd powers of ω if given
as a Fourier transform, or of s if given as a Laplace transform: s, s3 , etc.. These
The CSD is complex val- odd power of s mean that the CSD, when given as a Fourier transform, has an
ued imaginary part.
Example 38.1. SX (ω) = 10
ω 2 +1 corresponds to SX (s) = 10
−s2 +1 −1 , with
= − s210
poles ±1, which are symmetric.
The usefulness of the PSD can be seen from the following results.
Lemma 38.2. The auto-correlation of X(t) = sin t is
1
RX (τ ) = cos t (38.46)
2
Proof. We will consider an arbitrarily large nal time:
Z tnal −τ
1
RX (τ ) = lim sin(t) sin(t + τ ) dt
tnal →+∞ tnal − τ 0
Z tnal −τ
1
= lim sin(t) sin(t) cos(τ ) + cos(t) sin(τ ) dt
tnal →+∞ tnal − τ 0
Z tnal −τ
1
= lim sin2 (t) cos(τ ) dt +
tnal →+∞ tnal − τ 0
Z tnal −τ
1
lim sin(t) cos(t) sin(τ ) dt
tnal →+∞ tnal − τ 0
Z tnal −τ
1
= cos(τ ) lim sin2 (t) dt +
tnal →+∞ tnal − τ 0
Z tnal −τ
1 1
sin(τ ) lim sin(2t) dt (38.47)
tnal →+∞ tnal − τ 0 2

The last integral is limited; over each period, it has a zero mean: 0 12 sin(2t) dt =
0. Thus, the second limit is zero. As to the rst integral, since

cos(2t) = cos2 t − sin2 t = 1 − sin2 t − sin2 t = 1 − 2 sin2 t (38.48)

we make
Z tnal −τ
1 1 1
RX (τ ) = cos(τ ) lim − cos(2t) dt
tnal →+∞ tnal − τ
0 2 2
tnal −τ
1 t
= cos(τ ) lim
tnal →+∞ tnal − τ 2
0
Z tnal −τ
1 1
− cos(τ ) lim cos(2t) dt (38.49)
2 tnal →+∞ tnal − τ 0
38.2. DEFINITION AND PROPERTIES OF THE SPECTRAL DENSITY 525

Again, the last integral is limited, and thus the limit is zero. We are left with
1 tnal − τ − 0
RX (τ ) = cos(τ ) lim (38.50)
2 tnal →+∞ tnal − τ
and the result follows immediately.

Lemma 38.3. The Fourier transform of the complex exponential is


F ejat = 2πδ(ω − a) (38.51)

Proof. From (10.22) we know that L [δ(t)] = 1, and from (24.1) we know that
L [f (t − θ)] = F (s)e−θs . Thus L [δ(t − θ)] = e−θs ; the corresponding Fourier
transform is

F [δ(t − θ)] = e−jωθ (38.52)

Using the inverse Fourier transform (38.14),


Z +∞
1
δ(t − θ) = F −1 e−jωθ = e−jωθ ejωt dω

2π −∞
Z +∞
1
= ejω(t−θ) dω (38.53)
2π −∞

We will use this integral to nd the Fourier transform of the complex exponen-
tial:
Z +∞
F ejat = ejat e−jωt dt

−∞
Z+∞
= ejt(a−ω) dt (38.54)
−∞

The integral in (38.54) is the same as that in (38.53), with the following variable
changes:

ω becomes t (38.55)
t becomes a (38.56)
θ becomes ω (38.57)

Thus, F ejat = 2πδ(a − ω), which is zero everywhere, save at ω = a, just like

2πδ(ω − a).

Theorem 38.6. The PSD of X(t) = sin(at) is PSD of a sinusoid is an


impulse at its frequency
π π
SX (ω) = δ(ω − a) − δ(ω + a) (38.58)
2 2
(38.46) shows that SX (ω) = F 2 cos(at) , and since
1
Proof.

(
ejat = cos at + j sin at
⇒ ejat + e−jat = 2 cos at (38.59)
e−jat = cos at − j sin at

we can get
1 jat 1 −jat
SX (ω) = F e + F e (38.60)
4 4
Applying (38.51), the result follows immediately.

When computing the PSD of a sinusoid in practice, it is not an impulse


that is found, since that is of course impossible, but rather a signicant peak
at the frequency of the sinusoid. Likewise, when computing the PSD of a linear A signal's PSD shows its
combination of sinusoids, peaks will be found at the corresponding frequencies, spectral content
with heights proportional to the squares of the weights (because the signal is
multiplied by itself when computing RX (τ )). In other words, the PSD of a
signal gives us its spectral content.
526 CHAPTER 38. SPECTRAL DENSITY

Figure 38.2: Power spectral density of X = sin(t) + 3 sin(10t), found with the
code from Example 38.2.

Example 38.2. The PSD of X(t) = sin(t) + 5 sin(t) can be found using a
function to compute its autocorrelation
function [autocorrelation,tau] = R_X(t,X,m)
% function [autocorrelation,tau] = R_X(t,X,m)
% Finds the autocorrelation of X(t) at m points (default is length(t)/2).
n = length(t)-1;
if length(X)~=n+1, error('t and X must have the same length'), end
if nargin<3, m = floor(n/2); end
autocorrelation = zeros(1,m);
for k = 0 : m-1
autocorrelation(k+1) = sum( X(1:n-k+1) .* X(k+1:n+1) )/( n-k+1 );
end
autocorrelation = [autocorrelation(end:-1:2) autocorrelation];
tau = [ -t(m:-1:2) 0 t(2:m) ];
and a function that computes the PSD using the one above
function [S,w]=S_X(t,X,number_w)
% function [S,w]=S_X(t,X,number_w)
% Finds the PSD S(w) of X(t) at number_w frequencies (default 100 per
% decade) in a reasonable range of frequencies.
[autocorrelation,tau] = R_X(t,X);
Ts = mean(diff(t)); % sample time
wUp = floor(log10(pi/Ts));
wLow = ceil(log10(pi/t(end))); if wLow == wUp, wLow = wUp-1; end % at least 1 decade
if nargin == 3
wvector = logspace(wLow, wUp, number_w);
else
wvector = logspace(wLow, wUp, (wUp-wLow)*100+1);
end
S = zeros(size(wvector));
for k = 1:length(wvector)
w = wvector(k);
S(k) = trapz( autocorrelation .* exp(-1i*w*tau) ) * Ts;
end
if norm(imag(S))/norm(real(S)) > 1e-6
warning('Imaginary part of S not neglectable, something''s wrong')
end % sanity check
S = real(S);
w = wvector;
In this way, commands
>> Ts = 0.01; tfinal = 100;
>> t = 0 : Ts : tfinal;
>> X = sin(t) + 3*sin(10*t);
>> [S,w] = S_X(t,X); figure,semilogx(w,S),xlabel('\omega [rad/s]'),ylabel('PSD')
result in Figure 38.2.
Notice that:
38.3. NUMERICAL COMPUTATION OF THE PSD AND CSD 527

Figure 38.3: Power spectral density of X = sin(t) + 3 sin(3t) (left) and X =


sin(t) + 3.02 sin(3t) (right), found with the code from Example 38.2.

ˆ there are ripples in the PSD around the frequencies of the sinusoids;

ˆ the amplitude of the peaks of SX (ω) is very sensitive to the frequencies


where it is found. Figure 38.2 shows the results obtained with the code
above for signals X = sin(t) + 3 sin(3t) and X = sin(t) + 3 sin(3.02t). Even
though the PSD is being computed for 100 frequencies in each decade,
since in the rst case there is no precise match for 3 rad/s, the amplitude
is o by x%. In the second case, the match is far better, and the amplitude
is correct.

These numerical problems can be minimised, though never completely elimi-


nated, using windows, addressed in the next section.

38.3 Numerical computation of the PSD and CSD


Finding the PSD and the CSD as in Example 38.2 is not the best way to do so
computationally. This section is still being written.

ˆ Find PSD or CSD as product of F , better than F of convolution

ˆ cpsd(x,y) returns SY X (and not SXY !) because. . . reasons

ˆ Furthermore, to avoid the numerical problems mentioned in Example 38.2,


use windows etc. etc.

ˆ Say more about leakage Leakage

In the picture: National Pantheon, or Church of Saint Engratia, Lisbon (source:


http://www.panteaonacional.gov.pt/171-2/historia-2/), somewhen dur-
ing its construction (16821966).
528 CHAPTER 38. SPECTRAL DENSITY

Usual windows Some of the most usual windows, represented in Figures 38.4 and 38.5, are
the following. They are given as a function of t, in interval [0, tnal ], and are
zero outside this range. Matlab functions to create them are also shown;
they receive as argument the number of samples in interval [0, tnal ], and are
shown in the Figures using command wvtool, which shows the window's Fourier
transform.
ˆ Rectangular window, useful for signals with frequency content in a broad-
band (Matlab function rectwin):

w(t) = 1 (38.61)

Using no window is using Notice that this window corresponds, in fact, to doing nothing to the
a rectangular window signal. It is, thus, in a sense, the default window.
A Hann window often ˆ Hann (or Hanning) window, the most used one, useful for signals with
gives good results frequency content in a narrowband (Matlab function hann):
πt
w(t) = sin2 (38.62)
tnal

ˆ Hamming window, useful for signals with closely spaced frequencies


(Matlab function hamming):
2πt
w(t) = 0.54 − 0.46 cos (38.63)
tnal

ˆ Flat top window, useful for sinusoidal signals when amplitude accuracy is
more important than frequency accuracy (Matlab function flattopwin):
2πt 4πt
w(t) = 0.21557895 − 0.41663158 cos + 0.277263158 cos
tnal tnal
6πt 8πt
− 0.083578947 cos + 0.006947368 cos (38.64)
tnal tnal

ˆ Bartlett or triangular window (Matlab function bartlett):


t − tnal

w(t) = 1 − tnal2 (38.65)
2

ˆ Blackman window (Matlab function blackman):


2πt 4πt
w(t) = 0.42 − 0.5 cos + 0.08 cos (38.66)
tnal tnal
38.3. NUMERICAL COMPUTATION OF THE PSD AND CSD 529

Figure 38.4: Windows, plot for 64 samples between 0 and tnal , together with
their Fourier transforms. Continues in Figure 38.5.
530 CHAPTER 38. SPECTRAL DENSITY

Figure 38.5: Windows, plot for 64 samples between 0 and tnal , together with
their Fourier transforms. Continued from Figure 38.4.
38.4. WHITE NOISE 531

38.4 White noise


Denition 38.4. White noise is a stochastic process X(t) with autocorre-
lation RX (τ ) = RX (0) δ(τ ), i.e. the value assumed in each instant bears no
relation whatsoever to past values, and has no bearing whatsoever on future
values.

Example 38.3. In Figure 37.5, the signal in the lower plot, with normally
distributed random numbers, is white noise, or, rather, such an approximation
of white noise as is possible in practice.
The signal in the upper plot would also be (an approximation of) white noise
if it had no mean value.

Theorem 38.7. The PSD of white noise is constant over all frequencies. White noise has a constant
PSD
Proof.

L [δ(τ )] = 1 ⇒ F [δ(τ )] = 1 (38.67)

No analogical signal can have the autocorrelation of white noise. This is White noise does not exist
better seen taking the analogical signal as a digital signal with Ts → 0. Since
the autocorrelation is zero, the variation of the signal from one sample to the
next can take any value. For vanishing sampling times, the velocity would
become innite, which is impossible in practice, since this would require an
arbitrarily large energy. The same can be seen from the PSD: a constant value
over all frequencies, including arbitrarily large ones, would mean arbitrarily fast
oscillations, with an amplitude that never vanishes. (The argument bears a
resemblance with the one that shows that transfer functions must be strictly
proper, given in Section 11.4.)
Analogical signals can approximate white noise over a certain range of fre- White noise approximated
quencies if they have a (fairly) constant PSD in that range. The PSD will have in a frequency range
to decrease for larger frequencies. Digital signals have their frequency content Digital approximations of
limited by the sampling time; thus they can have a (fairly) constant PSD over white noise make more
all frequencies up to ωs , and appear as better approximations of white noise. sense
Of course, they do not have a constant frequency content for arbitrarily large
frequencies, just as analogical approximations of white noise do not.
So white noise cannot be found in practice just as an impulse cannot,
and just as unit steps normally have a ramp, fast as it may be, when changing
values. But the mathematical convenience of such signals, and their ability to
approximate situations frequently found in practice, justify their widespread
use.

Remark 38.4. White light is electromagnetic radiation white noise in the vis- Where white noise got its
ible spectrum. White noise got its name due to its similarity with white light. name from
Light, to be white, does not need to have frequency content outside the visi-
ble spectrum; it does not need to have any ultraviolet or infrared content; still
less gamma rays or radio waves (see Figure 38.6). Likewise, all signals that in
practice pass for white noise will have frequency content in a limited range of
frequencies only.

Denition 38.5. Coloured noise is noise which is not white. The color of Coloured noise
noise is the particular evolution of the PSD with frequency. In particular:
ˆ the PSD of pink noise has a slope of −10 dB/decade;

ˆ the PSD of brown noise has a slope of −20 dB/decade;

ˆ the PSD of blue noise has a slope of +10 dB/decade;

ˆ the PSD of violet noise has a slope of +20 dB/decade.

There are other colours, but these and white are the most frequent. Notice
that pink and blue noise can be obtained from white noise with fractional lter
1
s± 2 .
532 CHAPTER 38. SPECTRAL DENSITY

Figure 38.6: The electromagnetic spectrum (source: Wikimedia).

Glossary
coloured (colored, US) noise ruído colorido
colour (colour, US) of noise cor do ruído
cross-spectral density densidade espetral cruzada
power spectral density densidade de potência espetral
white noise ruído branco

Exercises
1. Question.
Chapter 39

Identication of continuous
stochastic models
Jenkins is a very good shot, said Fisher. A very good shot who can
pretend to be a very bad shot. Shall I tell you the second hint I hit
on, after yours, to make me think it was Jenkins? It was my cousin's
account of his bad shooting. He'd shot a cockade o a hat and a
weathercock o a building. Now, in fact, a man must shoot very
well indeed to shoot so badly as that. He must shoot very neatly to
hit the cockade and not the head, or even the hat. If the shots had
really gone at random, the chances are a thousand to one that they
would not have hit such prominent and picturesque objects. They
were chosen because they were prominent and picturesque objects.
They make a story to go the round of society.

Gilbert K. Chesterton (1874 „1936), The man who knew too much, I

This chapter concerns methods to identify a system when its input and
output are stochastic. These methods provide either the impulse response or
the frequency response of the system. From that point on, the procedures
studied in Part VI are applied.
In all that follows, assume a linear, stable or marginally stable system G(s),
with impulse response g(t) and static gain g0 . Its input is X(t) and its output
is

Z t
Y (t) = X(t) ∗ g(t) = X(t − τ )g(τ ) dτ (39.1)
0

as shown in Figure 39.1.

39.1 Identication in time


Theorem 39.1. The expected value of the output Y is the expected value of Mean value of the output
the input X multiplied by the static gain g0 . Y

Figure 39.1: System studied in this chapter.

533
534CHAPTER 39. IDENTIFICATION OF CONTINUOUS STOCHASTIC MODELS

Proof.

Z t
Y = lim E X(t − τ )g(τ ) dτ
t→+∞ 0
Z t
= lim E X(t − τ ) g(τ ) dτ
t→+∞ 0 | {z } |{z}
stochastic deterministic
Z t
= lim E[X(t − τ )] g(τ ) dτ
t→+∞ 0 | {z }
X (constant)
Z t
= X lim g(τ ) dτ
t→+∞ 0
Z t
= X lim g(τ )H(t − τ ) dτ
t→+∞ 0
= X lim g(t) ∗ H(t) (39.2)
t→+∞

This last limit is the steady-state value of the unit step response of G(s), i.e.
its static gain g0 . As assumed throughout this chapter, the system cannot be
unstable, otherwise the limit does not exist.

Example 39.1. A system with gain 5 receives an input with mean (approxi-
mately) equal to 12 :

>> t = 0 : 0.01 : 1000;


>> X = rand(1,length(t));
>> mean(X)
ans =
0.5004
>> s = tf('s'); G = 5/(s+1)
G =
5
-----
s + 1
Continuous-time transfer function.
>> Y = lsim(G,X,t);
>> mean(Y)
ans =
2.4994

The mean of the output is (approximately) 5 × 1


2 = 2.5.

Mean square value of the Theorem 39.2. The expected value of the square of the output Y 2 is
output
Z +∞ Z +∞
Y2 = RX (τ1 − τ2 )g(τ1 )g(τ2 ) dτ1 dτ2 (39.3)
0 0

Proof.

Y (t) Y (t)
zZ t
}| {Z
z
t
}| {
Y2 =E X(t − τ1 )g(τ1 ) dτ1 X(t − τ2 )g(τ2 ) dτ2
0 0
Z t Z t
=E X(t − τ1 )X(t − τ2 ) g(τ1 )g(τ2 ) dτ1 dτ2
0 0 | {z } | {z }
stochastic deterministic
Z tZ t
= E [X(t − τ1 )X(t − τ2 )] g(τ1 )g(τ2 ) dτ1 dτ2 (39.4)
0 0 | {z }
RX (t−τ2 −(t−τ1 ))=RX (τ1 −τ2 )

Autocorrelation of the out- Theorem 39.3. The autocorrelation of the output RY (τ ) is


put
Z +∞ Z +∞
RY (τ ) = RX (τ + τ1 − τ2 )g(τ1 )g(τ2 ) dτ1 dτ2 (39.5)
0 0
39.1. IDENTIFICATION IN TIME 535

Proof.

Y (t) Y (t+τ )
zZ t
}| { zZ
t
}| {
RY (τ ) = E X(t − τ1 )g(τ1 ) dτ1 X(t + τ − τ2 )g(τ2 ) dτ2
0 0
Z t Z t
=E X(t − τ1 )X(t + τ − τ2 ) g(τ1 )g(τ2 ) dτ1 dτ2
0 0 | {z } | {z }
stochastic deterministic
Z tZ t
= E [X(t − τ1 )X(t + τ − τ2 )] g(τ1 )g(τ2 ) dτ1 dτ2 (39.6)
0 0 | {z }
RX (t+τ −τ2 −(t−τ1 ))=RX (τ −τ2 +τ1 )

Theorem 39.4. If G(s) is stable, the correlations of input and output RXY (τ ) Correlation of input and
and RY X (τ ) are output

Z +∞
RXY (τ ) = RX (τ − τ1 )g(τ1 ) dτ1 (39.7)
0
Z +∞
RY X (τ ) = RX (τ + τ1 )g(τ1 ) dτ1 (39.8)
0

Proof.

Y (t+τ )
z }| {
Z t
RXY (τ ) = E X(t) X(t + τ − τ1 )g(τ1 ) dτ1
0
Z t
=E X(t)X(t + τ − τ1 ) g(τ1 ) dτ1
0 | {z } | {z }
stochastic deterministic
Z t
= E [X(t)X(t + τ − τ1 )] g(τ1 ) dτ1 (39.9)
0 | {z }
RX (t+τ −τ1 −t)=RX (τ −τ1 )
Y (t)
zZ }| {
t
RXY (τ ) = E X(t + τ ) X(t − τ1 )g(τ1 ) dτ1
0
Z t
=E X(t + τ )X(t − τ1 ) g(τ1 ) dτ1
0 | {z } | {z }
stochastic deterministic
Z t
= E [X(t + τ )X(t − τ1 )] g(τ1 ) dτ1 (39.10)
0 | {z }
RX (t−τ1 −(t+τ ))=RX (−τ1 −τ )

Since RX (−τ1 − τ ) = RX (τ + τ1 ), (39.8) follows immediately from (39.10).

For discrete signals, the integral in (39.7) is replaced with a rectangular Correlation of input and
approximation. It is more expedient to make use of the fact that RX (τ ) is even, output for discrete signals
and consider instead
Z +∞
RXY (τ ) = RX (τ − τ1 )g(τ1 ) dτ1
0
Z +∞
= RX (τ1 − τ )g(τ1 ) dτ1 (39.11)
0

Suppose that there are N + 1 samples of the impulse response g(kTs ), from
k = 0 to k = N , separated by sampling time Ts ; the autocorrelation R(kTs ),
which is an even function, is consequently known from k = −N to k = N . The
integral is approximated by N rectangles, and correlation Rx XY (nTs ) will be,
536CHAPTER 39. IDENTIFICATION OF CONTINUOUS STOCHASTIC MODELS

for successive values of τ = nTs , given by

N
X −1
RXY (0) = Ts RX (kTs ) g(kTs ) (39.12)
k=0
N
X −1
RXY (Ts ) = Ts RX (kTs − Ts ) g(kTs ) (39.13)
k=0
N
X −1
RXY (2Ts ) = Ts RX (kTs − 2Ts ) g(kTs ) (39.14)
k=0
..
.
N
X −1
RXY (nTs ) = Ts RX (kTs − nTs ) g(kTs ) (39.15)
k=0

These results can be arranged in matrix form:

n×1 n×N N ×1
z
 }| { z }| { z
}| {
RXY (0) RX (0) RX (Ts ) RX (2Ts ) ··· RX ((N − 1)Ts ) g(0)
 RXY (Ts ) 
 
 RX (−Ts )
 RX (0) RX (Ts ) ··· RX ((N − 2)Ts )    g(Ts ) 
 
 RXY (2Ts ) 
 = Ts  RX (−2Ts )
 RX (−Ts ) RX (0) ··· RX ((N − 3)Ts )   g(2Ts ) 
.. .. .. .. .. ..   .. 
  
. . . . . . . 
  
    
RXY (nTs ) RX (−nTs ) RX ((1 − n)Ts ) RX ((2 − n)Ts ) · · · RX ((N − 1 − n)Ts ) g(nTs )
| {z } | {z } | {z }
RXY RX g
(39.16)

The matrix is the autocorrelation matrix found in (37.60), save that, if values
of τ are never to approach tnal , there must be more columns than lines, i.e.
Finding the impulse re- n < N . If the autocorrelation of the input and the correlation of input and
sponse output are known, the impulse response of the plant can be found using the
pseudo-inverse of RX :

1 +
h(t) = R RXY (39.17)
Ts X

Example 39.2. This example is still being written. In the picture: Na-
tional Pantheon, or Church of Saint Engratia, Lisbon (source: http://www.
panteaonacional.gov.pt/171-2/historia-2/), somewhen during its construc-
tion (16821966).
39.2. IDENTIFICATION IN FREQUENCY 537

39.2 Identication in frequency


The following theorems provide dierent ways of obtaining the frequency re-
sponse of G(s).

Theorem 39.5. The cross-spectral densities of input and output and the spec-
tral density of the input are related by

SXY (ω) = G(jω)SX (ω) (39.18)


SY X (ω) = G(−jω)SX (ω) (39.19)

Proof. From (38.24) and (39.7),


Z +∞
SXY (ω) = RXY (τ )e−jωτ dτ
−∞
Z +∞ Z +∞
= RX (τ − τ1 )g(τ1 ) dτ1 e−jωτ dτ
−∞ 0
Z +∞ Z +∞
= g(τ1 ) RX (τ − τ1 )e−jωτ dτ dτ1 (39.20)
0 −∞

We now use the variable change

t = τ − τ1 ⇒ τ = t + τ1 (39.21)
τ = −∞ ⇒ t = −∞ (39.22)
τ = +∞ ⇒ t = +∞ (39.23)
dτ = dt (39.24)

to get
Z +∞ Z +∞
SXY (ω) = g(τ1 ) RX (t)e−jωt e−jωτ1 dt dτ1
0 −∞
Z +∞ Z +∞
= g(τ1 )e −jωτ1
dτ1 RX (t)e−jωt dt (39.25)
−∞
|0 {z }| {z }
F [g(t)]=G(jω) SX (ω)

The proof of (39.19) is similar to that of (39.18) and is left as exercise.

Corollary 39.1. From (39.18) and (39.19),


SXY (ω) G(jω)SX (ω)
=
SY X (ω) G(−jω) SX (ω)
| {z }
G(jω)

|G(jω)|ej∠G(jω)
=
|G(jω)|e−j∠G(jω)
= ej2∠G(jω) (39.26)

Theorem 39.6. The spectral densities of input and output are related by

SY (ω) = SX (ω)|G(jω)|2 (39.27)

Proof. From (38.23) and (39.5),


Z +∞
SY (jω) = RY (τ )e−jωτ dτ
−∞
Z +∞ Z +∞ Z +∞
= RX (τ + τ1 − τ2 )g(τ1 )g(τ2 ) dτ1 dτ2 e−jωτ dτ
−∞ 0 0
Z+∞ Z +∞ Z +∞
= g(τ1 )g(τ2 ) RX (τ + τ1 − τ2 )e−jωτ dτ dτ1 dτ2
0 0 −∞
(39.28)
538CHAPTER 39. IDENTIFICATION OF CONTINUOUS STOCHASTIC MODELS

We now use the variable change

t = τ + τ1 − τ2 ⇒ τ = t − τ1 + τ2 (39.29)
τ = −∞ ⇒ t = −∞ (39.30)
τ = +∞ ⇒ t = +∞ (39.31)
dτ = dt (39.32)

to get
Z +∞ Z +∞ Z +∞
SY (jω) = g(τ1 )g(τ2 ) RX (t)e−jωt ejωτ1 e−jωτ2 dt dτ1 dτ2
0 0 −∞
Z +∞ Z +∞ Z +∞
= g(τ2 )e−jωτ2 dτ2 g(τ1 )ejωτ1 dτ2 RX (t)e−jωt dt
−∞
|0 {z } |0 {z }| {z }
F [g(t)]=G(jω) G(−jω) SX (jω)
(39.33)

Finally, G(jω)G(−jω) = G(jω)G(jω) = |G(jω)|2 , which completes the proof.

Corollary 39.2. Replacing (39.27) in (38.35),


Z +∞
1
Y 2 (t) = SY (jω) dω
2π −∞
Z +∞
1
= SX (ω)|G(jω)|2 dω
2π −∞
Z +∞
1
= SX (ω)G(jω)G(−jω) dω (39.34)
2π −∞

So this is how the frequency response of G(s) can be found from spectral
densities SX (jω) and SY (jω) and from cross-spectral densities SXY (jω) and
SY X (jω):

Finding the gain ˆ The gain is either found from (39.27)


s
SY (ω)
|G(jω)| = (39.35)
SX (ω)

or from (39.18)

SXY (ω)
|G(jω)| =
(39.36)
SX (ω)

or from (39.19)

SY X (ω)
|G(jω)| = |G(−jω)| =
(39.37)
SX (ω)

Finding the phase ˆ The phase is either found from (39.26)



1 SXY (ω)
∠G(jω) = = log
2 SY X (ω)
j SXY (ω)
= − log (39.38)
2 SY X (ω)

or from (39.18)

SXY (ω)
∠G(jω) = ∠ (39.39)
SX (ω)

or from (39.19)

SY X (ω)
∠G(jω) = −∠G(−jω) = −∠ (39.40)
SX (ω)
39.2. IDENTIFICATION IN FREQUENCY 539

ing the frequency re- ˆ The entire frequency response is either found from (39.18)
se
SXY (ω)
G(jω) = (39.41)
SX (ω)
or from (39.19)

SY X (ω)
G(jω) = G(−jω) = (39.42)
SX (ω)

or conjugating (39.27) and (39.26)


s
SY (ω)SXY (ω)
G(jω) = |G(jω)|ej∠G(jω) = (39.43)
SX (ω)SY X (ω)

To verify if an identied frequency response is accurate, a function analogous


to the correlation coecient is used.
Denition 39.1. The coherence function γXY
2
is given by Coherence function

|SXY (ω)|2
2
γXY (ω) = (39.44)
|SX (ω)||SY (ω)|
Theorem 39.7. In the conditions of Figure 39.1, 2
γXY (ω) = 1 for a LTI if
all noise is accounted for
2
γXY (ω) ≤ 1, ∀ω (39.45)

Proof. From

2 |SXY (ω)|2
γXY (ω) =
|SX (ω)||SY (ω)|
|G(jω)SX (ω)|2
=
|SX (ω)|SX (ω)|G(jω)|2

|G(jω)|2 |SX (ω)|2


= =1 (39.46)
|G(jω)|2 |SX (ω)|2

In practice, γXY
2
(ω) is seldom 1. The limit case is that of an uncorrelated 0 ≤ γXY
2
(ω) ≤ 1
pair of input and output, and then
2
RXY (τ ) = 0 ⇒ SXY (ω) = 0 ⇒ γXY (ω) = 0 (39.47)

Consequently:
ˆ When γXY
2
(ω) = 1, a linear model G(s) relating input X with output Y
can be found from the data.
ˆ When γXY
2
(ω) < 1, no model can predict Y solely from X . This may
happen for several reasons: there is noise that could not be measured;
there is another input; there are non-linearities.
ˆ The magnitude of γXY
2
(ω) shows how good the model will be, and at what
frequencies it will perform better and worse.
ˆ When γXY
2
(ω) = 0, no model can be found.
Example 39.3. Consider the following linear system:
Ts = 0.01; % sample time
t = 0 : Ts : 1000;
X = rand(1,length(t)); % input
s = tf('s'); G = 5/(s+1);
Y = lsim(G,X,t); % output
Figure 39.2 shows the values of input X and output Y of plant G(s) during
some seconds.
The gain and phase of the frequency response of G(s) can be obtained from
X and Y using (39.35)(39.40) as follows. They will be compared with the
result of command freqresp.
540CHAPTER 39. IDENTIFICATION OF CONTINUOUS STOCHASTIC MODELS

Figure 39.2: Sample of input and output of the plant of Example 39.3.

Figure 39.3: Bode diagrams of the plant of Example 39.3.

% spectral densities
[Syx,F] = cpsd(X,Y,[],[],[],1/Ts); w = 2*pi*F;
Sxy = cpsd(Y,X,[],[],[],1/Ts); % remember that the order of X and Y is like this
Sxx = cpsd(X,X,[],[],[],1/Ts);
Syy = cpsd(Y,Y,[],[],[],1/Ts);
% gain
Gfreqresp = squeeze(freqresp(G,w));
Ggain = 20*log10(abs(Gfreqresp)); % this is what we should obtain
Ggain1 = 20*log10(sqrt(Syy./Sxx));
Ggain2 = 20*log10(abs(Sxy./Sxx));
Ggain3 = 20*log10(abs(Syx./Sxx));
% phase
Gphase = rad2deg(angle(Gfreqresp));
Gphase1 = rad2deg(unwrap(imag(0.5*log(Sxy./Syx))));
Gphase2 = rad2deg(unwrap(angle(Sxy./Sxx)));
Gphase3 = -rad2deg(unwrap(angle(Syx./Sxx)));
The corresponding Bode diagrams are shown in Figure 39.3, as plotted with
the following commands:
figure, subplot(2,1,1), semilogx(w,Ggain, w,Ggain1, w,Ggain2, w,Ggain3)
grid on, xlabel('\omega [rad\cdots^{-1}]'), ylabel('gain [dB]')
legend({'gain','(S_Y/S_X)^{1/2}','|S_{XY}/S_X|','|S_{YX}/S_X|'})
subplot(2,1,2), semilogx(w,Gphase, w,Gphase1, w,Gphase2, w,Gphase3)
grid on, ylabel('phase [^\circ]')
legend({'phase','Im[0.5*(S_{XY}/S_{YX})]','\angle(S_{XY}/S_X)','\angle(S_{YX}/S_X)'})
Two conclusions can at once be taken.
39.2. IDENTIFICATION IN FREQUENCY 541

Figure 39.4: Coherence function of Example 39.3.

Figure 39.5: Improved Bode diagrams of the plant of Example 39.3.

ˆ There are numerical problems with the result of (39.38), namely oscilla-
tions of 180◦ which command unwrap does not solve, since it only deals
with jumps of 360◦ . The way around this is to double the angle before
applying unwrap, so that jumps of 180◦ become 360◦ wide, and then halve
it:

Gphase1 = rad2deg(0.5*unwrap(2*imag(0.5*log(Sxy./Syx))));

ˆ Results are poor in the last decade, something we already know to be


expectable. This can be conrmed with γXY
2
, shown in Figure 39.4 and
obtained as follows:

gamma2 = (abs(Sxy)).^2./(abs(Sxx).*abs(Syy));
figure, semilogx(w,gamma2,'.')
grid on, xlabel('\omega [rad\cdots^{-1}]'), ylabel('\gamma_{XY}^2')

Fixing the phase and neglecting the last decade, the Bode diagram in Fig-
ure 39.5 is obtained.

Glossary
The political dialects to be found in pamphlets, leading articles,
manifestos, White Papers and the speeches of Under-Secretaries do,
of course, vary from party to party, but they are all alike in that
one almost never nds in them a fresh, vivid, home-made turn of
speech. When one watches some tired hack on the platform me-
chanically repeating the familiar phrases bestial atrocities, iron
heel, blood-stained tyranny, free peoples of the world, stand shoulder
to shoulder one often has a curious feeling that one is not watch-
ing a live human being but some kind of dummy: a feeling which
542CHAPTER 39. IDENTIFICATION OF CONTINUOUS STOCHASTIC MODELS

suddenly becomes stronger at moments when the light catches the


speaker's spectacles and turns them into blank discs which seem to
have no eyes behind them. And this is not altogether fanciful. A
speaker who uses that kind of phraseology has gone some distance
toward turning himself into a machine. The appropriate noises are
coming out of his larynx, but his brain is not involved as it would be
if he were choosing his words for himself. If the speech he is making
is one that he is accustomed to make over and over again, he may be
almost unconscious of what he is saying, as one is when one utters
the responses in church. And this reduced state of consciousness, if
not indispensable, is at any rate favourable to political conformity.

George Orwell (1903 „1950), Politics and the English Language

coherence function função de coerência

Exercises
1. Prove (39.19).
Chapter 40

Filter design
Other noises were subdued in this city of rubber; the passenger-
circles were a hundred yards away, and the subterranean trac lay
too deep for anything but a vibration to make itself felt. It was to
remove this vibration, and silence the hum of the ordinary vehicles,
that the Government experts had been working for the last twenty
years.

Robert Hugh Benson (1871 „1914), Lord of the world, Prologue

This chapter concerns the design of lters that receive a signal x(t) corrupted
by additive noise n(t), with the objective of returning an output y(t) as close
as possible to x(t), as seen in Figure 40.1. As might be expected, the ideal
situation y(t) = x(t) is seldom attainable, if ever; but useful approximations
can be usually found.

40.1 Wiener lters


The output of the lter with transfer function H(s) in Figure 40.1 will be, in
the general case,

y(t) = L −1 [H(s) (X(s) + N (s))]


X̃(s) M (s)
z }| { z }| {
=L −1
[H(s)X(s)] + L −1 [H(s)N (s)] (40.1)
| {z } | {z }
distorted signal residual noise

Consequently, there are two sources of error:


h i
ˆ signal distortion e(t) = L −1 [E(s)] = L −1 X(s) − X̃(s) = L −1 [X(s)(1 − H(s))];

ˆ residual noise m(t) = L −1 [M (s)] = L −1 [N (s)H(s)].

Denition 40.1. A Wiener lter minimises e2 (t) + m2 (t).


Theorem 40.1. A Wiener lter H(s) for a signal x(t) with spectral density
SX (s) corrupted by noise n(t) with spectral density SN (s) is given by

SX (s)
H(s) = (40.2)
SX (s) + SN (s)

Figure 40.1: Block diagram for lters H(s) addressed in this chapter.

543
544 CHAPTER 40. FILTER DESIGN

Proof. According to (38.35), using Laplace rather than Fourier transforms thanks
to variable change jω = s ⇔ ω = sj ,
Z +∞
1
m2 = SN (ω)H(jω)H(−jω) dω
2π −∞
Z +j∞
1 s
= SN (s)H(s)H(−s) d (40.3)

−j∞ j
Z +∞
1
e2 = SX (ω) 1 − H(jω) 1 − H(−jω) dω
2π −∞
Z +j∞
1 s
(40.4)

= SX (s) 1 − H(s) 1 − H(−s) d
2π −j∞ j
Z +j∞
1
= SX (s) − SX (s)H(−s) − SX (s)H(s) + SX (s)H(s)H(−s) ds
2πj −j∞

and thus
Z +j∞
1
e2 + m 2 = SX (s) − SX (s)H(−s) − SX (s)H(s)
2πj −j∞

+ SX (s)H(s)H(−s) + SN (s)H(s)H(−s) ds (40.5)

It is now expedient to dene

Fi (s)Fi (−s) = SX (s) + SN (s) (40.6)

so that

ˆ Fi (s) will only have poles and zeros with negative real parts, or on the
imaginary axis;

ˆ the poles and zeros of Fi (−s) will be the complex conjugates of those of
Fi (s).

We can now write


!
Z +j∞
1 SX (s) SX (s) SX (s)SN (s)
e2 + m2 = Fi (s)H(s) − Fi (−s)H(−s) − + ds
2πj −j∞ Fi (−s) Fi (−s) Fi (s)Fi (−s)
(40.7)

as can be seen working out the products and sums:


!
Z +j∞
1 SX (s) SX (s) SX (s)SN (s)
Fi (s)H(s) − Fi (−s)H(−s) − + ds
2πj −j∞ Fi (−s) Fi (s) Fi (s)Fi (−s)
Z +j∞
1 Fi (s)H(s)SX (s) Fi (−s)H(−s)SX (s)
= Fi (s)Fi (−s) H(s)H(−s) − −
2πj −j∞ | {z } Fi (s) Fi (−s)
SX (s)+SN (s)
!
2
SX (s) SX (s)SN (s)
+ + ds
Fi (s)Fi (−s) Fi (s)Fi (−s)
Z +j∞
1
= SX (s)H(s)H(−s) + SN (s)H(s)H(−s)
2πj −j∞
Fi (s)Fi (−s)
z }| { !
SX (s) (SX (s) + SN (s)) −Fi (s)Fi (−s)H(s)SX (s) − Fi (s)Fi (−s)H(−s)SX (s)
+ ds
Fi (s)Fi (−s)
Z +j∞
1
= SX (s)H(s)H(−s) + SN (s)H(s)H(−s) + SX (s) − H(s)SX (s) − H(−s)SX (s) ds
2πj −j∞
(40.8)

This is equal to (40.5).


We can now take a better look at the integrand of (40.7):
40.1. WIENER FILTERS 545

SX (s)SN (s)
ˆ = SSXX(s)+S
Fi (s)Fi (−s)
(s)SN (s)
N (s)
does not depend on H(s), so there is nothing to
do to this term;
SX (s)
ˆ Fi (s)H(s) − and Fi (−s)H(−s) − FSiX(−s)
Fi (−s)
(s)
depend on H(s). We know
from (38.38) that the second term veries
SX (s) SX (−s)
Fi (−s)H(−s) − = Fi (−s)H(−s) − (40.9)
Fi (−s) Fi (−s)
Consequently, these two terms are complex conjugates, and their product
is always positive or zero; it cannot be negative.
Thus, to minimise the integrand and thereby minimise e2 + m2 , we must have
SX (s)
Fi (s)H(s) − =0 (40.10)
Fi (−s)
from which the result is immediate.
Example 40.1. Let
24
SX (s) = − (40.11)
s2 −1
1
SN (s) = − (40.12)
s2
Then
− s224
−1 −24s2
H(s) = = (40.13)
− s224
−1 − 1
s2
−25s2 + 1

which has poles at 25s2 = 1 ⇔ s = ± 15 .


In the example above, the Wiener lter has a pole on the right-side of the
complex plane. We saw in Remark 38.3 the reason why poles and zeros with a
positive real part will often appear. Since this is undesirable, a causal Wiener
lter is needed, which will no longer minimise e2 (t)+m2 (t), but will provide the
best possible proper approximation to a lter that does. Notice that the causal
Wiener lter has this name even though the problem it solves is not necessarily
that of causality. To distinguish it from the causal Wiener lter, the Wiener
lter from Denition 40.1 is known as innite Wiener lter. Innite Wiener lter

Denition 40.2. A causal Wiener lter is the result of removing zeros and
poles with a positive real part from a Wiener lter.
When solving (40.10), Fi (s) has by denition no poles and zeros with positive
real part: these will appear (if they do) in FSiX(−s)
(s)
. A partial fraction expansion
SX (s)
can then be used to separate Fi (−s) into the sum of
h i
SX (s)
ˆ a rational function without poles and zeros with positive real part Fi (−s) ,
left
and
h i
SX (s)
ˆ a rational function without poles and zeros with negative real part Fi (−s) ,
right
so that (40.10) becomes

SX (s) SX (s)
Fi (s)H(s) − − =0 (40.14)
Fi (−s) left Fi (−s) right
h i
SX (s)
Term Fi (−s) is neglected, and the causal Wiener lter is given by
right

1 SX (s)
H(s) = (40.15)
Fi (s) Fi (−s) left

While it might seem that it would suce to neglect completely Fi (−s), since
by denition all its poles and zeros have non-negative real parts, it is better
to proceed as above since such zeros and poles may cancel poles and zeros of
SX (s).
546 CHAPTER 40. FILTER DESIGN

Example 40.2. In Example 40.1, we make


SX (s) SN (s)
z }| { z}|{
−24 −1
Fi (s)Fi (−s) = 2 + 2
s −1 s
−25s2 + 1 (5s − 1)(5s + 1)
= 2 =
(s − 1)s2 −s2 (s − 1)(s + 1)
5s + 1 −5s + 1
= (40.16)
s(s + 1) −s(−s + 1)
| {z } | {z }
Fi (s) Fi (−s)

Then
1
S (s)
X Fi (−s)
z }| { z }| {
SX (s) −24 −s(−s + 1)
= 2
Fi (−s) s − 1 −5s + 1
24s(s − 1)(−1) 24s
= = (40.17)
(s + 1)(s − 1)(5s − 1)(−1) (s + 1)(5s − 1)
A straightforward partial fraction expansion gives

SX (s) 24s 4 4
= = + (40.18)
Fi (−s) (s + 1)(5s − 1) s+1 5s − 1
| {z } | {z }
h i h i
SX (s) SX (s)
Fi (−s)
left Fi (−s)
right

Consequently

s(s + 1) 4 4s
H(s) = = (40.19)
5s + 1 s+1 5s + 1
| {z } | {z }
1
h i
SX (s)
Fi (s) Fi (−s)
left

Wiener lters can also be used:


Extrapolation ˆ To estimate x(t − τ ), i.e. the value that signal x(t) had, −τ seconds into
the past. This is called extrapolation.
Prediction ˆ To estimate x(t + τ ), i.e. the value that signal x(t) will have, τ seconds
into the future. This is called prediction.
As a consequence of what we saw in Section 24.1, both estimations are obtained
replacing the (causal) Wiener lter H(s) with H(s)e±τ s .

40.2 Whitening lters


Filters may have dierent objectives than those of a Wiener lter.
Denition 40.3. A whitening lter is a lter that outputs white noise.
Theorem 40.2. A causal whitening lter H(s) for a signal x(t) with spectral
density SX (s) corrupted by noise n(t) with spectral density SN (s) is given by
1
H(s) = (40.20)
Fi (s)

where Fi (s) is dened as in (40.6).


Proof. According to (39.27), we shall have

SY (s) = (SX (s) + SN (s)) |H(s)|2


1 1
= (SX (s) + SN (s)) =1 (40.21)
Fi (s) Fi (−s)
| {z }
1
SX (s)+SN (s)
40.2. WHITENING FILTERS 547

As was the case with the Wiener lter, whitening lters may have poles and
zeros with positive real parts, which in practice have to be neglected; or be
non-causal and need to have additional poles added. Such approximations, of
course, make the output of the lter deviate more from white noise.

Example 40.3. In Example 40.1, the whitening lter will be


1 s(s + 1)
H(s) = = (40.22)
Fi (s) 5s + 1

which, being an improper transfer function, will have to have two additional
poles added to become causal.

Glossary
Entam elle por lhe querer a cudir descuidara de si e o foguo zeralhe
alg
u nojo por ptes de seu corpo, e direito do caualeiro topou com
outro mateiro que pera ho mato hia que lhe perguntou vendo ho vir
assi sem lenha que pera que fora ao mato. Respondendolhe o mateiro
queimado falandolhe galego estas soos palauras, Bimarder, olhou o
caualeiro pelo barbarismo das letras mudadas na pronunciaçam do,
b, por, v, e pareceolhe misterio por que elle tambem na quelle se
fora arder, e quis se chamar assi da hi auante (. . . )

Bernardim Ribeiro (1482? „1552?), Hystoria de Menina e Moça

causal Wiener lter ltro de Wiener causal


innite Wiener lter ltro de Wiener innito
Wiener lter ltro de Wiener
whitening lter ltro de branqueamento

Exercises
1. A signal with SX (s) = −1
s2 −1 is corrupted by noise with SN (s) = s2 −4 .
−1

Find:

(a) A Wiener lter.


(b) A causal Wiener lter.
(c) A causal Wiener lter to extrapolate the signal 5 seconds in the past.

2. A signal with SX (s) = −1


s2 −4 is corrupted by noise with SN (s) = s2 −16 .
−1

Find:

(a) A Wiener lter.


(b) A causal Wiener lter.
(c) A causal Wiener lter to predict the signal 2 seconds in the future.

3. A signal with SX (s) = −9


s2 −9 is corrupted by noise with SN (s) = s2 −16 .
−1

Find:

(a) A Wiener lter.


(b) A causal Wiener lter.
(c) A causal Wiener lter to extrapolate the signal 1 second in the past.

4. Find whitening lters for the inputs of the previous exercises.

5. Consider an input consisting exclusively of brown noise. Find:

(a) A whitening lter.


(b) A causal whitening lter.
548 CHAPTER 40. FILTER DESIGN
Chapter 41

Digital stochastic models


He held the last coin between his ngers, staring absently at it.
Multivac is not the rst computer, friends, nor the best-known, nor
the one that can most eciently lift the load of decision from the
shoulders of the executive. A machine did win the war, John; at
least a very simple computing device did; one that I used every time
I had a particularly hard decision to make.
With a faint smile of reminiscence, he ipped the coin he held. It
glinted in the air as it spun and came down in Swift's outstretched
palm. His hand closed over it and brought it down on the back of
his left hand. His right hand remained in place, hiding the coin.
Heads or tails, gentlemen? said Swift.

Isaac Asimov (1920 „1992), The machine that won the war, The Magazine
of Fantasy & Science Fiction, October 1961

We now turn our attention to digital stochastic models, often useful given
that most signals are, as we saw in Chapter 3, discrete in time.

41.1 Types of digital stochastic models


Consider a digital system G(z −1 ) as shown in Figure #, with two inputs:

ˆ uk is a manipulated input, and is known as the exogenous input;


ˆ ek is stochastic, and thus, from the point of view of a control system, a
disturbance. This is usually assumed to be white noise.

G(z −1 ) is assumed as linear and proper, and thus its output yk is a linear
combination of the inputs and their past values. It will be a stochastic system if
yk depends only on ek but not on uk , or if it depends on both. Several paradigms
of digital stochastic systems are usually found.

Denition 41.1. The following digital stochastic systems have particular names.
ˆ Models that only depend on the stochastic input ek :

Autoregressive model of order p, AR(p): AR

yk = ek + a1 yk−1 + a2 yk−2 + . . . + ap yk−p


⇔ yk − a1 yk−1 − a2 yk−2 − . . . − ap yk−p = ek
⇔ yk 1 − a1 z −1 − a2 z −2 − . . . − ap z −p = ek

| {z }
A(z −1 )
yk 1
⇔ = (41.1)
ek A(z −1 )

Moving average model of order q , MA(q ): MA

549
550 CHAPTER 41. DIGITAL STOCHASTIC MODELS

yk = ek − c1 ek−1 − c2 ek−2 − . . . − cq ek−q


⇔ yk = ek 1 − c1 z −1 − c2 z −2 − . . . − cq z −q

| {z }
C(z −1 )
yk
⇔ = C(z −1 ) (41.2)
ek
ARMA Autorregressive, moving average model of orders p, q , ARMA(p, q ):
yk = ek − c1 ek−1 − c2 ek−2 − . . . − cq ek−q + a1 yk−1 + a2 yk−2 + . . . + ap yk−p
−1 −2 −p
= ek 1 − c1 z −1 − c2 z −2 − . . . − cq z −q

⇔ yk 1 − a1 z − a2 z − . . . − ap z
| {z } | {z }
A(z −1 ) C(z −1 )
−1
yk C(z )
⇔ = (41.3)
ek A(z −1 )
Autoregressive, integral, moving average model of orders p, q, d,
ARIMA ARIMA(p, q, d):
yk C(z −1 )
= (41.4)
ek A(z ) (1 − z −1 )d
−1

The poles in z = 1 correspond, as seen in Chapter 25, to integra-


tions. In fact an ARIMA(p, q, d) model is only a particular case of
an ARMA(p, q + d), as the denominator of (41.4) is a polynomial of
order q + d.
ˆ Models that depend both on the stochastic input ek and the exogenous
input uk :
ARX Autoregressive, exogenous model of orders p, m, ARX(p, m):
yk = ek + a1 yk−1 + a2 yk−2 + . . . + ap yk−p + b0 uk − b1 uk−1 − b2 uk2 − . . . − bm uk−m
−1 −2 −p
= ek + uk b0 − b1 z −1 − b2 z −2 − . . . − bm z −m

⇔ yk 1 − a1 z − a2 z − . . . − ap z
| {z } | {z }
A(z −1 ) B(z −1 )
−1
1 B(z )
⇔ yk = ek + uk (41.5)
A(z −1 ) A(z −1 )
An ARX model is sometimes given as ARX(p, m, d), allowing for
a delay z −d that aects the manipulated input (i.e. the exogenous
input):
1 B(z −1 )z −d
yk = e k + uk (41.6)
A(z −1 ) A(z −1 )
This is the same as an ARX(p, m + d) model, since the numerator
of the second transfer function is of order m + d. It makes no sense
to allow for a delay in the noise, precisely because it is noise, but a
delay in a control action may exist, as seen in Chapter 24.
Autorregressive, moving average, exogenous model of orders
p, q, m, ARMAX(p, q, m):
yk = ek − c1 ek−1 − c2 ek−2 − . . . − cq ek−q + a1 yk−1 + a2 yk−2 + . . . + ap yk−p
+ b0 uk − b1 uk−1 − b2 uk2 − . . . − bm uk−m
−1 −2 −p
= ek 1 − c1 z −1 − c2 z −2 − . . . − cq z −q +uk b0 − b1 z −1 − b2 z −2 − . . . − bm z −m

⇔ yk 1 − a1 z − a2 z − . . . − ap z
| {z } | {z } | {z }
A(z −1 ) C(z −1 ) B(z −1 )

C(z −1 ) B(z −1 )
⇔ yk = −1
ek + uk (41.7)
A(z ) A(z −1 )
An ARMAX model is sometimes given as ARX(p, q, m, d), allowing
for a delay z −d that aects the manipulated input (i.e. the exogenous
input):
C(z −1 ) B(z −1 )z −d
yk = −1
ek + uk (41.8)
A(z ) A(z −1 )
This is the same as an ARMAX(p, q, m + d) model, since the numer-
ator of the second transfer function is of order m + d.
41.1. TYPES OF DIGITAL STOCHASTIC MODELS 551

Autoregressive, integral, moving average, exogenous model


of orders p, q, d, m, ARIMAX(p, q, d, m): ARIMAX

C(z −1 ) B(z −1 )z −d
yk = e k + uk (41.9)
A(z −1 ) (1 − z −1 )d A(z −1 )

Box-Jenkins model of orders p, q, n, m, BJ(p, q, n, m): BJ

C(z −1 ) B(z −1 )
yk = e k + uk (41.10)
D(z −1 ) F (z −1 )
n and m are the orders of the denominators corresponding to p and
q.
Output error model of orders n, m, OE(n, m): OE

B(z −1 )
yk = ek + uk (41.11)
F (z −1 )

This is in fact a BJ(0, 0, p, q ) model.


General linear model (GLM): GLM

C(z −1 ) B(z −1 )z −d
A(z −1 ) yk = −1
ek + uk (41.12)
D(z ) F (z −1 )

Multiplying both members by A(z −1 ), this becomes a BJ model.


Denition 41.2. A digital system can have:
ˆ a nite impulse response (FIR), if its impulse response is zero after FIR
some time, or
ˆ an innite impulse response (IIR), otherwise. FIR

More formally, a FIR system is a system with an impulse response gk that


veries

∃n ∀m>k gm = 0, k, n, m ∈ N0 (41.13)

and an IIR system is one that does not verify (41.13).


Obviously,
ˆ all FIR systems are stable;

ˆ some stable digital systems have an IIR;

ˆ all unstable digital systems have an IIR;

ˆ a MA system has a FIR;

ˆ a AR system has an IIR.

Example 41.1. Consider a MA(2) given by


yk = ek + 5ek−1 − 7ek−2 (41.14)

Letting the input ek , which should be stochastic, be an impulse, the MA impulse


response is found:

y0 = e0 +5 e−1 −7 e−2 = 1 (41.15)


|{z} |{z} |{z}
1 0 0
y1 = e1 +5 e0 −7 e−1 = 5 (41.16)
|{z} |{z} |{z}
0 1 0
y2 = e2 +5 e1 −7 e0 = −7 (41.17)
|{z} |{z} |{z}
0 0 1
y3 = e3 +5 e2 −7 e1 = 0 (41.18)
|{z} |{z} |{z}
0 0 0

Clearly, yk = 0 for all subsequent time samples.


552 CHAPTER 41. DIGITAL STOCHASTIC MODELS

Remark 41.1. It is evident that a MA(q ) has an impulse response which is


zero after q time samples.

Example 41.2. Consider an AR(2) given by

yk = ek + 0.1yk−1 − 0.2yk2 (41.19)

This system is stable, since its transfer function is

yk 1
= (41.20)
ek 1 − 0.1z + 0.2z −2
−1

and its poles are 0.05±0.444j . Letting the input ek , which should be stochastic,
be an impulse, the MA impulse response is found:

y0 = e0 +0.1 y−1 −0.2 y−2 = 1 (41.21)


|{z} |{z} |{z}
1 0 0
y1 = e1 +0.1 y0 −0.2 y−1 = 0.1 (41.22)
|{z} |{z} |{z}
0 1 0
y2 = e2 +0.1 y1 −0.2 y0 = 0.01 − 0.2 = −0.19 (41.23)
|{z} |{z} |{z}
0 0.1 1
y3 = e3 +0.1 y2 −0.2 y1 = −0.019 − 0.02 = −0.039 (41.24)
|{z} |{z} |{z}
0 0.19 0.1
y4 = e4 +0.1 y3 −0.2 y2 = −0.0039 + 0.038 = 0.0341 (41.25)
|{z} |{z} |{z}
0 −0.039 −0.19
..
.

The impulse response converges to zero, but asymptotically.

The identication of a digital stochastic system follows the usual steps: iden-
tifying the order of the model or models, identifying model parameters, and
assessing performance (which includes, if several models were found, selecting
one of them). Model parameter identication is done as seen in Section 31.3,
and peformance assessment as was covered in Section 30.2. To nd reasonable
orders for models, however, there are methods particularly suited to stochastic
systems.

41.2 Autocorrelation of a MA
Theorem 41.1. The autocorrelation RY (τ ) of the output yk of a MA(q) model
veries

RY (τ ) 6= 0, if |τ | ≤ q (41.26)
RY (τ ) = 0, if |τ | > q (41.27)

provided that ek is white noise.


41.2. AUTOCORRELATION OF A MA 553

Proof.

RY (τ ) = E [(ek − c1 ek−1 − c2 ek−2 − . . . − cq ek−q ) (ek+τ − c1 ek+τ −1 − c2 ek+τ −2 − . . . − cq ek+τ −q )]


= E [ek ek+τ − c1 ek ek+τ −1 − c2 ek ek+τ −2 − . . . − cq ek ek+τ −q
− c1 ek−1 ek+τ + c21 ek−1 ek+τ −1 + c1 c2 ek−1 ek+τ −2 + . . . + c1 cq ek−1 ek+τ −q
− c2 ek−2 ek+τ + c1 c2 ek−2 ek+τ −1 + c22 ek−2 ek+τ −2 + . . . + c2 cq ek−2 ek+τ −q
...
−cq ek−q ek+τ + c1 cq ek−q ek+τ −1 + c2 cq ek−q ek+τ −2 + . . . + c2q ek−q ek+τ −q

= E [ek ek+τ ] − c1 E [ek ek+τ −1 ] − c2 E [ek ek+τ −2 ] − . . . − cq E [ek ek+τ −q ]


− c1 E [ek−1 ek+τ ] + c21 E [ek−1 ek+τ −1 ] + c1 c2 E [ek−1 ek+τ −2 ] + . . . + c1 cq E [ek−1 ek+τ −q ]
− c2 E [ek−2 ek+τ ] + c1 c2 E [ek−2 ek+τ −1 ] + c22 E [ek−2 ek+τ −2 ] + . . . + c2 cq E [ek−2 ek+τ −q ]
...
− cq E [ek−q ek+τ ] + c1 cq E [ek−q ek+τ −1 ] + c2 cq E [ek−q ek+τ −2 ] + . . . + c2q E [ek−q ek+τ −q ]
= RE (τ ) − c1 RE (τ − 1) − c2 RE (τ − 2) − . . . − cq RE (τ − q)
− c1 RE (τ + 1) + c21 RE (τ ) + c1 c2 RE (τ − 1) + . . . + c1 cq RE (τ − q + 1)
− c2 RE (τ + 2) + c1 c2 RE (τ + 1) + c22 RE (τ ) + . . . + c2 cq RE (τ − q + 2)
...
− cq RE (τ + q) + c1 cq RE (τ + q − 1) + c2 cq RE (τ + q − 2) + . . . + c2q RE (τ )
(41.28)

If τ > q , or if τ < −q , the autocorrelation RE (0) never appears above. Since ek


is white noise, it is the only one that is not zero. If −q ≤ τ ≤ q , autocorrelation
RE (0) appears at least once, with at least one coecient dierent from zero,
and thus the result is not zero.

In practice, this can be used to nd the order of a MA model with an


input which is white noise: calculate the autocorrelation of the output, and the
number of delays for which it is not zero is the order of the model. However,
there are some problems:

ˆ No noise, as we know, is really white. Nothing can be done about this.

ˆ The input may be clearly dierent from white noise. This may be
solved if a whitening lter can be applied at the input of the plant.

ˆ There is always a nite number of samples, and consequently even white


noise itself would not have a zero autocorrelation for τ 6= 0. This can
be improved increasing the number of samples, if possible. But, whatever
the case, it is always necessary to establish a threshold below which the
autocorrelation is assumed as zero. The usual threshold is the one in the
following result, quoted without proof.

Theorem 41.2. If xk is normally distributed, its autocorrelation coecient


ρX (τ ) for τ 6= 0, computed from N samples, is equal to zero, with a 5% signi-
cance level, if

1.959964 1.959964
− √ < ρX (τ ) < √ (41.29)
N N

Corollary 41.1. If xk is normally distributed, its autocorrelation RX (τ ) for


τ 6= 0, computed from N samples, is equal to zero, with a 5% signicance level,
if
2 2
1.959964σX 1.959964σX
− √ < RX (τ ) < √ (41.30)
N N

Proof. This is an obvious consequence of the denition of ρX (τ ) (37.58).

In (41.29)(41.30), the number in the numerators, usually approximated by


1.96 and sometimes even by 2, appears as shown in Figure 41.1.
554 CHAPTER 41. DIGITAL STOCHASTIC MODELS

Figure 41.1: The normal distribution and the gure for a 5% signicance level
(source: Wikimedia). If X is a normally distributed random process with aver-
age 0 and variance 1, then P (X > 1.96) = 2.5%, and P (X < −1.96) = 2.5%.
Consequently, P (−1.96 < X < 1.96) = 95%.

Figure 41.2: Autocorrelation coecient of the output of plant (41.31) from


Example 41.3.

Example 41.3. Consider a plant given by


yk
= 3 + 4z −1 + 2z −2
uk
⇔ yk = 3uk + 4uk−1 + 2uk−2 (41.31)

The autocorrelation of this plant's output when fed 2001 samples of normally
distributed white noise is shown in Figure 41.2 together with the threshold
given by (41.29), which is −0.044 < RX (τ ) < 0.044. The rst three values,
corresponding to three coecients of the plant, are large enought to be outside
the threshold.

The autocorrelation can be used as well to nd the order of a model that
only depends on an exogenous variable, as long as this variable can be approx-
imated by white noise, and the MA part of the model can be neglected. In
practice, orders adjacent to those found with this method should be considered
for potential models as well, since numerical errors or noise can aect the results.

41.3 Partial autocorrelation of an AR


This section is still being written:

ˆ Partial autocorrelation for AR.

ˆ Yule-Walker equations.

ˆ t-value and p-value to know if all inputs i.e. delays are needed.

In an AR model, additive noise at the output keeps inuencing it in future


samples. For this reason, the presence of noise easily leads to an overestimation
of the order of the model.
41.4. IDENTIFICATION 555

Figure 41.3: Left: partial autocorrelation of the output of plant (41.32) from
Example 41.4. Right: the same, when there is noise as in (41.33).

Example 41.4. Consider a plant given by

yk 1
=
uk 3 + 4z + 2z −2
−1

1 4 2
⇔ yk = uk − yk−1 − yk−2 (41.32)
3 3 3

The partial autocorrelation of this plant's output when fed 2001 samples of nor-
mally distributed white noise is shown in Figure 41.3 together with the threshold
given by (41.29), which is −0.044 < RX (τ ) < 0.044. The rst three values, cor-
responding to three coecients of the plant, are large enought to be outside the
threshold.
The partial autocorrelation is also shown for the situation when there is
additive noise at the output:

1 4 2
yk = uk − yk−1 − yk−2 + 0.05ek (41.33)
3 3 3

Here ek is normally distributed white noise, with zero-mean and variance 1.


Notice how there are now four delays outside the threshold.

Matlab commands autocorr and parcorr plot the autocorrelation and


the partial autocorrelation of a variable, and plot the threshold given by (41.29)
approximating the numerator by 2.

41.4 Identication
This section is still being written:

ˆ Finding MA and AR from the autocorrelation and the partial autocorre-


lation.

ˆ One step ahead prediction.

ˆ Prediction-correction.

ˆ Forgetting factor.
556 CHAPTER 41. DIGITAL STOCHASTIC MODELS

In the picture: National Pantheon, or Church of Saint Engratia, Lisbon


(source: http://www.panteaonacional.gov.pt/171-2/historia-2/), some-
when during its construction (16821966).

Glossary
I understood him in many Things, and let him know, I was very well
pleas'd with him; in a little Time I began to speak to him, and teach
him to speak to me; and rst, I made him know his Name should
be Friday, which was the Day I sav'd his Life; I call'd him so for the
Memory of the Time; (. . . )

Daniel Defoe (1660? „1731), The life and Strange Surprizing adventures of
Robinson Crusoe, of York, Mariner

word in English word in Portuguese


palavra em inglês palavra em português

Exercises
1. Question.
Chapter 42

Control of stochastic systems


Prince Andrew listened attentively to Bagratión's colloquies with
the commanding ocers and the orders he gave them and, to his
surprise, found that no orders were really given, but that Prince
Bagratión tried to make it appear that everything done by necessity,
by accident, or by the will of subordinate commanders was done, if
not by his direct command, at least in accord with his intentions.
Prince Andrew noticed, however, that though what happened was
due to chance and was independent of the commander's will, ow-
ing to the tact Bagratión showed, his presence was very valuable.
Ocers who approached him with disturbed countenances became
calm; soldiers and ocers greeted him gaily, grew more cheerful in
his presence, and were evidently anxious to display their courage
before him.

Leo Tolstoy (1828 „1910), War and Peace, II 17 (transl. Louise Maude
and Aylmer Maude)

In this chapter, three dierent ways of designing closed-loop controllers for


stochastic processes are presented. The rst two can only be applied to follow
constant references, i.e. in regulation problems.

42.1 Minimum variance control


This technique can be used to design a regulator. The eect of the noise in the
output can be minimised, but not eliminated.

Theorem 42.1. Consider a plant with an output given by


B(z −1 ) −d C(z −1 )
y(t) = −1
z u(t) + e(t) (42.1)
A(z ) A(z −1 )

where u(t) is a manipulated input, and e(t) is white noise. (If there is no
pure delay of d sample times from u(t) to the output, then d = 0.) This
plant is controlled in closed loop, as seen in Figure 42.1, and, without loss of
generality, reference r(t) is taken as 0 (otherwise a variable change is used). In
this situation, the controller that minimises the variance of error ε(t) = −y(t)

Figure 42.1: Closed loop control of a stochastic digital system.

557
558 CHAPTER 42. CONTROL OF STOCHASTIC SYSTEMS

is given by

G(z −1 )
u(t) = − y(t) (42.2)
B(z −1 )F (z −1 )

where F (z −1 ) and G(z −1 ) are found solving

C(z −1 ) = F (z −1 )A(z −1 ) + G(z −1 )z −d (42.3)

The output when control law (42.2) is used is given by the MA

y(t) = F (z −1 )e(t) (42.4)

Proof. Dropping the dependence on z −1 to alleviate the notation, (42.1) can be


rewritten as
B C
y(t + d) = u(t) + e(t + d) (42.5)
A A
C(z −1 )
(42.3) is the same as separating the dynamics of the noise A(z −1 ) into two parts
by means of polynomial division:
C G
= F + z −d
A A
C − Gz −d
⇔F = (42.6)
A
Replacing (42.6) in (42.5),

B G
y(t + d) = u(t) + F e(t + d) + e(t) (42.7)
A A
Now notice that (42.1) can also be rewritten as

A B
e(t) = y(t) − z −d u(t) (42.8)
C C
Replacing this in (42.7), and using (42.6),

B G A B
y(t + d) = u(t) + F e(t + d) + y(t) − z −d u(t)
A A C C
G BG −d B
= F e(t + d) + y(t) − z u(t) + u(t)
C CA A
G B C − Gz −d
= F e(t + d) + y(t) + u(t)
C | CA
{z }
BF
C

G BF
= F e(t + d) + y(t) + u(t) (42.9)
| {z } C {z C
this can only be
| }
known at time t + d this is already known at time t
h i
2
Consequently, to minimise E (ε(t)) , we minimise
" 2 #
h
2
i G BF
E (y(t + d)) = E F e(t + d) + y(t) + u(t)
C C
" 2 #
h
2
i G BF
= E (F e(t + d)) + E y(t) + u(t) (42.10)
C C

where there are no cross-terms because white noise e(t + d) is independent from
y(t) and u(t). There is nothing to do about the expected value that depends on
the white noise, but the second term can be minimised:
G BF
y(t) + u(t) = 0 (42.11)
C C
From here (42.2) is immediate.
42.1. MINIMUM VARIANCE CONTROL 559

As to the performance of the controller, replacing (42.2) in (42.9) gives



G BF G
y(t + d) = F e(t + d) + y(t) + − y(t) (42.12)
C C BF
| {z }
G
−C y(t)

which is (42.4).

Remark 42.1. Let the orders of polynomials A(z −1 ), B(z −1 ), etc. be nA , nB ,


etc.. Orders nF and nG must be large enough for (42.3) to be possible. They
can be found by inspection in each case; these orders turn out to be, in every
situation, the following:

nF = d − 1 (42.13)
nG = max{nA − 1, nC − d} (42.14)

Example 42.1. Consider a plant with an output given by

y(t) = 0.5y(t − Ts ) + 0.2y(t − 2Ts ) + 0.7u(t − Ts ) + 0.3u(t − 2Ts )


+ e(t) + 0.4e(t − Ts ) + 0.1e(t − 2Ts )
−1 −2
= u(t) 0.7z −1 + 0.3z −2 +e(t) 1 + 0.4z −1 + 0.1z −2

⇔ y(t) 1 − 0.5z − 0.2z
| {z }
z −1 (0.7+0.3z −1 )
(42.15)

That is to say,

A z −1 = 1 − 0.5z −1 − 0.2z −2 (42.16)


B z −1 = 0.7 + 0.3z −1 (42.17)


C z −1 = 1 + 0.4z −1 + 0.1z −2 (42.18)


d=1 (42.19)

We must solve (42.3):

1 + 0.4z −1 + 0.1z −2 = 1 − 0.5z −1 − 0.2z −2 F z −1 + z −1 G z −1 (42.20)


The left side of the equation is of order 2. The right side will be of order 2
if nF = 0 and nG = 1, i.e. F z −1 = f0 and G z −1 = g0 + g1 z −1 . Notice
that the only independent term on the right side will be f0 ; thus we must have
f0 = 1. This still leaves two variables, g0 and g1 , which suce to make the
equation possible.
Instead of reasoning like this we could apply (42.13)(42.14) and write

1 + 0.4z −1 + 0.1z −2 = 1 − 0.5z −1 − 0.2z −2 (f0 ) + z −1 g0 + g1 z −1


= f0 − 0.5f0 z −1 − 0.2f0 z −2 + g0 z −1 + g1 z −2 (42.21)

Equalling the coecients of the same order on both sides,


 
1 = f0 f0 = 1
(
F z −1 = 1
 
0.4 = −0.5f0 + g0 ⇔ g0 = 0.9 ⇒
G z −1 = 0.9 + 0.3z −1

 
0.1 = −0.2f0 + g1 g1 = 0.3
 
(42.22)

Thus

0.9 + 0.3z −1
u(t) = −y(t) (42.23)
0.7 + 0.3z −1

and this control law will achieve y(t) = e(t). This is not surprising, since the
noise itself cannot be eliminated; it is impossible to do any better.
Figure 42.2 shows the output, equal to the error, and the control action, for
a simulation with 100 time steps.
560 CHAPTER 42. CONTROL OF STOCHASTIC SYSTEMS

Figure 42.2: Simulation of plant (42.15) controlled by (42.23), from Exam-


ple 42.1.

Example 42.2. Consider a plant similar to that of Example 42.1, save that
now the output is given by

y(t) = 0.5y(t − Ts ) + 0.2y(t − 2Ts ) + 0.7u(t − 2Ts ) + 0.3u(t − 3Ts )


+ e(t) + 0.4e(t − Ts ) + 0.1e(t − 2Ts )
−1 −2
= u(t) 0.7z −2 + 0.3z −3 +e(t) 1 + 0.4z −1 + 0.1z −2

⇔ y(t) 1 − 0.5z − 0.2z
| {z } | {z } | {z }
A(z −1 ) z −2 (0.7+0.3z −1 ) C(z −1 )
|{z} | {z }
z −d
B (z −1 )

(42.24)

This is in fact the same plant of Example 42.1 but with d = 2. We must solve
(42.3):

1 + 0.4z −1 + 0.1z −2 = 1 − 0.5z −1 − 0.2z −2 F z −1 + z −2 G z −1 (42.25)


The left side of the equation is still


of order 2. Theright side will be of order 2
if nF = 0 and nG = 0, i.e. F z −1 = f0 and G z −1 = g0 . Once more, the only
independent term on the right side will be f0 ; thus we must have f0 = 1. This
leaves only one variable, g0 , and theequation is impossible. Consequently, we
need nF = 1 and nG = 1, i.e. F z −1 = f0 + f1 z −1 and G z −1 = g0 + g1 z −1 ;

the right member will be of order 3, and the terms of order 3 will have to cancel,
since there is none on the right member.
Instead of reasoning like this we could apply (42.13)(42.14) and write

1 + 0.4z −1 + 0.1z −2 = 1 − 0.5z −1 − 0.2z −2 f0 + f1 z −1 + z −2 g0 + g1 z −1


= f0 − 0.5f0 z −1 − 0.2f0 z −2 + f1 z −1 − 0.5f1 z −2 − 0.2f1 z −3 + g0 z −2 + g1 z −3


(42.26)

Equalling the coecients of the same order on both sides,


 

 1 = f0 
 f0 = 1 (
F z −1 = 1 + 0.9z −1

0.4 = −0.5f + f 
f = 0.9
0 1 1
⇔ ⇒
G z −1 = 0.75 + 0.18z −1



 0.1 = −0.2f 0 − 0.5f1 + g0 

 g0 = 0.3 + 0.5 × 0.9 = 0.75
0 = −0.2f1 + g1 g1 = 0.2 × 0.9 = 0.18
 

(42.27)

Thus
0.75 + 0.18z −1
u(t) = −y(t) (42.28)
(0.7 + 0.3z −1 ) (1 + 0.9z −1 )

and this control law will achieve y(t) = e(t) 1 + 0.9z −1 . Notice how one

additional delay from the control action to the output leads to more complicated
calculations, to a controller of higher order (there are two poles now rather than
only one), and to an output with more noise.
Figure 42.3 shows the output, no longer equal to the error, and the control
action, for a simulation with 100 time steps.
42.1. MINIMUM VARIANCE CONTROL 561

Figure 42.3: Simulation of plant (42.24) controlled by (42.28), from Exam-


ple 42.2.

Figure 42.4: Simulation of plant (42.29) controlled by (42.33), from Exam-


ple 42.3.

t of a non-minimum Example 42.3. Consider yet another plant similar to that of Example 42.1,
e zero save that now the output is given by

y(t) = 0.5y(t − Ts ) + 0.2y(t − 2Ts ) + 0.3u(t − Ts ) + 0.7u(t − 2Ts )


+ e(t) + 0.4e(t − Ts ) + 0.1e(t − 2Ts )
−1 −2
= u(t) 0.3z −1 + 0.7z −2 +e(t) 1 + 0.4z −1 + 0.1z −2

⇔ y(t) 1 − 0.5z − 0.2z
| {z } | {z } | {z }
A(z −1 ) z −1 (0.3+0.7z −1 ) C(z −1 )
|{z} | {z }
z −d
B (z −1 )

(42.29)

This is the same plant of Example 42.1 but this time with a non-minimum phase
zero, since
3 7
B z −1 = 0 ⇔ 0.7z −1 = −0.3 ⇔ z −1 = − ⇔ z = − (42.30)

7 3
which is outside the unit radius circle. Solving (42.3) is done as in Example 42.1;
the results are the same:

F z −1 = 1 (42.31)

−1 −1
(42.32)

G z = 0.9 + 0.3z

Consequently, the control action will be

0.9 + 0.3z −1
u(t) = −y(t) (42.33)
0.3 + 0.7z −1
and this control law will achieve y(t) = e(t).
Figure 42.4 shows the output, which equal to the error, and the control
action that achieves this result. Notice how the amplitude of the control action
grows exponentially. This is because control law is unstable: (42.2) cancels the
zeros of the plant, and so in this case the controller tries to cancel the non-
minimum phase zero. Such a controller is of course impossible in practice: as
562 CHAPTER 42. CONTROL OF STOCHASTIC SYSTEMS

soon as actuators saturate, the output will be far from what is desired. (In fact,
even in simulation, sooner or later an overow prevents good results; that is the
reason why Figure 42.4 only shows 40 time steps).
What to do with non- This last example shows that, if there are non-minimum phase zeros in
minimum phase zeros B(z −1 ), we cannot have (42.2), but must use only the minimum-phase zeros
in the denominator. That is to say, we separate B(z −1 ) as product

B(z −1 ) = Bmin (z −1 )Bnon (z −1 ) (42.34)

so that Bnon (z −1 ) will have all the non-minimum phase zeros, and Bmin (z −1 ) all
the minimum phase zeros; and then make

G(z −1 )
u(t) = − y(t) (42.35)
Bmin (z −1 )F (z −1 )

Price to pay for a stable The eect of the error in the output will be larger, but the control system (and
control action in particular the control action) will be stable.
Theorem 42.2. Consider a plant with an output given by
B(z −1 )
z }| {
Bmin (z −1 )Bnon (z −1 ) −d C(z −1 )
y(t) = z u(t) + e(t) (42.36)
A(z −1 ) A(z −1 )

where u(t) is a manipulated input, and e(t) is white noise. (If there is no pure
delay of d sample times from u(t) to the output, then d = 0.) All the roots
of Bnon (z −1 ) have positive real parts; none of the roots of Bmin (z −1 ) do. This
plant is controlled in closed loop, as seen in Figure 42.1, and, without loss of
generality, reference r(t) is taken as 0 (otherwise a variable change is used). In
this situation, the controller that minimises the variance of error ε(t) = −y(t)
and ensures a stable control action is given by

G(z −1 )
u(t) = − y(t) (42.37)
Bmin (z −1 )F (z −1 )

where F (z −1 ) and G(z −1 ) are found solving

C(z −1 )Bmin (z −1 ) = F (z −1 )A(z −1 ) + Bnon (z −1 )G(z −1 )z −d (42.38)

The output when control law (42.37) is used is given by

F (z −1 )
y(t) = e(t) (42.39)
Bmin (z −1 )

Proof.Replacing the desired control action (42.37) in (42.36), and dropping the
dependence on t and z −1 to alleviate the notation,

Bmin Bnon −d G C
y= z − y + e
A Bmin F A
−d

Bnon Gz C
⇔y 1+ = e
AF A
| {z }
AF +B non
Gz −d
AF

C AF CF
⇔y= e= e (42.40)
A AF + Bnon Gz −d AF + Bnon Gz −d

If (42.38) holds, the denominator is C(z −1 )Bmin (z −1 ) and (42.39) is obtained.

Remark 42.2. As before, orders nF and nG must be enough for (42.57) to be


possible, and can be found by inspection in each case; these orders now turn
out to be:

nF = nBnon + d − 1 (42.41)
nG = max{nA − 1, nC − d} (42.42)
42.1. MINIMUM VARIANCE CONTROL 563

Example 42.4. We are now in position of nding a much better controller for
the non-minimum phase plant (42.29) of Example 42.3. We have

A z −1 = 1 − 0.5z −1 − 0.2z −2 (42.43)


Bnon z −1 = 0.3 + 0.7z −1 (42.44)


Bmin z −1 = 1 (42.45)

C z −1 = 1 + 0.4z −1 + 0.1z −2 (42.46)


z −d
=z −1
(42.47)

Instead of solving (42.3), we solve (42.38):

1 + 0.4z −1 + 0.1z −2 × 1 = 1 − 0.5z −1 − 0.2z −2 F z −1 + z −1 0.3 + 0.7z −1 G z −1


(42.48)

The reasoning
of Example 42.2 applies here and shows that nF = 1 and nG = 1,
i.e. F z −1 = f0 +f1 z −1 and G z −1 = g0 +g1 z −1 . Or we could apply (42.41)
(42.42) and write

1 + 0.4z −1 + 0.1z −2 × 1 = 1 − 0.5z −1 − 0.2z −2 f0 + f1 z −1 + z −1 0.3 + 0.7z −1 g0 + g1 z −1


= f0 − 0.5f0 z −1 − 0.2f0 z −2 + f1 z −1 − 0.5f1 z −2 − 0.2f1 z −3


+ 0.3g0 z −1 + 0.3g1 z −2 + 0.7g0 z −2 + 0.7g1 z −3
(42.49)

Equaling the coecients of the same order on both sides,


 

1 = f0 
 f0 =1

0.4 = −0.5f + f + 0.3g 
f + 0.3g
0 1 0 1 0 = 0.9



0.1 = −0.2f0 − 0.5f1 + 0.3g1 + 0.7g0 

 −0.5f1 + 0.7g0 + 0.3g1 = 0.3
0 = −0.2f1 + 0.7g1 −0.2f1 + 0.7g1 =0
 

(42.50)

The last three equations are better solved with Matlab:

>> [1 0.3 0; -0.5 0.7 0.3; -0.2 0 0.7]\[0.9 0.3 0]'

ans =

0.6551
0.8163
0.1872
Thus

F z −1 = 1 + 0.6551z −1 (42.51)

G z −1 = 0.8163 + 0.1872z −1 (42.52)


and so, according to (42.37),

0.8163 + 0.1872z −1
u(t) = −y(t) (42.53)
1 × (1 + 0.6551z −1 )

As shown in Figure 42.5, this control law will achieve y(t) = e(t) 1 + 0.6551z −1 ,

an output larger than that of Example 42.3: the controller (42.37) is not in Sub-optimal minimum
fact a minimum variance controller; it is known as a sub-optimal minimum variance control
variance controller. However, this output is in practice feasible (since the
control action is now bounded), unlike the original controller, which would be
optimal if only it could ever work.
Remark
h i42.3. Minimum variance control minimises the variance of the error
2
E (ε(t)) , however large the control action has to be. It can be generalised so
as to minimise a cost function J instead, given by
h i h i
2 2
J = P E (ε(t)) + Q E (u(t)) (42.54)
564 CHAPTER 42. CONTROL OF STOCHASTIC SYSTEMS

Figure 42.5: Simulation of plant (42.29) controlled by (42.53), from Exam-


ple 42.4.

where P and Q are weights. J denes how large we are willing to have the
control action to lower the variance of the output. Of course, when Q = 0 we
get minimum variance control back.
We will not explore this possibility, called generalised minimum variance
control, and which is a particular case of optimal control, addressed below
in Section 43.5.

42.2 Pole-assignment control


Digital stochastic systems can be controlled by pole-assignment, as done in
Chapters 21 and 22 for deterministic plants in continuous time and in Chapter 27
for digital deterministic plants. We will assume a regulation problem, as we did
for minimum variance control.
Theorem 42.3. Consider a plant with an output given by
B(z −1 ) −d C(z −1 )
y(t) = z u(t) + e(t) (42.55)
A(z −1 ) A(z −1 )

where u(t) is a manipulated input, and e(t) is white noise. (If there is no
pure delay of d sample times from u(t) to the output, then d = 0.) This
plant is controlled in closed loop, as seen in Figure 42.1, and, without loss of
generality, reference r(t) is taken as 0 (otherwise a variable change is used).
In this situation, the controller that places the poles of the closed loop in the
locations dened by T (z −1 ) is given by

G(z −1 )
u(t) = − y(t) (42.56)
F (z −1 )

where F (z −1 ) and G(z −1 ) are found solving

T (z −1 )C(z −1 ) = F (z −1 )A(z −1 ) + B(z −1 )G(z −1 )z −d (42.57)

The output when control law (42.2) is used is given by

F (z −1 )
y(t) = e(t) (42.58)
T (z −1 )

Proof. Replacing (42.56) in (42.55), and dropping the dependence on t and z −1


to alleviate the notation,

Bz −d

G C
y= − y + e
A F A
−d

BGz C
⇔y 1+ = e
AF A
| {z }
AF +BGz −d
AF

C AF CF
⇔y= e= e (42.59)
A AF + BGz −d AF + BGz −d
42.2. POLE-ASSIGNMENT CONTROL 565

We want the denominator to be equal to T C , i.e. we want (42.57) to hold, so


that
CF F
y= −d
e= e (42.60)
AF + BGz T
| {z }
TC

which is (42.58).
Remark 42.4. Orders nF and nG must again be enough for (42.57) to be
possible, and can be found by inspection in each case; these orders turn out to
be:
nF = nB + d − 1 (42.61)
nG = nA − 1 (42.62)
The maximum number of poles that can be placed is given by
nT ≤ nA + nB + d − 1 − nC (42.63)
Example 42.5. Consider a plant with an output given by
y(t) = 2y(t − Ts ) + u(t − Ts ) + 0.5u(t − 2Ts ) + e(t) + 0.3e(t − Ts )
⇔ y(t) 1 − 2z −1 = u(t) |{z}
z −1 1 + 0.5z −1 +e(t) 1 + 0.3z −1 (42.64)

| {z } | {z } | {z }
A(z −1 ) z −d B(z −1 ) C(z −1 )

for which we want a controller placing a pole at z = 0.5, i.e.


T z −1 = 1 − 0.5z −1 (42.65)

We must solve (42.57):


1 − 0.5z −1 1 + 0.3z −1 = 1 − 2z −1 F z −1 + z −1 1 + 0.5z −1 G z −1

(42.66)
The left side of the equation is of order 2. The right side will be of order 2
if nF = 1 and nG = 0, i.e. F z −1 = f0 + f1 z −1 and G z −1 = g0 . Notice
that the only independent term on the right side will be f0 ; thus we must have
f0 = 1. This still leaves two variables, g0 and f1 , which suce to make the
equation possible.
Instead of reasoning like this we could apply (42.61)(42.62) and write
1 − 0.2z −1 − 0.15z −2 = 1 − 2z −1 f0 + f1 z −1 + z −1 + 0.5z −2 g0

= f0 + f1 z −1 − 2f0 z −1 − 2f1 z −2 + g0 z −1 + 0.5g0 z −2


(42.67)
Equalling the coecients of the same order on both sides,
 
1 = f0 f0 = 1
(
F z −1 = 1 + 0.42z −1
 
−0.2 = f1 − 2f0 + g0 ⇔ f1 + g0 = 1.8 ⇒
G z −1 = 1.38

 
−0.15 = −2f1 + 0.5g0 −4f1 + g0 = −0.3
 
(42.68)
Thus
1.38
u(t) = −y(t) (42.69)
1 + 0.42z −1
and this control law will achieve
1 + 0.42z −1
y(t) = −e(t) (42.70)
1 − 0.5z −1
with the desired pole. Notice that (42.69) is stable.
Remark 42.5. Unlike (42.2), which has poles that cancel the zeros of the plant, Always check if a pole
and can therefore be known in advance, the controller given by (42.56) has poles placement controller is
wherever the roots of F z −1 turn out to be. Consequently, its stability should stable
always be veried; an unstable controller would result in a situation similar to
that of Example 42.3.
If the controller is unstable, the only solution is changing T z −1 .

566 CHAPTER 42. CONTROL OF STOCHASTIC SYSTEMS

42.3 Control design for time-varying references


When the reference varies with time, controllers are more dicult to design,
and let through more noise to the output.
Tracking controller Theorem 42.4. Consider a plant with an output given by
B(z −1 ) −d C(z −1 )
y(t) = z u(t) + e(t) (42.71)
A(z −1 ) A(z −1 )

where u(t) is a manipulated input, and e(t) is white noise. (If there is no pure
delay of d sample times from u(t) to the output, then d = 0.) This plant is
controlled in closed loop, as seen in Figure 42.1, and no restriction on reference
r(t) is assumed. In this situation, the controller given by

G(z −1 ) 1
(42.72)

u(t) = r(t) − y(t)
B(z −1 )F (z −1 ) 1 − z −1
| {z }
integration

where F (z −1 ) and G(z −1 ) are found solving

C(z −1 ) = A(z −1 )F (z −1 ) 1 − z −1 + z −d G(z −1 ) (42.73)


achieves an output given by

G z −1 −d

−1 −1
(42.74)

y(t) = F (z ) 1−z e(t) + z r(t)
C (z −1 )

Proof. Replacing (42.72) in (42.71), and dropping the dependence on t and z −1


to alleviate the notation,
B G 1 C
y = z −d −1
(r − y) + e
A BF 1 − z A
G z −d G z −d

C
⇔y 1+ = e+ r
AF 1 − z −1 A AF 1 − z −1
| {z }
AF (1−z −1 )+Gz −d
AF (1−z −1 )

CF 1 − z −1

Gz −d
⇔y= −1 −d
e+ r
AF (1 − z ) + Gz AF (1 − z −1 ) + Gz −d
(42.75)

Replacing (42.73) in the denominator, (42.74) is obtained.


Remark 42.6. Once more, orders nF and nG must be enough for (42.73) to
be possible, can be found by inspection in each case, and turn out to be:

nF = d − 1 (42.76)
nG = max{nA , nC − d} (42.77)

Example 42.6. Consider plant (42.64) from Example 42.5:


A z −1 = 1 − 2z −1 (42.78)

B z −1 = 1 + 0.5z −1 (42.79)

C z −1 = 1 + 0.3z −1 (42.80)

d=1 (42.81)

To nd a tracking controller, we must solve (42.73):

1 + 0.3z −1 = 1 − 2z −1 1 − z −1 F z −1 + z −1 G z −1 (42.82)

The left side of the equation is of order 1. The right


side is at least of order 2; this
is the case when nF = 1 and nG = 2, i.e. F z −1 = f0 and G z −1 = g0 +g1 z −1 .
Notice that the only independent term on the right side will be f0 ; thus we must
have f0 = 1. This still leaves two variables, g0 and g1 , which suce to make the
equation possible.
42.4. ADAPTIVE CONTROL 567

Figure 42.6: Simulation of plant (42.64) controlled by (42.85), from Exam-


ple 42.6.

Instead of reasoning like this we could apply (42.76)(42.77) and write

1 + 0.3z −1 = 1 − 2z −1 1 − z −1 f0 + z −1 g0 + g1 z −1

= f0 − 3f0 z −1 + 2f0 z −2 + g0 z −1 + g1 z −2 (42.83)

Equalling the coecients of the same order on both sides,

 
1 = f0 f0 = 1
(
F z −1 = 1
 
0.3 = −3f0 + g0 ⇔ g0 = 3.3 ⇒ (42.84)
G z −1 = 3.3 − 2z −1

 
0 = 2f0 + g1 g1 = −2
 

Thus

3.3 − 2z −1 3.3 − 2z −1
u(t) = −y(t) −1 −1
=− y(t) (42.85)
(1 + 0.5z ) (1 − z ) 1 − 0.5z −1 − 0.5z −2

and this control law will achieve

3.3 − 2z −1 −1
y(t) = 1 − z −1 e(t) + (42.86)

z r(t)
1 + 0.3z −1

Figure 42.6 shows the results of a simulation with 50 time steps and a sinusoidal
reference. Notice that the output is not much far from the reference corrupted
by the noise (which as usual cannot be eliminated).

42.4 Adaptive control

This section is still being written. In the picture: National Pantheon, or


Church of Saint Engratia, Lisbon (source: http://www.panteaonacional.gov.
pt/171-2/historia-2/), somewhen during its construction (16821966).
568 CHAPTER 42. CONTROL OF STOCHASTIC SYSTEMS

Glossary
I shook my head: I could not see how poor people had the means
of being kind; and then to learn to speak like them, to adopt their
manners, to be uneducated, to grow up like one of the poor women
I saw sometimes nursing their children or washing their clothes at
the cottage doors of the village of Gateshead: no, I was not heroic
enough to purchase liberty at the price of caste.

Charlotte Brontë (1816 „1855), Jane Eyre: An Autobiography, III

adaptive control controlo adaptativo


minimum variance control controlo de variância mínima
generalised (generalized, US) minimum variance control controlo de
variância mínima generalizado
sub-optimal minimum variance control controlo sub-ótimo de variância
mínima
pole assignment control controlo por colocação de polos

Exercises
1. Consider a plant with sampling time Ts and an output given by

y(t) = 0.6 y(t−Ts )+0.1 y(t−2Ts )+u(t−Ts )+2 u(t−2Ts )+e(t)−0.5 e(t−Ts )
(42.87)
where e(t) is white noise and u(t) is a manipulated input. Find the transfer
function R z −1 of a minimum variance regulator for this plant. Hint:

notice that there is a non-minimum phase zero.

2. Find a controller for plant (42.15) of Example 42.1 that places the poles
of the closed loop at z = 10 1
and z = 201
. Hint: use Matlab for the
calculations.
Epilogue

569
Chapter 43

What next?
Beloved pupil! Tamed by thee, Caro discípulo, que bem dominas
Addish-, Subtrac-, Multiplica-tion, somas, produtos e subtrações,
Division, Fractions, Rule of Three, regras de três, razões e quocientes,
Attest thy deft manipulation! fazendo dextras manipulações:

Then onward! Let the voice of Fame avança, pois, para que a voz da Fama
From Age to Age repeat thy story, de era em era ecoe a tua história,
Till thou hast won thyself a name até que alcances para ti um nome
Exceeding even Euclid's glory! que exceda até de Euclides mesmo a glória!

Lewis Carroll (1832 „1898), A tangled tale, To my pupil (transl. Duarte


Valério)

This chapter not only brings together some odd ends left behind in previous
chapters, as it tries to show that what you have learned is related to many
subjects outside the scope of these Lecture Notes, which you may with this
background easily learn in dedicated courses.
This chapter is still being written. In the picture: National Pantheon, or
Church of Saint Engratia, Lisbon (source: http://www.panteaonacional.gov.
pt/171-2/historia-2/).

43.1 Discrete events and automation


This section concerns a particular type of control systems, called automation
systems, involving binary variables.

43.2 State-space representations of systems con-


tinuous in time
Linear systems, both continuous in time and discrete, can be put in a matrix
form that is convenient for several techniques of modelling, control, and identi-
cation. Let us rst see how this can be done for continuous time.

43.3 State-space representations of systems dis-


crete in time
Systems which are discrete in time can also be put in a state-space representa-
tion.

43.4 MIMO systems and MIMO control


While we have only been concerned with SISO systems, MIMO systems are in
fact ubiquitous. They can be represented in matrix form, either using transfer
functions or state-space representations.

571
572 CHAPTER 43. WHAT NEXT?

43.5 Optimal control


In this section we have a very brief introduction to techniques of controller
design called optimal control.

43.6 Fractional order control


Fractional order derivatives and systems, which were dealt with in Part VII, can
be used for controller design in a variety of ways. In short, the main ones are:

ˆ Fractional PID control

ˆ First-generation CRONE control

ˆ Second-generation CRONE control

ˆ Third-generation CRONE control

ˆ Non-linear fractional control

ˆ Variable order fractional control

43.7 Other areas


In this course we have studied many tools of modelling, control, and identica-
tion that can be applied to systems and signals that have little or nothing to
do with mechatronics. They can be used in many areas as dierent as biology,
economy, or military sciences, once you grasp how.

This chapter is still being written. In the picture: National Pantheon, or


Church of Saint Engratia, Lisbon (source: http://www.panteaonacional.gov.
pt/171-2/historia-2/).

Glossary
Had We revealed it as a non-Arabic Quran, they would have certainly
argued, If only its verses were made clear [in our language]. What!
A non-Arabic revelation for an Arab audience!

Muhammad ibn Abdullah (570? „632), Quran xli 44, Mustafa Khattab
version
43.7. OTHER AREAS 573

discrete event evento discreto


demand procura (demanda, bras.)
optimal control controlo ótimo
predatorprey predadorpresa
supply oferta

You might also like