0% found this document useful (0 votes)
22 views385 pages

Book MPC

Uploaded by

Luis C
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
0% found this document useful (0 votes)
22 views385 pages

Book MPC

Uploaded by

Luis C
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/ 385

PREDICTIVE CONTROL

WITH CONSTRAINTS

J.M.Maciejowski
Reader in Control Engineering
University of Cambridge
Fellow, Pembroke College, Cambridge

15 October 2000
ii

Copyright c 1998–2000 J.M.Maciejowski. All Rights Reserved.

MATLAB and Simulink are registered trademarks of The MathWorks, Inc.


DMCPlus is a registered trademark of Aspen Technology Inc.
RMPCT is a registered trademark of Honeywell Inc.
Connoisseur is a registered trademark of Simulation Sciences Inc.
3dMPC is a registered trademark of ABB Automation Products AB.

World-Wide Web site for this book:

http://www.booksites.net/maciejowski/
Preface

Predictive Control, or Model-Based Predictive Control (‘MPC’ or ‘MBPC’) as it is


sometimes known, is the only advanced control technique — that is, more advanced
than standard PID control — to have had a significant and widespread impact on
industrial process control. The main reason for this is that it is

• The only generic control technology which can deal routinely with equipment
and safety constraints.

Operation at or near such constraints is necessary for the most profitable or most ef-
ficient operation in many cases. The penetration of predictive control into industrial
practice has also been helped by the facts that

• Its underlying idea is easy to understand,

• Its basic formulation extends to multivariable plants with almost no modifica-


tion,

• It is more powerful than PID control, even for single loops without constraints,
without being much more difficult to tune, even on ‘difficult’ loops such as those
containing long time delays.

Predictive control was developed and used in industry for nearly 20 years before
attracting much serious attention from the academic control community. This com-
munity tended to ignore its potential for dealing with constraints, thus missing its
main advantage. In addition, it tended to point to the fact that, when constraints
are ignored, predictive control is equivalent to conventional, though generally ‘ad-
vanced’, linear control, and hence apparently nothing new. This is true, but again
misses the important point that issues such as tunability and understandability are
crucial for the acceptance of a control technology, at least in the process control envi-
ronment. Fortunately the academic community has for some years now appreciated
that predictive control really does offer something new for control in the presence
of constraints, and has provided much analysis, and new ideas, to such an extent
that it has gone beyond current industrial practice, and is preparing the ground for

iii
iv 0. Preface

much wider application of predictive control — potentially to almost all control en-
gineering problems. The constant increase in computing speed and power certainly
makes that a real prospect.

In this book I have attempted to bring everything together. I have tried to convey
the simplicity of the underlying concepts of predictive control, but also to show how
it relates to existing control theory, and indeed how much more can be done with
it when its use is informed by a knowledge of standard control techniques, such as
state estimation, disturbance modelling, and frequency response analysis. Predictive
control involves optimization, and I have included details of how to solve at least
some of the optimization problems encountered. I have also tried to display the main
directions of current research, and give some indication of likely future directions,
both of research and of applications.

This book assumes that the reader has some previous exposure to control theory,
such as a first course and some contact with state-space models. It will be suitable
for graduate students taking systems and control courses, but I hope that it will also
prove useful to practising industrial engineers. In order to increase its usefulness to
non-students, and also to alleviate the problem of prerequisites for students, I have
included a number of minitutorials. These are one-page summaries of topics, such
as observers or Lyapunov equations, that are needed in order to understand the ma-
terial at certain points. I believe that the minitutorials contain enough explanation
to allow the reader to follow the developments in the book, but of course they are
not meant to replace in-depth study of these important topics.

It is essential to have access to suitable software in order to solve any


non-trivial predictive control problems, and to gain experience of how it
actually works. This book assumes that the reader has access to MAT-
LAB, together with its Control System Toolbox and Model Predictive
Control Toolbox. Some simple MATLAB files have also been written,
and some files which augment those available in the Model Predictive
Control Toolbox— some of these also require the Optimization Toolbox.
All such additional software is available on this book’s World-Wide Web
site:

http://www.booksites.net/maciejowski/

The versions of software used for the preparation of this book were:
MATLAB 5.3.1
Control System Toolbox 4.2.1
Model Predictive Control Toolbox 1.0.4
Optimization Toolbox 2.0

My students Eric Kerrigan and Simon Redhead were responsible for most of the
modifications to Model Predictive Control Toolbox functions which are available on
the web site.
v

This book originated in a course of lectures given at the Faculty of Aerospace Engi-
neering in Delft, during November and December 1997. I would like to thank Bob
Mulder, Hans van der Vaart, and Samir Bennani for inviting me to spend a sab-
batical term at Delft, for making all the arrangements, for making my stay at Delft
both pleasant and interesting, and above all for having enough vision to believe that
a course on predictive control was not out of place in an aerospace department. I
would also like to thank Ton van den Boom for giving me feedback on the first few
chapters, Rob de Vries (both of TU Delft) for some valuable help with chapter 4,
and Hans van der Vaart for providing me with the linearised model of the Citation
aircraft which is used in a number of illustrative examples in the book. The use of an
aircraft example may seem quirky, since predictive control has been used almost ex-
clusively in the process industries. There are two reasons for this. Firstly, it reflects
my conviction that predictive control has great potential in all application sectors,
as a result of continuing increases in real-time computational possibilities. Secondly,
most process control examples require considerable explanation of the context to
those who are not chemical engineers, whereas most readers will be able to under-
stand the (very simplified) aircraft example from their own experience. Of course
there are also examples based on process control in the book, and the major case
studies in Chapter 9 are both taken from process control.

I gave a graduate course based on the material in this book to the Centre for Process
Control Design at Lund University, and received several very valuable suggestions
from both faculty and students who attended that course. Andrew Ogden-Swift of
Honeywell Hi-Spec Solutions, Sean Goodhart of Aspentech, David Sandoz of SimSci–
Predictive Control, and Jacques Richalet of Adersa have all been very generous of
their time, have provided me with details of their companies’ products, and have
discussed the practicalities of predictive control most valuably and stimulatingly.
David Sandoz and David Clarke both provided extremely useful, but also encour-
aging, feedback at various stages of the development of the manuscript, and Fred
Loquasto of UC Santa Barbara read the almost-final version in record time, and
picked up several errors and infelicities.

Any errors remain my own responsibility, of course.

J.M.Maciejowski
14 October 2000
vi 0. Preface
Contents

Preface iii

1 Introduction 1

1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 The ‘Receding Horizon’ Idea . . . . . . . . . . . . . . . . . . . . . . . 7

1.3 Computing the Optimal Inputs . . . . . . . . . . . . . . . . . . . . . 10

1.4 A Simple MATLAB Program . . . . . . . . . . . . . . . . . . . . . . 15

1.5 Offset-free Tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

1.6 Unstable Plant . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

1.7 Early History and Terminology . . . . . . . . . . . . . . . . . . . . . 27

1.8 Predictive Control in the Control Hierarchy . . . . . . . . . . . . . . 28

1.9 General Optimal Control Formulation . . . . . . . . . . . . . . . . . 32

1.10 What Is In This Book . . . . . . . . . . . . . . . . . . . . . . . . . . 34

1.11 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

2 A Basic Formulation of Predictive Control 41

2.1 State-space models . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

2.1.1 Form of the model . . . . . . . . . . . . . . . . . . . . . . . . 41

2.1.2 Linear model, nonlinear plant . . . . . . . . . . . . . . . . . . 42

2.1.3 First-principles models and system identification . . . . . . . 45

vii
viii CONTENTS

2.2 A Basic Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

2.3 General Features of Constrained Predictive Control . . . . . . . . . . 53

2.4 Alternative State Variable Choices . . . . . . . . . . . . . . . . . . . 54

2.5 Allowing for Computational Delay . . . . . . . . . . . . . . . . . . . 56

2.6 Prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

2.6.1 No disturbances, Full state measurement . . . . . . . . . . . . 60

2.6.2 Constant output disturbance . . . . . . . . . . . . . . . . . . 63

2.6.3 Using an observer . . . . . . . . . . . . . . . . . . . . . . . . 64

2.6.4 Independent and re-aligned models . . . . . . . . . . . . . . . 69

2.7 Example: Citation Aircraft Model . . . . . . . . . . . . . . . . . . . 71

2.8 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

3 Solving Predictive Control Problems 83

3.1 Unconstrained Problems . . . . . . . . . . . . . . . . . . . . . . . . . 83

3.1.1 Measured State, No Disturbances . . . . . . . . . . . . . . . . 83

3.1.2 Formulation as a Least-Squares Problem . . . . . . . . . . . . 86

3.1.3 Structure of the Unconstrained Controller . . . . . . . . . . . 88

3.1.4 Estimated State . . . . . . . . . . . . . . . . . . . . . . . . . 90

3.2 Constrained Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 91

3.2.1 Formulation as a QP Problem . . . . . . . . . . . . . . . . . . 91

3.2.2 Controller Structure . . . . . . . . . . . . . . . . . . . . . . . 95

3.3 Solving QP Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

3.3.1 Active set methods . . . . . . . . . . . . . . . . . . . . . . . . 101

3.3.2 Interior point methods . . . . . . . . . . . . . . . . . . . . . . 107

3.4 Softening the Constraints . . . . . . . . . . . . . . . . . . . . . . . . 110

3.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117


CONTENTS ix

4 Step Response and Transfer Function Formulations 121

4.1 Step and Pulse Response Models . . . . . . . . . . . . . . . . . . . . 121

4.1.1 Step and Pulse Responses . . . . . . . . . . . . . . . . . . . . 121

4.1.2 Relations to State-Space Models . . . . . . . . . . . . . . . . 124

4.1.3 Prediction Using Step Response Model . . . . . . . . . . . . . 126

4.1.4 State-Space Models From Step Responses . . . . . . . . . . . 128

4.2 Transfer Function Models . . . . . . . . . . . . . . . . . . . . . . . . 135

4.2.1 The Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

4.2.2 Prediction Using Transfer Functions . . . . . . . . . . . . . . 138

4.2.3 Prediction with a Disturbance Model . . . . . . . . . . . . . . 140

4.2.4 The GPC Model . . . . . . . . . . . . . . . . . . . . . . . . . 148

4.2.5 State-Space Interpretations . . . . . . . . . . . . . . . . . . . 149

4.2.6 Multivariable Systems . . . . . . . . . . . . . . . . . . . . . . 157

4.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159

5 Other Formulations of Predictive Control 161

5.1 Measured Disturbances and Feedforward . . . . . . . . . . . . . . . . 161

5.2 Stabilised Predictions . . . . . . . . . . . . . . . . . . . . . . . . . . 164

5.3 Decomposition of Unstable Model . . . . . . . . . . . . . . . . . . . . 166

5.4 Non-quadratic Costs . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

5.4.1 Characteristics of LP and QP problems . . . . . . . . . . . . 168

5.4.2 Absolute value formulations . . . . . . . . . . . . . . . . . . . 171

5.4.3 Min-max formulations . . . . . . . . . . . . . . . . . . . . . . 172

5.5 Zones, Funnels and Coincidence Points . . . . . . . . . . . . . . . . . 173

5.6 Predictive Functional Control (PFC) . . . . . . . . . . . . . . . . . . 175

5.7 Continuous-time Predictive Control . . . . . . . . . . . . . . . . . . . 181


x CONTENTS

5.8 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

6 Stability 185

6.1 Terminal Constraints Ensure Stability . . . . . . . . . . . . . . . . . 187

6.2 Infinite Horizons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

6.2.1 Infinite horizons give stability . . . . . . . . . . . . . . . . . . 191

6.2.2 Constraints and infinite horizons — stable plant . . . . . . . 195

6.2.3 Constraints and infinite horizons — unstable plant . . . . . . 197

6.3 Fake Algebraic Riccati Equations . . . . . . . . . . . . . . . . . . . . 198

6.4 Using the Youla Parametrization . . . . . . . . . . . . . . . . . . . . 203

6.5 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

7 Tuning 207

7.1 What Are We Trying To Do? . . . . . . . . . . . . . . . . . . . . . . 207

7.2 Some Special Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

7.2.1 Effect of Control Weighting . . . . . . . . . . . . . . . . . . . 211

7.2.2 Mean-Level Control . . . . . . . . . . . . . . . . . . . . . . . 211

7.2.3 Deadbeat Control . . . . . . . . . . . . . . . . . . . . . . . . 212

7.2.4 ‘Perfect’ Control . . . . . . . . . . . . . . . . . . . . . . . . . 213

7.3 Frequency-Response Analysis . . . . . . . . . . . . . . . . . . . . . . 218

7.4 Disturbance Models and Observer Dynamics . . . . . . . . . . . . . . 221

7.4.1 Disturbance models . . . . . . . . . . . . . . . . . . . . . . . 221

7.4.2 Observer dynamics . . . . . . . . . . . . . . . . . . . . . . . . 224

7.5 Reference Trajectory and Pre-Filter . . . . . . . . . . . . . . . . . . 231

7.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

8 Robust Predictive Control 239


CONTENTS xi

8.1 Formulations of Robust Control . . . . . . . . . . . . . . . . . . . . . 239

8.1.1 Norm-bounded uncertainty . . . . . . . . . . . . . . . . . . . 240

8.1.2 Polytope uncertainty . . . . . . . . . . . . . . . . . . . . . . . 242

8.2 The Tuning Procedure of Lee and Yu . . . . . . . . . . . . . . . . . . 243

8.2.1 Simplified disturbance and noise model . . . . . . . . . . . . 243

8.2.2 Tuning procedure . . . . . . . . . . . . . . . . . . . . . . . . . 248

8.3 The LQG/LTR Tuning Procedure . . . . . . . . . . . . . . . . . . . 249

8.4 LMI Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

8.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

8.4.2 Robustness without constraints . . . . . . . . . . . . . . . . . 257

8.4.3 Robustness with constraints . . . . . . . . . . . . . . . . . . . 261

8.5 Robust feasibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263

8.5.1 Maximal output admissible sets . . . . . . . . . . . . . . . . . 264

8.5.2 Robust admissible and invariant sets . . . . . . . . . . . . . . 266

8.6 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

9 Two Case Studies 273

9.1 Shell Oil Fractionator . . . . . . . . . . . . . . . . . . . . . . . . . . 273

9.1.1 Process description . . . . . . . . . . . . . . . . . . . . . . . . 273

9.1.2 Control specifications . . . . . . . . . . . . . . . . . . . . . . 276

9.1.3 Initial controller design . . . . . . . . . . . . . . . . . . . . . 278

9.1.4 Controller performance and refinement . . . . . . . . . . . . . 283

9.1.5 Constraint softening . . . . . . . . . . . . . . . . . . . . . . . 286

9.1.6 Robustness to model errors . . . . . . . . . . . . . . . . . . . 288

9.2 Newell and Lee Evaporator . . . . . . . . . . . . . . . . . . . . . . . 295

9.3 Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301


xii CONTENTS

10 Perspectives 303

10.1 Spare Degrees of Freedom . . . . . . . . . . . . . . . . . . . . . . . . 303

10.1.1 Ideal resting values . . . . . . . . . . . . . . . . . . . . . . . . 303

10.1.2 Multiobjective formulations . . . . . . . . . . . . . . . . . . . 304

10.1.3 Fault tolerance . . . . . . . . . . . . . . . . . . . . . . . . . . 305

10.2 Constraint Management . . . . . . . . . . . . . . . . . . . . . . . . . 308

10.3 Nonlinear Internal Models . . . . . . . . . . . . . . . . . . . . . . . . 311

10.3.1 Motivation and approaches . . . . . . . . . . . . . . . . . . . 311

10.3.2 Sequential quadratic programming . . . . . . . . . . . . . . . 312

10.3.3 Neural net models . . . . . . . . . . . . . . . . . . . . . . . . 313

10.3.4 Sub-optimal nonlinear MPC . . . . . . . . . . . . . . . . . . . 315

10.4 Moving-Horizon Estimation . . . . . . . . . . . . . . . . . . . . . . . 317

10.5 Concluding Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . 318

References 320

A Some Commercial MPC Products 335

A.1 Aspentech: DMCPlus . . . . . . . . . . . . . . . . . . . . . . . . . . 336

A.2 Honeywell: RMPCT . . . . . . . . . . . . . . . . . . . . . . . . . . . 338

A.3 Simulation Sciences: Connoisseur . . . . . . . . . . . . . . . . . . . . 340

A.4 Adersa: PFC and HIECON . . . . . . . . . . . . . . . . . . . . . . . 341

A.5 ABB: 3dMPC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

A.6 Pavilion Technologies Inc: Process Perfecter . . . . . . . . . . . . . . 342

B MATLAB Program basicmpc 343

C The MPC Toolbox 349


CONTENTS xiii

C.1 General remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349

C.2 Functions scmpc2 and scmpcnl2 . . . . . . . . . . . . . . . . . . . . 353

C.3 Functions scmpc3 and scmpc4 . . . . . . . . . . . . . . . . . . . . . . 354

Author Index 355

Subject Index 358


xiv CONTENTS
List of Mini-Tutorials

1 Quadratic Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

2 State Observers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

3 Convex Optimization, QP and LP Problems . . . . . . . . . . . . . . 94

4 The Singular Value Decomposition . . . . . . . . . . . . . . . . . . . 131

5 Diophantine Equations . . . . . . . . . . . . . . . . . . . . . . . . . . 141

6 Stability and Lyapunov Functions . . . . . . . . . . . . . . . . . . . 189

7 Linear Quadratic Optimal Control . . . . . . . . . . . . . . . . . . . 200

8 Interpreting Frequency Responses . . . . . . . . . . . . . . . . . . . . 220

9 The Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

10 Linear Matrix Inequalities . . . . . . . . . . . . . . . . . . . . . . . . 259

xv
xvi LIST OF MINI-TUTORIALS
List of Figures

1.1 Semi-batch reactor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.2 Set-point improvement available from the use of predictive control. . 5

1.3 Surge level control . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.4 Predictive Control: The Basic Idea . . . . . . . . . . . . . . . . . . . 8

1.5 Results from basicmpc, exact model . . . . . . . . . . . . . . . . . . 19

1.6 Results from basicmpc with incorrect model gain . . . . . . . . . . . 20

1.7 Results from trackmpc with incorrect model gain . . . . . . . . . . . 21

1.8 Input and output disturbances, and measurement noise . . . . . . . 23

1.9 Simulation of system with input and output disturbances, and mea-
surement noise, using noisympc. . . . . . . . . . . . . . . . . . . . . 24

1.10 Control of unstable helicopter using unstampc . . . . . . . . . . . . . 26

1.11 Typical use of predictive control — current practice . . . . . . . . . 29

1.12 Use of predictive control — future trend? . . . . . . . . . . . . . . . 31

2.1 Paper machine with headbox . . . . . . . . . . . . . . . . . . . . . . 51

2.2 The boundary between controller and plant — a matter of convenience 55

2.3 Assumed timing of measuring and applying signals . . . . . . . . . . 57

2.4 Output disturbance . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

2.5 A State Observer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

2.6 Response of Citation aircraft to 40 m step change in altitude set-point. 72

xvii
xviii LIST OF FIGURES

2.7 Response of Citation aircraft to 400 m step change in altitude set-point. 74

2.8 Response of Citation aircraft to 400 m step change in altitude set-


point, with altitude rate constraint. . . . . . . . . . . . . . . . . . . . 75

2.9 Response to disturbance with altitude rate constraint. . . . . . . . . 76

2.10 Response to disturbance with altitude rate set-point. . . . . . . . . . 77

2.11 Response of Citation aircraft to 400 m step change in altitude set-


point, with altitude rate constraint and plant-model error. . . . . . . 78

3.1 Structure of controller with no constraints and full state measurement. 89

3.2 Structure of controller with no constraints and state observer. . . . . 90

3.3 Structure of controller with constraints and state observer. . . . . . . 95

3.4 A quadratic cost surface and a linear inequality constraint: Constraint


inactive. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

3.5 A quadratic cost surface and a linear inequality constraint: Constraint


active. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

3.6 Basic interior point method for Example 3.1. . . . . . . . . . . . . . 109

3.7 Plant-model error and hard constraints result in infeasibility. . . . . 113

3.8 Soft output constraints restore feasibility. 1-norm penalty with ρ = 104 .114

3.9 Response to disturbance with softened altitude rate constraint, ρ =


5 × 105 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116

3.10 Response to disturbance with softened altitude rate constraint, ρ = 104 .117

4.1 Step response of 3-input, 2-output distillation column. Solid curves:


original responses. Dotted curves: responses of 8-state model. . . . . 134

4.2 The first 15 singular values of H250 for the example. . . . . . . . . . 135

4.3 Spectral density of crew disturbance, modelled by (4.109) with ρ = 0.98.143

4.4 Generation of v̂(k|k) — one interpretation. . . . . . . . . . . . . . . 145

4.5 GPC applied to unstable helicopter. . . . . . . . . . . . . . . . . . . 157

5.1 Feedforward from measured disturbances . . . . . . . . . . . . . . . . 162


LIST OF FIGURES xix

5.2 Decomposition of unstable plant as feedback interconnection of two


stable systems. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

5.3 Decomposition of unstable plant as stable model and ‘measured quasi-


disturbance’. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167

5.4 Coprime factorisation of unstable system, and its approximation. . . 168

5.5 Cost contours and constraints for LP (left) and QP (right) problems.
The black dot shows the optimal solution in each case. . . . . . . . . 169

5.6 Using a QP formulation to place the desired operating point just


inside the feasible region. Left: x1 deviations cheaper than x2 devia-
tions. Right: x2 deviations cheaper than x1 deviations. . . . . . . . . 171

5.7 A zone objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

5.8 A funnel objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

5.9 A funnel objective with a straight line boundary . . . . . . . . . . . 176

5.10 A reference trajectory with only a few coincidence points . . . . . . . 177

5.11 A future input built up from a polynomial basis. . . . . . . . . . . . 178

6.1 Finite and infinite horizons (no disturbances, perfect model) . . . . . 192

6.2 Finite horizon and deadbeat response . . . . . . . . . . . . . . . . . 192

6.3 Youla parametrisation of all stable feedback systems (if the plant is
stable). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

7.1 Two degree of freedom feedback system. . . . . . . . . . . . . . . . . 209

7.2 Mean-level control: set-point change on r1 . . . . . . . . . . . . . . . 215

7.3 Mean-level control: set-point change on r3 . . . . . . . . . . . . . . . 215

7.4 Default (DMC) observer: response to step disturbance. . . . . . . . . 216

7.5 Deadbeat observer: response to step disturbance. . . . . . . . . . . . 216

7.6 Deadbeat set-point response. Step demand on r1 . . . . . . . . . . . . 217

7.7 ‘Perfect’ controller: Set-point response. Step demand on r1 . . . . . . 218

7.8 ‘Perfect’ controller: Set-point response. Step demand on r3 . . . . . . 219


xx LIST OF FIGURES

7.9 Singular values of S(z) (solid line) and T (z) (broken line) for mean-
level control of the headbox. . . . . . . . . . . . . . . . . . . . . . . . 221

7.10 A ‘proportional + integral’ (PI) controller . . . . . . . . . . . . . . . 223

7.11 Predictive controller, unconstrained case. . . . . . . . . . . . . . . . 224

7.12 Predictive controller, simplified. . . . . . . . . . . . . . . . . . . . . . 225

7.13 Predictive controller, simplified again. . . . . . . . . . . . . . . . . . 226

7.14 Control of water temperature with perfect plant model, and model
of air temperature disturbance. W = 1, V = 10−6 . The broken line
shows the air temperature. . . . . . . . . . . . . . . . . . . . . . . . . 229

7.15 Control of water temperature with model of air temperature dis-


turbance. Perfect (solid line) and imperfect (broken line) models.
W = 1, V = 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

7.16 Control of water temperature with model of air temperature distur-


bance, heater power constraints, and imperfect model. W = 1, V = 1. 231

7.17 Controller structure with reference trajectories: Non-anticipated set-


point. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

7.18 Controller structure with reference trajectories: Anticipated set-point. 234

8.1 Feedback combination of controller and plant, with additive uncer-


tainty model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

8.2 The disturbance and noise model used by Lee and Yu [LY94] . . . . 244

8.3 The LQ state feedback regulator . . . . . . . . . . . . . . . . . . . . 250

8.4 The Kalman filter as a feedback system . . . . . . . . . . . . . . . . 251

8.5 The closed loop with LQG controller . . . . . . . . . . . . . . . . . . 251

8.6 Disturbance and noise model used for LQG/LTR. . . . . . . . . . . . 255

9.1 The ‘Shell’ heavy oil fractionator. . . . . . . . . . . . . . . . . . . . . 274

9.2 Open-loop step responses of the ‘Shell’ heavy oil fractionator. . . . . 277

9.3 Hankel singular values of the ‘Shell’ heavy oil fractionator, with Ts = 4
minutes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
LIST OF FIGURES xxi

9.4 Response with initial tuning parameters. . . . . . . . . . . . . . . . . 284

9.5 Response with increased weight on z1 and z2 tracking errors, and


penalised control moves. . . . . . . . . . . . . . . . . . . . . . . . . . 285

9.6 Response to measured disturbance. . . . . . . . . . . . . . . . . . . . 286

9.7 Response to unmeasured disturbance. . . . . . . . . . . . . . . . . . 287

9.8 Response to measured and unmeasured disturbances, and soft con-


straints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

9.9 Response to measured and unmeasured disturbances, and hard con-


straints on ẑ(k + i|k) for i > 3. . . . . . . . . . . . . . . . . . . . . . 289

9.10 Largest singular values of sensitivity S(z) (broken line) and comple-
mentary sensitivity T (z) (solid line). . . . . . . . . . . . . . . . . . . 290

9.11 Largest singular value (solid line), and estimates of complex µ (broken
line) and real µ (chained line) of K(z)S(z)W (z). . . . . . . . . . . . 291

9.12 Response with plant-model mismatch, unmeasured disturbance, and


soft constraints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

9.13 Response with plant-model mismatch, unmeasured disturbance, soft


constraints, and increased control move penalty. . . . . . . . . . . . . 293

9.14 Response with correct model, unmeasured disturbance, and increased


control move penalty. . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

9.15 Largest singular value (solid line), complex µ (broken line) and real
µ (chained line) of K(z)S(z)W (z) with the reduced-gain controller. . 294

9.16 Forced-circulation evaporator . . . . . . . . . . . . . . . . . . . . . . 295

9.17 Simulink model of the evaporator . . . . . . . . . . . . . . . . . . . . 298

9.18 Simulation with single linearised model, obtained at the initial equi-
librium condition. (Broken lines show the set-points.) . . . . . . . . 299

9.19 Simulation with a re-linearised internal model, obtained 70 minutes


into the simulation run. (Broken lines show the set-points.) . . . . . 300

9.20 Simulation with a re-linearised internal model obtained every 10 min-


utes of simulated time. (Broken lines show the set-points.) . . . . . . 301

10.1 Execution of a step change in yaw angle with a jammed rudder. . . . 306
xxii LIST OF FIGURES

10.2 LNG liquefaction plant . . . . . . . . . . . . . . . . . . . . . . . . . . 307

10.3 LNG plant: Response in normal operation . . . . . . . . . . . . . . . 308

10.4 LNG plant: Valve H stuck, controller unaware . . . . . . . . . . . . . 309


Chapter 1

Introduction

1.1 Motivation

The only advanced control methodology which has made a significant impact on
industrial control engineering is predictive control. It has so far been applied mainly
in the petrochemical industry, but is currently being increasingly applied in other
sectors of the process industry. The main reasons for its success in these applications
are:

1. It handles multivariable control problems naturally.

2. It can take account of actuator limitations.

3. It allows operation closer to constraints (compared with conventional control),


which frequently leads to more profitable operation. Remarkably short pay-
back periods have been reported.

4. Control update rates are relatively low in these applications, so that there is
plenty of time for the necessary on-line computations.

In addition to the ‘constraint-aware optimising’ variety of predictive control, there


is an ‘easy-to-tune, intuitive’ variety, which puts less emphasis on constraints and
optimization, but more emphasis on simplicity and speed of computation, and is
particularly suitable for single-input, single-output (‘SISO’) problems. This variety
has been applied in high-bandwidth applications such as servomechanisms, as well
as to relatively slow processes.

Modern computing hardware is now so fast that it is no longer necessary to dis-


tinguish between these two varieties of predictive control. It has been estimated
that during the last ten years the increase in the speed of hardware, together with

1
2 1. Introduction

improvements in optimization algorithms, could in principle allow the speed of so-


lution of convex optimization problems — which are central to predictive control —
to have increased by a factor of 106 [RTV97]. That is, problems which required 10
minutes to solve ten years ago should only require about 600 microseconds now. Of
course that is an exaggeration; it considers only the speed of the processor, and ig-
nores factors such as memory access times — a ‘fetch’ from memory can take more
than 100 processor clock cycles — but even if it is over-optimistic by a factor of
102 , it is compelling evidence that predictive control need no longer be confined to
‘slow’ processes, even with the full paraphernalia of constraints and optimization.
Furthermore, this estimate does not take account of efficiencies which are possible
due to the structure of the predictive control problem, and which have only recently
been discovered [RWR98].

For this reason, this book does not make a big distinction between the two varieties of
predictive control identified above, but gives a unified treatment of both of them. In
this chapter, the underlying ideas are introduced along the lines of the ‘easy-to-tune,
intuitive’ variety — which is already capable of handling very non-trivial problems,
as Example 1.8 shows. More details of this approach to predictive control are given
later in section 5.6. But most of the following chapters treat the predictive control
problem in its full complexity, and hence in its most useful form: multivariable, and
with constraints.

The importance of being able to take account of constraints arises for several reasons.
The reason cited most often for the success of predictive control in the process
industries, is that the most profitable operation is often obtained when a process is
running at a constraint, or even at more than one constraint. Often these constraints
are associated with direct costs, frequently energy costs; if a product requires heating
during its manufacture, for instance, the manufacturing cost can be minimised by
keeping the heat supplied as small as possible; nevertheless the heat supplied (and its
profile with time) has to be sufficient, and this is a constraint on the manufacturing
process. If a product has to be of at least a certain quality in order to be useful, the
cost can usually be minimised by making its quality just sufficient; again, this is a
constraint which has to be respected. These are examples of constraints on outputs
of controlled processes: the quality of the product is either a controlled variable
itself, or depends on some combination of controlled variables.

Constraints on the control signals, that is inputs to the process, or manipulated


variables, are also present. Most commonly these constraints are in the form of
saturation characteristics: valves with a finite range of adjustment, flow rates with
maximum values due to fixed pipe diameters, control surfaces with limited deflection
angles. Input constraints also appear in the form of rate constraints: valves and other
actuators with limited slew rates. These constraints, especially of the saturation
type, are also often active when a process is running at its most profitable condition.
They may limit the production rate, for example.

Example 1.1 Semi-batch reactor


1.1. Motivation 3

Figure 1.1 shows a semi-batch reactor. A reactant enters the reactor on the left. An
exothermic reaction occurs, whose temperature is controlled to a set-point by adjust-
ing the flow of cooling water to the heat-exchanger shown on the right. A successful
reaction requires the temperature to be held close to the set-point (possibly within
specified limits). The reactant flow rate and the cooling water flow rate can both be
adjusted between minimum and maximum limits. The economic objective is to finish
the batch as quickly as possible, subject to these requirements and constraints. In
practice, that is equivalent to keeping the reactant flow rate as large as possible.

Figure 1.1: Semi-batch reactor

There are many other control systems in which the performance is limited by the
presence of constraints, even if that performance is not naturally expressed in mon-
etary terms. Traditionally, control system performance requirements have not been
formulated in a way which reflects this, partly because the available control design
and implementation technologies have not been able to support such a formulation.
But the feasibility of using predictive control in an increasing range of applications
highlights not only the importance of constraints in such applications, but also the
natural way in which quite complex control objectives can be stated, once constraints
can be explicitly stated as part of the problem formulation.

• Compressors typically operate most efficiently at or close to the ‘surge line’,


but can suffer catastrophic failure if the operating point crosses to the wrong
side of the line; that is clearly a hard constraint on any compressor control
system.1
1
The surge line constraint is a nonlinear inequality constraint involving the pressure ratio across
the compressor and the flow rate through it. Most formulations of predictive control assume linear
inequality constraints. But the nonlinear constraint can be approximated by one or more linear
constraints.
4 1. Introduction

• Automotive pollution legislation leads to running internal combustion engines


at relatively weak fuel/air ratios. This makes the engines liable to stall, and
has led to widespread introduction of engine control systems. Currently these
systems are not formulated as predictive control systems, but a natural for-
mulation of the control problem in this case is one which contains both the
legislated pollution limits, and the torque production requirements, as con-
straints.

• Underwater vehicles, both military (submarines) and commercial (oil platform


maintenance etc), have a requirement to perform manoeuvres as quickly as
possible, either to evade pursuers or to reduce operating costs. But they
typically have constraints on allowable pitch and roll angles and on rate of
change of depth, arising from the needs of internal equipment and of the crew.
So again there are scenarios in which the best performance is obtained by
operating for an extended period at one or more constraints.

Of course one does not really want to operate a plant exactly at the real limits
of its capabilities. One has to have something in reserve, to deal with unexpected
disturbances from various sources. But the better the control system is at dealing
with such disturbances, the closer can one operate to the constraints. A classical
argument in favour of linear optimal control is that if the disturbances are random,
and if one can reduce the variance of the controlled outputs as far as possible, then
one can operate as near as possible to the constraints, and hence operate the plant
as near as possible to its optimal performance. This is illustrated in Figure 1.2.
This shows three hypothetical probability distributions of some controlled output of
a plant, and a constraint beyond which the output should not stray. Distribution
(a) shows the Gaussian shape and relatively large variance which results from the
use of a relatively badly-tuned linear controller, assuming that the plant behaves
approximately linearly, and that the disturbances have a Gaussian distribution. In
order to have an acceptably low probability of violating the constraint, the set-point
for the output variable has to be set relatively far away from the constraint, and
hence the plant operates far away from the optimal point for the great majority of
the time. Distribution (b) shows a distribution which might be achieved by the use
of linear optimal control. The variance has been reduced, thus allowing the set-point
to be significantly closer to the constraint. The distribution remains Gaussian, since
the control law is linear.

Distribution (c) shows the effect of using predictive control. The controller is aware
of the constraint, and hence reacts very differently in response to a disturbance
which pushes the output towards the constraint, than it would do in response to
a disturbance which pushes it away from it. The controller is therefore nonlinear,
and the distribution of the output variable is no longer Gaussian . It becomes
significantly unsymmetric, with the result that it is possible to operate the plant
with a set-point very close to the constraint, while retaining an acceptably small
1.1. Motivation 5

(c)

(b)

Constraint

(a)

Figure 1.2: Set-point improvement available from the use of predictive control.

probability of violating the constraint.2

Another reason for the importance of being able to take account of constraints
is the presence of buffer tanks in many processes. Such tanks are often used to
store product between individual units in production processes, and their principal
purpose is to absorb the effects of disturbances in one unit, thus preventing the
propagation of the effects to downstream units. The level of liquid in such a buffer
tank has to be controlled, in order to ensure that it does not become completely
empty or full, but between these limits it can be allowed to vary. In fact, the whole
point of having such a tank is for the level to vary, since that is the means by which
it absorbs the effects of disturbances. There is no point whatever in controlling the
level in a buffer tank to a set-point, since that would destroy its purpose. Traditional
process control deals with this problem by means of overrides and other ad hoc fixes.
Predictive control, however, provides a very natural means of handling the control
of buffer tanks, within its standard formulation: constraints on the levels of such
tanks are defined, but no set-points are specified. (The control objectives for such
outputs are sometimes called zone objectives — see Section 5.5.) Similar control
objectives exist in other contexts, and it has even been suggested [ZAN73] that the
majority of process control problems are naturally formulated in this way.

2
The figure is supposed to illustrate the qualitative effects of using predictive control. Since the
control action becomes nonlinear once constraints become active, it is usually extremely difficult to
compute the actual probability distribution achieved.
6 1. Introduction

Example 1.2 Surge level control

Figure 1.3 shows a train of fractionators. The liquid heavy fraction in each column
drains to the sump at the bottom, and is then passed on to the next fractionator. The
flow rate is controlled to keep the level in the sump between minimum and maximum
levels. The sump acts as a buffer, and absorbs any surges in flow which might arise
from upstream columns. The sump levels are thus naturally controlled by defining
them as zone objectives. The buffering action would be destroyed by tight control to
set-points.

Figure 1.3: Surge level control

There is one more reason why predictive control’s ability to handle constraints ex-
plicitly is important. The fact that the controller is aware of input constraints,
in particular of actuator saturation constraints, and never generates input signals
which attempt to violate them, removes the problem of integrator wind-up . This
problem occurs with conventional controllers if long-duration set-point errors cause
integrator outputs to exceed the saturation limits, and can result in large overshoots
and even instability [FPEN94]. Standard remedies for the problem are known, but
these have to be ‘tacked on’ to a conventional controller, increasing its complexity
considerably. With predictive control, the wind-up problem does not arise.

Another factor which is crucial to the industrial success of predictive control is the
natural way in which it can handle multivariable problems. Profit maximisation,
and more generally performance optimization, requires integrated control of com-
plex plants and processes. This implies monitoring the future behaviour of many
1.2. The ‘Receding Horizon’ Idea 7

output variables, and using the full range of possible control variables to keep a pro-
cess operating as economically as possible, and safely, over some future prediction
horizon. Looking ahead to future applications of predictive control, one can cite
as a suitable example the integrated control of advanced aircraft, in which engines,
lateral thrusters, vortex separation control, and aerodynamic surfaces, are all used
in a coordinated manner. All the ideas, and most of the algorithms, can be applied
without modification to such multivariable problems, and are not significantly dif-
ferent if the number of available control inputs exceeds, is the same as, or is smaller
than, the number of controlled outputs.

So far, reasons have been given for the practical success which predictive control has
had to date. There is another reason which can be expected to become prominent in
the future. Predictive control is model based in the sense that it uses an explicit in-
ternal model to generate predictions of future plant behaviour. The models currently
used are usually ‘black-box’ linear input-output models, obtained from simple plant
tests or by applying system identification methods to plant data. But there is an
increasing use of nonlinear ‘first-principles’ models in the process industries. These
are models which are obtained from an understanding of the physical and chemical
transformations occurring inside a process. Some of them are extremely detailed
and complex. As methodologies and technologies for supporting the development of
such models improve, so the cost of developing them can be expected to fall from
its current level, which is very high, and their use is therefore likely to become more
widespread. There is much potential for future synergy of first-principles models
with (model-based) predictive control. This may be realised by increasing use of
nonlinear models in order to give more accurate predictions of process behaviour in
nonlinear regimes (which leads to difficulties with predictive control — see Chap-
ter 10), or by using nonlinear models to derive linear approximate models without
the need for plant tests, or by using them in some other, as yet undeveloped, way.

1.2 The ‘Receding Horizon’ Idea

Figure 1.4 shows the basic idea of predictive control. In this presentation of the
basics, we confine ourselves to discussing the control of a single-input, single-output
(SISO) plant. We assume a discrete-time setting, and that the current time is
labelled as time step k. At the current time the plant output is y(k), and the
figure shows the previous history of the output trajectory. Also shown is a set-point
trajectory, which is the trajectory that the output should follow, ideally. The value
of the set-point trajectory at any time t is denoted by s(t).

Distinct from the set-point trajectory is the reference trajectory. This starts at the
current output y(k), and defines an ideal trajectory along which the plant should
return to the set-point trajectory, for instance after a disturbance occurs. The ref-
erence trajectory therefore defines an important aspect of the closed-loop behaviour
of the controlled plant. It is not necessary to insist that the plant should be driven
8 1. Introduction

s(t)
r(t|k)

Hp

y(t)

ŷ(t|k)

ŷf (t|k)

k k + Hp Time

Input

k k + Hp Time

Figure 1.4: Predictive Control: The Basic Idea

back to the set-point trajectory as fast as possible, although that choice remains
open. It is frequently assumed that the reference trajectory approaches the set-
point exponentially from the current output value, with the ‘time constant’ of the
exponential, which we shall denote Tref , defining the speed of response. That is, if
the current error is

(k) = s(k) − y(k) (1.1)

then the reference trajectory is chosen such that the error i steps later, if the output
followed it exactly, would be

(k + i) = e−iTs /Tref (k) (1.2)


i
= λ (k) (1.3)

where Ts is the sampling interval and λ = e−Ts /Tref . (Note that 0 < λ < 1.) That
1.2. The ‘Receding Horizon’ Idea 9

is, the reference trajectory is defined to be

r(k + i|k) = s(k + i) − (k + i) (1.4)


−iTs /Tref
= s(k + i) − e (k) (1.5)

The notation r(k + i|k) indicates that the reference trajectory depends on the con-
ditions at time k, in general. Alternative definitions of the reference trajectory are
possible — for example, a straight line from the current output which meets the
set-point trajectory after a specified time.

A predictive controller has an internal model which is used to predict the be-
haviour of the plant, starting at the current time, over a future prediction hori-
zon. This predicted behaviour depends on the assumed input trajectory û(k + i|k)
(i = 0, 1, . . . , Hp − 1) that is to be applied over the prediction horizon, and the idea
is to select that input which promises the best predicted behaviour. We shall assume
that the internal model is linear; this makes the calculation of the best input rela-
tively straightforward. The notation û rather than u here indicates that at time k
we only have a prediction of what the input at time k + i may be; the actual input at
that time, u(k + i), will probably be different from û(k + i|k). Note that we assume
that we have the output measurement y(k) available when deciding the value of the
input u(k). This implies that our internal model must be strictly proper, namely
that according to the model y(k) depends on past inputs u(k − 1), u(k − 2), . . . , but
not on the input u(k).

In the simplest case we can try to choose the input trajectory such as to bring
the plant output at the end of the prediction horizon, namely at time k + Hp ,
to the required value r(k + Hp ). In this case we say, using the terminology of
Richalet [Ric93b], that we have a single coincidence point at time k + Hp . There
are several input trajectories {û(k|k), û(k + 1|k), . . . , û(k + Hp − 1|k)} which achieve
this, and we could choose one of them, for example the one which requires the
smallest input energy. But it is usually adequate, and in fact preferable, to impose
some simple structure on the input trajectory, parametrised by a smaller number of
variables. Figure 1.4 shows the input assumed to vary over the first three steps of
the prediction horizon, but to remain constant thereafter: û(k + 2|k) = û(k + 3|k) =
· · · , û(k + Hp − 1|k), so that there are three ‘parameters’ to choose: û(k|k), û(k +
1|k), û(k + 2|k). The simplest possible structure is to assume that the input will
remain constant over the prediction horizon: û(k|k) = û(k + 1|k) = · · · = û(k +
Hp − 1|k). In this case there is only one parameter, namely û(k|k); since there is
also only one equation to be satisfied — ŷ(k + Hp |k) = r(k + Hp |k) — there is a
unique solution.

Once a future input trajectory has been chosen, only the first element of that tra-
jectory is applied as the input signal to the plant. That is, we set u(k) = û(k|k),
where u(k) denotes the actual signal applied. Then the whole cycle of output mea-
surement, prediction, and input trajectory determination is repeated, one sampling
interval later: a new output measurement y(k + 1) is obtained; a new reference tra-
jectory r(k + i|k + 1) (i = 2, 3, . . . ) is defined; predictions are made over the horizon
10 1. Introduction

k + 1 + i, with i = 1, 2, . . . , Hp ; a new input trajectory û(k + 1 + i|k + 1), with


i = 0, 1, . . . , Hp − 1 is chosen; and finally the next input is applied to the plant:
u(k + 1) = û(k + 1|k + 1). Since the prediction horizon remains of the same length as
before, but slides along by one sampling interval at each step, this way of controlling
a plant is often called a receding horizon strategy.3

1.3 Computing the Optimal Inputs

In the simplest case considered above, when there is only one coincidence point
and only one parameter to choose for the future input trajectory, there is a unique
solution, as has already been stated. More commonly, there are several coincidence
points in the prediction horizon — perhaps even all the points k +1, k +2, . . . , k +Hp
are coincidence points. Even if there is more than one parameter to be chosen for the
future input trajectory, in the usual situation there are more coincidence points than
parameters. In this case there are more equations to be satisfied than the number
of available variables, and it is in general impossible to solve them exactly. That
is, it is impossible to choose the future input trajectory such that the predicted
output coincides with the reference input at all the coincidence points. In this
case, some kind of approximate solution is necessary. Most commonly, a least-
squares
P solution is found, namely one such that the sum of the squares of the errors,
iP [r(k + i|k) − ŷ(k + i|k)] , is minimised, where P denotes the set of indices i
2

which correspond to coincidence points. As will be seen shortly, if the internal model
is linear, the least-squares solution is easily found, and in fact yields a linear control
law.

Again, let us consider the simplest case first, with one coincidence point k + Hp
and one parameter to choose, û(k|k). Conceptually, one can proceed as follows.
The internal model can first be used to predict the free response ŷf (k + Hp |k) of
the plant, namely the response that would be obtained at the coincidence point if
the future input trajectory remained at the latest value u(k − 1). The details of
how this is obtained will depend on the form of model available, because the ‘initial
conditions’ depend on the form of the model. If a step or pulse response is available
as the model, then all the available past inputs are needed. For a transfer function
or difference equation model, n past inputs and outputs are needed, where n is the
order of the transfer function. For a state-space model, the current state is needed,
or an estimate of it. Now let S(Hp ) be the response of the model to a unit step
input, Hp steps after the unit step is applied. The predicted output at time k + Hp
is

ŷ(k + Hp |k) = ŷf (k + Hp |k) + S(Hp )∆û(k|k) (1.6)

3
The receding horizon concept corresponds to the usual behaviour of the Earth’s horizon: as one
moves towards it, it recedes, remaining a constant distance away from one.
1.3. Computing the Optimal Inputs 11

where

∆û(k|k) = û(k|k) − u(k − 1) (1.7)

is the change from the current input u(k − 1) to the predicted input û(k|k). We
want to achieve

ŷ(k + Hp |k) = r(k + Hp |k) (1.8)

so the optimal change of input is given by

r(k + Hp |k) − ŷf (k + Hp |k)


∆û(k|k) = (1.9)
S(Hp )

Note that we have assumed that the model output and the plant output are the
same up to time k. This will not be so in practice, but we shall address that in the
next section.

Example 1.3 Suppose that the set-point is constant at value s(k + i) = 3, and that
Tref = 9 sec, the sampling interval is Ts = 3 sec, there is a single coincidence point
at Hp = 2 (steps; that is, 6 sec into the future), and the plant’s z-transform transfer
function is
2
G(z) = (1.10)
z − 0.7
The previous and current outputs are y(k−1) = y(k) = 2, and the latest control input
is u(k−1) = 0.3. What is the optimal input û(k|k), assuming that û(k|k) = û(k+1|k)
?

We have (k) = s(k) − y(k) = 3 − 2 = 1, and λ = exp(−Ts /Tref ) = 0.7165. Hence

r(k + 2|k) = s(k + 2) − λ2 (k) = 3 − 0.71652 × 1 = 2.487

To get the free response, we put the transfer function into difference equation form:

y(k) = 0.7y(k − 1) + 2u(k − 1) (1.11)

then assume that u(k + 1) = u(k) = u(k − 1) = 0.3 to get

ŷf (k + 1|k) = 0.7 × 2 + 2 × 0.3 = 2.0 (1.12)


ŷf (k + 2|k) = 0.7 × 2.0 + 2 × 0.3 = 2.0 (1.13)

Finally we need S(2), the step response Hp = 2 time steps after a unit step input
is applied. We can get this from (1.11) by assuming u(k) = u(k + 1) = 1 and
y(k) = y(k − 1) = 0:

S(1) = 0.7 × 0 + 2 × 1 = 2 (1.14)


S(2) = 0.7 × 2 + 2 × 1 = 3.4 (1.15)
12 1. Introduction

We now have everything required to compute the optimal input, using (1.9):
2.487 − 2.0
∆û(k|k) = = 0.1432 (1.16)
3.4
û(k|k) = u(k − 1) + ∆û(k|k) = 0.4432 (1.17)

This is the input signal applied to the plant: u(k) = û(k|k) = 0.4432. If our model
of the plant is perfect, and there are no disturbances, then this would result in the
next plant output value being y(k + 1) = 0.7 × 2 + 2 × 0.4432 = 2.2864.

If there is more than one coincidence point, then there are more equations to be
satisfied than there are variables, and we therefore have to be satisfied with an
approximate solution. Suppose we have c coincidence points, with corresponding
values of the reference trajectory r(k + P1 |k), r(k + P2 |k), . . . , r(k + Pc |k), with
Pc ≤ Hp . Since we would like to achieve ŷ(k + Pi |k) = r(k + Pi |k) for i = 1, 2, . . . , c,
we would like to choose û(k|k) to solve the following equations:

r̂(k + P1 |k) = ŷf (k + P1 |k) + S(P1 )∆û(k|k) (1.18)


r̂(k + P2 |k) = ŷf (k + P2 |k) + S(P2 )∆û(k|k) (1.19)
..
.
r̂(k + Pc |k) = ŷf (k + Pc |k) + S(Pc )∆û(k|k) (1.20)

Most commonly, this equation is solved in the ‘least-squares’ sense. Some details of
least-squares solutions are given in Chapter 3, but for the moment we just note that
if we define the vectors
     
r̂(k + P1 |k) ŷf (k + P1 |k) S(P1 )
 r̂(k + P2 |k)   ŷf (k + P2 |k)   S(P2 ) 
     
T = ..  Yf =  ..  S= ..  (1.21)
 .   .   . 
r̂(k + Pc |k) ŷf (k + Pc |k) S(Pc )

then in MATLAB the least-squares solution is obtained using the ‘backslash’ oper-
ator as:

∆û(k|k) = S\(T − Yf ) (1.22)

Example 1.4 Consider the same set-up as in Example 1.3, but this time with two
coincidence points: P1 = 1, P2 = Hp = 2. We have

r(k + 1|k) = s(k + 1) − λ(k) = 2.284


r(k + 2|k) = 2.487 as before

So, using results already found in Example 1.3, we have


     
2.284 2.0 2.0
T = Yf = S=
2.487 2.0 3.4
1.3. Computing the Optimal Inputs 13

and hence

∆û(k|k) = S\(T − Yf ) = 0.1429


û(k|k) = u(k − 1) + ∆û(k|k) = 0.4429

We can already see at this point how predictive control can easily be given the capa-
bility of respecting constraints. If there are constraints on the inputs and/or outputs,
then the simple ‘linear least-squares’ solution has to be replaced by a ‘constrained
least-squares’ solution. To be sure, it is no longer possible to obtain a closed-form
solution and some form of iterative optimization algorithm must be employed, but
if the constraints are in the form of linear inequalities then we have a quadratic pro-
gramming problem, which can be solved very reliably and relatively quickly. We will
look in detail at solving the constrained predictive control problem in Chapters 3
and 5.

Now suppose that we allow a more complicated future input trajectory. We could
assume that the input is allowed to change over the next Hu steps, for example, so
that we have to choose û(k|k), û(k + 1|k), . . . , û(k + Hu − 1|k), and assume that
û(k + Hu − 1|k) = û(k + Hu |k) = · · · = û(k + Hp − 1|k) = if Hu < Hp . (It would
be unusual to choose Hu > Hp , but this could be done. Usually Hu is chosen to be
considerably smaller than Hp .) Now the predicted output at time k + Pi is given by

ŷ(k + Pi |k) = ŷf (k + Pi |k) + H(Pi )û(k|k) + H(Pi − 1)û(k + 1|k) + · · ·


+H(Pi − Hu + 2)û(k + Hu − 2|k) +
+S(Pi − Hu + 1)û(k + Hu − 1|k) (1.23)

where H(j) = S(j)−S(j −1) is the unit pulse response coefficient of the system after
j time steps. The reason why pulse reponse coefficients appear in this expression,
rather than step response coefficients, is that each of the input values û(k|k), û(k +
1|k), . . . , û(k + Hu − 2|k) is assumed to be applied for only one sampling interval.
Only the last one, û(k + Hu − 1|k), remains unchanged until step Pi , and its effect is
therefore obtained by multiplying it by the step response coefficient S(Pi − Hu + 1).
Since we assume that the system is strictly proper, we have H(0) = 0 and S(0) = 0,
and of course H(j) = 0 and S(j) = 0 if j < 0 because of causality. So if Pi ≤ Hu
then the last non-zero term in this expression is H(1)û(k + Pi − 1|k).

Since H(j) = S(j) − S(j − 1), we can rewrite (1.23) as

ŷ(k + Pi |k) = ŷf (k + Pi |k) + S(Pi )∆û(k|k) + S(Pi − 1)∆û(k + 1|k)


+ · · · + S(Pi − Hu + 1)∆û(k + Hu − 1|k) (1.24)

by regrouping terms. Now we can write a set of equations for the predicted outputs
at all the coincidence points in matrix-vector form:

Y = Yf + Θ∆U (1.25)
14 1. Introduction

where
   
ŷ(k + P1 |k) ∆û(k|k)
 ŷ(k + P2 |k)   ∆û(k + 1|k) 
   
Y = ..  ∆U =  ..  (1.26)
 .   . 
ŷ(k + Pc |k) ∆û(k + Hu − 1|k)

and
 
S(P1 ) S(P1 − 1) · · · S(1) 0 ··· 0 0 ··· 0
 S(P2 ) S(P2 − 1) · · · ··· ··· ··· S(1) 0 ··· 0 
 
Θ= .. .. .. .. .. .. .. .. .. .. 
 . . . . . . . . . . 
S(Pc ) S(Pc − 1) · · · ··· ··· ··· ··· ··· ··· S(Pc − Hu + 1)
(1.27)

Again, since we want to achieve Y = T , but usually don’t have enough variables to
do so exactly, we obtain the least-squares solution:

∆U = Θ\[T − Yf ] (1.28)

As was said before, we now select the first element of the vector ∆U , namely ∆û(k|k),
use it to form the input applied to the plant:

u(k) = ∆û(k|k) + u(k − 1) (1.29)

and repeat the whole cycle of calculations at the next time step, starting with the
next measurement of the plant output, y(k + 1).

Example 1.5 We return to Example 1.4. This time in addition to having the two
coincidence points P1 = 1 and P2 = 2, we will choose Hu = 2, so that we compute
optimal values of û(k|k) and û(k + 1|k) at each step. T , Yf and S remain the same
as before. The new entity now is
   
S(1) 0 2.0 0
Θ= =
S(2) S(1) 3.4 2.0

From Example 1.3 we know that u(k − 1) = 0.3. Note that in this case the number
of variables to be chosen is the same as the number of coincidence points, so that
the matrix Θ is square and can be inverted, and the solution is unique. MATLAB’s
‘backslash’ operator still gives the correct solution in this case:

∆U = Θ\[T − Yf ]
 
0.1420
=
0.0021

so that the input to be applied to the plant is

u(k) = ∆û(k|k) + u(k − 1) = 0.1420 + 0.3 = 0.4420


1.4. A Simple MATLAB Program 15

It should be apparent that it is not necessary to have a discrete-time model in order


to use predictive control. All that is needed is to know the step response at the
coincidence points, and to be able to compute the ‘free response’ at the coincidence
points — that is, one must have a simulation model capable of running faster than
real time. In practice, however, a discrete-time linear model is easy to obtain, and
more convenient than a continuous-time linear model.

1.4 A Simple MATLAB Program

Clearly, some software is needed not only to implement predictive control, but even
to study it. Even for the simple scenarios studied in Section 1.3, with just one or
two coincidence points and one or two variables, one needs to repeat the calcula-
tions many times in order to see how the resulting control law performs. A simple
MATLAB program, called basicmpc, has been written to simulate basic predictive
control, as described in this chapter. A complete listing of it is given in Appendix B,
and it is also available on this book’s web site:

http://www.booksites.net/maciejowski/

This shows one way of organising the computations. The reader should be able to use
it as a ‘template’ which can be modified to handle other formulations of predictive
control problems. For more complicated scenarios, however, such as multivariable
problems and/or those involving constraints, and for simulation of nonlinear plants,
we will later rely on the use of MATLAB’s Model Predictive Control Toolbox, which
is described in Appendix C.

In this section we shall explain the main features of basicmpc, without going through
all the details.

basicmpc assumes that an exponential reference trajectory is used, and the program
starts by defining Tref . The variable Tref is used, and as far as possible variables
are used which correspond to the notation used in this chapter. Note that the
program is in the form of a MATLAB script file, not a function, so that values of
variables such as Tref are changed by editing the file, not by supplying arguments.
The reader can easily modify the program so that it becomes a function, if desired.4
The possibility Tref = 0 is allowed for, which represents immediate return of the
reference trajectory to the set-point trajectory: r(k + i|k) = s(k + i). Next, the
sampling interval Ts is defined; by default this is set to Tref /10 (or 1 if Tref = 0),
but this can be changed as required.

Next the plant is defined, as variable plant which is a single-input, single-output


discrete-time system in the form of an object of class lti, the class used to represent
4
Consult the MATLAB documentation for details.
16 1. Introduction

Linear, Time-Invariant systems in the Control System Toolbox. In the rest of the
program, the plant is represented by the numerator and denominator polynomials of
its z-transform transfer function representation, nump and denp, respectively. Con-
sequently, however plant has been defined, it is then coerced into transfer function
form, and these polynomials are extracted:

% Define plant as SISO discrete-time ’lti’ object ’plant’ in


% transfer function form:
%%%%% CHANGE FROM HERE TO DEFINE NEW PLANT %%%%%
nump=1;
denp=[1,-1.4,0.45];
plant = tf(nump,denp,Ts);
%%%%% CHANGE UP TO HERE TO DEFINE NEW PLANT %%%%%
plant = tf(plant); % Coerce to transfer function form
nump = get(plant,’num’); nump = nump{:}; % Get numerator polynomial
denp = get(plant,’den’); denp = denp{:}; % Get denominator polynomial

This allows the plant to be defined in many ways. For example, from a continuous-
time state-space description:

%%%%% CHANGE FROM HERE TO DEFINE NEW PLANT %%%%%


plant = ss(A,B,C,D); % Continuous-time state-space
plant = c2d(plant,Ts); % Discrete-time equivalent
%%%%% CHANGE UP TO HERE TO DEFINE NEW PLANT %%%%%

Next, the model is defined in the same way, as variable model. This allows model to
be different from plant, so that the effects of modelling errors can be studied, but as
supplied the program sets model = plant. Again the numerator and denominator
polynomials are extracted, this time with names numm and denm.

The coincidence points are defined in the vector P in terms of the number of sampling
intervals, so that P1 = 3, P2 = 7, P3 = 12 would be represented by P=[3;7;12], etc.
Later this vector is multiplied by Ts to get the corresponding vector of coincidence
times, which is needed to compute the values of exp(−Pi Ts /Tref ) (in vector errfac).

The variable M is used to store the control horizon Hu , the change of notation here
being made for compatibility with the Model Predictive Control Toolbox, which also
uses M for this purpose.

The set-point trajectory is defined in the vector setpoint. Note that its length
has to be nsteps + max(P) where nsteps is the number of steps to be simulated,
because the controller needs to have a prediction of the set-point, even when it
reaches the end of the simulation.

Next, the Control System Toolbox function step is used to compute the step response
of the model over the required prediction horizon (which is max(P)), and form the
1.4. A Simple MATLAB Program 17

matrix Θ (variable theta) and the vector S, as in (1.27) and (1.21):

stepresp = step(model,[0:Ts:max(P)*Ts]);
theta = zeros(length(P),M);
for j=1:length(P),
theta(j,:) = [stepresp(P(j):-1:max(P(j)-M+1,1))’,zeros(1,M-P(j))];
end
S = stepresp(P);

Everything described so far needs to be done only once, before the simulation is
started. The remaining calculations need to be repeated for every simulation step.
This is done in a big ‘for-loop’ (for k=1:nsteps). First the reference trajectory
has to be computed over the prediction horizon, starting at the current plant output
yp(k); the reference trajectory is stored in the vector reftraj.

Next the free response of the model over the prediction horizon is obtained and
stored in ymfree, by iterating the difference equation which corresponds to the
transfer function of the model. At each iteration the previous values of the free
response are held in the vector yfpast, which is initialised to the previous values of
the model output, from previous steps (that is, from lower values of k:

% Free response of model over prediction horizon:


yfpast = ympast;
ufpast = umpast;
for kk=1:max(P), % Prediction horizon
ymfree(kk) = numm*ufpast-denm(2:ndenm+1)*yfpast;
yfpast=[ymfree(kk);yfpast(1:length(yfpast)-1)];
ufpast=[ufpast(1);ufpast(1:length(ufpast)-1)];
end

Note that ufpast is needed to hold past values of the model input, even though the
new values applied over the prediction horizon are all the same.

Now everything is ready for computing the optimal value of ∆U (variable dutraj)
and forming the new input to the plant u(k) (variable uu(k)):

dutraj = theta\(reftraj-ymfree(P)’);
uu(k) = dutraj(1) + uu(k-1);

Finally the plant and model are simulated for one step to obtain their next outputs.
It is important to note here that, if there is any difference between the plant and
the model, then their outputs evolve independently:

% Simulate plant:
18 1. Introduction

% Update past plant inputs:


uppast = [uu(k);uppast(1:length(uppast)-1)];
yp(k+1) = -denp(2:ndenp+1)*yppast+nump*uppast; % Simulation
% Update past plant outputs:
yppast = [yp(k+1);yppast(1:length(yppast)-1)];

% Simulate model:
% Update past model inputs:
umpast = [uu(k);umpast(1:length(umpast)-1)];
ym(k+1) = -denm(2:ndenm+1)*ympast+numm*umpast; % Simulation
% Update past model outputs:
ympast = [ym(k+1);ympast(1:length(ympast)-1)];

Richalet [Ric93b] has drawn attention to the importance of this independent model
implementation, because it makes dealing with plant-model errors relatively simple,
as we shall see in the next section. We shall also see, however, that it is not always
possible to respect this desideratum.

If the program is modified to simulate the effects of disturbances and/or noise, care
should be taken to modify only the simulation of the plant, not of the model. For
details, examine the program noisympc, which is available on the web site — also
see the end of the next section.

When the simulation has been completed, a summary of the parameters is written
out to the screen, and the results are presented graphically.

Example 1.6 The program basicmpc is supplied with the plant defined by the trans-
fer function
1
z2 − 1.4z + 0.45
with Tref = 6, Ts = 0.6, Hp = P1 = 8, M = 1, and with model = plant. Figure 1.5
shows the simulation results, when the set-point is constant at 1, all initial conditions
are zero, and there are no disturbances or noise.

1.5 Offset-free Tracking

If the model is not the same as the plant, in particular if the steady-state gain of
the model is not correct, then the plant output will reach an incorrect final value.
This is illustrated in Figure 1.6, which shows the results of running basicmpc with
the plant having transfer function
1
z2 − 1.4z + 0.45
1.5. Offset-free Tracking 19

Plant output (solid) and set−point (dashed)


1

0.8

0.6

0.4

0.2

0
0 10 20 30 40 50 60
Time

Input
0.07

0.065

0.06

0.055

0.05

0.045
0 10 20 30 40 50 60
Time

Figure 1.5: Results from basicmpc, exact model

while the model transfer function is


1
z2 − 1.4z + 0.46
Here, in addition to changed pole locations, the steady-state gain of the plant is
1/(1 − 1.4 + 0.45) = 20, while that of the model is 1/(1 − 1.4 + 0.46) = 16.67. As
a result, both the input and the output reach incorrect steady-state values. This is
of course an extremely common situation, since the real plant gain is never known
perfectly accurately. In fact, since the real plant is invariably nonlinear, its exact
steady-state gain is likely to be different at each steady-state condition.

Fortunately, it is very easy to modify the predictive controller slightly, to make it


insensitive to errors in the steady-state gain. All that is necessary is to measure the
discrepancy between the latest plant output and the latest model output, and then
to subtract that discrepancy from the reference trajectory at the coincidence points.
That is, if we define

d(k) = y(k) − ŷ(k|k − 1) (1.30)

then we replace (1.28) by:

∆U = Θ\[T − 1d(k) − Yf ] (1.31)

where 1 denotes a vector [1, 1, . . . , 1]T . Note that the step response coefficients in
Θ are those of the model, not the plant, since the true plant step response is not
known to the controller. The corresponding change in the software is to insert the
line
20 1. Introduction

Plant output (solid) and set−point (dashed)


1.5

0.5

0
0 10 20 30 40 50 60
Time

Input
0.075

0.07

0.065

0.06

0.055

0.05

0.045
0 10 20 30 40 50 60
Time

Figure 1.6: Results from basicmpc with incorrect model gain

d = yp(k) - ym(k);

and to replace

dutraj = theta\(reftraj - ymfree(P)’);

by

dutraj = theta\(reftraj - d - ymfree(P)’);

The program trackmpc incorporates this modification, and is available on this book’s
web site. Simulation results, when using this modification with the same plant-model
mismatch as in Figure 1.6, are shown in Figure 1.7. This figure shows that the plant
output now reaches the set-point correctly.

This works — for asymptotically stable plant and model — for the following reason.
Let the steady-state gain of the plant be Sp (∞), and the steady-state gain of the
model be Sm (∞). Also assume that the closed-loop is asymptotically stable, and
that the set-point is a constant s(k) = s∞ . Then the input, and both the plant
and model outputs settle to constant values, say u(k) → u∞ , yp (k) → yp∞ , and
ym (k) → ym∞ , where yp and ym denote the plant and model outputs, respectively.
Then yp∞ = Sp (∞)u∞ and ym∞ = Sm (∞)u∞ , so that
d(k) → d∞ = [Sp (∞) − Sm (∞)]u∞ (1.32)
1.5. Offset-free Tracking 21

Plant output (solid) and set−point (dashed)


1.4

1.2

0.8

0.6

0.4

0.2

0
0 10 20 30 40 50 60
Time

Input
0.07

0.065

0.06

0.055

0.05

0.045
0 10 20 30 40 50 60
Time

Figure 1.7: Results from trackmpc with incorrect model gain

In steady-state conditions, since both the set-point trajectory and the plant output
are constant, the reference trajectory does not depend on k: r(k + i|k) = ri . Hence
T is a constant vector. Also Yf is a constant vector, since the free response is always
computed from the same initial conditions, once steady-state has been reached. Now
recall from (1.25) that we have

Θ∆U = Y − Yf

and that we compute ∆U by replacing Y in this equation by T − 1d(k). So in steady


state we have

Θ∆U = T − 1d∞ − Yf (1.33)


= T − 1yp∞ + (1ym∞ − Yf ) (1.34)

But note that

1ym∞ − Yf = 0 (1.35)

The reason for this is a little subtle: the free response starts from a constant level
of ym∞ , since it is the free reponse of the model. But we are assuming steady-state
conditions, so that the free response remains constant at its initial value. So we
conclude that

Θ∆U = T − 1yp∞ (1.36)

But in the steady state ∆U = 0, and hence T = 1yp∞ , or ri = yp∞ . So the reference
trajectory is constant, with value yp∞ . But ri = s∞ − λi (s∞ − yp∞ ), so we conclude
22 1. Introduction

that

yp∞ = s∞ (1.37)

which shows that the plant output reaches the set-point value, despite the modelling
error.

Note that this analysis has assumed that the closed loop is stable, which is not
guaranteed, of course.

This same ‘trick’ also gives offset-free tracking of constant set-points if there is an
unknown constant additive disturbance acting at either the input or the output of
the plant, since both of these have the same effect as an incorrect steady-state gain
of the model. In fact, the use of (1.31) can be seen as explaining any error between
the current plant and model outputs as a disturbance acting at the plant output,
and assuming that this disturbance will continue to act throughout the prediction
horizon. This method of obtaining offset-free tracking is used in every commercial
predictive control product known to the author. (See Appendix A for descriptions
of some of these products.)

The reader familiar with conventional control may wonder how it is possible to
eliminate steady-state errors without the use of ‘integral action’. We shall show
later that the scheme just described can in fact be interpreted as incorporating a
‘discrete-time integrator’ in the control law in a particularly simple way.

The use of the disturbance estimate (1.30) is in fact the only way in which feedback
enters the predictive control law. Using it in (1.31) corresponds to assuming that
the currently-estimated disturbance will persist at the same level into the future.
This is not the only assumption that can be made; for example, it could be assumed
that the disturbance dies away exponentially with a known time constant, though
the offset-free tracking property would be lost in that case.

The program noisympc has been written, and is available on this book’s web site.
This program provides offset-free tracking, but in addition simulates the effects of
measurement noise, and of input and output disturbances, as shown in Figure 1.8.
The vectors noise, udist and ydist contain the measurement noise, and the input
and output disturbances. The actual plant output, with the output disturbance
included (variable ypd), and the measured output (variable ypm), are formed by the
statements

ypd(k) = yp(k) + ydist(k);


ypm(k) = ypd(k) + noise(k);

One has to be careful to use ypm instead of yp in the definition of the reference
trajectory (errornow = setpoint(k)-ypm(k)) and of the output disturbance esti-
mate (d = ypm(k) - ym(k)). The model output is left unaltered — because of the
‘independent model’ idea, and because neither the noise nor the disturbances are
1.6. Unstable Plant 23

known directly to the controller. Input disturbances are included by modifying the
definition of the vector uppast, which holds the past values of the input received by
the plant:

uppast = [uu(k)+udist(k);uppast(1:length(uppast)-1)];

The graphical display is now a little more elaborate: both the real and the measured
plant outputs are shown. Also both the controller output and the effective plant
input are plotted — if input disturbances are present these are not the same. As
Input Output
disturbance disturbance

Plant
output
PLANT
Controller
output

Noise

Measured
output

Figure 1.8: Input and output disturbances, and measurement noise

supplied, the program simulates noise of standard deviation 0.1, a constant input
disturbance of value 0.1, and an output disturbance which switches from value +0.1
to -0.1 halfway through the simulation.

Example 1.7 Figure 1.9 shows the graphical output from simulating the same sys-
tem as shown in figures 1.5 and 1.7, with noise and disturbances present, using the
program noisympc. Note how the plant output reaches the correct set-point, despite
the unknown input and output disturbances. The output disturbance switches from
+0.1 to -0.1 halfway through the simulation, at t = 30.

1.6 Unstable Plant

Some plants contain integrations, typically if the output is the level of a tank con-
taining liquid, or the position or attitude of an inertial object such as an aircraft.
These are no longer asymptotically stable, but the basic predictive controller as de-
veloped in the previous two sections can still be applied to such ‘marginally stable’
plants — see Problem 8.
24 1. Introduction

Plant output (solid), Measured output (dotted) and set−point (dashed)


2

1.5

0.5

−0.5
0 10 20 30 40 50 60
Time

Controller output (solid), Plant input (dotted)


0.2

0.15

0.1

0.05

−0.05

−0.1
0 10 20 30 40 50 60
Time

Figure 1.9: Simulation of system with input and output disturbances, and measure-
ment noise, using noisympc.

However, if the plant is unstable, in the sense that its impulse or pulse response is
unbounded (continuous-time poles in the right half-plane, discrete-time poles outside
the unit circle), then the scheme as presented will no longer work. The problem is
precisely the use of the ‘independent model’ that was previously advocated as a
desirable feature, because this means that the model is running ‘open loop’. If the
model is unstable and running open-loop, then its behaviour will rapidly diverge
from the real plant behaviour, and numerical errors in the simulation will be rapidly
amplified by the instability, so that its value as a predictor of plant behaviour will
be completely lost.

The only remedy in this case is to stabilise the model somehow, and that requires
the ‘independence’ of the model to be given up. The easiest way of stabilising the
model is to ‘re-align’ it on the plant outputs. That is, when running it to generate
predictions of plant behaviour, the initial conditions are taken to be those of the
plant, not those resulting from the previous model simulation step. Suppose that
the unstable model corresponds to the difference equation

X
n X
n
ym (k) = − ai ym (k − i) + bi u(k − i) (1.38)
i=1 i=1
1.6. Unstable Plant 25

then the ‘re-aligned’ model generates predictions according to


X
n X
n
ŷ(k + 1|k) = − ai yp (k + 1 − i) + b1 û(k|k) + bi u(k + 1 − i) (1.39)
i=1 i=2
X
n
ŷ(k + 2|k) = −a1 ŷ(k + 1|k) − ai yp (k + 2 − i) +
i=2
X
n
+b1 û(k + 1|k) + b2 û(k|k) + bi u(k + 2 − i) (1.40)
i=3
..
.

That is, actual past plant outputs (and inputs) are used whenever they are available.
We shall see later that this always stabilises the model, and that it can be interpreted
as implementing a deadbeat observer for the plant, so the model does not diverge
much from the plant. But it does not necessarily lead to a stable closed loop. Note
that (1.39) introduces feedback into the predictive controller, in a manner different
from the use of (1.30).

The corresponding modification is easily made to basicmpc. Assuming that the


plant and model have the same order (degree of denominator), then all that is
required is to replace the line

ympast = [ym(k+1);ympast(1:length(ympast)-1)];

by

ympast = yppast;

The program unstampc has this modification incorporated.

Now a drawback of the ‘re-aligned’ model implementation becomes apparent. The


simple technique introduced in the previous section does not give offset-free tracking.
The reason is that (1.35) no longer holds, because the model is now driven not only
by the input u(k), but also by the plant output yp (k), which acts as an input to the
model.

It is still possible to get offset-free tracking with a ‘re-aligned’ model, by explicitly


building in integral action in the controller, but this can no longer be done as simply
as before. We shall investigate this in more detail later in the book. Other ways
of stabilising the model are possible: Richalet [Ric93b] factors unstable models into
stable and unstable parts, then leaves the stable part ‘independent’ and stabilises
only the unstable part — this is described in detail in section 5.3. A ‘re-aligned’
model, as described in this section, is assumed in Generalised Predictive Control
(GPC), one of the best-known variations of predictive control [CMT87].
26 1. Introduction

Example 1.8 The transfer function from the rotor angle to the forward speed of a
helicopter in a particular flight condition is given by
9.8(s2 − 0.5s + 6.3)
(s + 0.6565)(s2 − 0.2366s + 0.1493)
This has zeros at +0.25 ± 2.5j and poles at +0.118 ± 0.37j. It is therefore both non-
minimum-phase and unstable — certainly a difficult plant to control. Figure 1.10
shows the response obtained using the program unstampc when an exact model is
assumed, and parameters Tref = 6 and Ts = 0.6 are used, with a single coincidence
point P1 = 8, and Hu = 1. This example shows that predictive control, although
Plant output (solid) and set−point (dashed)
1.4

1.2

0.8

0.6

0.4

0.2

0
0 10 20 30 40 50 60
Time

−4 Input
x 10
20

15

10

−5
0 10 20 30 40 50 60
Time

Figure 1.10: Control of unstable helicopter using unstampc

simple and intuitive in its formulation, can produce some very sophisticated control
action when required. In order to stabilise this unstable plant, classical theory tells
us that the Nyquist locus of the loop-gain frequency response must encircle the point
−1 twice, and this can only be achieved by supplying sufficient phase lead at the
appropriate frequencies. Doing this successfully requires considerable skill on the part
of a designer using classical ‘loop-shaping’ techniques. Predictive control achieves
this implicitly, given only some ‘reasonable’ design specifications.

On the other hand, this does not mean that classical theory can be forgotten. For this
example it tells us, for instance, that the loop gain must increase to values greater
than 1 at a frequency no lower than 0.4 rad/sec, approximately, and must decrease
again to values smaller than 1 at a frequency no higher than 2.5 rad/sec, approx-
imately [Mac89, chapter 1]. Its range of possible behaviours is rather restricted,
therefore, and this knowledge certainly helps to give the predictive controller a ‘rea-
sonable’ specification to achieve.
1.7. Early History and Terminology 27

The reader will find that improving the performance — for example, reducing the
overshoot or speeding up the response — by adjusting the parameters of the predictive
controller, is not so easy in this case.

1.7 Early History and Terminology

Predictive control appears to have been proposed independently by several people,


more or less simultaneously. It is notoriously difficult to analyse the history of an
idea, so no attempt will be made here to settle the rival claims to originality. Dates
of publications give some idea of precedence, of course, but the pioneers were mostly
industrial practitioners who implemented predictive control several years before the
first publications appeared, so the publication dates do not tell the whole story.

Richalet et al [RRTP78], of the French company Adersa, proposed predictive control


under the name Model Predictive Heuristic Control. The emphasis was on a control
methodology which could be applied to problems too difficult to be handled by
conventional PID control, but which was based on intuitive concepts and offered ease
of tuning. Constraint handling and optimality were not the principal objectives.

Cutler and Ramaker [CR80] also proposed predictive control, calling it Dynamic Ma-
trix Control, or DMC. This emphasised optimal plant operation under constraints,
and computed the control signal by repeatedly solving a linear programming (LP)
problem. DMC went on to become the most well-known of the commercial predictive
control products. A patent for it was granted to Prett et al in 1982 [PRC82].

The earliest patent, however, appears to be that granted to Martin-Sanchez in


1976 [San76], who called his method simply Adaptive Predictive Control. As the
name implies, the emphasis here was on exploiting the presence of the internal model
to obtain adaptive control, by adapting the model and relying on the optimization
to compute the appropriate control signals.

All of these proposals shared the essential features of predictive control: an explicit
internal model, the receding horizon idea, and computation of the control signal
by optimising predicted plant behaviour. Early academic publications containing
similar ideas include those of Propoi [Pro63], Kleinman [Kle70], Kwon and Pear-
son [KP75], and Rouhani and Mehra [RM82]. A very early contribution which
adressed a rather different problem, but introduced some ideas similar to those now
standard in predictive control, was that of Coales and Noton [CN56]. This provided
an approximate solution to the problem of synthesising minimum-time ‘bang-bang’
optimal controls; it did so by generating predictions of plant behaviour, using a fast
simulation model and assuming constant control signals, and deciding whether to
switch the sign of the control signal on the basis of the predicted behaviour at the
end of the prediction horizon. The horizon was not constant, however, so it was not
a receding horizon strategy; but it did contain the essential ideas of using predic-
28 1. Introduction

tions, generated from an explicit internal model (which was assumed at that time
to be an analog computer), and of computing an optimal control signal on-line in
real time.5

Of course, the idea of using predictions is a very old and common one in control.
The well-known Smith predictor [Smi57], for example, which is a controller for plants
with large time delays, has at its heart a model of the plant without the time delay,
thus providing a prediction of the plant output. Obtaining the prediction is a means
of obtaining phase lead, which offsets the large phase lag caused by the delay in the
plant. More fundamentally, any controller which uses derivative action, or a phase
lead compensator, can be viewed as providing a prediction of some signal. In a basic
‘proportional and derivative’ controller, for instance, the control signal depends on
y + T (dy/dt), where y is the plant output. This can be seen as a ‘T -second-ahead’
prediction of the output, on the assumption that dy/dt will remain constant over this
interval. The point of this discussion is to indicate that we will not consider every
control law which involves some kind of prediction as being an instance of ‘predictive
control’. Only those which include, as a minimum, an explicit model of the plant,
the receding horizon idea, and some kind of optimization, will be considered in this
book.

There is a plethora of names denoting particular variants of predictive control, usu-


ally with corresponding acronyms. Examples of these are:

• Dynamic Matrix Control (DMC),


• Extended Prediction Self Adaptive Control (EPSAC),
• Generalised Predictive Control (GPC),
• Model Algorithmic Control (MAC),
• Predictive Functional Control (PFC),
• Quadratic Dynamic Matrix Control (QDMC),
• Sequential Open Loop Optimization (SOLO),

and so on. Generic names which have become widely used to denote the whole
area of predictive control are Model Predictive Control, or MPC, and Model Based
Predictive Control, or MBPC.

1.8 Predictive Control in the Control Hierarchy

Figure 1.11 shows how predictive control is typically used in the process industries
at present. At the top level there is determination of set-points, usually by means
5
For an extended discussion of this proposal, and later developments, see [Rya82].
1.8. Predictive Control in the Control Hierarchy 29

Plant−wide static set−point optimization

(daily)

Set−point optimization at unit level

(hourly)

Predictive Control
(Logic, Overrides, Decoupling,
Exception handling)

Local loop controllers

(P, PI, PID)

Actuators

(valve servos etc)

Figure 1.11: Typical use of predictive control — current practice

of steady-state optimization . This steady-state optimization may itself be per-


formed at more than one level; plant-wide optimization of strategic set-points may
be performed once a day, but more detailed optimization, at the unit level, may be
performed every hour, say. This optimization is based on economic requirements
— so it may produce time-varying set-points, for instance — but it usually does
not take any account of the dynamic characteristics of the plant. At the bottom
level there are traditional local controllers, individually controlling pressures, flows,
temperatures, and so on. These are typically proportional and proportional-integral
(PI) controllers, occasionally three-term PID controllers with derivative action. At
the very lowest level, there are control loops associated with individual actuators,
such as valve positioning servos.

In between the static optimization layer and the local controller layer, there is tra-
ditionally a complex layer of logic, overrides, decoupling networks and exception
handling, to deal with all those conditions which cannot be handled by the simple
‘one set-point, one control loop’ paradigm. This layer usually consists of a collec-
tion of ad-hoc solutions to individual problems, and so tends to evolve during the
30 1. Introduction

lifetime of a plant, rather than being the product of an integrated design process.
Each solution is unlikely to take account of the behaviour of the whole process or
plant, and the overall behaviour of this layer is very far from being optimised.

It is in replacing this ad-hoc layer that predictive control currently has its most
successful niche in the process industries. The most commonly used combination,
of linear dynamic models and constrained optimization, allows it to handle very
many of the ‘exceptional’ (but not rare) conditions previously handled by the layer
of ad-hoc ‘fixes’. Furthermore, because predictive control is an integrated solution
to handling all these problems, it can provide dramatically better performance than
the technology it is replacing.

The fact that predictive control is usually implemented on top of traditional lo-
cal controllers had had important implications for its acceptance and development.
Firstly, it has allowed operating companies to be relatively brave in introducing this
new technology; if a predictive controller starts to misbehave, it is usually possible
to disable it, and let the local loop controllers hold the plant at the last set-points
they received from higher levels. The great majority of process plant is stable in this
condition, so although this may not be the most profitable condition, it is at least
a safe one. This is one of the reasons why there were many predictive controllers
installed even before there was a satisfactory stability theory for predictive control,
and indeed why many current installations take no account of that stability theory.
Secondly, it has resulted in commercial predictive controllers being developed almost
exclusively for stable plant. The plant ‘seen’ by the predictive controller is one which
is already running under closed-loop control, and is almost invariably stable.

Not all predictive controllers play the role shown in Figure 1.11. There are some
which are used as replacements of low-level controllers, for instance in servomechan-
sims, and in applications where adaptive control is required [CBB94, Cla88, ReADAK87].
It can be expected, especially as predictive control spreads to new application areas,
that it will become increasingly common for predictive control to include the lower
level currently populated by PI controllers, leaving only the actuator servos below it.
This is illustrated in Figure 1.12. In applications such as flight or spacecraft control,
for example, there is no scope for individual loops above the actuator level, because
holding each set-point (such as climb rate, or 3-axis attitude) requires coordinated
action by several actuators. Faster control update rates are needed if lower-level
control functions are to be performed, but these are becoming possible as comput-
ing hardware becomes faster. The other feature shown in Figure 1.12 is integration
of economic (short-term set-point) optimization with the dynamic performance op-
timization currently implemented by predictive control.
1.8. Predictive Control in the Control Hierarchy 31

Plant-wide static set-point optimization

(daily)

PREDICTIVE
CONTROL

Actuators
(valve servos etc)

Figure 1.12: Use of predictive control — future trend?


32 1. Introduction

1.9 General Optimal Control Formulation

The idea of posing control problems as problems of constrained optimization is not


new. In fact all the ‘classical’ theory of Optimal Control, as developed between, say,
1955 and 1970, was driven by problems of constrained optimization arising out of the
needs of the aerospace industry, particularly by military needs in flight and missile
control, and by the problems of launching, guiding and landing space vehicles.

In some ways this theory solved an extremely wide range of problems. Suppose that
the ‘plant’ being controlled has an input vector u and a state vector x, and has
nonlinear behaviour governed by the vector differential equation
dx
= f (x, u).
dt
Also suppose that the control objective is to minimise a ‘cost function’ (or ‘value
function’) which has the form
Z T
V (x, u, t) = `(x(t), u(t), t)dt + F (x(T ))
0

where `(x(t), u(t), t) is some function which is never negative, and that the control
input is constrained to be in some set u(t) ∈ U .

This is a very general formulation, and just about every sensible problem can be
represented in this form by using suitable functions f , F and `.

Example 1.9 Suppose the plant is a rocket which is to be transferred from the
launch site — state x0 — to a low-earth orbit — state xf — using as little fuel as
possible, and the vector of inputs includes the fuel flow rate as the first element, u1 .
This problem can be represented by setting

`(x(t), u(t), t) = |u1 (t)|

and

∞ if x(T ) 6= xf
F (x(T )) =
0 if x(T ) = xf

The vector function f depends on the dynamics of the rocket. The optimization will
be subject to the constraint 0 ≤ u1 (t) ≤ umax , where umax is the maximum possible
fuel flow rate.

In principle, the solution to such general problems is known: you have to solve the
so-called Hamilton-Jacobi-Bellman equation [BH75]:
∂ 0 ∂ 0
V (x, t) = min H(x, u, V (x, t))
∂t u∈U ∂x
1.9. General Optimal Control Formulation 33

where H(x, u, λ) = `(x, u)+λf (x, u), with the boundary condition V 0 (x, T ) = F (x).
Once you have solved this, you choose the control input signal as the one which
minimises H:
∂ 0
u0 (x, t) = arg min H(x, u, V (x, t)).
u∈U ∂x
Note that this is a feedback control law, because it depends, at time t, on x(t), which
itself depends on what has happened over the whole interval from the initial time to
the current time. (Note: You do not have to know where all this comes from. The
point is to see that it is nasty.)

Unfortunately, it is virtually impossible to solve this partial differential equation in


most cases! A few particular problems have been solved (of the type: ‘Minimise fuel
(or time) needed to get from A to B’), but that is all. So it is necessary to consider
some more specific problems in order to get solutions in practice.

One way to go is to assume that the plant is linear, so that the function f (x, u)
takes the special form:

ẋ = A(t)x(t) + B(t)u(t)

and that the functions ` and F are quadratic functions:

`(x(t), u(t), t) = x(t)T Q(t)x(t) + u(t)T R(t)u(t)


F (x(T )) = x(T )T Sx(T )

where Q(t), R(t) and S are square, symmetric, positive-definite matrices. In that
case the Hamilton-Jacobi-Bellman equation simplifies to an ordinary differential
equation (the Riccati equation) which can be solved, and which leads to a linear
(but time-varying) feedback law:

u(t) = F (t)x(t)

where F (t) is a matrix (the ‘state feedback’ matrix) which depends on the solution
of the Riccati equation [BH75, KR72]. Probably more than 95% of the development
of optimal control has been devoted to going in this direction. It leads to a very
complete and powerful theory, which has been widely applied — particularly in its
‘dual’ form, for the filtering problem, in which case it leads to the theory of Kalman
filters. But it has nothing to say about constraints or other nonlinearities.

The other way to go is down the road of Predictive Control. The difficulty of the
general optimal control problem arises because it is a function optimization problem.
Instead of ordinary calculus, it needs the Calculus of Variations, to find the optimal
input function among all possible ones. (For a very nice account of how this theory
developed see [SW97].) The main idea of Predictive Control is to avoid this difficulty
by restricting the set of possible inputs to such an extent that the optimization is
performed only over a finite set of parameters or ‘decision variables’, rather than
over a set of functions. Most commonly this is done as has already been seen: by
34 1. Introduction

cutting up time into discrete intervals, optimising over a finite horizon, and hence
over a finite number of intervals, and assuming that the input signal is held constant
during each interval, or even during several intervals. The future values of the input
signal are then the decision variables. Furthermore, predictive control does not
usually attempt to solve the feedback problem; it solves a sequence of open-loop
problems, with feedback entering rather indirectly, the latest measurements being
used to provide initial conditions for the next open-loop optimization. Other ways
of reducing the problem to an ‘ordinary’ optimization problem are possible — see
sections 5.6 or 8.4, for example.

1.10 What Is In This Book

This chapter has introduced the main concepts involved in predictive control:

• An internal model capable of simulating the plant behaviour faster than real
time.

• A reference trajectory which defines the desired closed-loop behaviour.

• The receding horizon principle.

• Characterising the assumed future input trajectory by a finite number of


‘moves’, or other parameters.

• On-line optimization, possibly constrained, to determine the future control


strategy.

These concepts together provide an intuitively appealing way, and a powerful way,
of controlling various systems. The rest of this book elaborates on the use of these
concepts in predictive control.

Most of the interest in predictive control comes from its ability to handle constraints,
and from the natural way in which it can be applied to the control of multivariable
systems, without losing its intuitive aspect. Chapter 2 introduces a standard for-
mulation of predictive control which assumes the presence of constraints, and of a
multivariable plant. For this purpose a state-space setting is used — it is the most
convenient for multivariable problems, and it includes all other approaches. Some of
the questions which have arisen in this chapter, especially the independent model,
offet-free tracking and stabilisation of an unstable model, are all illuminated by dis-
cussing them in the context of state observers. So far we have assumed a small
number of coincidence points — only one in all the examples. More commonly, co-
incidence points are spaced ‘densely’ over the prediction horizon — often there is a
coincidence point at each point in the horizon. Similarly, more than one parameter
is commonly used to characterise the assumed future control signal (Hu > 1).
1.10. What Is In This Book 35

Chapter 3 then considers how to solve the on-line optimization problems which arise
in predictive control when constraints are present. It includes discussion of relatively
recent algorithms, such as ‘interior point’ methods. It also discusses the structure
of the resulting controller, assuming the standard formulation adopted in chapter 2.
A major problem which arises when constraints are present is the possibility that
the optimization problem becomes infeasible; strategies are needed for handling this
eventuality. A commonly-adopted strategy is to ‘soften’ the constraints, namely to
allow their violation as a last resort if no other possibility exists. Chapter 3 includes
an explanation of how this can be done.

It was seen in section 1.3 that the only information really needed to implement a
predictive controller is the plant’s step response — so long as the plant is assumed to
behave linearly. It is therefore very understandable that the original developments
of predictive control assumed a model in the form of a step response, sometimes
referred to as a ‘dynamic matrix’.6 Some developments, especially the very well-
known Generalised Predictive Control, or GPC, assumed the model to be in the
form of a transfer function. Chapter 4 deals with formulations of predictive control
based on step response and transfer function models, and shows how these are related
to the state-space setting used in the rest of the book. It tries to persuade the reader
that it is best to use state-space models.

Many variations on the basic formulation are possible. If there are measured dis-
turbances, conventional control attempts to compensate for them by using ‘feed-
forward’. The same is possible with predictive control. It is possible to use other
criteria than a quadratic one for finding the optimal future input trajectory. And
it is possible to be creative when defining required performance. These and other
possibilities are introduced in chapter 5.

Chapter 6 shows how to adjust the formulation and the tuning parameters so that
closed-loop stability is guaranteed. The two principal methods are to introduce ‘ter-
minal constraints’ at the end of the prediction horizon, or to distribute coincidence
points evenly along an infinite prediction horizon. Some other methods are also
introduced. All the analysis in this chapter is concerned with ‘nominal stability’,
namely the stability of the closed loop under the assumption that an exact model
of the plant is available. The important problem of ensuring that a predictive con-
troller is robust to inexact modelling is addressed in chapter 8, which presents some
recent research proposals — this problem is still at the research stage.

Predictive controllers are ‘tuned’ by adjusting parameters such as the prediction


horizon, the time constant of the reference trajectory, and weights in the criterion
being optimised. Satisfactory tuning may not be easy to achieve. Chapter 7 consid-
ers this problem. It introduces some ‘classical’ analysis from linear control theory,
which is useful because chapter 3 shows that predictive controllers for the standard
formulation actually implement linear control laws, so long as all the constraints are

6
Hence the name of the commercial product Dynamic Matrix Control, or DMC — see Ap-
pendix A.
36 1. Introduction

inactive, or if a fixed set of constraints is active.

Chapter 9 gives an extended account of the application of predictive control to the


well-known Shell heavy-oil fractionator problem. It also gives a briefer account of
its application to the Newell-Lee evaporator, in order to demonstrate the effects of
plant nonlinearities.

Finally, chapter 10 presents some wider perspectives on predictive control: the possi-
bilities of constraint management within the predictive control framework, the use of
nonlinear models, and the potential of predictive control as a basis for fault-tolerant
control systems are all discussed here.

The Appendices provide details of some leading predictive control commercial prod-
ucts, of the software described in this chapter, and of MATLAB’s Model Predictive
Control Toolbox, the use of which will be assumed in later chapters.
1.11. Problems 37

1.11 Problems

1. Continue Example 1.3 for two more steps to find the optimal values of û(k +
1|k + 1) and û(k + 2|k + 2). (Note that the steady-state gain of the model is
20/3, so that the input signal should converge to 3/(20/3) = 0.45 if the control
scheme is stable.)
Verify that the output at time k + 2, y(k + 2), is not the same as that predicted
at time k, ŷ(k + 2|k), even though a perfect model and absence of disturbances
are assumed.

2. Continue Example 1.4 for two more steps, using MATLAB or other suitable
software (or a calculator) as necessary.

3. Repeat Examples 1.3 and 1.4 using a ‘straight-line’ reference trajectory, with
(1.2) replaced by
(  
1− iTs
Tref (k) if iTs < Tref
(k + i) =
0 otherwise

4. Verify that (1.24) is equivalent to (1.23).

5. A plant has a continuous-time transfer function

2e−1.5s
1 + 7s

that is, it has a steady-state gain of 2, a time constant of 7 sec, and a time
delay of 1.5 sec. The set-point has a constant value s(t) = 3, and the reference
trajectory is exponential with Tref = 5 sec. A predictive controller operates
with a sampling interval Ts = 0.5 sec, and coincidence points at 6 sec and
10 sec ahead of the current time. The future control input is assumed to be
constant over the prediction horizon (Hu = 1).
If the plant output is constant at 1 (y(k) = 1, ẏ(k) = 0), find the optimal
input u(k)

(a) by using the continuous-time model directly,


(b) by first obtaining an equivalent discrete-time model.

(Use MATLAB’s Control System Toolbox as necessary. In particular, the func-


tions step and lsim are useful for both parts, and c2d for part (b).)

6. Explain why a coincidence point nearer than 1.5 sec into the future (P1 × Ts <
1.5) should not be chosen in Problem 5.

7. Show how equation (1.31) and the subsequent analysis of the offset-free track-
ing property simplifies if there is only one coincidence point, and Hu = 1.
38 1. Introduction

8. Suppose the plant includes an integrator, so that its z-domain transfer function
is 1/(z −0.5)(z −1). Its gain is modelled incorrectly, so that the model transfer
function is 1.1/(z − 0.5)(z − 1). Apply the programs basicmpc and trackmpc
in this case. Verify that using basicmpc results in a steady-state error when
the set-point is constant (despite having an integrator in the plant), whereas
using trackmpc results in offset-free tracking.

9. Explain the following surprising fact. If the basic algorithm contained in pro-
gram basicmpc is used, without the modification to obtain offset-free tracking,
and if Tref = 0, so that the reference trajectory returns immediately to the
set-point trajectory, then the control signal is completely unaffected by mea-
surement noise. Why is this no longer the case when offset-free tracking is
included, as in program trackmpc?

10. The discussion of unstable systems emphasises the problem of having an un-
stable model running open-loop inside the controller. This implies that it may
be possible to control an unstable plant using the ‘independent model’ imple-
mentation used in basicmpc and trackmpc, providing that the model is stable.
This can in fact be done, providing that the plant and model are ‘close enough’,
in some sense, for the controller to stabilise the plant despite the modelling
error. The reader can check that this occurs for the following example:

Plant: 1/(z − 0.5)(z − 1.01)


Model: 1/(z − 0.6)(z − 0.99)

by running trackmpc with Tref = 6, Ts = 0.6, a single coincidence point


P1 = 8, Hu = 1, and a constant set-point. (The transient from zero initial
conditions takes some time to complete, so the parameter tend should be
increased to 200.) Note that in this case not only is the instability unmodelled,
but the steady-state gain of the model even has the incorrect sign.
The reader should also verify that stability of the closed loop is easily lost
when this kind of mis-modelling is present. (For example if the plant has a
pole at 1.05, while the model has it at 0.95.)

11. Show, by using the program unstampc, that the parameters used in Exam-
ple 1.8 give a reasonably robust controller, in the sense that some plant-model
mismatch can be tolerated without losing closed-loop stability. Observe that
in such cases a steady-state offset exists between the output and the set-point.
(For example, changing the gain factor from 9.8 to 9.9, or the constant term
in the second denominator factor from 0.1493 to 0.15 — in the model only, of
course — leaves the closed loop stable.)

12. Modify the program unstampc by changing the computation of the optimal
input trajectory to the form given in (1.31). Verify that offset-free tracking
is not obtained if the steady-state gain is modelled incorrectly, or if there is a
constant input or output disturbance acting on the plant.
1.11. Problems 39

13. Write a version of the program unstampc which allows the plant and the model
transfer functions to have different orders.

14. In (1.25)–(1.27) we assumed that the control signal changes at every one of the
first Hu sampling intervals, and then it remains constant: û(k + Hu − 1|k) =
û(k + Hu |k) = · · · . Suppose that the number of changes remains the same,
but the instants at which the changes occur are arbitrarily distributed over
the prediction horizon: û(k + i|k) = uj for Mj ≤ i < Mj+1 , j = 1, 2, . . . , Hu ,
M1 = 0, MHu < Hp . Describe the corresponding changes that need to be
made to ∆U and Θ. (Note that their dimensions should remain unchanged.)
Comment: In practice it is often desirable to have more frequent changes of
û near the beginning of the prediction horizon, and less frequent later; for
example, in non-minimum-phase systems which exhibit fast ‘inverse response’
followed by slow settling. In the Model Predictive Control Toolbox this is
referred to as ‘blocking’, because the input signal is assumed to remain constant
over ‘blocks’ of sampling intervals.

15. Using the programs basicmpc, trackmpc and noisympc (available on this
book’s web site), and the system defined in Example 1.6, observe the effects
of changing the parameters Tref , Ts , the number and spacing of coincidence
points, and the control horizon Hu (variable M). Also try non-constant set-point
trajectories.
40 1. Introduction
Chapter 2

A Basic Formulation of
Predictive Control

2.1 State-space models

2.1.1 Form of the model

In most of this book we will assume a linearised, discrete-time, state-space model of


the plant, in the form
x(k + 1) = Ax(k) + Bu(k) (2.1)
y(k) = Cy x(k) (2.2)
z(k) = Cz x(k) (2.3)
where x is an n-dimensional state vector, u is an `-dimensional input vector, y is
an my -dimensional vector of measured outputs, and z is an mz -dimensional vector
of outputs which are to be controlled , either to particular set-points, or to satisfy
some constraints, or both. The variables in y and z will usually overlap to a large
extent, and frequently they will be the same — that is, all the controlled outputs
will frequently be measured. We will often assume that y ≡ z, and we will then use
C to denote both Cy and Cz , and m to denote both my and mz . The index k counts
‘time steps’.

The reason for using this standard form is mainly that it connects well with the
standard theory of linear systems and control. We will often generalise this model by
including the effects of measured or unmeasured disturbances, and of measurement
noise.

We are going to assume that the sequence of actions at time step k is the following:

1. Obtain measurements y(k).

41
42 2. A Basic Formulation of Predictive Control

2. Compute the required plant input u(k).

3. Apply u(k) to the plant.

This implies that there is always some delay between measuring y(k) and applying
u(k). For this reason there is no ‘direct feed-through’ from u(k) to y(k) in the
measured output equation (2.2), so that the model is ‘strictly proper’ . Taking
computational delay into account is considered in more detail in section 2.5.

The controlled outputs z(k) could, in principle, depend on u(k). That is, the de-
scription

z(k) = Cz x(k) + Dz u(k) (2.4)

with Dz 6= 0 could be appropriate and useful in some cases. This would, however,
complicate the computation of the optimal u(k) slightly. This complication can be
avoided, without losing anything, by defining a new vector of controlled outputs

z̃(k) = z(k) − Dz u(k) (2.5)

which clearly depends on x(k) only, without any direct feed-through from u(k):
z̃(k) = Cz x(k). The corresponding changes to the cost function and constraints
are easily made — see Problems 12 and 13. We shall therefore assume that the
controlled outputs are defined by (2.3).

2.1.2 Linear model, nonlinear plant

The relationship between the linear model (2.1) – (2.3) and the real plant needs
careful consideration for predictive control. In most control methodologies the linear
model is used off-line, as an aid to analysis and design. In predictive control it is
used as part of the control algorithm, and the resulting signals are applied directly
to the plant. Therefore careful attention must be paid to appropriate treatment of
measurements before using them in the control computation algorithm, and of the
computed control signal.

The plant in reality behaves in some complicated nonlinear fashion. Suppose that
its state vector X evolves according to some nonlinear differential equation
dX
= f (X, U, t) (2.6)
dt
where U is the vector of inputs. (This is a simplification. Many processes are
naturally described by implicit equations of the form

f (X, dX/dt, U, t) = 0 (2.7)

and the extraction of the explicit form (2.6) may not be easy — but that is not
important here.) Suppose the process is in some state X = X0 , with input U = U0 ,
2.1. State-space models 43

and consider the effects of small perturbations X = X0 + x, U = U0 + u, with kxk


and kuk both small:

dX
= f (X0 + x, U0 + u, t) (2.8)
dt
∂f ∂f
≈ f (X0 , U0 , t) + x+ u (2.9)
∂X (X0 ,U0 ,t) ∂U (X0 ,U0 ,t)

where quadratic and higher-order terms in x and u have been neglected. The ex-
pressions ∂f /∂X|(X0 ,U0 ,t) and ∂f /∂U |(X0 ,U0 ,t) denote matrices of partial derivatives,
evaluated at (X0 , U0 , t). Denote these (‘Jacobian’) matrices by Ac and Bc , respec-
tively. Since X = X0 + x and X0 is a particular value of X, we have dX/dt = dx/dt.
Hence we have the linearised model
dx
= Ac x + Bc u + f (X0 , U0 , t) (2.10)
dt
If (X0 , U0 ) is an equilibrium point (that is, a possible steady state) at time t, namely
if f (X0 , U0 , t) = 0, then clearly this model simplifies further, to the familiar form
of continuous-time linear state-space model used very widely in systems and control
theory, namely

dx
= Ac x + Bc u (2.11)
dt
This is the most common case: linearised models are usually found for the neigh-
bourhood of an equilibrium point.

Sometimes it is useful to linearise at a point (X0 , U0 ) which is not an equilibrium


point. In this case we can define (Ẋ)0 = f (X0 , U0 , t)1 and

dx
ẋ = − (Ẋ)0 (2.12)
dt
to obtain

ẋ = Ac x + Bc u (2.13)

The form of this equation is the same as the one obtained when linearising about an
equilibrium point, and it can be used in much the same way. But it must be remem-
bered that ẋ is now a perturbation of the time derivative dx/dt, not the derivative
itself. This affects the formation of predictions, for instance. The exact linearisation
about a non-equilibrium trajectory of a system is a time-varying linear model, since
the state X does not remain constant at X0 . When using such models for predictive
control, one does not necessarily re-linearise at each time step, however. Often the
same linear model is retained for a number of time steps before re-linearising, even
if the plant is being transferred from one state to another.
1
Note that this is different from dX0 /dt, which is zero. Non-standard notation is being used
here; also our use of ẋ is non-standard.
44 2. A Basic Formulation of Predictive Control

For predictive control we need the difference equation model (2.1), since we use a
discrete-time setting. This can be obtained from the linearised differential equation
by standard techniques, usually assuming that the input u is constant between
sampling intervals [FPEN94]. Section 2.5 considers what to do if the computational
delay is too large to allow the standard conversion formulae to be used.

Conceptually, it is also possible to arrive at the linear, discrete-time model (2.1) by


linearising an assumed discrete-time nonlinear model of the general form
x(k + 1) = φ (x(k), u(k), k) (2.14)
But the function φ is usually not one that can be written down as a set of equations;
it is the function implemented by solving the continuous-time differential equations
between sampling intervals, assuming that the inputs are constant. In other words,
it is necessary to run a simulation in order to discover what the value of the function
φ is for a particular triple (x(k), u(k), k).

The outputs of a real plant are also determined from the state in a nonlinear way:
Y = g(X, t) (2.15)
where g is some nonlinear function, and we have assumed no explicit dependence
on the input U . Proceeding as before, suppose that Y0 = g(X0 , t) and Y = Y0 + y.
Then
Y = g(X0 + x, t) (2.16)
∂g
≈ g(X0 , t) + x (2.17)
∂X (X0 ,t)
= Y 0 + Cy x (2.18)
which leads to (2.2). The linearised equation (2.3) for the controlled ouptputs z can
obviously be obtained in the same way. Since we assume that the output equations
are static equations, their linearisations are the same in both the continuous-time
and the discrete-time models. When obtaining measurements from the plant, the
‘baseline’ values Y0 must be subtracted before using them in the linearised model.
When making predictions, and when expressing constraints and objectives, care must
be taken to either re-insert Y0 at the appropriate points, or to express everything
relative to Y0 . Conceptually this is very straightforward, but it requires care and a
systematic approach to get it right on a complex plant.

Similar considerations apply when applying the control signal to the plant. The
predictive control calculations usually give a value of u, and the ‘baseline’ value U0
must be added to this before applying it to the plant. However, as we saw in the
previous chapter, in predictive control we most often compute the required changes
in the control signal from one time step to the next, ∆u(k) = u(k) − u(k − 1). Since
∆u = ∆U , the required change can be applied directly. But the correct expression
of constraints again requires attention to consideration of U0 , as does the expression
of objectives in those cases in which the input values, as well as their changes, are
of concern.
2.1. State-space models 45

2.1.3 First-principles models and system identification

The linearised model (2.1)–(2.3) used in predictive control can be obtained in two
ways, essentially. Most commonly, it is obtained by performing tests on the plant,
which involve injecting known signals, such as steps, multi-sines, pseudo-random, or
others, at the plant inputs, and recording the resulting plant outputs. Linearised
models can then be obtained by using the techniques of system identification, which
range from simple curve-fitting to sophisticated statistically-based methods; there
is a large literature on this, and we refer the reader to [Lju89, Nor86, vOdM96]
as good starting points. It is sometimes claimed that predictive control has special
requirements, as regards system identification. This is probably inaccurate, however;
but it is certainly true that most applications of predictive control are in the process
industries, and these industries have special requirements, largely because of the
multivariable cross-couplings between inputs and outputs, and because of the slow
dynamics that are typical. Some material on system identification specifically for
the process industries can be found in [Ric91, RPG92, SMS92, ZB93, Zhu98].

Models obtained in this way are ‘black-box’ models, which represent only the input-
output behaviour of the plant, and carry no information about its internal structure.
In some cases special-purpose tests may be unnecessary or impossible, but it may
be possible to identify a linearised model on the basis of normal operating data; in
particular, this is the situation in adaptive control[ÅW89, SR96a, Mos95].

It should be emphasised that the form of linear model that is adopted does not
constrain the kind of test that should be applied to the plant. There appears to be
quite a widespread misconception that step inputs are required in order to identify
a model in step-response form, or that pseudo-random inputs are needed to obtain
a transfer-function model form, and so on. This is not true; if one is lucky enough
to have some choice of the input signal to use, that choice should depend primarily
on the experimental conditions — how much testing is possible, how noisy are the
measurements, etc — and on the inherent requirements of the model — at which
operating point should it be valid, what range of signal amplitudes are expected,
over what range of frequencies should it be accurate, etc. Once a linear model is
obtained in any of the standard forms, it is very straightforward to transform it to
any other form. This point will be emphasised again in chapter 4, and some specific
transformation procedures will be discussed there.

Sometimes a first-principles nonlinear model of the plant is available. That is, a


model in which the equations are obtained from a knowledge of the underlying
physical, chemical and thermodynamic processes. For flight control, for example,
the equations which accurately describe the nonlinear dynamics of an aircraft are
well known, and not very complicated. For complex industrial processes such first-
principles dynamic models are much more complex and expensive to develop, but
this is being done increasingly commonly. (Typically they are developed for the pur-
poses of operator training or safety certification, but once they have been developed,
there is no reason why they should not be used for the purposes of control.) The
46 2. A Basic Formulation of Predictive Control

availability of such a model corresponds to having (2.7) available, though one should
be aware that the innocuous-looking notation f (X, dX/dt, U, t) = 0 can represent a
very large collection of differential-algebraic equations, containing non-smooth ele-
ments such as switches (case statements) and look-up tables.

Linearised models can be obtained from a first-principles nonlinear model. In


relatively simple cases, such as aircraft, this can be done largely ‘by hand’, but in
complex cases it has to be done automatically. The standard way of doing this
is by applying perturbations to the noninear model, and estimating the Jacobian
matrices (Ac and Bc ) numerically. Another very effective procedure is to use the
nonlinear model to generate simulation data for particular conditions, and then to
apply system identification techniques to this data, as if it had been obtained from
the plant itself — see chapter 4 for an example.

2.2 A Basic Formulation

For the basic formulation of predictive control we shall assume that the plant model
is linear, that the cost function is quadratic, and that constraints are in the form
of linear inequalities. We shall also assume that everything is time-invariant. Fur-
thermore, we shall assume that the cost function does not penalise particular values
of the input vector u(k), but only changes of the input vector, ∆u(k), which are
defined as before. This formulation coincides with that used in the majority of the
predictive control literature.

To make the formulation useful in the real world, we shall not assume that the state
variables can be measured, but that we can obtain an estimate x̂(k|k) of the state
x(k), the notation indicating that this estimate is based on measurements up to time
k — that is, on measurements of the outputs up to y(k), and on knowledge of the
inputs only up to u(k − 1), since the next input u(k) has not yet been determined.
û(k+i|k) will denote a future value (at time k+i) of the input u, which is assumed at
time k. x̂(k + i|k), ŷ(k + i|k) and ẑ(k + i|k) will denote the predictions, made at time
k, of the variables x, y and z at time k + i, on the assumption that some sequence of
inputs û(k + j|k) (j = 0, 1, . . . , i − 1) will have occurred. These predictions will be
made consistently with the assumed linearised model (2.1)–(2.3). We will usually
assume that the real plant is governed by the same equations as the model, although
this is not really true. Only in Chapter 8 will we explicitly consider the fact that
the model is inevitably inaccurate.

Cost function:
The cost function V penalises deviations of the predicted controlled outputs ẑ(k+i|k)
from a (vector) reference trajectory r(k +i|k). Again the notation indicates that this
reference trajectory may depend on measurements made up to time k; in particular,
its initial point may be the output measurement y(k), as in Chapter 1. But it may
also be a fixed set-point, or some other predetermined trajectory. We define the cost
2.2. A Basic Formulation 47

function to be

X
Hp u −1
HX
V (k) = kẑ(k + i|k) − r(k + i|k)k2Q(i) + k∆û(k + i|k)k2R(i) (2.19)
i=Hw i=0

There are several points to note here. The prediction horizon has length Hp , but
we do not necessarily start penalising deviations of z from r immediately (if Hw >
1), because there may be some delay between applying an input and seeing any
effect. Hu is the control horizon. We will always assume that Hu ≤ Hp , and that
∆û(k + i|k) = 0 for i ≥ Hu , so that û(k + i|k) = û(k + Hu − 1|k) for all i ≥ Hu .
(Recall Figure 1.4.)

The form of the cost function (2.19) implies that the error vector ẑ(k+i|k)−r(k+i|k)
is penalised at every point in the prediction horizon, in the range Hw ≤ i ≤ Hp .
This is indeed the most common situation in predictive control. But it is possible
to penalise the error at only a few coincidence points, as was done in chapter 1, by
setting Q(i) = 0 for most values of i. It is also possible to have different coincidence
points for different components of the error vector, by setting appropriate elements
of the weighting matrices Q(i) to 0. To allow for these possibilities, we do not insist
on Q(i) > 0, but allow the weaker condition Q(i) ≥ 0.2 (At least this condition is
required, to ensure that V (k) ≥ 0.)

Example 2.2 Suppose that there are two controlled outputs. The prediction horizon
is Hp = 3. There is only one coincidence point for the first output, at i = 2. For the
second output there are two coincidence points, at i = 2 and i = 3. Errors in the
second output are penalised more heavily than errors in the first output. This could
be represented by
     
0 0 1 0 0 0
Q(1) = Q(2) = Q(3) = (2.20)
0 0 0 2 0 2

with Hw = 1. It could also be represented by taking Hw = 2, in which case Q(1)


would not be defined, while Q(2) and Q(3) would remain as above. Most commonly,
the weighting matrices Q(i) and R(i) are diagonal, as in this example.

We also need R(i) ≥ 0 to ensure that V (k) ≥ 0. Again, we do not insist on the
stronger condition that R(i) > 0, because there are cases in which the changes in
the control signal are not penalised — for instance, all the examples considered
in chapter 1. The weighting matrices R(i) are sometimes called move supression
factors, since increasing them penalises changes in the input vector more heavily.

The cost function (2.19) only penalises changes


P in the input vector, not its value.
In some cases an additional term of the form kû(k + i|k) − u0 kS is added, which
2

2
The notation Q ≥ 0 usually excludes the extreme possibility that Q = 0. But we use it here to
include this possibility.
48 2. A Basic Formulation of Predictive Control

Expressions like xT Qx and uT Ru, where x, u are vectors and Q, R are symmetric
matrices, are called quadratic forms, and are often written as kxk2Q and kuk2R , re-
spectively. They are just compact representations of certain quadratic functions in
several variables. This is best illustrated by an example.

Example 2.1 Suppose that


 
x1
x =
x2

and
 
10 4
Q = .
4 3

Then
  
T
  10 4 x1
x Qx = x 1 x2
4 3 x2
= 10x21 + 8x1 x2 + 3x22 .

If xT Qx > 0 for every x except x = 0, then this quadratic form is called positive
definite. It can be shown that a quadratic form is positive definite if and only if
all the eigenvalues of the matrix involved in it are positive, in which case we write
Q > 0. If xT Qx ≥ 0 then the quadratic form is called semi-positive definite and
we write Q ≥ 0.
The matrix Q in the example has both eigenvalues positive. So the quadratic form
is positive-definite. You can try substituting any real values for x1 and x2 (even
negative ones), and you will see that the value is always positive. Note that this
happens even if x1 = 0 or x2 = 0, provided that they are not both zero.
If Q = I then xT Qx = xT x = ||x||2 , the squared ‘length’ of the vector, or squared
Euclidean norm. Even if Q 6= I (but Q ≥ 0), it is possible to think of a quadratic
form as the square of a ‘weighted norm’, since xT Qx = kQ1/2 xk2 . Hence the notation
kxk2Q .
The only other thing we will need to know about a quadratic form is how to find its
gradient. Let V = xT Qx, but now consider the general case where x has n elements,
x = [x1 , x2 , . . . , xn ]T , and Q is an n × n matrix. Then the gradient of V is given by:
 
∂V ∂V ∂V
∇V = , ,... ,
∂x1 ∂x2 ∂xn
= 2xT Q

(We are not going to prove this here.) Note that we have defined the gradient to
be a row vector. Sometimes it is defined to be a column vector, in which case it is
given by 2Qx.
Mini-Tutorial 1: Quadratic Forms
2.2. A Basic Formulation 49

penalises deviations of the input vector from some ideal resting value. Usually this
is done only if there are more inputs than variables which are to be controlled to
set-points. We shall not include such a term in our basic formulation, but it will be
discussed in more detail in section 10.1.

The prediction and control horizons Hp and Hu , the ‘window’ parameter Hw , the
weights Q(i) and R(i), and the reference trajectory r(k + i), all affect the behaviour
of the closed-loop combination of plant and predictive controller. Some of these
parameters, particularly the weights, may be dictated by the economic objectives
of the control system, but usually they are in effect tuning parameters which are
adjusted to give satisfactory dynamic performance. Chapters 6, 7, and 8 all discuss
the influence of these parameters (and others).

Constraints: In the following we use vec(0) to denote a column vector, each element
of which is 0. We also use vec(a, b, c) to denote the vector [a, b, c]T , etc. We assume
that constraints of the following form hold over the control and prediction horizons:

E vec(∆û(k|k), . . . , ∆û(k + Hu − 1|k), 1) ≤ vec(0) (2.21)


F vec(û(k|k), . . . , û(k + Hu − 1|k), 1) ≤ vec(0) (2.22)
G vec(ẑ(k + Hw |k), . . . , ẑ(k + Hp |k), 1) ≤ vec(0) (2.23)

Here E, F and G are matrices of suitable dimensions. We can use constraints of


this form to represent possible actuator slew rates (2.21), actuator ranges (2.22),
and constraints on the controlled variables (2.23).

Example 2.3 Suppose we have a plant with 2 input variables and 2 controlled vari-
ables. The control horizon is Hu = 1 and the prediction horizon is Hp = 2 (with
Hw = 1). We have the following constraints, which are to hold at each time:

−2 ≤ ∆u1 ≤ 2 (2.24)
0 ≤ u2 ≤ 3 (2.25)
z1 ≥ 0 (2.26)
z2 ≥ 0 (2.27)
3z1 + 5z2 ≤ 15 (2.28)

To put these into our standard form, we rewrite the ∆u1 constraints as follows.
 
∆u1
1
−2 ≤ ∆u1 ⇔ −∆u1 ≤ 2 ⇔ − ∆u1 − 1 ≤ 0 ⇔ [−1/2, 0, −1]  ∆u2  ≤ 0
2
1
 
∆u1
1
δu2 ≤ 2 ⇔ ∆u1 − 1 ≤ 0 ⇔ [1/2, 0, −1]  ∆u2  ≤ 0
2
1
50 2. A Basic Formulation of Predictive Control

Now we write these two inequalities together, and replace ∆u by ∆û:


 
  ∆û1 (k|k)  
−1/2 0 −1   0
∆û2 (k|k) ≤
1/2 0 −1 0
1
so that we have
 
−1/2 0 −1
E=
1/2 0 −1
We leave finding the matrix F for this example to the reader (Problem 4), and go
on to find G. We proceed in the same way, the main difference being that we have
to express the inequalities across the prediction horizon, which is greater than 1.
z1 ≥ 0 ⇔ −z1 ≤ 0
z2 ≥ 0 ⇔ −z2 ≤ 0
 
z1
1 1
3z1 + 5z2 ≤ 15 ⇔ z1 + z2 − 1 ≤ 0 ⇔ [1/5, 1/3, −1]  z2  ≤ 0
5 3
1
from which we get
   
−1 0 0 0 0   0
 0 ẑ1 (k + 1|k)
 −1 0 0 0 
  ẑ2 (k + 1|k)

  0 

 1/5 1/3 0 0 −1     0 
   ẑ1 (k + 2|k) ≤ 
 0 0 −1 0 
0    0 
  ẑ2 (k + 2|k)   
 0 0 0 −1 0   0 
1
0 0 1/5 1/3 −1 0
| {z }
G

It will be seen that the dimensions of the matrices E, F and G can become very
large very quickly (Hp may be 10 or 20 or more). However, assembling them from
the given constraints is simple, and this job can be automated. In fact, the software
which we will use — the Model Predictive Control Toolbox for MATLAB— does this
for the user.

The important thing about the constraints is that they are all in the form of linear
inequalities. When we come to solve the predictive control optimization problem, all
these inequalities will need to be translated into inequalities concerning ∆û(k + i|k).
Since we assume a linear model, we will see that these inequalities remain linear,
even after this translation (Problem 5). This is going to be crucial for being able to
solve the optimization problem reliably and efficiently.

Notice that in the example there are variables (u1 , ∆u2 ) which are not constrained.
It is also possible to have the converse situation, of variables which are constrained,
but do not appear in the cost function (zone objectives). This is only likely to
occur with the z variables, and is represented in our standard formulation by having
appropriate zero entries in the weighting matrices Q(i).
2.2. A Basic Formulation 51

Np Gp
Stock

Feed

Tank

H1 N1 Headbox

H2 N2
Nw
Wire Wet
paper
Gw
White water

Figure 2.1: Paper machine with headbox

Example 2.4 Paper Machine Headbox

This example is based on an example in the Model Predictive Control Toolbox User’s
Guide[MR95], and some of the software-based problems will refer to it.

Part of a paper-making machine is shown in Figure 2.1. The following variables are
involved:

Inputs (u) States (x) Measured Controlled


Outputs (y) Variables (z)
Stock flowrateGp Feed tank level H1
WW flowrateGw Headbox level H2 H2 H2
Feed tank consistencyN1 N1
headbox consistency N2 N2 N2

A linearised model of this machine has the (continuous-time) state-space matrices


   
−1.93 0 0 0 1.274 1.274
 0.394 −0.426 0 0   0 0 
Ac =  0
 Bc = 
  1.34 −0.65


0 −0.63 0
0.82 −0.784 0.413 −0.426 0 0
 
0 1 0 0  
  0 1 0 0
Cy = 0 0 1 0 Cz =
0 0 0 1
0 0 0 1
52 2. A Basic Formulation of Predictive Control

where time has been measured in minutes. Predictive control is to be applied to this
plant, with an update interval of Ts = 2 minutes. Discretising the model with this
sample interval (using the MATLAB function c2d for example) gives
   
0.0211 0 0 0 0.6462 0.6462
 0.1062 0.4266 0 0   0.2800 0.2800 
A= 

 B = 
 1.5237 −0.7391 

0 0 0.2837 0
0.1012 −0.6688 0.2893 0.4266 0.9929 0.1507

Note that the matrices Cy and Cz remain the same in the discrete-time model.

The prediction horizon is to be Hp = 10 (that is, 20 minutes) and the control horizon
is to be Hu = 3. Since control of consistency is more important than control of level,
errors in consistency (N2 ) are penalised more than errors in level (H2 ):
 
0.2 0
Q(i) =
0 1
Changes of the two valves are penalised equally, and the same penalties are applied
at each step of the prediction and control horizons (that is, for each i):
 
0.6 0
R(i) =
0 0.6
Since there is no delay in the plant (beyond the usual 1-step delay — u(k) does not
affect x(k)), errors are penalised from the first step, namely Hw = 1.

The valves are scaled so that their range of operation is:


−10 ≤ u1 (k) ≤ 10 − 10 ≤ u2 (k) ≤ 10
(0 is usually the point at which the plant was linearised, so that the range is not
always symmetric about 0), and their slew rate (maximum rate of change) is such
that they can move through 10% of the range in one step (2 minutes):
−2 ≤ ∆u1 (k) ≤ 2 − 2 ≤ ∆u2 (k) ≤ 2

The headbox level (H2 ) is constrained, so that the headbox never runs dry, or over-
fills:
−3 ≤ z1 ≤ 5
Note that if an operating point is represented by u = 0, then with a linear model we
must also have y = 0 at that point (unless there is integration in the plant).

From these constraints we can assemble the matrices E, F and G which appear in
our standard formulation of the predictive control problem. These matrices will have
the following dimensions:
E: 4×7 F : 4×7 G: 20 × 21
2.3. General Features of Constrained Predictive Control 53

2.3 General Features of Constrained Predictive Control

Since predictive control problems usually include constraints, the resulting control
law is usually nonlinear. It is easy to understand why this is so. Suppose we have a
gas-turbine engine with a ‘hard’ state constraint of the form xj (t) < Xj — such as
‘Turbine temperature lower than 1000 ◦ C’. If the turbine is running at 995 ◦ C and a
disturbance d occurs which has the effect of moving xj away from Xj — the cooling
oil flow rate increases for some reason, say — then the control system will react
in a fairly ‘relaxed’ way, and will coordinate bringing xj back to its set-point with
maintaining other objectives — correct turbine speed, power output, fuel economy,
etc. Now if a disturbance −d occurs instead, then by definition a linear controller
would react in a similarly relaxed way, replacing a control signal u(t) by −u(t).

In contrast, a controller which is aware of the constraint will react in ‘panic mode’.
It ‘knows’ that there is no point in worrying about other objectives, because if the
constraint is exceeded catastrophic failure is likely to result. It therefore reacts in
a very different way to the disturbance −d than it would to disturbance +d — in
our example, perhaps it will cut the fuel flow rate sharply and change the inlet vane
angle to get maximum air flow. In a multi-engine aircraft it might even shut the
engine down. Such behaviour is of course nonlinear.

We will see later that ‘standard’ predictive controllers in fact behave linearly so
long as the plant is operating safely away from constraints, but nonlinearly when
constraints are approached too closely. On the other hand, a standard predictive
controller would not go so far as to shut down an engine, and it does not have the
authority to do so. That kind of decision is usually handled by a separate higher-level
‘supervisor’, which may be a human operator or pilot.

Although constrained predictive controllers are nonlinear, they are usually time-
invariant. This means that there is a function h, such that the control signal can
be expressed as u = h(x), namely it depends only on the current state, and not
explicitly on time (that is, it is not necessary to write u = h(x, t)). Of course this
function ‘exists’ only in a mathematical sense; it would be impossibly difficult to
write it down in ‘closed-form’ (as a formula). In order to see what u is, you have to
feed x into an optimization algorithm and see what comes out. This time-invariance
occurs so long as there is nothing in the problem formulation that depends explicitly
on time: the model of the plant, the cost function and the constraints must all be
independent of time.

We have to be rather careful about what this means exactly. First of all, our model
(2.1)–(2.3) does not depend on the time k, except through x and u. Secondly, the
cost function (2.19) can depend on i — the weights Q(i) and R(i) can vary over
the prediction and control horizons — but not on k. So a different weight can be
attached to an error predicted to be 3 steps in the future than to an error predicted
1 step ahead. But when the problem is solved at the next k value, it must have the
same pattern of weights. As time moves on, so k increases to k + 1, but exactly
54 2. A Basic Formulation of Predictive Control

the same problem is solved as was solved at time k. So the cost function does not
depend on time.

Thirdly, to get a time-invariant controller we can have constraints depending on i


but not on k. So |x̂j (k + i|k)| < Xj (i) is ok, but |x̂j (k + i|k)| < Xj (k) is not. More
generally,

x̂(k + i|k) ∈ X(i) (2.29)


û(k + i|k) ∈ U (i) (2.30)

is ok, whereas

x̂(k + i|k) ∈ X(k) (2.31)


û(k + i|k) ∈ U (k) (2.32)

is not. This can be a restriction if we want a time-invariant controller. For instance,


when landing an aircraft, one may want constraints to become tighter as the air-
craft approaches the runway. If one assumes a certain speed profile, the constraint
tightening can be ‘scheduled’ as a function of time. This would give a time-varying
predictive control law. However it may make more sense to schedule the constraint
tightening as a function of distance from the runway, and make this one of the states.
In this case the control law will be time-invariant (though not necessarily simpler!).

There is no necessary advantage to having a time-invariant control law. Having one


may make analysis of its behaviour easier in some cases, but in practice changes to
the model, the cost and the constraints are all made from time to time.

2.4 Alternative State Variable Choices

As usual, our plant model (2.1) expresses the plant state x in terms of the values of
the input u. But the cost function penalises changes in the input, ∆u, rather than
the input values themselves. We shall see in the next chapter that the predictive
control algorithm will in fact produce the changes ∆u rather than u. It is therefore
convenient for many purposes to regard the ‘controller’ as producing the signal ∆u,
and the ‘plant’ as having this signal as its input. That is, it is often convenient to
regard the ‘discrete-time integration’ from ∆u to u as being included in the plant
dynamics. Figure 2.2 shows the real controller producing the signal u, which is
passed to the real plant. It also shows the MPC ‘controller’ producing the signal
∆u, which is passed to the MPC ‘plant’.

There are several ways of including this ‘integration’ in a state-space model of the
MPC ‘plant’. All of them involve augmenting the state vector. The first way is to
2.4. Alternative State Variable Choices 55

MPC ‘PLANT’

MPC
∆u u REAL
z
‘CONTROLLER’
z−1 PLANT

REAL CONTROLLER

Figure 2.2: The boundary between controller and plant — a matter of convenience

define the state vector3


 
x(k)
ξ(k) = . (2.33)
u(k − 1)

Then, assuming the linear model (2.1) holds for the real plant state, we have
      
x(k + 1) A B x(k) B
= + ∆u(k) (2.34)
u(k) 0 I u(k − 1) I
 
x(k)
y(k) = [Cy , 0] (2.35)
u(k − 1)
 
x(k)
z(k) = [Cz , 0] (2.36)
u(k − 1)

A less obvious way is to define the state vector


 
∆x(k)
ξ(k) =  y(k)  (2.37)
z(k)

where ∆x(k) = x(k) − x(k − 1) is the change in the state at time k. From (2.1) we
have

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


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

Subtracting these gives

∆x(k + 1) = A∆x(k) + B∆u(k) (2.40)


3
We shall often use ξ as an augmented state, with associated matrices à and B̃, etc. The
meaning will be different, depending on the context, but will always be defined ‘locally’.
56 2. A Basic Formulation of Predictive Control

Furthermore, from (2.2) and (2.3) we have

y(k + 1) = Cy x(k + 1)
= Cy [∆x(k + 1) + x(k)]
= Cy [A∆x(k) + B∆u(k)] + y(k) (2.41)
z(k + 1) = Cz x(k + 1)
= Cz [∆x(k + 1) + x(k)]
= Cz [A∆x(k) + B∆u(k)] + z(k) (2.42)

so that we have the state-space representation


      
∆x(k + 1) A 0 0 ∆x(k) B
 y(k + 1)  =  Cy A I 0   y(k)  +  Cy B  ∆u(k) (2.43)
z(k + 1) Cz A 0 I z(k) Cz B
 
    ∆x(k)
y(k) 0 I 0 
= y(k)  (2.44)
z(k) 0 0 I
z(k)

Both of these state-space representations have been used in the literature of pre-
dictive control. For example, the first representation (2.33) was used in [Ric90],
while the second one (2.37) was used in [PG88] and many other publications. The
second representation is also used in the Model Predictive Control Toolbox for some
purposes. These two seem to be the most useful, although other representations are
possible — see Problem 8. Note that if the number of inputs is not the same as
the number of measured and controlled outputs, then at least one of these represen-
tations is not minimal — that is, it must be either uncontrollable or unobservable
— since the two representations will then have different state dimensions, but both
give the same input-output transfer function.

2.5 Allowing for Computational Delay

Since predictive control involves on-line optimization, a considerable computational


delay may be involved, and this should be taken account of. Figure 2.3 shows the
assumptions we shall make about the timing of measurements made on the plant
being controlled, and the resulting control signals being applied.

The measurement interval and control update interval are assumed to be the same,
with length Ts . The plant output vector is measured at time kTs , and this mea-
surement is labelled y(k). If there is a measured disturbance this is assumed to be
measured at the same time, and this is labelled dm (k). There is then a delay of τ ,
which is the time taken by the predictive controller to complete its computations,
after which a new control vector is produced and applied as the plant input signal.
This input signal is labelled u(k). The input signal is assumed to be held constant
2.5. Allowing for Computational Delay 57

Disturbance

dm (k) dm (k + 1)
Time

Output Ts

y(k) y(k + 1)
Time

Input u(k)
τ u(k + 1)

Time

kTs (k + 1)Ts
kTs + τ (k + 1)Ts + τ

Figure 2.3: Assumed timing of measuring and applying signals


58 2. A Basic Formulation of Predictive Control

until it is recomputed Ts time units later. This sequence is repeated at time (k+1)Ts ,
and regularly thereafter.

In practice, process plants may have hundreds of measurements which may be taken,
and/or made available, at various times during the measurement interval. If accurate
modelling is required, this may have to be taken into account. Also the computation
delay τ may vary in practice, in which case the decision must be taken whether to
apply the new control signal to the plant as soon as it becomes available — which
probably improves the control but complicates the modelling and analysis — or
whether the result should be held up until a standard interval has elapsed before
applying it to the plant. It would be impossible to deal with all such eventualities
here, so we will assume that all the measurements are taken synchronously, as shown
in Figure 2.3, and that the computational delay τ is the same at each step.

Now we suppose that we have a linearised model for the continuous-time plant in
the state-space form:

ẋc (t) = Ac xc (t) + Bc uc (t) (2.45)


yc (t) = Cc xc (t) (2.46)

(It is enough to consider the measured outputs y. Controlled outputs z are treated
in exactly the same way.) The assumptions shown in Figure 2.3 imply that y(k) =
yc (kTs ), and that

uc (t) = u(k) for kTs + τ ≤ t < (k + 1)Ts + τ (2.47)

so that we have

Ac xc (t) + Bc u(k − 1) for kTs ≤ t < kTs + τ
x˙c (t) = (2.48)
Ac xc (t) + Bc u(k) for kTs + τ ≤ t < (k + 1)Ts

Now the solution of (2.45) is well known [FPEN94, Kai80] to be given by


Z t
Ac (t−t0 )
xc (t) = e xc (t0 ) + eAc (t−θ) Buc (θ)dθ (2.49)
t0

where t0 < t is some initial time, and xc (t0 ) is the initial state at that time. So,
applying this solution over the interval kTs ≤ t < kTs + τ , and defining x(k) =
xc (kTs ), gives
Z kTs +τ 
Ac (kTs +τ −θ)
Ac τ
xc (kTs + τ ) = e x(k) + e dθ Bc u(k − 1) (2.50)
kTs

Now using the change of variable η = kTs + τ − θ it is easy to show that


Z kTs +τ Z τ
eAc (kTs +τ −θ) dθ = eAc η dη = Γ1 (2.51)
kTs 0

which is a constant matrix, so we have

xc (kTs + τ ) = eAc τ x(k) + Γ1 Bc u(k − 1) (2.52)


2.5. Allowing for Computational Delay 59

Similarly, applying (2.49) over the interval kTs + τ ≤ t < (k + 1)Ts gives
Z (k+1)Ts !
Ac (Ts −τ ) Ac ([k+1]Ts −θ)
x(k + 1) = e xc (kTs + τ ) + e dθ Bc u(k)(2.53)
kTs +τ
Ac (Ts −τ )
= e [e x(k) + Γ1 Bc u(k − 1)] +
Ac τ
Z Ts −τ 
Ac η
+ e dη Bc u(k) (2.54)
0
= Ax(k) + B1 u(k − 1) + B2 u(k) (2.55)
where
Z Ts −τ
A = eAc Ts B1 = eAc (Ts −τ ) Γ1 Bc B2 = eAc η dηBc (2.56)
0

Now this is not in the standard form of a discrete-time state-space model, because of
the dependence of x(k + 1) on u(k − 1). But we can easily bring it into the standard
form by introducing the state
 
x(k)
ξ(k) = (2.57)
u(k − 1)
which gives the state equation in standard form:
ξ(k + 1) = Ãξ(k) + B̃u(k) (2.58)
where
   
A B1 B2
à = B̃ = (2.59)
0 0 I
From (2.46) the associated equation for the measured outputs is
y(k) = Cc x(k) = C̃ξ(k) (2.60)

where C̃ = [Cc , 0].

Because of this possibility, we can continue to assume that the linearised plant model
has the form (2.1)–(2.3), providing that an appropriate definition of the state vector
is used. The reason for using this standard form is mainly that it connects well with
the standard theory of linear systems and control. It is not necessarily the best form
for implementation — for example it may be more efficient to use the form (2.55)
in some circumstances.

The reader is warned that most standard software for finding discrete-time equiva-
lents of continuous-time systems, such as the Control System Toolbox for MATLAB
function c2d, does not take account of computation delay. It is, however, fairly easy
to obtain the required model using such software — see Problem 9.

Note that if the computational delay is negligible (τ = 0) then B1 = 0, and in the


other extreme case, namely τ = Ts , we have B2 = 0. Most examples which appear
in the predictive control literature neglect the computational delay.
60 2. A Basic Formulation of Predictive Control

2.6 Prediction

In order to solve the predictive control problem, we must have a way of computing
the predicted values of the controlled variables, ẑ(k + i|k), from our best estimate of
the current state, x̂(k|k), and the assumed future inputs, or equivalently, the latest
input, u(k − 1), and the assumed future input changes, ∆û(k + i|k).

It may seem that this is really part of the solution, not of the problem formulation, so
that it belongs in the next chapter. But it turns out that the way the predictions are
made has a great effect on the performance of the closed-loop system running under
predictive control. So the choice of prediction strategy is another ‘tuning parameter’
for predictive control, just as choices of horizons and cost functions are. Furthermore,
the prediction strategy follows in a rather systematic way from assumptions made
about disturbances acting on the system and measurement errors such as noise.
So we can say that, rather than choosing a prediction strategy, we are specifying
a model of the environment in which the plant is operating. And that properly
belongs here, as part of the problem formulation.

However, prediction can get very complicated. So to avoid being too distracted by
it at this stage, we will deal with a few simple cases here — which will already cover
much of industrial practice — and come back to more general cases later.

2.6.1 No disturbances, Full state measurement

We will start with the simplest situation. Assume that the whole state vector is
measured, so that x̂(k|k) = x(k) = y(k) (so Cy = I). Also assume that we know
nothing about any disturbances or measurement noise. Then all we can do is to
predict by iterating the model (2.1)–(2.3). So we get

x̂(k + 1|k) = Ax(k) + B û(k|k) (2.61)


x̂(k + 2|k) = Ax̂(k + 1|k) + B û(k + 1|k) (2.62)
2
= A x(k) + AB û(k|k) + B û(k + 1|k) (2.63)
..
.
x̂(k + Hp |k) = Ax̂(k + Hp − 1|k) + B û(k + Hp − 1|k) (2.64)
= AHp x(k) + AHp −1 B û(k|k) + . . . + B û(k + Hp − 1|k) (2.65)

In the first line we have used û(k|k) rather than u(k), because at the time when we
need to compute the predictions we do not yet know what u(k) will be.

Now recall that we have assumed that the input will only change at times k, k +
1, . . . , k + Hu − 1, and will remain constant after that. So we have û(k + i|k) =
û(k + Hu − 1) for Hu ≤ i ≤ Hp − 1. In fact we will later want to have the predictions
expressed in terms of ∆û(k + i|k) rather than û(k + i|k), so let us do that now.
2.6. Prediction 61

Recall that ∆û(k + i|k) = û(k + i|k) − û(k + i − 1|k), and that at time k we already
know u(k − 1). So we have

û(k|k) = ∆û(k|k) + u(k − 1)


û(k + 1|k) = ∆û(k + 1|k) + ∆û(k|k) + u(k − 1)
..
.
û(k + Hu − 1|k) = ∆û(k + Hu − 1|k) + . . . + ∆û(k|k) + u(k − 1)

and hence we get

x̂(k + 1|k) = Ax(k) + B[∆û(k|k) + u(k − 1)]


x̂(k + 2|k) = A2 x(k) + AB[∆û(k|k) + u(k − 1)] +
+ B [∆û(k + 1|k) + ∆û(k|k) + u(k − 1)]
| {z }
û(k+1|k)

= A x(k) + (A + I)B∆û(k|k) + B∆û(k + 1|k) + (A + I)Bu(k − 1)


2

..
.
x̂(k + Hu |k) = AHu x(k) + (AHu −1 + . . . + A + I)B∆û(k|k) +
. . . + B∆û(k + Hu − 1|k) + (AHu −1 + . . . + A + I)Bu(k − 1)

(Notice the change at this point)

x̂(k + Hu + 1|k) = AHu +1 x(k) + (AHu + . . . + A + I)B∆û(k|k) +


. . . + (A + I)B∆û(k + Hu − 1|k) + (AHu + . . . + A + I)Bu(k − 1)
..
.
x̂(k + Hp |k) = AHp x(k) + (AHp −1 + . . . + A + I)B∆û(k|k) +
. . . + (AHp −Hu + . . . + A + I)B∆û(k + Hu − 1|k) + (AHp −1 + . . . + A + I)Bu(k − 1)
62 2. A Basic Formulation of Predictive Control

Finally we can write this in matrix-vector form:


     
x̂(k + 1|k) A B
 ..   ..   .. 
 .   .   . 
     PHu −1 i 
 x̂(k + Hu |k)   AHu   AB 
 =  x(k) +  Pi=0  u(k − 1) +
 x̂(k + Hu + 1|k)   AHu +1   Hu i 
     i=0 A B 
 ..   ..   .. 
 .   .   . 
PHp −1 i
x̂(k + Hp |k) AHp AB
| {z i=0 }
past
 
B ··· 0
 ··· 
 AB + B 0 
 .. .. ..  
 . . .  ∆û(k|k)
 PHu −1 i 
 ···  .. 
 Pi=0
AB B  .  (2.66)
 Hu 
 i=0 A B
i ··· AB + B  ∆û(k + Hu − 1|k)
 
 .. .. .. 
 . . . 
PHp −1 i PHp −Hu
i=0 A B ··· i=0 Ai B
| {z }
future

The predictions of z are now obtained simply as

ẑ(k + 1|k) = Cz x̂(k + 1|k) (2.67)


ẑ(k + 2|k) = Cz x̂(k + 2|k) (2.68)
..
. (2.69)
ẑ(k + Hp |k) = Cz x̂(k + Hp |k) (2.70)
(2.71)

or
 
  Cz 0 · · · 0  
ẑ(k + 1|k)   x̂(k + 1|k)
 ..   0 Cz · · · 0  .. 
 . = .. .. . . ..  .  (2.72)
 . . . . 
ẑ(k + Hp |k) x̂(k + Hp |k)
0 0 ··· Cz

A warning is in order about the prediction equation (2.66). It involves computing


Ai , possibly for quite large values of i. This can lead to numerical problems. If the
plant is unstable, then some elements in Ai may become extremely large relative
to others, and relative to elements in lower powers of A. Since computers work
with finite-precision arithmetic, this can sometimes lead to wrong results. Similar
problems can occur if the plant is stable; in this case some elements of Ai may
become extremely small relative to others. Again wrong answers may result. (Using
‘IEEE Standard’ arithmetic, computers cannot distinguish between 1 and 1 +  if
|| < 10−16 , approximately.)
2.6. Prediction 63

d(k)

y(k) = z(k)
u(k)
PLANT

ŷ(k|k − 1) = ẑ(k|k − 1)

Figure 2.4: Output disturbance

The safest way of computing the predictions is probably to iterate one step at a
time. This is in effect what is done if the predictions are not computed explicitly
when computing the optimal control signal, but if

x̂(k + i|k) = Ax̂(k + i − 1|k) + B û(k + i − 1|k) (2.73)

is included as an equality constraint during the optimization, which also leads to


the most efficient computation [RWR98]— see section 3.2 for details. Alternatively,
problems of predicting with an unstable plant can be alleviated by pre-stabilising
the plant, as described in section 5.2. Even if explicit predictions are not made
for the purposes of optimization, they may be needed for the operator interface.
One of the problems associated with running an advanced controller, such as a
predictive controller, is that plant operators may lose confidence in the correctness
of the actions taken by the controller, if they do not understand what it is doing.
Displaying predictions can contribute very effectively to retaining their confidence.

2.6.2 Constant output disturbance

Now we will assume that there are disturbances acting on the plant. The simplest
assumption is that the measured and controlled outputs are the same (z = y), and
that there is an ‘output disturbance’ — see Figure 2.4. At time k we do not know
ˆ
what the disturbance d(k) is, but we can form an estimate of it, d(k|k), by comparing
the measured output with the predicted one:
ˆ
y(k) = ŷ(k|k − 1) + d(k|k) (2.74)
ˆ
= Cy x̂(k|k − 1) + d(k|k) (2.75)

Another simple assumption is that this disturbance will continue unchanged during
the prediction horizon. This means that, although we keep (2.2) and (2.3), we
predict y and z using
ˆ + i|k)
ẑ(k + i|k) = ŷ(k + i|k) = Cy x̂(k + i|k) + d(k (2.76)
64 2. A Basic Formulation of Predictive Control

where
ˆ + i|k) = d(k|k)
d(k ˆ (2.77)
So at time step k we do the following:

1. Measure the actual plant output y(k).


2. Estimate the disturbance as the difference between the actual and the esti-
mated output.
3. Use that estimate to predict outputs over the prediction horizon.

We will generally follow this scheme, but Step 2 will become more elaborate when
we make more elaborate assumptions about the nature of the disturbance. In Step 3
we need to assume future input movements, in order to use (2.1) or (2.66) to predict
x̂(k + i|k).

The assumption of a constant output disturbance, and the simplest disturbance


estimation scheme of (2.76)–(2.77) is sometimes called the ‘DMC scheme’, because
that is what was used in one of the original proprietary predictive control products,
DMC (= Dynamic Matrix Control) [CR80, PRC82]. The same scheme is used in
most proprietary predictive control products — see Appendix A — and we already
used it in Chapter 1.

Notice that, even if Cy = I, we now have ŷ(k + i|k) 6= x̂(k + i|k). In general, this
means that we need an observer to estimate x̂.

2.6.3 Using an observer

If we cannot measure the full state vector, or if the measured outputs consist of some
linear combinations of the states, so that the states cannot be measured directly,
then an observer can be used to estimate the state vector. It is instructive to see how
the ‘constant output disturbance’ assumption we made in the previous subsection
can be handled using observer theory. We can do this by augmenting the model of
the plant, so that it also includes a model of the output disturbance. We do this by
defining a new augmented state:
 
x(k)
ξ(k) =
d(k)
Since we assume that the output disturbance is constant, the new state and output
equations are
      
x(k + 1) A 0 x(k) B
= + u(k) (2.78)
d(k + 1) 0 I d(k) 0
 
x(k)
y(k) = [Cy I] (2.79)
d(k)
2.6. Prediction 65

The general structure of a state observer is shown in Figure 2.5, for a plant described
by the equations

x(k + 1) = Ax(k) + Bu(k), y(k) = Cx(k) (2.80)

It is a copy of the plant, with feedback from the measured plant output, through
the gain matrix L, to correct the state estimate x̂.
The equations of the observer are:

x̂(k|k) = x̂(k|k − 1) + L0 [y(k) − ŷ(k|k − 1)] (2.81)


x̂(k + 1|k) = Ax̂(k|k) + Bu(k) (2.82)
ŷ(k|k − 1) = C x̂(k|k − 1) (2.83)

Substituting the third equation into the first, and eliminating x̂(k|k), we get

x̂(k + 1|k) = A(I − L0 C)x̂(k|k − 1) + Bu(k) + AL0 y(k) (2.84)


= (A − LC)x̂(k|k − 1) + Bu(k) + Ly(k) (2.85)

where L = AL0 . This is a stable system if the eigenvalues of A−LC lie inside the unit
disk. Furthermore if we define the state estimation error as e(k) = x(k) − x̂(k|k − 1),
then using (2.80) we have

e(k + 1) = (A − LC)e(k)

which shows that the state estimation error converges to zero if the observer is stable,
at a rate determined by the eigenvalues of A − LC.
If the pair (A, C) is observable, then given an arbitrary set of locations in the
complex plane, a gain matrix L exists which places the observer eigenvalues at these
locations. The problem of finding L is the dual of the state-feedback pole-placement
problem, and can be solved using the same algorithm. (See functions place, acker,
or kalman in MATLAB’s Control System Toolbox.)
If the state and output equations of the plant are assumed to be subjected to white
noise disturbances with known covariance matrices, then L can be chosen such that
the mean square state estimation error is the smallest possible. The observer is then
known as a Kalman Filter.
Mini-Tutorial 2: State Observers
66 2. A Basic Formulation of Predictive Control

PLANT
y(k)
u(k) x(k)
B z −1 C
+
+
A

+
L
+

x̂(k|k − 1)
B z −1 C
+
ŷ(k|k − 1)
+
A
OBSERVER

Figure 2.5: A State Observer

Now if we partition the observer gain matrix L:


 
Lx
L=
Ld

then applying the standard observer equation (see Minitutorial 2) gives the following
estimates:
           
x̂(k + 1|k) A 0 Lx x̂(k|k − 1) B Lx
ˆ + 1|k) = − [Cy I] ˆ + u(k) + y(k)
d(k 0 I Ld d(k|k − 1) 0 Ld
(2.86)

But in the previous subsection we had


ˆ
d(k|k) = −Cy x̂(k|k − 1) + y(k)

ˆ + 1|k) = d(k|k)
and since we assume that d(k ˆ we have
ˆ + 1|k) = −Cy x̂(k|k − 1) + y(k)
d(k (2.87)

We can see that the estimate obtained from the observer is the same as this if the
observer gain matrix L is
   
Lx 0
L= =
Ld I
2.6. Prediction 67

This gives
      
A 0 Lx A 0
− [Cy I] =
0 I Ld −Cy 0
The block-triangular structure of this matrix shows that the observer’s eigenvalues
are those of the plant (the matrix A) and the remaining ones are zeros. The zeros
indicate that ‘deadbeat’ estimation of the disturbance is obtained, namely that the
disturbance estimate is exact after a finite number of steps — and we can see from
(2.87) that it is in fact exact after only 1 step (if the real disturbance behaves exactly
according to our model).

The fact that the observer’s eigenvalues include those of A shows that this simple
disturbance estimation scheme can be used only with stable plants — otherwise the
estimate x̂(k + 1|k) will get worse and worse as k increases. So we see that, although
the ‘DMC scheme’ for estimating disturbances is simple and intuitive, it has some
limitations. We also see that it is easy to overcome these limitations: we can keep
the same disturbance model, but use a different observer gain matrix L. Even with
unstable plants, it is possible to find L such that all the observer’s eigenvalues lie
inside the unit disk (providing that the pair (A, Cy ) is observable).

Note that if an observer is used, then the form of the state prediction equation (2.66)
remains the same, but x(k) has to be replaced by x̂(k|k). We will look at the details
of this later.

Suppose now that we use the alternative state-space representation (2.37), and
assume again that y and z are the same. Since we are now assuming the presence
of a disturbance on the output, we must distinguish between the actual measured
output y(k), and the output η(k) that would have been obtained in the absence of
any disturbance. We now take the state vector to be
 
∆x(k)
ξ(k) = (2.88)
η(k)
which gives the plant model:
   
A 0 B
ξ(k + 1) = ξ(k) + ∆u(k) (2.89)
Cy A I Cy B
y(k) = [0 I]ξ(k) + d(k) (2.90)

so the standard observer equation is


        
A 0 L∆x B L∆x
ξ̂(k + 1) = − [0 I] ξ̂(k) + ∆u(k) + y(k)
Cy A I Lη Cy B Lη
(2.91)
Reading along the second row of this equation gives

η̂(k + 1) = Cy A∆x̂(k) + (I − Lη )η̂(k) + Cy B∆u(k) + Lη y(k)


= [Cy A∆x̂(k) + η̂(k) + Cy B∆u(k)] + Lη [y(k) − η̂(k)] (2.92)
68 2. A Basic Formulation of Predictive Control

The first bracketed term is what we would expect the output to be at time k + 1
in the absence of any disturbance at time k + 1, and this is corrected by the second
term, which depends on the error in the previous prediction.

ˆ
Now if we have Lη = I, and if we write d(k|k) = y(k) − η̂(k), then we get precisely
the DMC prediction of the next plant output. That is, the difference between the
actual and the predicted outputs is taken as the estimate of an output disturbance,
and the same estimate is assumed to affect the next output. So we see that, in both
state-space representations, the DMC estimate is obtained by the same observer
gain matrix:
     
Lx 0 L∆x
= = (2.93)
Ld I Lη

(Note that the partitions in these two observer gain matrices have the same dimen-
sions, since d and η are vectors with the same number of elements.) From (2.91) we
see that in this case the observer’s state transition matrix is
      
A 0 L∆x A 0
− [0 I] = (2.94)
Cy A I Lη Cy A 0

so again the observer’s eigenvalues are located at the plant’s pole locations and at
zero.

An important observation is that, with either representation, if we have Ld = Lη = I


then at each step the prediction is corrected by the prediction error at the previous
step, whatever the value of Lx or L∆x — that is, even if Lx 6= 0 or L∆x 6= 0. The
significance of this is that most often it is not possible to obtain truly ‘optimal’ esti-
mates of the state, because not enough is known about the statistical characteristics
of disturbances and measurement noises, and because one has limited confidence
in the accuracy of one’s model. In these circumstances the observer gain becomes,
in effect, another ‘tuning parameter’ which affects the behaviour of the predictive
controller — particularly its response to disturbances, its stability margins, etc: see
sections 7.4.2, 8.2 and 8.3 for further details. The state estimates produced by the
observer can therefore bear little relation to any physical variables. But the key
feature of predictive control is the ability to respect constraints. Clearly, it will only
be possible to keep accurately to output constraints if accurate estimates of the out-
puts are available. The choice Ld = I or Lη = I ensures that the predicted output
never diverges too far from the actual output — prediction errors are not allowed to
accumulate over more than one step. This will therefore often be a constraint upon
the observer design.

On the other hand, if some measurements are known to be very noisy, then there
is no point in having the estimate of the real (ie meaningful) output jump about,
following the noise at every step, which will not only cause unnecessary moves of the
plant inputs, but might also cause random activation and de-activation of output
constraints. In that case, at least we should be sure that the estimated output follows
the real output ‘on average’. In particular, if the measured output is constant, the
2.6. Prediction 69

estimated output should converge to the same constant value. Since the observer
should be designed to be asymptotically stable, we know that, if the plant input
and output measurements are constant (∆u(k) = 0 and ∆x(k) = 0), then the state
estimate will converge to a constant value. Suppose that η̂(k) converges to η0 . From
(2.92) we see that, if the measured plant output has constant value y(k) = y0 , then

η0 = η0 + Lη (y0 − η0 ) (2.95)

and hence η0 = y0 whatever the value of Lη (providing that det Lη 6= 0). So, ‘on
average’ the observer will always estimate the measured plant output correctly, so
long as it is asymptotically stable. If there is no bias (no systematic error) in the
measurement, then it will also estimate the real plant output correctly ‘on average’.
The same conclusion follows if we use the representation (2.78)–(2.79) — see Problem
16.

2.6.4 Independent and re-aligned models

In chapter 1 we noted the idea of having an independent model, namely one whose
predictions are influenced only by the inputs which are applied to the plant, but
not by the actual plant response. We can now see that this corresponds precisely
to choosing an observer gain such that Lx = 0 (or L∆x = 0 if the alternative
representation is used). That part of the model’s state vector which is supposed to
correspond to the plant’s state vector is not affected by output measurements in this
case, as can be seen from equation (2.86) or (2.91).

As was already stated in chapter 1, an independent model can only be used if it


is stable. Attempting to use an independent unstable model would lead to rapid
divergence of the state estimates from the plant states, which in turn would lead to
very inaccurate predictions. With an unstable model, it is necessary to use Lx 6= 0
(or L∆x 6= 0) in order to stabilise the observer.

One widely used procedure with difference-equation (transfer function) models is


to re-align the model on the measurements, namely to use actual measurements of
past outputs instead of past model outputs, when predicting future outputs. We
have already introduced this in section 1.6. We shall now show that this can be
interpreted as using an observer, with a particular way of stabilising it.

Consider the case when no attempt is made to model any disturbance. This corre-
sponds to the use of equation (1.39). Suppose that a difference-equation model is
given in the form
X
r X
r
y(k) + Ai y(k − i) = Bi u(k − i) (2.96)
i=1 i=1

Several equivalent state-space forms can be obtained [Kai80]. One simple way of
getting a state-space form of this model is to define the state to be made up of past
70 2. A Basic Formulation of Predictive Control

inputs and outputs:


x(k) = [y(k)T , y(k − 1)T , . . . , y(k − r + 1)T , u(k − 1)T , u(k − 2)T , . . . , u(k − r + 1)T ]T
(2.97)
Then a state-space model equivalent to (2.96) has its (A, B, C) matrices defined as:
 
−A1 −A2 . . . −Ar−1 −Ar B2 . . . Br−1 Br
 Im 0 ... 0 0 0 ... 0 0 
 
 0 I . . . 0 0 0 . . . 0 0 
 m 
 .. .. . . . . . . 
 . . .. .. .. .. .. .. 
 
A =  0 0 ... Im 0 0 ... 0 0  (2.98)

 0 0 ... 0 0 0 ... 0 0 
 
 0 0 . . . 0 0 I . . . 0 0 
 ` 
 . . . . . . . . 
 .. .. .. .. .. .. .. .. 
0 0 ... 0 0 0 ... I` 0
 T
B = B1T 0 0 ... 0 I` 0 . . . 0 (2.99)
 
C = Im 0 . . . 0 0 0 ... 0 0 (2.100)
Now suppose that an observer is used with gain matrix
 T
L 0 = Im 0 . . . 0 (2.101)
Then
 
0 0m,m 0
I −LC = (2.102)
0 I
so the first element of x̂(k|k) becomes y(k). Furthermore, the form of A ensures that
y(k) will become the second (vector) element of x̂(k + 1|k) and of x̂(k + 1|k + 1), the
third element of x̂(k + 2|k + 1) and of x̂(k + 2|k + 2), and so on. Also u(k) will enter
x̂(k + 1|k) and x̂(k + 1|k + 1), and again the form of A will lead to it propagating
‘downwards’ in x̂(k + 2|k + 1), x̂(k + 3|k + 2), etc. Thus, after at most r steps of
running the observer, it will be true that x̂(k|k) = x(k). That is, the state estimate
obtained from the observer will contain present and past values of the input and
output, and predictions obtained on the basis of this estimate will be precisely the
same as predictions obtained using the ‘realigned’ difference equation model.

The dynamics of the observer are determined by the eigenvalues of A(I − L0 C) =


A − LC, which has the block-triangular form:
 
0 0m,m X
A(I − L C) = A − LC = (2.103)
0 J
where X = [−A2 , −A3 , . . . , Br ], and
 
0 0 ... 0 0
 Im 0 . . . 0 0 
 
J = . . . .. ..  (2.104)
 .. .. .. . . 
0 0 ... Im 0
2.7. Example: Citation Aircraft Model 71

Since this matrix is block-triangular, the top-left block is zero, and all the eigenvalues
of J are zero, it is clear that all the eigenvalues of A − LC are zero. That is, this
observer is always stable, and in fact ‘deadbeat’; note that no assumptions have
been made about the stability of the plant.

This section, then, has shown several things:

1. ‘Re-aligning’ the prediction model on past data is a way of stabilising the


observer, and explains why it can be used with unstable plant models.

2. It is not the only way of dealing with unstable plant models. There are many
other observer gain matrices which give a stable observer, and may sometimes
be more suitable.

3. However, the advantage of ‘re-aligning’the model, namely of choosing the state


as in (2.97), is that the past inputs and outputs are already known, and there
is no real need for an observer — the analysis of this section is just an inter-
pretation in terms of observers.

2.7 Example: Citation Aircraft Model

The following is a constant-speed approximation of some of the linearised dynamics


of a Cessna Citation 500 aircraft, when it is cruising at an altitude of 5000 m and
a speed of 128.2 m/sec. The elevator angle (rad) is the only input, and the pitch
angle (rad), altitude (m), and altitude rate (m/s) are outputs.

ẋ = Ax + Bu y = Cx + Du

where
   
−1.2822 0 0.98 0 −0.3
 0 0 1 0   0 
A= −5.4293
 B= 
0 −1.8366 0   −17 
−128.2 128.2 0 0 0
   
0 1 0 0 0
C=  0 0 0 1  D= 0 
−128.2 128.2 0 0 0

For the purposes of this example we will pretend that this is an accurate represen-
tation of the aircraft dynamics.

The elevator angle is limited to ±15◦ (±0.262 rad), and the elevator slew rate is
limited to ±30◦ /sec (±0.524 rad/sec). These are limits imposed by the equipment
design, and cannot be exceeded. For passenger comfort the pitch angle is limited to
±20◦ (±0.349 rad).
72 2. A Basic Formulation of Predictive Control

Figure 2.6 shows the response to a step change of 40 m in the altitude set-point at
time 0, with set-points for pitch angle and altitude rate held at 0, and the reference
trajectory equal to the set-point: r(k + i|k) = [0, 40, 0]T for k ≥ 0. The sampling
interval is Ts = 0.5 sec, the prediction horizon is Hp = 10 (5 sec), and the control
horizon is Hu = 3 (1.5 sec). Tracking errors are penalised over the whole prediction
horizon (Hw = 1). The weights on tracking errors are Q(i) = I3 (the same at each
point in the prediction horizon) and the weights on control moves are R(i) = 1 (the
same at each point in the control horizon). For this magnitude of change none of

Pitch angle and constraint Altitude and set−point

20 40

15 Altitude (m)
Pitch (deg)

30
10
20
5

10
0

−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

25 15
Elevator angle (deg)
Altitude rate (m/sec)

20 10

5
15
0
10
−5
5
−10
0
−15
−5
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 2.6: Response of Citation aircraft to 40 m step change in altitude set-point.

the constraints are active at any point of the transient, and a linear time-invariant
controller results — as will be shown in detail in Chapter 3.

Note that the altitude tracking error dominates the pitch angle and altitude rate
errors during most of the transient, so that the pitch angle and altitude rate depart
from their set-points in order to allow the altitude error to be reduced. As the
required altitude is acquired, all three outputs settle rapidly to their set-points.
This behaviour is entirely a result of the numerical values of the errors which arise,
the altitude error being sufficiently larger, numerically, than the other errors for its
contribution to the cost function to be the dominant one. This will not be the case
in general, and — as in all multivariable control problems — problem-dependent
scaling must be employed to obtain the desired performance. (For example, if the
pitch angle had been represented in degrees rather than radians in the predictive
2.7. Example: Citation Aircraft Model 73

control algorithm then the pitch set-point would have been much more significant,
and would have impeded the acquisition of the required altitude.)

Other specifications are possible for this manoeuvre. One obvious possibility is
to allow the pitch angle and altitude rate to be free until the altitude error has
been reduced to some small value. This could be done by reducing the weights on
the corresponding errors, possibly for a fixed time, based on the anticipated time
required to complete the manoeuvre:

0 if k + i < 8
Q1 (k + i|k) = Q3 (k + i|k) = (2.105)
1 if k + i ≥ 8

But this would need to be adjusted for each amplitude of required altitude change,
and would be prone to error if the manoeuvre was not performed exactly as planned;
a much better alternative would be to make the weights state-dependent4 :

0 if |r2 (k + i|k) − ŷ2 (k + i|k)| > 5
Q1 (k + i|k) = Q3 (k + i|k) = (2.106)
1 if |r2 (k + i|k) − ŷ2 (k + i|k)| ≤ 5

Suppose that a larger change in altitude is required: 400 m instead of 40 m. Figure


2.7 shows the response in this case. It can be seen that the pitch angle constraint
becomes active for much of the transient, with the result that the altitude rate
becomes constant for part of the transient. The control action is now nonlinear.

In figures 2.6 and 2.7 the rate of change of altitude was unconstrained. Suppose
now that it is constrained to 30 m/sec, and an altitude change of 400 m is again
required. Figure 2.8 shows the resulting response. It can be seen that the pitch
angle constraint is briefly active near the beginning of the transient, but that the
altitude rate constraint is active for most of the time. The resulting (nonlinear)
behaviour is close to that obtained from a conventional autopilot during an altitude
change: a required rate of climb is held until the required altitude is nearly acquired,
whereupon the required altitude is acquired and held.

This example demonstrates some of the flexibility that results from the ability to
specify and respect constraints. Quite complicated behaviours can be obtained by
relatively simple specifications, without any need to introduce mode-switching logic
explicitly.5 It should be emphasised that the intention here is to demonstrate just
how much flexibility there is. It is not being proposed that constraints are usually
a good substitute for set-points. In this example it may well be preferable to have
a set-point for the altitude rate, either simultaneously with a constant set-point
4
Simulation with state-dependent weights is not possible in the Model Predictive Control Toolbox.
However the modified functions scmpc2 and scmpcnl2 available on this book’s web site make this
possible, albeit inefficiently.
5
There is an analogy here with the difference between ‘procedural’ programming, in which soft-
ware is used to tell a computer how to perform a required computation, and ‘declarative’ program-
ming, in which it is used to define what is to be computed. Mode-switching logic specifies how
the controller is to achieve the required behaviour, whereas the use of constraints specifies what
beaviour it must achieve.
74 2. A Basic Formulation of Predictive Control

Pitch angle and constraint Altitude and set−point

20 400

15

Altitude (m)
Pitch (deg)

300
10
200
5

100
0

−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

50 Elevator angle (deg) 15


Altitude rate (m/sec)

40 10

5
30
0
20
−5
10 −10

0 −15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 2.7: Response of Citation aircraft to 400 m step change in altitude set-point.

for the altitude (which may require changing the weights during the maneouvre, as
in (2.105) or (2.106)), or to ramp the altitude reference trajectory from the latest
altitude measurement:
 
0
r(k + i|k) =  y2 (k) + 30Ts i  if ŷ2 (k + i|k) < 395 (2.107)
30
 
0
r(k + i|k) =  400  if ŷ2 (k + i|k) ≥ 395 (2.108)
0

Different ways of specifying such manoeuvres will result in different behaviours in


response to disturbances. For example, turbulence which results in the altitude rate
exceeding 30 m/sec will result in more agressive control action to reduce this rate if
it is specified by a constraint rather than as a set-point. Figures 2.9 and 2.10 show
the responses when turbulence appears as a disturbance pulse on the altitude rate
of 5 m/sec, lasting for 5 sec, which starts 5 sec into the transient, in the two cases.
Figure 2.9 corresponds to the constraint of 30 m/sec being imposed on the altitude
rate. This constraint is active when the disturbance occurs, causing a violation
of the constraint. The controller immediately brings the altitude rate down below
the constraint by moving the elevator to +11◦ for one sample period, which causes
2.7. Example: Citation Aircraft Model 75

Pitch angle and constraint Altitude and set−point

20 400

15

Altitude (m)
Pitch (deg)

300
10
200
5

100
0

−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

15
30
Elevator angle (deg)
Altitude rate (m/sec)

10

20 5

0
10 −5

−10
0
−15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 2.8: Response of Citation aircraft to 400 m step change in altitude set-point,
with altitude rate constraint.

the pitch angle to change suddenly from about 13◦ to −5◦ , before recovering to a
steady value of +11◦ . This value of the pitch angle holds the altitude rate at its
constraint while the disturbance is present. The disturbance ceases suddenly 10
seconds into the manoeuvre, which has the immediate effect of reducing the altitude
rate. Since there is now no danger of the altitude rate constraint being violated, the
controller reacts to this in a much less agressive manner than it did to the onset of
the disturbance. This nicely illustrates the nonlinear behaviour of the controller.

Figure 2.10, on the other hand, shows what happens when there is a set-point of
30 m/sec for the altitude rate instead of a constraint. The set-points for the pitch
angle and altitude are constant, as before, at 0◦ and 400 m, respectively. In order
to give the altitude rate set-point sufficient weight, compared with the altitude set-
point, the tracking error weights Q(i) were chosen to be Q(i) = diag[1, 1, 100] for
i = 1, . . . , 5, and Q(i) = I3 for i = 6, . . . , 10 — recall that Hp = 10. It can be seen
that the response to the disturbance is now much milder. Although the altitude
rate remains above 30 m/sec for a little longer than in the previous case, overall it
remains closer to this value than in the previous case, because there is no big dip
below 30 m/sec, since the elevator action is now much smaller. It can also be seen
that the responses to the start and end of the disturbance pulse are now much more
symmetric, as a result of the fact that the controller is now operating in linear mode.
76 2. A Basic Formulation of Predictive Control

Pitch angle and constraint Altitude and set−point

20
400
10

Altitude (m)
Pitch (deg)

300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint


40
Elevator angle (deg) 15
Altitude rate (m/sec)

30 10

5
20 0

−5
10
−10
0 −15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 2.9: Response to disturbance with altitude rate constraint.

The fact that at the end of the manoeuvre there is a more violent transient than in
the previous case is an unimportant artefact of the choice of weights and set-point
specifications, and could be removed by more careful tuning.

For further discussion of possible specifications of closed-loop behaviours see section


5.5 and chapter 7.

Now suppose that the gain from the elevator angle to the altitude rate is mis-
modelled, so that the model used by the predictive controller underestimates this
gain by 10%. (That is, elements A(4, 1), A(4, 2), C(3, 1), C(3, 2) are 10% smaller in
the model than in the plant.) Figure 2.11 shows the response to an altitude set-point
change of 400 m, when the altitude rate is constrained to 30 m/sec, and when the
constant output disturbance assumption is made on each output. Comparing the
response with figure 2.8 shows that the response is now a little more erratic, with
more elevator activity. The altitude rate constraint is violated briefly about 1.5 sec
into the transient (by about 0.5 m/sec), but after that it is not violated again. The
required altitude is acquired and held without any error in the steady state.
2.8. Problems 77

Pitch angle and constraint Altitude and set−point

20
400
10

Altitude (m)
Pitch (deg)

300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and set−point Elevator angle and constraint


40 15
Elevator angle (deg)
Altitude rate (m/sec)

10
30
5
20 0

−5
10
−10
0 −15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 2.10: Response to disturbance with altitude rate set-point.

2.8 Problems

The first 3 problems can be skipped by those familiar with quadratic forms, ∇V ,
etc.

1. Use MATLAB to find the eigenvalues of the matrix Q which appears in Ex-
ample 2.1. Check that they are both positive.

2. (a) Suppose V (x) = 9x21 + 25x22 + 16x23 . Find Q such that V (x) = xT Qx.
(b) Suppose V (x, u) = (5x21 + 2x22 + x23 ) + (100u21 + 4u22 ). Find Q and R such
that V (x) = xT Qx + uT Ru.
(c) Are the functions V which appear in this problem positive-definite?

3. Check that the formula (2.20) for the gradient is correct for Example 2.1, by
working out the partial derivatives in the elementary way, and comparing the
results.

4. Find the matrix F corresponding to the constraints given in Example 2.4.


78 2. A Basic Formulation of Predictive Control

Pitch angle and constraint Altitude and set−point

20 400

15

Altitude (m)
Pitch (deg)

300
10
200
5

100
0

−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

15
30
Elevator angle (deg)
Altitude rate (m/sec)

10

5
20
0

10 −5

−10
0
−15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 2.11: Response of Citation aircraft to 400 m step change in altitude set-point,
with altitude rate constraint and plant-model error.

5. Suppose that we have a 1-state, 1-input model with 1 controlled variable:

x̂(k + 1|k) = 2x̂(k|k − 1) + u(k)


ẑ(k|k) = 3x̂(k|k)

and we have the constraint

−1 ≤ z(k) ≤ 2 for all k

If x̂(k|k) = 3 and u(k − 1) = −1, show that the corresponding constraint on


∆u(k) is
16 13
− ≤ ∆u(k) ≤ −
3 3

6. As practice at using MATLAB, and a little revision of discrete-time systems,


check the discretisation done in Example 2.4. You can create a state-space sys-
tem object by a command of the form: cont sys=ss(Ac,Bc,Cc,Dc); where
Ac etc are the continuous time state-space matrices. You can discretise it
using disc sys=c2d(cont sys,Ts); where Ts is the sample interval. Ma-
trices can be extracted from these system objects by commands of the form
Ad=get(disc sys,’a’). (Use help lti for more information.)
2.8. Problems 79

Is the system stable? With the default discretization method used by c2d
each eigenvalue λ of Ac should be mapped to exp(λTs ). Check this (using the
functions eig and exp).

7. Suppose that in Example 2.4 the feed tank level H1 is constrained, to ensure
that the feed tank neither runs dry nor overfills (in addition to the other
constraints).

(a) Explain why the matrix Cz in the basic formulation must be changed to
represent this. What is the new value of this matrix?
(b) What are the new dimensions of the matrices E, F and G in this case?
(c) Do you anticipate any additional difficulty with this case? (Hint: Com-
pare the matrices Cy and Cz .)

8. Referring to section 2.4, show that a third possible state-space representation


is obtained by taking the augmented state vector to be
 
∆x(k)
ξ(k) =  y(k − 1)  (2.109)
z(k − 1)

in which case the plant model equations become


   
A 0 0 B
ξ(k + 1) =  Cy I 0  ξ(k) +  0  ∆u(k) (2.110)
Cz 0 I 0
   
y(k) Cy I 0
= ξ(k) (2.111)
z(k) Cz 0 I

9. Write a MATLAB function ‘c2dd’ to obtain the discrete-time model in the


form (2.58) from a continuous-time model in the form (2.45) when there is a
computational delay, using the Control System Toolbox function c2d.

10. For the linearised model of the Citation aircraft defined in section 2.7:

(a) Obtain discrete-time models of the aircraft, assuming a sampling interval


of 0.1 second, with
i. no computational delay,
ii. a computational delay of 0.02 second (using the function c2dd re-
ferred to in Problem 9).
(b) Compare the step responses from the elevator angle to the three outputs
for the two models.
(c) Compare the frequency responses from the elevator angle to the three
outputs for the two models. Comment on the implications, for control,
of neglecting the computational delay.

(The function makecita, available on this book’s web site, creates the continuous-
time Citation model.)
80 2. A Basic Formulation of Predictive Control

11. Using equations (2.67)–(2.70), or (2.72), write the predictions ẑ(k + i|k) in
matrix-vector form (analogously to (2.66)).
12. Suppose that Dz 6= 0 in (2.4). Introduce the new vector of controlled variables
z̃(k) = z(k) − Dz u(k). Show that if the cost function and linear inequality
constraints are re-written in terms of z̃ instead of z then the predictive con-
trol problem remains in the standard form, namely the cost function remains
quadratic in ∆û and the constraints remain as linear inequalities involving ∆û.
13. Suppose that Dz 6= 0 in (2.4), but that the change of variable z̃(k) = z(k) −
Dz u(k) is not made. How does the computation of ẑ(k + i|k) need to be
modified from (2.67)–(2.70)? Can you find an expression for the vector [ẑ(k +
1|k), . . . , ẑ(k + Hp |k)]T in matrix-vector form? (Note that the predictions ẑ
remain linear in the x̂ and ∆û variables.)
14. Show that the pair
 
A 0
, [Cy , I]
0 I
is observable if and only if the pair (A, Cy ) is observable.
(The significance is that if this pair is observable then an observer gain matrix
L can always be found which places the eigenvalues of the ‘constant output’
observer (2.86) at arbitrary locations.)
15. A plant with 1 input, 1 output and 1 state has the model
x(k + 1) = 0.9x(k) + 0.5u(k), y(k) = x(k)
Predictive control is to be used with Q(i) = 1, R(i) = 0, Hp = 30, and
Hu = 2. A constant step disturbance at the plant input is assumed (that is,
u(k) is replaced by u(k) + d(k)).
(a) Show how the plant model can be augmented to incorporate this distur-
bance model.
(b) Design a state observer with a ‘deadbeat’ response for the plant with
this disturbance model. (The easy way to do this is to use the Model
Predictive Control Toolbox function smpcest(imod,Q,R), where Q and R
are fictitious state and output noise covariances, respectively, with R very
small. The observer approaches a deadbeat observer as R approaches 0.)
(c) Simulate the response of the predictive controller to an input step dis-
turbance when your observer is used. Compare the response to that
obtained when the default ‘DMC’ observer is used. (Assume there are no
constraints.)
(d) How does the observer design affect the set-point response?
(e) Work out the details of how to use the Control System Toolbox function
place to design observers for use with the Model Predictive Control Tool-
box. (You will need to pay attention to the model representations used
by the Model Predictive Control Toolbox.)
2.8. Problems 81

16. Using the representation (2.78)–(2.79) show that the plant output estimated
by any asymptotically stable observer converges to the measured plant output,
if that is constant (assuming that the plant input and state are both constant).
82 2. A Basic Formulation of Predictive Control
Chapter 3

Solving Predictive Control


Problems

This chapter explains how the standard predictive control problem can be solved. It
also discusses the structure of the controller which results. Active set and interior
point methods of solving the optimization problems which arise in predictive control
are introduced, and the very important topic of constraint softening is treated.

3.1 Unconstrained Problems

3.1.1 Measured State, No Disturbances

Recall that the cost function which we must minimise is

X
Hp u −1
HX
V (k) = ||ẑ(k + i|k) − r(k + i)||2Q(i) + ||∆û(k + i|k)||2R(i) (3.1)
i=Hw i=0

We can rewrite this as

V (k) = ||Z(k) − T (k)||2Q + ||∆U (k)||2R (3.2)

where
     
ẑ(k + Hw |k) r̂(k + Hw |k) ∆û(k|k)
 ..   ..   .. 
Z(k) =  .  T (k) =  .  ∆U (k) =  . 
ẑ(k + Hp |k) r̂(k + Hp |k) ∆û(k + Hu − 1|k)

83
84 3. Solving Predictive Control Problems

and the weighting matrices Q and R are given by


 
Q(Hw ) 0 ··· 0
 0 Q(Hw + 1) · · · 0 
 
Q= .. .. .. ..  (3.3)
 . . . . 
0 0 ··· Q(Hp )
 
R(0) 0 ··· 0
 0 R(1) · · · 0 
 
R= .. .. .. ..  (3.4)
 . . . . 
0 0 ··· R(Hu − 1)

Also recall from (2.66) and (2.72) — and from Problems 11 and 13 of Chapter 2 —
that Z has the form

Z(k) = Ψx(k) + Υu(k − 1) + Θ∆U (k) (3.5)

for suitable matrices Ψ, Υ and Θ. Define

E(k) = T (k) − Ψx(k) − Υu(k − 1) (3.6)

This can be thought of as a ‘tracking error’, in the sense that it is the difference
between the future target trajectory and the ‘free response’ of the system, namely
the response that would occur over the prediction horizon if no input changes were
made — that is, if we set ∆U (k) = 0. And if E(k) really were 0, then it would
indeed be correct to set ∆U (k) = 0. Now we can write

V (k) = ||Θ∆U (k) − E(k)||2Q + ||∆U(k)||2R (3.7)


= [∆U(k) Θ − E(k) ]Q[Θ∆U (k) − E(k)] + ∆U (k) R∆U (k)
T T T T
(3.8)
= E(k) QE(k) − 2∆U(k) Θ QE(k) + ∆U (k) [Θ QΘ + R]∆U (k)
T T T T T
(3.9)

But this has the form

V (k) = const − ∆U (k)T G + ∆U (k)T H∆U (k) (3.10)

where

G = 2ΘT QE(k) (3.11)

and

H = ΘT QΘ + R, (3.12)

and neither G nor H depends on ∆U(k).

To find the optimal ∆U(k) we can now find the gradient of V (k) and set it to zero.
From (3.10) we find

∇∆U (k) V = −G + 2H∆U (k) (3.13)


3.1. Unconstrained Problems 85

so the optimal set of future input moves is

1
∆U (k)opt = H−1 G (3.14)
2

Remember that we use only the part of this solution corresponding to the first step,
in accordance with the receding horizon strategy. So if the number of plant inputs
is ` then we just use the first ` rows of the vector ∆U (k)opt . We can represent this
as

∆u(k)opt = [I` , 0` , . . . , 0` ]∆U (k)opt (3.15)


| {z }
(Hu −1) times

where I` is the ` × ` identity matrix, and 0` is the ` × ` zero matrix.

Note that we can write ∆u(k)opt here, rather than û(k|k)opt , because we have now
found the solution and this is the input that is really applied to the plant at time k.

Does ∆U(k)opt really give a minimum of the cost function V ? It certainly gives a
stationary point, but that is not enough to guarantee a minimum. Differentiating
the gradient ∇∆U (k) V (3.13) again with respect to ∆U (k) gives the matrix of second
derivatives, or Hessian, of V :

∂2V
= 2H = 2(ΘT QΘ + R). (3.16)
∂∆U(k)2

We have assumed that Q(i) ≥ 0 for each i, and this ensures that ΘT QΘ ≥ 0. So if
R > 0 then the Hessian is certainly positive-definite, which is enough to guarantee
that we have a minimum. And this will be the case if R(i) > 0 for each i.

But sometimes we may want to have no penalty on the input moves, which would
lead to R = 0. Or we may want to leave the moves of some inputs unpenalised, or
the moves at some points in the control horizon unpenalised. In these cases we will
have R ≥ 0, but not R > 0. When R = 0 we need ΘT QΘ > 0 in order to have a
minimum — and of course, to ensure that H−1 exists. In intermediate cases, when
R ≥ 0, we need to ensure that ΘT QΘ + R > 0.

Let us check the dimensions of the various matrices introduced in this section. Θ has
as many rows as there are elements in Z. If we have p controlled outputs, and we
predict between steps Hw and Hp , then there are p(Hp − Hw + 1) of these elements.
The number of columns in Θ is the same as the number of elements in ∆U (k), which
is `Hu . Q(i) has m rows and columns, so Q has m(Hp − Hw + 1) of each. Thus
H = ΘT QΘ is square, with `Hu rows and columns. This agrees (as it must!) with
the number of rows and columns in R. Similar checks on the remaining matrices
lead to Table 3.1.
86 3. Solving Predictive Control Problems

Matrix Dimensions
Q m(Hp − Hw + 1) × m(Hp − Hw + 1)
R `Hu × `Hu
Ψ m(Hp − Hw + 1) × n
Υ m(Hp − Hw + 1) × `
Θ m(Hp − Hw + 1) × `Hu
E m(Hp − Hw + 1) × 1
G `Hu × 1
H `Hu × `Hu

Table 3.1: Dimensions of matrices and vectors involved in computing the optimal
input moves. (The plant has ` inputs, n states, and m controlled outputs.)

3.1.2 Formulation as a Least-Squares Problem

The optimal solution, as expressed in (3.14), should never be obtained by computing


the inverse of H. The matrix Θ is often ill-conditioned, which can result in H
being ill-conditioned. It is therefore imperative to pay attention to the numerical
algorithms involved in finding the optimal solution.

The best way of computing the solution is by solving it as a ‘least-squares’ problem.


It is also a way which gives some additional insight.

Since Q ≥ 0 and R ≥ 0, we can find matrices SQ and SR which are their ‘square-
roots’:

T
SQ SQ = Q T
SR SR = R

If Q and R are diagonal, it is trivial to do this — just take the square-root of


each diagonal element. If they are not diagonal, square-roots can be obtained by
using the ‘Cholesky’ algorithm (function chol in MATLAB) for positive-definite
matrices, or by using other algorithms, such as singular value decomposition (svd)
for semi-definite matrices.

Now consider the vector

 
SQ {Θ∆U(k) − E(k)}
SR ∆U(k)

We shall show that the squared ‘length’ of this vector, or equivalently, the sum of
squares of its elements, is the same as the cost function V (k), so that ∆U (k)opt is
3.1. Unconstrained Problems 87

the value of ∆U (k) which minimises this length.


  2   2
SQ {Θ∆U (k) − E(k)} SQ {Z(k) − T (k)}
= (3.17)
SR ∆U (k) SR ∆U(k)
= [Z(k) − T (k)]T SQ
T
SQ [Z(k) − T (k)] + ∆U (k)T SR
T
SR ∆U(k)
(3.18)
= ||Z(k) − T (k)||2Q + ||∆U (k)||2R (3.19)
= V (k) (3.20)

So ∆U(k)opt is the ‘least-squares’ solution of the equation


 
SQ {Θ∆U (k) − E(k)}
=0 (3.21)
SR ∆U(k)

or, equivalently, of:


   
SQ Θ SQ E(k)
∆U(k) = (3.22)
SR 0

Equations of the form Aθ = b can be solved in a least-squares sense using the ‘QR’
algorithm. In MATLAB this solution is obtained as θopt = A\b. Although formally
this solution is the same as θopt = (AT A)−1 AT b, (which gives (3.14)), this algorithm
avoids ‘squaring up’ A, and never forms the product AT A, or computes its inverse.
If A is ill-conditioned and/or large this is crucial, since it avoids unnecessary loss
of precision. For more details see any book on numerical linear algebra, such as
[GL89], or Chapter 8 of [Mac89] (or the MATLAB documentation).

Hence we have, using MATLAB notation:


   
SQ Θ SQ E(k)
∆U (k)opt = (3.23)
SR 0

Equation (3.22) is almost always over-determined: there are not enough degrees of
freedom to get an exact solution. It contains m(Hp −Hw +1)+`Hu scalar equations,
but there are only `Hu variables to be solved for. Even in the special case of R = 0,
when there is no penalty on input moves, and the equation simplifies to

SQ Θ∆U (k) = SQ E(k) (3.24)

there are usually more scalar equations than variables. A unique exact solution exists
only if the matrix SQ Θ is square and non-singular, which requires m(Hp −Hw +1) =
`Hu . However, we usually have m(Hp − Hw + 1) > `Hu . Note that in the case of
R = 0 we cannot remove SQ from each side of the equation — doing so would give
a different solution, since it would change the weighting used when minimising the
sum of squares of the error.
88 3. Solving Predictive Control Problems

Why do we expect ill-conditioning in the predictive control problem? Typically it


arises in the following way. Suppose we had two controlled variables which behaved
exactly the same as each other. Then the corresponding pairs of rows of Ψ would
be identical. Consequently the rank of Θ (the number of linearly independent rows)
would be smaller than expected from its dimensions by Hp − Hw + 1 — that is
how many pairs of identical rows there would be. If it were sufficiently smaller, the
rank could become smaller than `Hu , at which point ΘT QΘ would become singular.
If we also had R = 0, then H would be singular. In practice variables do not
behave exactly the same as each other. But sometimes they behave very similarly.
Consider a distillation column with 40 trays, for example. Adjacent trays do not
behave identically, but obviously if you can manipulate only a few temperatures in
the column, adjacent trays are going to react very similarly. In such cases one can
have many rows of Θ being ‘nearly linearly dependent’ on each other, and then H
can be nearly singular. Even without this cause, the rows near the bottom of Θ
are often ‘nearly linearly dependent’ if Hp − Hw  Hu . One remedy for this is to
increase the diagonal elements of R — but that may distort the problem away from
the real one [QB96].

3.1.3 Structure of the Unconstrained Controller

Recall from (3.15) and (3.6) that

∆u(k)opt = [I` , 0` , . . . , 0` ]H−1 ΘT QE(k) (3.25)

and

E(k) = T (k) − Ψx(k) − Υu(k − 1). (3.26)

The only part of this solution which changes from step to step is the ‘tracking error’
E(k). Consequently the predictive controller, for the unconstrained problem and
with full state measurement, can be drawn as in figure 3.1.

The block labelled KM P C is defined by

KM P C = [I` , 0` , . . . , 0` ]H−1 ΘT Q (3.27)

We point out that the ‘correct’ way of computing KM P C is (again using MATLAB
notation, including the ‘:’ operator to pick out the first ` rows of the solution):
   
SQ Θ SQ
Kf ull = (3.28)
SR 0
KM P C = Kf ull (1 : `, :) (3.29)

(This works for the following reason: If we had E(k) = [1, 0, . . . , 0]T then we would
effectively have only the first column of SQ on the right hand side of (3.23). E(k) =
[0, 1, 0, . . . , 0]T would effectively give the second column, etc. Since E(k) enters the
3.1. Unconstrained Problems 89

z(k)
T (k) E(k) ∆u(k) u(k)
KM P C z
+ z−1 I PLANT

− y(k) = x(k)

u(k − 1)
Υ z −1 I

CONTROLLER

Figure 3.1: Structure of controller with no constraints and full state measurement.

solution linearly, it is only necessary to solve (3.23) with these columns on the right
hand side. The ‘\’ operator in MATLAB is smart enough to solve for all the columns
simultaneously — and this is very effficient, since most of the work involved is in
computing the QR decomposition of the left hand side, which needs to be done only
once.)

It is clear from the figure that the controller is a linear time-invariant system in
this case. So it is possible to compute its frequency response, stability margins,
etc. We shall do that kind of analysis in a later chapter. Note that the controller
is, in general, dynamic. It is not just ‘state feedback’, except under very special
circumstances.

The matrix Ks computed by the Model Predictive Control Toolbox function smpccon
is related to KM P C as follows:
  
I
 I  
  
Ks = KM P C  ..  , −Ψ, −Υ (3.30)
 .  
I

so that
 
T (k)
∆u(k)opt = Ks  x(k)  (3.31)
u(k − 1)
90 3. Solving Predictive Control Problems

3.1.4 Estimated State

Now we need to address the more realistic case, when we do not have measurements
of the whole state vector, and must use an observer. We will see that the solution
is very similar to the solution in the previous case. In fact, we will see that all
the gain matrices involved are exactly the same as in the previous case. The only
difference is that we need to use an observer, and use the state estimate x̂(k|k) to
replace the measured state x(k). The controller structure in this case is shown in
figure 3.2. This is again a linear time-invariant system, but now with more dynamic
complexity, because its state vector includes the observer state.

z(k)
T (k) E(k) ∆u(k) u(k)
z
+ KM P C z−1 I PLANT

− y(k)

u(k − 1)
Υ z −1 I

x̂(k|k)
Ψ OBSERVER

CONTROLLER

Figure 3.2: Structure of controller with no constraints and state observer.

To obtain the vector of predicted controlled outputs, Z(k), it is reasonable to go


back to equation (3.5), and simply replace x(k) by the best estimate of it available
to us, namely x̂(k|k). We say ‘reasonable’ because it is not self-evident that this
is the ‘optimal’ thing to do in any sense. The Separation Principle or Certainty
Equivalence Principle says that it is the optimal thing to do if one is solving a
stochastic linear quadratic problem, and one has Gaussian noises acting on the
states and outputs, and the observer gain L0 is obtained using Kalman filtering
theory [AM79, BH75, BGW90]. But in general it is just a heuristic, albeit one which
is very widely used in control engineering. After all, no other obvious alternative
presents itself.

So now we define

Z(k) = Ψx̂(k|k) + Υu(k − 1) + Θ∆U(k) (3.32)

and we make the corresponding change in the definition of the ‘tracking error’ E(k)
3.2. Constrained Problems 91

(compare with equation (3.6)):

E(k) = T (k) − Ψx̂(k|k) − Υu(k − 1) (3.33)

Once these changes have been made, the derivation of the optimal control ∆u(k)opt
is exactly the same as in earlier sections. Hence we arrive at the controller structure
shown in figure 3.2.

3.2 Constrained Problems

3.2.1 Formulation as a QP Problem

Now we deal with the case when constraints are present. Recall that these are in
the form:
 
∆U(k)
E ≤0 (3.34)
1
 
U (k)
F ≤0 (3.35)
1
 
Z(k)
G ≤0 (3.36)
1

where U (k) = [û(k|k)T , . . . , û(k + Hu − 1|k)T ]T is defined analogously to ∆U (k).


We have to express all of these as constraints on ∆U(k).

Suppose F has the form

F = [F1 , F2 , · · · , FHu , f ]

where each Fi is of size q × m, and f has size q × 1, so that (3.35) can be written as

X
Hu
Fi û(k + i − 1|k) + f ≤ 0.
i=1

Since

X
i−1
û(k + i − 1|k) = u(k − 1) + ∆û(k + j|k)
j=0

we can write (3.35) as

X
Hu X
Hu X
Hu
Fj ∆û(k|k) + Fj ∆û(k + 1|k) + . . . + FHu ∆û(k + Hu − 1|k) + Fj u(k − 1) + f ≤ 0
j=1 j=2 j=1
92 3. Solving Predictive Control Problems

PH u
Now define zi = j=i Fj and z = [z1 , . . . , zHu ]. Then (3.35) can be written as

z∆U (k) ≤ −z1 u(k − 1) − f (3.37)

where the right hand side of the inequality is a vector, which is known at time k.
So we have converted (3.35) into a linear inequality constraint on ∆U (k).

Note that if we have simple range constraints on the inputs, of the form

ulow (k + i) ≤ û(k + i|k) ≤ uhigh (k + i) (3.38)

then this inequality takes quite a simple form. (See Problem 6.)

Now we have to do a similar thing for (3.36). Fortunately we have already done
most of the work needed in this case. Assuming full state measurements, we can use
(3.5) to write (3.36) as
 
Ψx(k) + Υu(k − 1) + Θ∆U(k)
G ≤0
1

Now letting G = [Γ, g], where g is the last column of G, this is the same as

Γ[Ψx(k) + Υu(k − 1)] + ΓΘ∆U(k) + g ≤ 0

or

ΓΘ∆U (k) ≤ −Γ[Ψx(k) + Υu(k − 1)] − g (3.39)

which is in the required form.

If we have only state estimates available, then we replace x(k) by x̂(k|k), just as we
did in section 3.1.4.

It only remains to put inequality (3.34) into the form

W ∆U (k) ≤ w (3.40)

(see Problem 6). Then we can assemble inequalities (3.37), (3.39), and (3.40) into
the single inequality
   
z −z1 u(k − 1) − f
 ΓΘ  ∆U(k) ≤  −Γ[Ψx(k) + Υu(k − 1)] − g  (3.41)
W w

(Replace x(k) by x̂(k|k) if an observer is used.)

Now the cost function V (k) which we have to minimise is still the same as in the
unconstrained case. So, from (3.10), we see that we have to solve the following
constrained optimization problem:

minimise ∆U(k)T H∆U (k) − G T ∆U(k) (3.42)


3.2. Constrained Problems 93

subject to the inequality constraint (3.41). But this has the form

1
min θ T Φθ + φT θ (3.43)
θ 2

subject to

Ωθ ≤ ω (3.44)

which is a standard optimization problem known as the Quadratic Programming (or


QP) problem, and standard algorithms are available for its solution.

Similarly to solving the unconstrained problem, it is better to pass the QP problem


to a solution algorithm in ‘square root’ form, namely in the form
  2
SQ {Θ∆U (k) − E(k)}
min subject to (3.41). (3.45)
∆U (k) SR ∆U (k)

Since H ≥ 0, the QP problem which we have to solve is convex. This is extremely


good news — see Minitutorial 3. Because of the convexity we can guarantee termi-
nation of the optimization problem, and because of the additional structure of the
QP problem, we can estimate how long it will take to solve. This is an extremely
desirable property for an algorithm which has to be used on-line, and to keep up
with the real-time operation of the plant.

A major problem which can occur with constrained optimization is that the prob-
lem may be infeasible. Standard QP solvers just stop in such cases, their only
output being a message such as Problem Infeasible, or perhaps some diagnostics
in certain cases. This is obviously unacceptable as a substitute for a control signal
which must be provided to the plant. So when implementing predictive control it
is essential to take steps either to avoid posing an infeasible problem, or to have a
‘back-up’ method of computing the control signal. Various approaches to this have
been suggested, including:

• Avoid ‘hard’ constraints on z.

• Actively manage the constraint definition at each k.

• Actively manage the horizons at each k.

• Use non-standard solution algorithms.

We shall examine these more closely later in the book.


94 3. Solving Predictive Control Problems

In general optimization problems are solved numerically by ‘going downhill’ — as-


suming a minimization problem — until one reaches a minimum. The big problem
with this is that in general problems there are many ‘local’ minima, and the algo-
rithm is very likely to be stuck in such a local minimum, unaware that the true
‘global’ minmum is elsewhere.
A convex optimization problem is one in which this problem does not occur. Because
of the convexity of the objective function, there is only one minimum — or possibly
a connected set of equally good minima, as on a flat valley floor. When solving a
convex problem, one is guaranteed that a global minimum will eventually be reached
if one keeps ‘going downhill’.
For a ‘smooth’ problem the property of convexity can be established from the Hessian
of the objective function — it has to be positive semi-definite everywhere. But
constrained problems are usually not smooth, or at least not everywhere. In this
case convexity can be characterised without using derivatives, as follows. A function
V (θ) is convex if, for every pair of points θ1 and θ2 , and any λ such that 0 ≤ λ ≤ 1,
it is always true that

λV (θ1 ) + (1 − λ)V (θ2 ) ≥ V (λθ1 + [1 − λ]θ2 ) (3.46)

The straight line joining any two points on the cost surface is never below the surface.
A Quadratic Program is an optimization problem of the form
1
min θ T Φθ + φT θ subject to Ωθ ≤ ω
θ 2

Here the objective function is V (θ) = 12 θ T Φθ + φT θ and its Hessian is Φ. If there are
no constraints this is clearly convex if Φ ≥ 0. (Without this condition there might
be no minimum, since arbitrarily large negative values of V might be attainable.)
Since the constraints are linear inequalities, the surfaces on which they are active
are hyperplanes. So the constrained objective function can be visualised as a convex
quadratic surface, parts of which have been cut off by a number of flat ‘faces’. It is
intuitively clear that this constrained surface remains convex, although we shall not
give a formal proof of this.
A Linear Program (or LP) is the special case of a QP when Φ = 0, so that the
objective function is linear rather than quadratic. It is also convex when Ω and
φ are such that a minimum exists; in this case the minimum always occurs at a
vertex (or possibly an edge). The constrained objective surface can be visualised
as a convex object with flat faces. Such an object is called a simplex. There are
standard algorithms for solving large LP problems, including the famous ‘simplex
method’.
The literature of convex optimization, LP and QP problems is enormous. Good
general books on optimization which include relevant material are [Fle87, GMW81].
A whole book on using convex optimization for control design (but which does not
deal with predictive control) is [BB91].
Mini-Tutorial 3: Convex Optimization, QP and LP Problems
3.2. Constrained Problems 95

3.2.2 Controller Structure

So long as all the constraints are inactive, the solution of the predictive controller
is exactly the same as in the unconstrained case. But if constraints become active
then the controller becomes nonlinear and the structure shown in figures 3.1 and
3.2 is lost. Figure 3.3 shows the controller structure in this case. The controller is
nonlinear because the box labelled ‘OPTIMIZER’ computes a nonlinear function of
its inputs.

z(k)
T (k) ∆u(k) z u(k)
OPTIMIZER
z−1 I PLANT

y(k)

u(k − 1)
Υ z −1 I

x̂(k|k)
Ψ OBSERVER

CONTROLLER

Figure 3.3: Structure of controller with constraints and state observer.

We can say a little more about the controller structure. Suppose a particular set of
constraints is active. That is, in the QP problem (3.43)–(3.44), suppose that

Ωa θ = ωa (3.47)

where Ωa is made up of those rows of Ω which relate to the active constraints, and ωa
is made up of the corresponding elements of ω. If we knew before solving the problem
that these would be the active constraints, and were therefore equality rather than
inequality constraints, then we could (only in principle!) pose the optimization
problem

1
min θ T Φθ + φT θ subject to Ωa θ = ω a (3.48)
θ 2

which could, by the theory of Lagrange multipliers, be solved by solving the problem

min L(θ, λ) (3.49)


θ,λ
96 3. Solving Predictive Control Problems

where

1 T
L(θ, λ) = θ Φθ + φT θ + λ(Ωa θ − ωa ) (3.50)
2
Now

∇θ L(θ, λ) = Φθ + φ + ΩTa λ (3.51)


∇λ L(θ, λ) = Ωa θ − ωa (3.52)

or
    
Φ ΩTa θ −φ
∇L(θ, λ) = − (3.53)
Ωa 0 λ ωa

Consequently the optimal solution would be obtained, by setting ∇L(θ, λ) = 0, as


   −1  
θ Φ ΩTa −φ
= (3.54)
λ opt
Ωa 0 ωa

Now recall that


 
z
Ω =  ΓΘ 
W

and Φ = H/2. Looking back at the definitions of z, Γ, Θ, W and H, it will be


seen that none of these depend on signals at time k. So the matrix which is being
inverted here is fixed, so long as a fixed set of constraints is active. On the other
hand, φ = −G = −2ΘT QE(k) clearly does depend on the signals present at time k,
and so does ωa .

We can therefore conclude that the constrained predictive control law is a linear
time-invariant control law, so long as the set of active constraints is fixed. A more
intuitive explanation can be given on the basis of Figures 3.4 and 3.5. These show
a quadratic cost function as a surface in the case when there are only two decision
variables. In Figure 3.4 a linear inequality constraint restricts the decision variables
so that only part of the cost surface is ‘attainable’, but the unconstrained minimum
is in the feasible region, so the optimal solution is at the unconstrained minimum. In
Figure 3.5 the constraint is active, so that the optimal solution is on the intersection
of the cost surface and the inequality constraint. It can be seen that the optimal
solution is still the global minimum of a quadratic surface, but one of lower dimension
— in this case, the minimum of a quadratic curve. It is the fact that a quadratic
problem is still being solved that leads to the controller being linear.

In practice the set of active constraints changes, so we have the picture of the control
law as consisting of a number of linear controllers, each with a structure similar to
that shown in figure 3.2, and switching between them. If we could be sure that
3.2. Constrained Problems 97

90

80

70

60

50

40

30

20
10
10
8
0 6
−2 4
0
2 2
4
6 0
8
10 −2

Figure 3.4: A quadratic cost surface and a linear inequality constraint: Constraint
inactive.
98 3. Solving Predictive Control Problems

90

80

70

60

50

40

30

20
10
10
8
0 6
−2 4
0
2 2
4
6 0
8
10 −2

Figure 3.5: A quadratic cost surface and a linear inequality constraint: Constraint
active.
3.2. Constrained Problems 99

changes of active constraint sets occurred rarely enough — and there is no reason
to suppose that this would be the case in general — we might be able to exploit this
structure to perform some analysis of the constrained controller.

In [BMDP, BMDP99] a promising attempt is made not only to use the piecewise-
linear nature of the controller as a basis for analysis, but also as a way of computing
the optimal solution efficiently for small problems. In this context ‘small’ means
that the number of constraints is such that the number of possible active constraint
sets is manageable, since a separate solution is pre-computed explicitly for each such
set. Note that the number of possible active constraint sets can be extremely large.
If there are q constraints in the problem formulation (Ω has q rows) then there are
2q possible sets of active constraints. Analysis of specific problems can often reduce
the size of this set to some extent — for example, lower and upper limits on variable
values cannot be active simultaneously.

The approach taken by Bemporad et al in [BMDP] and [BMDP99] is based on the


observation that in the MPC problem, the inequality constraint (3.44) takes the
form:

Ωθ ≤ ω(x̂) (3.55)

The vector on the right-hand side of the inequality depends on the (estimate of the)
current state, which can be thought of as a set of parameters of the QP problem.
Techniques of multiparametric programming are then employed to analyse the set
of solutions. One new result which is obtained by this means is that the control
law is continuous in x̂. Algorithms are also given for determining efficiently the
boundaries (in the state-space) at which changes from one piecewise-linear control
law to another occur. The idea, then, is that for small problems, in which the
state-space is divided up into a manageably small number of (convex) pieces, one
could pre-compute (off-line) the control law that should be applied in each piece,
and then the MPC algorithm would consist simply of reading the appropriate gain
matrix from a table look-up, depending on the current state estimate. This should
be particularly useful in high-bandwidth applications, when high control update
rates are required.

Although this idea is not feasible for applications in which the number of constraints
is large (q > 10, say), it may be possible even in large problems to compute the
solution by conventional means (as described in the next subsection) when a region
of the state-space is entered for the first time, but then to store it in a growing
database, as the state-space is explored, so that if the region is revisited later the
solution does not need to be recomputed. Many variations of this can be easily
imagined.
100 3. Solving Predictive Control Problems

3.3 Solving QP Problems

In this section we shall consider the general QP problem:

1
min θ T Φθ + φT θ (Φ = ΦT ≥ 0) (3.56)
θ 2

subject to

Hθ = h (3.57)

and

Ωθ ≤ ω (3.58)

This is the same as the QP problem introduced earlier, except that the equality
constraints Hθ = h have been identified explicitly. We shall assume that it is not
feasible to pre-compute the solutions in the manner described at the end of the
previous subsection.

Two approaches to solving the QP problem appear to offer the best performance:
Active Set methods [Fle87], and the more recent Interior Point methods [NN94,
Wri97, RTV97] . It is tempting to assume that the more recent methods should
offer the best performance, but Wright [Wri96] argues that for predictive control
this issue is still open. He points out that the predictive control problem has a
lot of special structure, and that the main performance gains are to be obtained
by exploiting this structure, whichever approach is used. The special structure is
primarily due to two features:

1. With a particular ordering of the variables, the QP problem which arises in


predictive control is ‘sparse’.

2. Most of the time — in the absence of large disturbances, or of set-point changes,


etc — a very good initial guess of the solution is available, from the solution
computed at the previous step.

In this section, both the Active Set and the Interior Point methods will be de-
scribed very briefly, and some of the points at which the structure of the predic-
tive control problem can be exploited will be identified. The presentation is based
on [Fle87]and [Wri96].

As a result of the QP problem being convex, the necessary and sufficient conditions
for θ to be the global optimum are given by the Karush-Kuhn-Tucker (or KKT)
conditions [Fle87, Wri97]: there must exist vectors (Lagrange multipliers) λ ≥ 0
3.3. Solving QP Problems 101

and ζ, and a vector t ≥ 0, such that


Φθ + H T ζ + ΩT λ = −φ (3.59)
−Hθ = −h (3.60)
−Ωθ − t = −ω (3.61)
T
t λ = 0 (3.62)

3.3.1 Active set methods

The Active Set method assumes that a feasible solution is available. (We shall
consider later how that might be found.) For such a solution, the equality constraints
(3.57) are of course satisfied, and some subset of the inequality constraints (3.58)
is active, namely the constraints hold with equality for this subset. This subset
is called the active set; it is possible for it to be empty, if none of the inequality
constraints is active at the current feasible solution. Using the same notation as
earlier, we use the subscript a to denote those rows of (3.58) which are in the active
set, so that
Ωa θ = ωa
Suppose that at the r’th iteration we have the feasible solution θr . The active set
method then finds an improved solution θr + ∆θ which minimises the cost (3.56)
while satisfying the equality constraints Hθ = h and Ωa θr = ωa , without worrying
about the inactive inequality constraints. If this new solution is feasible, that is
if Ω(θr + ∆θ) ≤ ω, then it is accepted as the next iteration: θr+1 = θr + ∆θ.
If it is not feasible, then a line-search is made in the direction ∆θ to locate the
point at which feasibility is lost — namely the point at which one of the inactive
inequality constraints becomes active. The solution at this point is accepted as the
next iteration: θr+1 = θr + αr ∆θ, where 0 < αr < 1, and the newly active constraint
is added to the active set.

It remains to decide whether this new solution is already the global optimum of
the QP problem, or whether further improvement can be obtained. This decision
can be made by checking whether the KKT conditions (3.59)–(3.62) are satisfied at
θr+1 . Note that the complementarity condition (3.62) implies that those elements of
λ corresponding to inactive constraints are zero, since the corresponding elements of
t are positive. So only those elements of λ corresponding to active constraints need
to be evaluated; if they are all nonnegative then the global solution has been found,
because of the condition λ ≥ 0, otherwise further iteration is needed. So suppose
that λq < 0. Since λq is a Lagrange multiplier corresponding to the q’th inequality
constraint, which is active (by assumption), its negative value indicates that the cost
function could be reduced by making that constraint inactive, namely moving to a
solution θ for which Ωq θ < ωq . Thus the q’th constraint is removed from the active
set. (If more than one element of λ is negative, then the constraint corresponding
to the most negative one is removed from the active set.) So now a new active set
has been selected, and the whole process is repeated, replacing θr by θr+1 .
102 3. Solving Predictive Control Problems

Note that V (θr+1 ) < V (θr ), where V (θ) = 12 θ T Φθ + φT θ is the cost function, so that
this iterative process is guaranteed to terminate at the global optimum, because of
the convexity of the QP problem. A potential advantage of the active-set method
over other methods, for predictive control, is that the iterations remain feasible once
an initial feasible solution has been found. In many predictive control problems it is
the feasibility of the solution, rather than exact optimality, that is most important.
So if the QP solver has failed to terminate by the time the next control move is
required, using the latest available iteration may be an adequate solution, and in
many cases it is likely to be nearly as effective as the true optimal solution. This
may arise, for example, when an unusually large disturbance occurs, so that the
most important thing is to keep the plant within a safe operating region — that is,
find a feasible solution, if the constraints delineate the boundary of this region; in
these circumstances, a good initial guess of the solution is not likely to be available
from earlier steps.

Now we consider in more detail the minimisation of the cost function at the r’th
iteration. The new cost is
1
V (θr + ∆θ) = (θr + ∆θ)T Φ(θr + ∆θ) + φT (θr + ∆θ) (3.63)
2
1
= V (θr ) + ∆θ T Φ∆θ + (φT + θrT Φ)∆θ (3.64)
2

so the minimisation problem to be solved can also be stated as

1
min ∆θ T Φ∆θ + φTr ∆θ (3.65)
∆θ 2

subject to

H∆θ = 0 and Ωa ∆θ = 0 (3.66)

where φr = φ + Φθr . This is a convex QP problem, but with equality constraints


only.

One way of solving such an equality-constrained problem is by the method of La-


grange multipliers — that is, by using the KKT conditions for this sub-problem, but
since there are only equality constraints, only (3.59) and (3.60) are needed from the
KKT conditions. However, it is convenient to separate out the vector ζ into those
components corresponding to H∆θ = 0 and those corresponding to Ωa ∆θ = 0. We
shall call these ∆ζ and ∆λ, respectively. Thus the KKT conditions for this sub-
problem are: There must exist vectors ∆ζ and ∆λ (unrestricted as to sign), such
that

Φ∆θ + H T ∆ζ + ΩTa ∆λ = −φr (3.67)


−H∆θ = 0 (3.68)
−Ωa ∆θ = 0 (3.69)
3.3. Solving QP Problems 103

These equations can be assembled into the matrix equation:


    
Φ H T ΩTa ∆θ −φr
 H 0 0   ∆ζ  =  0  (3.70)
Ωa 0 0 ∆λ 0

This equation is solved by some version of Gaussian elimination, which involves


factorising the matrix on the left hand side into the product of a lower-triangular
and an upper-triangular matrix:
 
Φ H T ΩTa
 H 0 0  = LU (3.71)
Ωa 0 0

Once this factorisation has been obtained, the solution is obtained very quickly, since
it requires the solution (for η) of
 
−φr
Lη =  0 
0

which is done by forward substitution, followed by the solution of


 
∆θ
U  ∆ζ  = η
∆λ

which is done by back-substitution. So the speed of the active-set method is dom-


inated by the speed with which this factorisation can be performed. At first sight
it seems obvious that the symmetric structure of the matrix should be exploited,
and there are algorithms for efficient LU factorisation of symmetric matrices [GL89].
But as pointed out in [Wri96], more advantage may be obtained by rearranging the
variables in [∆θ T , ∆ζ T , ∆λT ]T , so that the matrix becomes banded, if that is possi-
ble. The structure of the predictive control problem allows this to be done, though
at the cost of introducing many more variables into the problem.

Taking the predictive control QP problem to be defined by (3.41) and (3.42), we see
that the corresponding values for Φ and Ω are

Φ = H = ΘT QΘ (3.72)
 
z
Ω =  ΓΘ  (3.73)
W

and H does not exist. Although Q is block-diagonal, Θ is nearly full, so that Φ does
not have any particular structure which can be exploited, apart from symmetry.

But an alternative formulation is obtained by not eliminating the predicted states


x̂(k + j|k) from the problem, and leaving them as variables to be found by the QP
104 3. Solving Predictive Control Problems

solver. That is, we still minimise the cost function (3.2), but instead of replacing
Z(k) by using (3.5), we use (2.72) and impose the equality constraints
x̂(k + j + 1|k) = Ax̂(k + j|k) + B û(k + j|k) for j = 0, . . . , Hp − 1 (3.74)
and
û(k + j + 1|k) = û(k + j|k) + ∆û(k + j + 1|k) for j = 0, . . . , Hu − 1
(3.75)
(with û(k − 1|k) = u(k − 1)). The minimisation is then performed over the variables
∆û(k + j|k) and û(k + j|k) for (j = 0, . . . , Hu − 1), and x̂(k + j|k) for j = 1, . . . , Hp .
This introduces `Hu + nHp additional variables into the problem (where ` is the
number of inputs and n is the state dimension), which looks like a bad idea. But the
potential benefit is that now the matrix which has to be factorised in the active-set
method can be banded. If the variables are ordered in the following way:
 
û(k|k)
 ∆û(k|k) 
 
 x̂(k + 1|k) 
 
 û(k + 1|k) 
 
 ∆û(k + 1|k) 
 
 x̂(k + 2|k) T 
 
 . 
θ= 
.
. 
 (3.76)
 û(k + Hu − 1|k) 
 
 ∆û(k + Hu − 1|k) 
 
 x̂(k + Hu |k) 
 
 x̂(k + H + 1|k) 
 u 
 . 
 .. 
x̂(k + Hp |k)
then we have (assuming Hw = 1 and Hu < Hp for simplicity):
 
0 0 0 0 0 0 ··· 0 0
 0 R(0) 0 0 0 0 ··· 0 0 
 
 0 0 Q̄(1) 0 0 0 ··· 0 0 
 
 0 0 0 0 0 0 ··· 0 0 
 
 0 0 0 0 R(1) 0 ··· 0 0 
Φ =   (3.77)
 0 0 0 0 0 Q̄(2) ··· 0 0 
 
 . . .. .. .. .. .. .. .. 
 .. .. . . . . . . . 
 
 0 0 0 0 0 0 0 Q̄(Hp − 1) 0 
0 0 0 0 0 0 0 0 Q̄(Hp )
 
B 0 −I 0 0 0 0 ··· 0 0
 I −I 0 −I 0 0 0 ··· 0 0 
 
 0 0 A B 0 −I 0 · · · 0 0 
 
H =  0 0 0 I −I 0 −I · · · 0 0  (3.78)
 
 .. .. .. .. .. .. .. .. .. .. 
 . . . . . . . . . . 
0 0 0 0 0 0 0 ··· A −I
3.3. Solving QP Problems 105

where Q̄(i) = CzT Q(i)Cz . The point here is that both Φ and H have a banded
structure (ie all their non-zero entries are relatively close to the principal diagonal),
as does the matrix Ω associated with the inequality constraints. Now this does not
itself make the matrix to be factorised in (3.71) banded, but this can also be achieved
by reordering the order of the variables. The key is to keep all the variables associated
with predicted time k+j grouped together, including the relevant elements of ∆ζ and
∆λ. The bandedness can be exploited to speed up the factorisation. Furthermore,
the matrix to be factorised at the (r + 1)’th iteration of the active set method is
only a little different from the one factorised at the r’th iteration. Wright [Wri96]
proposes a method which takes advantage of both of these features.

Is it worthwhile obtaining bandedness in this way, since it involves introducing ad-


ditional variables into the QP problem? According to [Wri96], the time required
to factor a banded matrix with half-bandwidth b and total dimension N (b + 1) is
O(N (b + 1)3 ), compared with O(N 3 (b + 1)3 ) for a dense matrix of the same size.
If we assume that Hu = Hp (so that the bandwidth is the same along the whole
diagonal of the matrix) and that half of the inequality constraints are active, then
the half-bandwidth in the scheme just outlined is approximately 2n+3`+ν/2, where
ν is the number of inequality constraints (on inputs, input changes, and outputs),
and the total size of the matrix to be factorised is Hp (2n + 3` + ν/2). On the other
hand, for the original scheme, using (3.41) and (3.42), the matrix is dense, and its
size is approximately (` + ν/2)Hp . So, roughly speaking, it is worth considering the
banded scheme if
 ν 3  ν 3
Hp2 ` + > 2n + 3` + (3.79)
2 2
For some typical numbers this works out as follows:

Typical process application n = 200, ` = 20, ν = 40


` + ν/2 = 40, 2n + 3` + ν/2 = 480
‘Banded’ scheme looks worthwhile if Hp > 41.

Typical aerospace application n = 12, ` = 3, ν = 4


` + ν/2 = 5, 2n + 3` + ν/2 = 35
‘Banded’ scheme looks worthwhile if Hp > 18.

These examples suggest that the banded scheme is likely to be worthwhile in many
cases. As we will see in chapters 6 and 8, long prediction horizons help to ensure
closed-loop stability, and to minimise the risk of driving the plant into ‘dead-ends’
from which no feasible solution is possible; thus there are good reasons for making
Hp as large as computation speed will allow. Note that if Hu  Hp then the original
‘dense’ scheme will be more favoured over the ‘banded’ scheme than inequality (3.79)
suggests. The comparison should be done more carefully for any particular applica-
tion, since it will be affected by factors such as how many constraints are likely to
be active typically (which it may be possible to predict for particular applications).
Also, the comparison as made above disregards the difference in the difficulty of
106 3. Solving Predictive Control Problems

finding an initial feasible solution. In practice, actual performance comparisons of


the two schemes may be required in order to make the correct decision.

One more point remains to be dealt with: how to find an initial feasible solution.
This is needed in order to get the iterations of the active set method started. The
basic idea is the following. Suppose that we have an infeasible solution θ0 , which
satisfies the equality constraints Hθ0 = h, and that a subset of the inequality con-
straints is satisfied, so that Ωs θ0 ≤ ωs , and the remaining inequality constraints are
not satisfied: Ωu θ0 > ωu . Then a solution θ is sought for the linear programming
(LP) problem:
X
min (ωuj − Ωju θ) (3.80)
θ
j

subject to

Hθ = h (3.81)

and

Ωs θ ≤ ωs (3.82)

where Ωju denotes the j’th row of Ωu and ωuj denotes the j’th element of ωu . The
usual simplex algorithm for solving LP problems can be used, which searches among
the vertices of the feasible region. However, the problem formulation is changed
at every new vertex visited, because the selection of rows in Ωs and Ωu (and of
corresponding elements in ωs and ωu ) changes at every vertex. Eventually either
all the inequality constraints are satisfied, in which case a feasible solution has been
found, or the cost (3.80) is still positive and the Lagrange multipliers indicate that
it cannot be improved, in which case the problem is infeasible. Problems with this
basic idea are:

1. The feasible solution which is found is arbitrary, and can be very far from the
optimal solution of the QP problem.

2. The simplex algorithm always requires as many active constraints as the di-
mension of θ. So it may not be possible to use the solution of the QP problem
solved at the previous step as an initial guess (hot starting), because that may
have a different number of active constraints.

These problems can be overcome by adding a small multiple of the QP cost to the
cost function (3.80). This ‘biases’ the initial feasible solution towards the optimal
solution of the QP problem, hopefully leading to fewer iterations of the active set
method, and it also changes the initial feasibility problem from an LP problem into
a QP problem, which can be started with any number of active constraints.
3.3. Solving QP Problems 107

3.3.2 Interior point methods

In the last twenty years or so, a rival family of algorithms for solving convex
optimization problems has emerged. These are the so-called interior point meth-
ods [NN94, Wri97, RTV97] . They first came to prominence with Kamarkar’s algo-
rithm for solving LP problems, the first serious rival to the simplex algorithm, and
one which was potentially dramatically faster for large problems. Much develop-
ment since then has led to versions of interior point methods which are particularly
effective for solving QP problems. The attraction of these new methods is that their
computational complexity (number of iterations, time to complete, . . . ) is no worse
than some polynomial function of parameters such as the number of constraints or
the number of variables, whereas the complexity of other known approaches, includ-
ing active set methods, can be exponential in these parameters in the worst case.
We remark that the availability of interior point methods for more general convex
optimization problems has led to the intense current interest in linear matrix in-
equalities (LMIs) for solving control and other ‘systems’ problems [BGFB94] — we
shall make use of them in section 8.4.

In this subsection we shall give a brief indication of how interior point methods work.
As with active set methods, one can apply interior point methods to the predictive
control problem ‘naively’, that is regarding it as just a standard QP problem, or one
can exploit the particular structure inherent in predictive control problems. The
second alternative has been investigated in detail by Wright et al [Wri96, RWR98].

Whereas the main iterations of the active set methods search among points on the
boundary of the feasible region, early interior point methods searched among points
in the ‘interior’ of this region; in other words, the iterates were always feasible
solutions of the optimization problem being solved. It turned out that this was not
a particularly efficient strategy, among other things requiring an initial feasible point
to be found. The iterates in more recent versions are not feasible — until the end
of the search, typically — but they are still away from the boundary of the feasible
region, and in that sense ‘interior’ (and they are in the interior of a certain positive
orthant).

Suppose that a function V (x) is to be minimised over x, subject to the constraint


Ax ≤ b. One way of looking at interior point methods is to consider the minimisation
of the function
X
f (x, γ) = γV (x) − log(bi − aTi x) (3.83)
i
| {z }
barrierf unction

where aTi is the i’th row of A, bi is the i’th element of the vector b, and γ is some
positive scalar. If the minimum of f (x, γ) is being sought by some search strategy,
starting in the feasible region, then the logarithmic barrier function prevents the
search leaving the feasible region, since it becomes infinite on the boundary of the
108 3. Solving Predictive Control Problems

region. 1 Let xγ be the minimiser of f (x, γ), and let x∗ be the solution of the original
problem, namely the minimiser of V (x) which satisfies the constraints. x0 is known
as the analytic centre of the constraints; if the feasible region is not empty then
x0 lies in its interior, and does not depend on the objective function V (x) at all.
On the other hand, xγ → x∗ as γ → ∞. The underlying idea is that if an initial
(feasible) solution is found in the vicinity of x0 , then it can be continuously improved
by increasing γ and minimising f (x, γ), until kx∗ − xγ k is sufficiently small. The
path traced out by xγ is known as the central path.

Example 3.1 Consider the following QP problem, taken from Fletcher [Fle87, Prob-
lem 10.4]:

min V (θ) = θ12 − θ1 θ2 + θ22 − 3θ1


θ

subject to

θ1 ≥ 0
θ2 ≥ 0
θ1 + θ2 ≤ 2

Figure 3.6 shows the feasible region — the interior of the triangle — and some
contours of V (θ). It is clear that the optimal solution is at (3/2, 1/2), where the
V (θ) = −11/4 contour is tangential to the constraint θ1 + θ2 ≤ 2. The small circle
in the middle of the triangle shows the analytic centre, which is at (2/3, 2/3), and
the dots show the central path traced out as γ increases from 0 to 100. To get the
sequence of solutions shown, the γ values were spaced logarithmically between 0.01
and 100, using 20 values (MATLAB command: logspace(-2,2,20)).

Examining the neighbourhood of the optimal solution in Figure 3.6 reveals a draw-
back of naive implementations of the interior point approach: one of the solutions
seems to be at the constraint, but a little way away from the optimum — in fact, it
is at (1.5266, 0.4742), which is just infeasible. This is the solution obtained with the
last few values of γ, and it is clearly incorrect. The reason is that with these values of
γ the solution is very close to the constraint boundary, where the logarithmic barrier
function is increasing extremely quickly, and as a result the optimization problem
becomes very ill-conditioned. The solution which is obtained then depends strongly
on the particular algorithm used; the solution shown in the figure was obtained us-
ing the very unsophisticated ‘direct-search’ approach implemented by MATLAB’s
Optimization Toolbox function fmins. The major reason why good interior point
algorithms are relatively complicated is that they take elaborate precautions to deal
with this ill-conditioning.
1
Other barrier functions are possible.
3.3. Solving QP Problems 109

2.5

1.5

0.5

−0.5
−0.5 0 0.5 1 1.5 2 2.5

Figure 3.6: Basic interior point method for Example 3.1.

At present the most effective interior-point algorithms are the so-called primal-dual
methods [Wri97]. These find solutions to convex optimization problems and their
dual problems simultaneously. Recall the KKT conditions (3.59)–(3.62) for the QP
problem. If the complementarity condition (3.62) is relaxed to

1
tT λ = >0 (3.84)
γ

then the equations (3.59), (3.60), (3.61), (3.84) define a central path which converges
to the optimal solution of the QP problem, and simultaneously of its dual, as γ → ∞.
The basic idea of primal-dual methods is to alternately take steps towards the central
path (γ fixed), and ‘parallel’ to the central path (γ increased). For both kinds of
step the search direction is found by solving an equation of the form
    
Φ HT ΩT ∆θ rφ
 H 0 0   ∆ζ  =  rH  (3.85)
Ω 0 Λ T −1 ∆λ rΩ

where Λ = diag{λi } and T = diag{ti }. The vector on the right-hand side of (3.85)
varies, depending on which kind of step is being performed, and on which particular
variant of primal-dual algorithms is being implemented. It will be seen that the
matrix on the left-hand side of this equation has the same form as the matrix which
110 3. Solving Predictive Control Problems

appears in (3.70). As in the active set method, the speed of solution is dominated
by the speed with which equation (3.85) can be solved. Therefore much the same
considerations apply as were discussed in the previous section. Once again, it is
advantageous to order the variables so that the matrix in (3.85) is banded. For
further details see [RWR98, Wri97] .

3.4 Softening the Constraints

A serious problem which can occur with the predictive control problem as we have
formulated it so far, is that the optimiser may be faced with an infeasible problem.
This can happen because an unexpectedly large disturbance has occurred, so there
is really no way in which the plant can be kept within the specified constraints. Or
it can happen because the real plant behaves differently from the internal model;
the predictive controller may attribute differences between the plant and the model
behaviours to large disturbances, and if these keep growing then it can eventually
decide — erroneously — that it does not have enough control authority to keep the
plant within the constraints. There are many ways in which the predictive control
problem can become infeasible, and most of them are difficult to anticipate.

Because of this, it is essential to have a strategy for dealing with the possibility of
infeasibility. Standard algorithms for solving QP problems just give up, and output
a message such as ‘Infeasible problem’. Clearly this is unacceptable behaviour for
an on-line controller. Various possibilities exist, ranging from ad-hoc measures such
as outputting the same control signal as in the previous step, or (better) the control
signal computed as û(k + 2|k) in the previous step, to sophisticated strategies of
‘constraint management’, in which one tries to relax the least-important constraints
in an attempt to regain feasibility — see section 10.2.

One systematic strategy for dealing with infeasibility is to ‘soften’ the constraints.
That is, rather than regard the constraints as ‘hard’ boundaries which can never be
crossed, to allow them to be crossed occasionally, but only if really necessary.

There is an important distinction between input and output constraints. Usually


input constraints really are ‘hard’ constraints, and there is no way in which they
can be softened; valves, control surfaces, and other actuators have limited ranges
of action, and limited slew rates. Once these have been reached there is no way
of exceeding them, except for fitting more powerful actuators. Therefore input
constraints are usually not softened.

A straightforward way of softening output constraints is to add new variables, so-


called ‘slack variables’, which are defined in such a way that they are non-zero only
if the constraints are violated. Then their non-zero values are very heavily penalised
in the cost function, so that the optimiser has a strong incentive to keep them at
zero if possible.
3.4. Softening the Constraints 111

A first way of doing this is to add a quadratic penalty for constraint violations
[OB94]. The optimization problem (3.43)–(3.44) is modified to

1
min θ T Φθ + φT θ + ρkk2 (3.86)
θ, 2

subject to

Ωθ ≤ ω + 
(3.87)
≥0

where  is a nonnegative vector of the same dimension as ω, and ρ is a nonnegative


scalar. This is still a QP problem, though with a larger number of variables. It is
clear that a similar modification can be made if some of the constraints are to be
retained as hard constraints.

If ρ = 0 then one has the completely unconstrained problem, and as ρ → ∞ so


one recovers the solution to the hard-constrained problem. But a drawback of a
quadratic penalty on constraint violations is that, if the constraints are active, then
for all finite values of ρ this formulation will result in them being violated to some
extent (decreasing as ρ increases), even if such violation is not necessary.

Alternatives are to penalise the 1-norm (sum of violations) or the ∞-norm (maximum
violation) of the constraint violations:
 
  X
1 T 1
min θ Φθ + φT θ + ρkk1 = min  θ T Φθ + φT θ + ρ j  (3.88)
θ, 2 θ, 2
j

subject to

Ωθ ≤ ω + 
(3.89)
≥0

or
   
1 T 1 T
min θ Φθ + φT θ + ρkk∞ = min θ Φθ + φT θ + ρ max j
θ, 2 θ, 2 j

subject to

Ωθ ≤ ω + 
≥0

Note that the second alternative can be posed more efficiently as


 
1 T T
min θ Φθ + φ θ + ρ (3.90)
θ, 2
112 3. Solving Predictive Control Problems

subject to

Ωθ ≤ ω + 1
(3.91)
≥0

where  is a scalar, and 1 is a vector, each element of which is 1. In this form only
one slack variable is introduced, which gives, in general, a much faster algorithm.
Penalising the 1-norm of constraint violations requires a separate slack variable for
every constraint, at every point of the prediction horizon for which the constraint is
enforced. The number of slack variables can (greatly) exceed the number of decision
variables in the original ‘hard-constrained’ problem. Both of these ‘soft’ optimization
problems are again equivalent to QP problems.

It can be shown that, with ρ large enough, using either the 1-norm or the ∞-
norm penalty on constraint violations gives an ‘exact penalty’ method, which means
that constraint violations will not occur unless there is no feasible solution to the
original ‘hard’ problem. That is, the same solution will be obtained as with a ‘hard’
formulation, if a feasible solution exists. The reason for this difference in behaviour
between these formulations and the quadratic penalty formulation is that, starting
from the true constrained solution θ ∗ , there exists a move to an infeasible solution
θ ∗ + εd, for some vector d, which gives a reduction in the cost function of o(ε). Since
the penalty for the violation is o(ε2 ) then the violation gives a smaller value of the
‘softened’ cost function (3.86), for small enough ε. But in the cost functions (3.88)
and (3.90) the penalty is also o(ε), so if the coefficient ρ is large enough then such
a move results in an increase in the cost function. ‘Large enough’ means ‘larger
than kd( 12 θ ∗T Φθ ∗ + φT θ ∗ )/dωk∞ at the optimal solution’; this can be related to the
Lagrange multipliers of the original ‘hard’ problem at the optimal solution — for
details see [Fle87]. Unfortunately, in the context of predictive control, the Lagrange
multipliers will depend on the current state, so it is not easy to decide just how large
ρ should be [OB94, SR96b] . A contribution towards solving this problem is made
in [KM00b]. In [SR96b] a mixture of linear and quadratic penalties on constraint
violations is proposed.

The following example shows that it can be difficult to predict the circumstances
in which infeasibility is encountered, and hence the virtual necessity of softening
constraints. In this example the infeasibility arises as a result of modelling error.

Example 3.2 Consider again the linearised Citation aircraft, as introduced in sec-
tion 2.7. In that section it has already been shown that some error in the model can
be tolerated without serious difficulty. But this is not always true. Suppose that the
gain from elevator to altitude rate is over-estimated by 20%, and that a constraint
is imposed on the altitude, in an attempt to ensure a very small overshoot. If the
altitude is to be increased by 400 m, as in figure 2.8, the constraint

ŷ2 (k + i|k) < 405 (3.92)


3.4. Softening the Constraints 113

is imposed for all k and i, and all other parameters are the same as in section 2.7,
figure 2.8, then the result is shown in figure 3.7. 13 seconds into the manoeuvre, the
predictive controller is faced with an infeasible problem, and stops working.

Pitch angle and constraint Altitude and set−point

20 400

15

Altitude (m)
Pitch (deg)

300
10
200
5

100
0

−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

15
30
Elevator angle (deg)
Altitude rate (m/sec)

10

20 5

0
10 −5

−10
0
−15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 3.7: Plant-model error and hard constraints result in infeasibility.

Figure 3.8 shows the results when the output constraints are softened, using a 1-
norm penalty function with weight ρ = 104 . Note that the pitch angle constraint
is violated briefly in the early part of the manoeuvre, although this did not happen
with hard output constraints — see figure 3.7; this suggests that the penalty func-
tion is not exact, despite the large value of ρ. Another notable feature is that the
altitude constraint of 405 m is not violated — in fact there is no overshoot, and
the altitude never exceeds 400 m. This may seem inconsistent with the fact that
the hard-constrained problem became infeasible after 13 seconds. The explanation is
that the figure shows the actual altitude of the aircraft, whereas the infeasibility arose
from the controller’s predictions of the altitude, which were based on an inaccurate
model. This phenomenon, of the controller predicting a constraint violation which
does not actually occur, is quite common. The converse phenomenon can be seen in
figure 2.11; there the altitude rate constraint is violated briefly, yet no infeasibility is
detected by the controller. Again, the explanation is that the controller’s predictions
were inaccurate and did not indicate an inevitable constraint violation.

In this example, the ‘hard-constrained’ QP problem to be solved at each step has 3


114 3. Solving Predictive Control Problems

Pitch angle and constraint Altitude and set−point

20 400

15

Altitude (m)
Pitch (deg)

300
10
200
5

100
0

−5 0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

15
30
Elevator angle (deg)
Altitude rate (m/sec)

10

20 5

0
10 −5

−10
0
−15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 3.8: Soft output constraints restore feasibility. 1-norm penalty with ρ = 104 .

decision variables, namely û(k + i|k) for i = 0, 1, 2, since Hu = 3 and there is only
one control input. When the output constraints are softened using a 1-norm penalty,
4 slack variables are introduced at each point in the prediction horizon — one for
each constraint: maximum pitch angle, minimum pitch angle, maximum altitude
rate, and maximum altitude. Since the constraints are enforced at each point of the
prediction horizon, which has length Hp = 10, there are 40 slack variables altogether.
So the total number of decision variables has increased from 3 to 43, as a result of
softening the constraints in this way. The average time required to solve and simulate
one step on a 333 MHz Pentium II processor was 0.81 sec. (Most of this time is
taken by the optimization, since simulation of a linear model is very fast.) Solving the
same problem using an ∞-norm penalty, again with ρ = 104 , gave virtually identical
results, but required only 0.15 sec per step. The average time required per step for
the hard-constrained problem was 0.04 sec.2 These solution times are summarised
in Table 3.2.

A more typical reason for encountering infeasibility is the presence of disturbances.


2
The simulation was performed using the Model Predictive Control Toolbox function scmpc for
the hard-constrained case, and its modified version scmpc2 for the soft-constrained cases — see Ap-
pendix C. The latter uses a different QP solver, so the solution speeds are not directly comparable.
It should also be borne in mind that the quoted solution times are very far from the minimum
achievable times.
3.4. Softening the Constraints 115

Problem formulation Time


Soft-constrained, 1-norm penalty 0.81 s
Soft-constrained, ∞-norm penalty 0.15 s
Hard-constrained 0.04 s

Table 3.2: Relative solution times for different formulations of altitude change ma-
noeuvre.

The next example illustrates this, and again shows the efficacy of softening con-
straints. It also shows that using inexact penalty functions can give a useful com-
promise between the harshness of constraints and the ‘sponginess’ of set-point spec-
ifications.

Example 3.3 In section 2.7, Figure 2.9, the response was shown to a disturbance of
5 m/sec in the altitude rate, arising from turbulence acting on the Citation aircraft.
If, however, the disturbance is slightly greater, 6 m/sec instead of 5 m/sec, then the
controller finds that it cannot return the altitude rate to below 30 m/sec within one
sample period — because of the elevator angle being limited to 15◦ — and infeasibility
occurs. Note that this is true even if the model is perfect.

If, however, the constraints are softened, then the disturbance can be dealt with.
Figure 3.9 shows the response when an ∞-norm penalty function is used with ρ =
5×105 . Such a large value of ρ is needed to get an exact penalty function in this case;
the peak value of all the Lagrange multipliers obtained during the simulation shown
in Figure 2.9 was approximately 4 × 105 . This response is very similar to that shown
in Figure 2.9; thus, although the manoeuvre can be completed successfully despite
the large disturbance, the disadvantage of a violent response to avoid violation of the
constraints is still present.

If, however, the penalty coefficient is reduced to ρ = 104 , so that the penalty function
is no longer exact, then the response shown in Figure 3.10 is obtained. The response
to the onset of the disturbance is now significantly less agressive than before, al-
though still more agressive than the response to the disappearance of the disturbance
5 seconds later. The inexactness of the penalty function reveals itself by the slight
violation of the altitude rate constraint before the disturbance occurs.

Using a 1-norm penalty function (instead of ∞-norm) gives very similar results for
this example, if the same values of the penalty coefficient ρ are used.

In [RK93] an unconventional way of solving the constrained QP problem is intro-


duced. This solves the problem as an iteration of weighted least-squares problems,
the weights being changed at each iteration in such a way that the greatest penalty
is attached to the most-violated constraint. This can be shown to find the correct
solution to the QP problem if it exists, but has the advantage that it produces a
solution even if the problem is infeasible, so that it enforces soft constraints, in
116 3. Solving Predictive Control Problems

Pitch angle and constraint Altitude and set−point

20
400
10

Altitude (m)
Pitch (deg)

300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint

40 15
Elevator angle (deg)
Altitude rate (m/sec)

10
30
5
20 0

−5
10
−10
0 −15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 3.9: Response to disturbance with softened altitude rate constraint, ρ =


5 × 105 .

effect. Furthermore, the solution that is produced is one which tries to minimise
the worst-case constraint violation, in the sense of minimising the peak value of the
violation.

It may happen, however, that minimising the magnitude of constraint violations


leads to the violations persisting over an unnecessarily long time, and this may not
be the preferred trade-off. In [SR99] several formulations of soft constraints are
discussed, which allow various magnitude/duration trade-offs to be imposed.
3.5. Problems 117

Pitch angle and constraint Altitude and set−point

20
400
10

Altitude (m)
Pitch (deg)

300
0
200
−10
100
−20
0
0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Altitude rate and constraint Elevator angle and constraint


40
Elevator angle (deg) 15
Altitude rate (m/sec)

30 10

5
20
0

−5
10
−10
0 −15

0 5 10 15 20 0 5 10 15 20
Time (sec) Time (sec)

Figure 3.10: Response to disturbance with softened altitude rate constraint, ρ = 104 .

3.5 Problems

1. Work through the unconstrained predictive control example described on pages


50–55 of the MPC Toolbox User’s Guide. Don’t worry about how the Toolbox
does the conversion from transfer function to state-space form. Also don’t
worry about how the observer (= ‘estimator’) gain is designed (p.55). The
emphasis for the moment is on the ‘mechanical’ skills of running the Toolbox.
(You should read the detailed description of the function smpccon before/while
doing this.)

2. Work through the constrained predictive control example described on pages


56–61 of the MPC Toolbox User’s Guide.
(You should read the detailed description of the function scmpc before or while
doing this.)

3. The water temperature in a heated swimming pool, θ, is related to the heater


input power, q, and the ambient air temperature, θa , according to the equation

T = kq + θa − θ (3.93)
dt
where T = 1 hour and k = 0.2 degC/kW. (It is assumed that the water is
perfectly mixed, so that it has a uniform temperature.) Predictive control
118 3. Solving Predictive Control Problems

is to be applied to keep the water at a desired temperature, and a sampling


interval Ts = 0.25 hour is to be used. The control update interval is to be the
same as Ts .

(a) Use MATLAB’s Control System Toolbox to show that the corresponding
discrete-time model is

θ(k + 1) = 0.7788θ(k) + 0.0442q(k) + 0.2212θa (k) (3.94)

Form the corresponding model in the Model Predictive Control Toolbox’s


‘MOD’ format, assuming that q is the control input and that θa is an
unmeasured disturbance.
(b) Verify that if the weights Q = 1 and R = 0, and the horizons Hp = 10
and Hu = 3 (and Hw = 1) are used, then

Ks = KM P C [1, −Ψ, −Υ] = [22.604, −17.604, −22.604] (3.95)

where Ks is the unconstrained controller gain matrix Ks produced by


Model Predictive Control Toolbox function smpccon, and that stable closed-
loop behaviour is obtained.
(c) If the air temperature θa is constant at 15 degC verify that a set-point for
θ of 20 degC is attained without error. Verify that this remains the case
even if the pool parameters change to T = 1.25 hour, k = 0.3 degC/kW
but the predictive controller’s internal model remains unchanged.
(d) Suppose that the air temperature follows a sinusoidal diurnal variation
with amplitude 10 degC:
 

θa (t) = 15 + 10 sin t (3.96)
24

(where t is measured in hours). Verify that in the steady-state the mean


water temperature reaches the set-point exactly, but that θ has a small
residual oscillation of amplitude approximately 0.5 degC.
(e) Now suppose that the input power is constrained:

0 ≤ q ≤ 40 kW (3.97)

and that the air temperature varies sinusoidally, as above. Investigate


the behaviour of the predictive control system — use Model Predictive
Control Toolbox function scmpc.

(You are advised to save any models created, and to keep a record of MATLAB
commands you use — using diary for example — as this swimming pool
example will reappear in later examples and problems. See Problems 1 and 6
of Chapter 5, Example 7.4, and Problem 6 of Chapter 7.)

4. If blocking is used, as in the Model Predictive Control Toolbox, how should the
details of equation (2.23) be changed? (Also see Problem 14 of Chapter 1.)
3.5. Problems 119

5. Suppose that the cost function used in the predictive control formulation was
changed to include the penalty term

u −1
HX
||û(k + i|k) − uref (k + i)||2S(i)
i=0

in addition to the terms penalising tracking errors and control moves, where
uref denotes some prescribed future trajectory for the plant inputs.

(a) Describe in detail the changes that would need to be made to the com-
putations of predictions and the optimal solution.
(b) Briefly list some reasons for and against making such a modification.

6. (a) If inequality (3.35) arises from the simple range constraints (3.38), show
that z takes the simple form
 
I 0 ··· 0
 −I 0 · · · 0 
 
 I I ··· 0 
 
 −I −I · · · 0 
 
 .. .. ..
z= . . ... .
 
 I I ··· 0 
 
 −I −I · · · 0 
 
 I I ··· I 
−I −I · · · −I

What form does the vector on the right hand side of inequality (3.37)
take in this case? (Note that it is possible to reorder the inequalities so
that z takes the form of two lower-triangular matrices stacked on top of
each other in this case, each one being made up of identity matrices. This
is commonly done in the literature [PG88].)
(b) Put inequality (3.34) into the form W ∆U(k) ≤ w, where W is a matrix
and w is a vector. If (3.34) arises from simple rate constraints of the form
−B(k + i) ≤ ∆û(k + i|k) ≤ B(k + i), what form do W and w take?

7. If you look at the code for function smpccon in the MPC Toolbox (using type
smpccon), you will see how the weights are forced to be diagonal before solving
for the unconstrained gain matrix KM P C . Copy the function to your own
directory, change its name, and edit it so that you can specify arbitrary weights.
Then solve Example 6.1 and Problem 2 of Chapter 6 using your new function.
Simulate the designs using smpcsim.

8. Put the QP problem stated in Example 3.1 into the standard form (3.56)–
(3.58). Check that Φ ≥ 0, and hence that the problem is convex. Check that
the point (θ1 = 3/2, θ2 = 1/2) satisfies the KKT conditions (3.59)–(3.62), and
hence that it is the optimal solution, as claimed in the example.
120 3. Solving Predictive Control Problems

9. (a) Check that the optimization problem (3.86)–(3.87) is a standard QP prob-


lem, as claimed in the text.
(b) Modify the problem (3.86)–(3.87) to deal with the case that a subset of
the constraints Ω1 θ ≤ ω1 is to be ‘hard’, while the remainder, Ω2 θ ≤ ω2 ,
is to be ‘soft’, and again check that this is a QP problem.

10. Check that the optimization problems (3.88)–(3.89) and (3.90)–(3.91) are stan-
dard QP problems.

11. Suppose that the gain from the elevator angle to the altitude rate of the Ci-
tation aircraft model is underestimated by 20%, rather than overestimated,
as in Example 3.2, but everything else is the same as in Example 3.2. Show
that infeasibility is not encountered in this case, but the response is relatively
oscillatory — as one would expect with conventional control if the plant gain
were higher than expected.
(The function mismatch2, available from this book’s web site, makes it easy to
run the simulation. Use parameter values: percent=-20 to simulate the 20%
gain undermodelling, and pencoeff=inf, normtype=’inf-norm’ to enforce
hard constraints.)

12. Verify that similar results to those shown in Example 3.3 are obtained if a
1-norm penalty function is used instead of an ∞-norm penalty function.
(The function disturb2, available from this book’s web site, makes it easy
to run the simulation. The parameter pencoeff corresponds to the penalty
coefficient ρ, and can either be a scalar (the same coefficient for each con-
straint violation) or a vector, one element corresponding to each constraint.
Set normtype=’1-norm’ to select the 1-norm penalty function.)
Chapter 4

Step Response and Transfer


Function Formulations

The original formulations of predictive ccontrol, such as DMC [CR80, PG88], used
step or pulse response models instead of state-space models. Some commercial
products still use these representations. GPC [CMT87, Soe92] popularised the use
of transfer function, or difference equation, models in predictive control; these models
are the most widely-used in the academic literature of predictive control, and are
also used in some commercial products. This chapter shows the details of using
these models in predictive control. Wherever possible, everything is related to what
has already been done with state-space models.

4.1 Step and Pulse Response Models

4.1.1 Step and Pulse Responses

The idea behind step-response models is that one can apply a step input to each input
(‘manipulated variable’ or actuator) of the plant, and record the open-loop response
of each output variable, until all the output variables have settled to constant values.
Because of the assumed linearity of the plant, knowing the (multivariable) step
response allows one to deduce the response to any other input signal (vector). This
is an easy and intuitive concept; however it does have some drawbacks:

• It can only be used with asymptotically stable plants.

• It is frequently impractical to apply step inputs — they can be too disruptive


to normal operations.

• Estimating models from step responses gives a lot of emphasis to low fre-

121
122 4. Step Response and Transfer Function Formulations

quencies. For feedback control other frequencies are usually more important.
In particular, step response tests estimate steady-state gains very well. But
steady-state gains are relatively unimportant for feedback design — the feed-
back changes them anyway. (However, steady-state gains are important for
certain purposes, such as sizing actuators, and steady-state optimization.)

• Step response models are only adequate if all the controlled variables are mea-
sured outputs. (Otherwise one needs some other kind of model to predict how
the unmeasured outputs will behave.)

• Storing multivariable step responses is an inefficient form of model represen-


tation, in terms of storage requirements.

There are some myths about step-response models, particularly in the process in-
dustries, which are simply not true:

• Step-response models are necessary to capture complicated patterns in the


response. This is not true; one can routinely build a state-space model which
can reproduce exactly any given step response, even a multivariable one. This
will be shown in this chapter.

• Step-response models are necessary to represent delays in the plant. This is


also not true; since we are working in discrete time, one can simply introduce
states into state-space models to represent as many delays as necessary.

Mathematically, a more fundamental concept than the step response is the pulse
response. Suppose that the plant is at steady-state, with all inputs and outputs
initially at 0. We apply a unit pulse at time 0 on input j:

uj (0) = 1 uj (k) = 0 for k > 0

Let the response sequence of output i be

(hij (0), hij (1), . . . )

so that the vector of responses of all the outputs at time t is

[h1j (t), h2j (t), . . . , hpj (t)]T

We can arrange a matrix which shows how each output responds to a unit pulse on
each input:
 
h11 (t) h12 (t) . . . h1m (t)
 h21 (t) h22 (t) . . . h2m (t) 
 
H(t) =  .. .. .. ..  (4.1)
 . . . . 
hp1 (t) hp2 (t) . . . hpm (t)
4.1. Step and Pulse Response Models 123

Now the response y(t) to an arbitrary input signal vector {u(0), u(1), . . . } is —
because of linearity — given by the convolution sum:

X
t
y(t) = H(t − k)u(k) (4.2)
k=0

(This is just the discrete-time equivalent of the convolution integral which occurs in
continuous-time linear systems theory.)

In principle, the sequence of pulse response matrices {H(0), H(1), . . . , H(N )} can
be obtained from pulse response tests. However it is very rarely practical to perform
such tests, because unacceptably large pulse amplitudes are usually needed in order
to excite the plant sufficiently to get useful results. The sequence must be long
enough so that H(N ) ≈ 0. If one really performed such a test, the initial steady-
state would not be at zero, and the sequence would really provide information about
the differences y(t) − y(−1) resulting from pulse inputs on u.

Now let us return to the concept of the step response of the plant. Consider a unit
step on input j: {uj (t)} = (1, 1, 1, . . . ). Using (4.2) the response of output i is:

X
t
yi (t) = hij (t − k)uj (k)
k=0
Xt
= hij (t − k)
k=0
X
t
= hij (k)
k=0

so that we can define the step response matrix as

X
t
S(t) = H(k) (4.3)
k=0

This matrix (or perhaps the whole sequence (S(0), S(1), . . . ) — it is not clear) is
sometimes called the Dynamic Matrix of the plant, which gives rise to the name
Dynamic Matrix Control, or DMC. The sequence (S(0), S(1), . . . , S(N )) can be
used as a model of the plant, if N is sufficiently large that S(N + 1) ≈ S(N ).

Recall that in the standard formulation we use changes of the input ∆u(t) = u(t) −
u(t − 1), rather than the input itself. We can express the output which results from
an arbitrary input sequence by using the step response matrices and the changes of
124 4. Step Response and Transfer Function Formulations

the input, instead of pulse response matrices and the actual input as we did in (4.2):
X
t
y(t) = H(t − k)u(k) (4.4)
k=0
Xt X
k
= H(t − k) ∆u(i) (assuming u(0) = 0) (4.5)
k=0 i=0
X
t X
t−1
= H(k)∆u(0) + H(k)∆u(1) + . . . + H(0)∆u(t) (4.6)
k=0 k=0
Xt
= S(t − k)∆u(k) (4.7)
k=0

Notice the similarity in form of this expression and of (4.2). Again, in practice we
should replace y(t) by y(t) − y(−1).

It is useful to note that the arguments t − k and k can be interchanged in (4.7), as


usual in convolutions: let ` = t − k, then
X
t
y(t) = S(t − k)∆u(k) (4.8)
k=0
X0
= S(`)∆u(t − `) (4.9)
`=t
X
t
= S(k)∆u(t − k) (4.10)
k=0

4.1.2 Relations to State-Space Models

Suppose the plant has the state-space model


x(k + 1) = Ax(k) + Bu(k) (4.11)
y(k) = Cy x(k) + Dy u(k) (4.12)
and suppose that x(0) = 0. Now apply a pulse input vector, so that u(0) 6= 0, but
u(k) = 0 for all k > 0. We get the following sequence of states and outputs:
x(0) = 0 y(0) = Dy u(0) (4.13)
x(1) = Bu0 y(1) = Cy Bu(0) (4.14)
x(2) = ABu(0) y(2) = Cy ABu(0) (4.15)
.. ..
. .
x(k) = Ak−1 Bu(0) y(k) = Cy Ak−1 Bu(0) (4.16)
.. ..
. .
4.1. Step and Pulse Response Models 125

It is clear from this sequence that the pulse response matrix sequence is given by

H(0) = Dy (which is often 0) (4.17)


H(1) = Cy B (4.18)
H(2) = Cy AB (4.19)
..
.
H(k) = Cy Ak−1 B (4.20)
..
.

The matrix Cy Ak−1 B is called the k’th Markov parameter of the state-space model.

From this we immediately get the step response sequence, using (4.3), as

S(0) = Dy (which is often 0) (4.21)


S(1) = Cy B + Dy (4.22)
S(2) = Cy AB + Cy B + Dy (4.23)
..
.
X
k−1
S(k) = Cy Ai B + Dy (4.24)
i=0
!
X
k−1
= Cy Ai B + Dy (4.25)
i=0
..
. (4.26)

Looking back at equations (2.66) and (2.72), and at Problems 11 and 12 of Chapter
2 — and remembering that here we must assume that y = z — one can see that most
of the expressions appearing in the matrices required for computing the predictions
needed for predictive control in fact involve the step response matrices. In particular,
recalling (3.5):

Z(k) = Ψx(k) + Υu(k − 1) + Θ∆U (k)

and the definitions of the matrices Υ and Θ, we see that


 
S(Hw )
 S(Hw + 1) 
 
Υ= ..  (4.27)
 . 
S(Hp )
126 4. Step Response and Transfer Function Formulations

and

 
S(Hw ) S(Hw − 1) ... 0
 S(Hw + 1) S(Hw ) ... 0 
 
 .. .. .. .. 
 . . . . 
 
Θ=
 S(Hu ) S(Hu − 1) ... S(1) 
 (4.28)
 S(Hu + 1) S(Hu ) ... S(2) 
 
 .. .. .. .. 
 . . . . 
S(Hp ) S(Hp − 1) ... S(Hp − Hu + 1)

So we can immediately use the results from Chapter 2 for prediction, and those from
Chapter 3 for obtaining a solution, if we have a step response model of the plant.
Well, not quite immediately, because the predictions in Chapter 2 made use of the
state x(k). With a step response model we do not seem to have a state, so we need
to replace x(k) with something else. The state of a system summarises its ‘past
history’ — if you know x(k) you don’t need to know anything that happened before
time k in order to predict its future behaviour. But now we do not have a state
accessible, so it is reasonable to expect that we will have to use ‘old’ information,
about what happened to the system before time k — in principle we need to look
infinitely far back into the past.

4.1.3 Prediction Using Step Response Model

In order to see what exactly we should do, it is easiest to start from first principles.
Given that the only model that we have of plant behaviour is the step response
(matrix) sequence {S(0), . . . , S(N )} (by assumption) — or, equivalently, the pulse
response sequence {H(0), . . . , H(N )}, and no disturbance model for the time being,
we can form predictions of future outputs, as:


X
ẑ(k + j|k) = ŷ(k + j|k) = H(i)ũ(k + j − i) (4.29)
i=1

where the input sequence {ũ} consists of known inputs from the past and predicted
inputs in the future:

(
u(i) if i < k,
ũ(i) = (4.30)
û(i|k) if i ≥ k.
4.1. Step and Pulse Response Models 127

Since we assume that H(i) ≈ 0 for i > N we approximate this prediction by


X
N
ẑ(k + j|k) = H(i)ũ(k + j − i) (4.31)
i=1
X
N X
j
= H(i)u(k + j − i) + H(i)û(k + j − i|k) (4.32)
i=j+1 i=1
" #
X
N X
j X
j−i
= H(i)u(k + j − i) + H(i) u(k − 1) + ∆û(k + j − i − `|k)
i=j+1 i=1 `=0
(4.33)
X
N X
j
= H(i)u(k + j − i) + H(i)u(k − 1) +
i=j+1 i=1

H(1)∆û(k + j − 1|k) + [H(1) + H(2)]∆û(k + j − 2|k) + . . . +


[H(1) + H(2) + . . . + H(j)]∆û(k|k) (4.34)
P
Now, recalling that S(j) = ji=1 H(j) (if we assume H(0) = 0), and that
X
j X
j
H(i)u(j − i) = S(i)∆u(j − i) (4.35)
i=1 i=1
we can write the prediction as
X
N X
j
ẑ(k + j|k) = S(i)∆u(k + j − i) + S(j)u(k − 1) + S(i)∆û(k + j − i|k)
i=j+1 i=1
(4.36)

Now from equation (2.66) we had (using the relations derived in the previous sub-
section, and remembering that z = y in this section):
X
j
ẑ(k + j|k) = Cy Aj x(k) + S(j)u(k − 1) + S(i)∆û(k + j − i|k) (4.37)
i=1
The second and third terms are the same in both cases. So we see that the term
 
Cy AHw
 .. 
Ψx(k) =  .  x(k) (4.38)
Cy A H p

which appears in the prediction when a state-space model is used must be replaced
by the term
  
S(Hw + 1) S(Hw + 2) · · · ··· ··· S(N − 1) S(N ) ∆u(k − 1)
 S(Hw + 2) S(Hw + 3) · · · ··· ··· S(N ) S(N )   ∆u(k − 2) 
  
 .. .. .. .. .. .. ..   .. 
 . . . . . . .  . 
S(Hp + 1) S(Hp + 2) · · · S(N ) ··· S(N ) S(N ) ∆u(k + Hw − N )
(4.39)
128 4. Step Response and Transfer Function Formulations

Not surprisingly, one must have N > Hp . In addition, one must store the last N −Hw
input moves (or input values). This gives a striking illustration of the ‘efficiency’ of
state-space models at representing the past history of a system.

A matrix such as this, with blocks along ‘anti-diagonals’ being the same, is called
a block-Hankel matrix. Such matrices appear frequently in systems theory, usually
when relating ‘past inputs’ to ‘future outputs’, as here.

The only disturbance model commonly used with step-response models is the ‘con-
stant output disturbance’ model that was treated in Section 2.3.2, and the distur-
bance is estimated using the ‘DMC scheme’ described there. The disturbance is
simply estimated as the difference between the measured and the predicted outputs:

ˆ
d(k|k) = y(k) − ŷ(k|k − 1), (4.40)

it is assumed that it will remain the same over the prediction horizon:

ˆ + j|k) = d(k|k)
d(k ˆ (4.41)

and this estimate is just added on to the prediction obtained previously:

X
N
ẑ(k + j|k) = S(i)∆u(k + j − i) + S(j)u(k − 1) +
i=j+1

X
j
+ ˆ + j|k)
S(i)∆û(k + j − i|k) + d(k (4.42)
i=1

Since we are now using an input-output model, there is no alternative to assuming


a disturbance which acts directly on the inputs or outputs. But it is not essential to
assume that such a disturbance remains constant. For example, one could assume
an exponentially decaying output disturbance:

ˆ + j|k) = αj d(k|k)
d(k ˆ with 0 < α < 1 (4.43)

The main reason why a constant disturbance is commonly assumed is that this
leads to integral action in the controller, as we shall see later in the book. More
complicated disturbance models can be handled much more systematically when one
uses state-space or transfer function models.

4.1.4 State-Space Models From Step Responses

There is really no good reason for working with step (or pulse) response models. If
one has such a model, one can easily obtain a state-space model which reproduces
the step response exactly, without losing anything. But this model will be of large
state dimension — N ×min(m, p) if the plant has m inputs, p outputs, and you want
to match N step response matrices. Usually it is possible to get an approximate
4.1. Step and Pulse Response Models 129

model of much lower state dimension, which matches the step response matrices
very closely. This subsection will describe one way in which this can be done.

First we start with a very simple method of getting state-space models, best de-
scribed by an example.

Example 4.1 Consider an example which is simple enough to work through by


hand. Suppose we have a 1-input, 1-output (SISO) system with step responses
S(0) = 0, S(1) = 0, S(2) = −1, S(3) = +2, S(k) = S(3) for k > 3. Note that
S(1) = 0 shows that this system has a delay between the input and output. The
corresponding pulse responses are H(0) = 0, H(1) = 0, H(2) = −1, H(3) = +3,
H(k) = 0 for k > 3. Since the pulse response becomes 0 after 3 steps and we have
only 1 input and output, we need at most 3 states. In order to get a ‘finite impulse
response’ or ‘FIR’ model, all the eigenvalues of the ‘A’ matrix will have to be at 0.
So a suitable (but not the only) choice is
 
0 1 0
A= 0 0 1 
0 0 0

This does not determine B and C uniquely, but try


 
0
B= 0 
1

(This combination of A and B is known as the controller form of a state-space model


[Kai80].) Now C = [c1 , c2 , c3 ] is determined uniquely from the equations:

CB = c3 = 0
CAB = c2 = −1
CA2 B = c1 = 3

namely C = [3, −1, 0]. And D = 0 since H(0) = 0.

A state-space model for any single-input, single-output (‘SISO’) system can be ob-
tained from step response data in this way. Even for a multivariable system it is
possible to use this method for one input at a time, and then combine the 1-input
models. However for large N , and with more than one input and output, numerical
problems begin to arise. And models obtained in this form (the ‘controller form’)
tend to have numerical problems.

A better practical algorithm is the following. Recall from subsection 4.1.2 that the
pulse response matrices are related to the state-space matrices by
(
D (k = 0)
H(k) = k−1
CA B (k > 0)
130 4. Step Response and Transfer Function Formulations

Hence we have the following relationship:


   
H(1) H(2) · · · CB CAB · · ·
 H(2) H(3) · · ·   CAB CA2 B · · · 
 =  (4.44)
.. .. .. .. .. ..
. . . . . .
 
C
 CA 
 
=  CA2  [B, AB, A2 B, . . . ] (4.45)
 
..
.

That is, the block-Hankel matrix built up from the pulse response matrices factorises
into the product of the (extended) observability and controllability matrices. Since
each of these has rank n for a minimal state-space system of state dimension n, the
block-Hankel matrix must also have rank n.

Given a set of step response matrices S(0), . . . , S(N ), we obtain a corresponding set
of pulse response matrices H(0), . . . , H(N ), and assemble them into a block-Hankel
matrix, as shown in (4.44). The rank of this matrix will usually be large. But it is
usually ‘close’ to a matrix of much lower rank. The idea now is to approximate it by
a lower-rank matrix, factorise it into two low-rank matrices, and compute A, B, and
C from these. The essential tool for doing this is the Singular Value Decomposition
or SVD — see Minitutorial 4.

Suppose that the available pulse response matrices are assembled into an ‘anti-upper
triangular’ block-Hankel matrix as follows:
 
H(1) H(2) · · · H(N )
 H(2) H(3) · · · 0 
 
HN =  .. .. .. ..  (4.49)
 . . . . 
H(N ) 0 ··· 0

Now obtain an SVD of this matrix:

HN = U ΣV T . (4.50)

This has rank N × min(m, p). But the singular values usually approach zero very
quickly, so that HN is usually close to a matrix of lower rank. Somehow choose a
value n < N × min(m, p). This step is not rigorous, but for example one can choose
n such that σn < σ1 /100, or some similar (heuristic) criterion. It is sometimes
suggested that one should choose n such that there is a significant ‘gap’ between σn
and σn+1 , but with real data no such gap is usually evident. Let Σn be the result
of replacing σn+1 , σn+2 , . . . in Σ by zeros.

Now we have

Hn = U Σ n V T (4.51)
4.1. Step and Pulse Response Models 131

Let M be any matrix of dimensions p × m. It can always be factorised as

M = U ΣV T (4.46)

where U U T = Ip , V V T = Im , and Σ is a rectangular matrix of dimensions p × m


which has non-zero entries only on its leading diagonal. For the case p < m it looks
like:
 
σ1 0 ··· 0 0 ··· 0
 0 σ2 ··· 0 0 ··· 0 
 
Σ= . .. .. .. .. . . .. 
 .. . . . . . . 
0 0 ··· σN 0 ··· 0

and σ1 ≥ σ2 ≥ . . . ≥ σN ≥ 0. This factorisation is called the Singular Value


Decomposition. The σ’s are called the Singular Values of M .
The number of positive (non-zero) σ’s is the rank of the matrix. If one replaces Σ
by Σn , in which σn+1 , σn+2 , . . . , σN are replaced by zeros (where n < N ), then the
matrix

Mn = U Σn V T

has rank n. Furthermore the matrix Mn is the best rank-n approximation to M ,


in the sense that the error kM − Mn kF = σn+1 is the smallest possible among all
rank-n matrices. (kXkF denotes the Frobenius norm, which pis just the square root
of the sum of the squares of all the elements of X: kXkF = trace(X T X).)
The SVD can be computed extremely reliably, even for very large matrices, although
it does involve some heavy computation. The flop count increases as (min(m, p))3 .
In MATLAB it can be obtained by the function svd: [U,S,V] = svd(M)
The SVD is of great importance in numerical linear algebra [GL89], and in multi-
variable robust control theory [Mac89, ZDG96].
The Moore-Penrose pseudo-inverse of M is obtained from its SVD as

M † = V Σ† U T (4.47)

where Σ† is obtained from Σ by replacing each positive σi by 1/σi .


The largest singular value, σ1 , is an induced norm of M :

kM xk
σ1 = sup (4.48)
x6=0 kxk

This is the origin of the importance of the SVD in robust control theory.
Mini-Tutorial 4: The Singular Value Decomposition
132 4. Step Response and Transfer Function Formulations

as a rank-n approximation to HN , and we can factorise it as follows: define


 
1/2 In
Ωn = U Σn (4.52)
0

and

Γn = [In , 0]Σ1/2 T
n V . (4.53)
1/2 √
where Σn is the same as Σn , but with each σi replaced by σi . Note that Ωn has
n columns, Γn has n rows, and

Hn = Ω n Γn (4.54)

Now the idea is to find the A,B and C matrices of an n-state model, which have Ωn
and Γn as their observability and controllability matrices, respectively.

Finding B and C is easy: just take B as the first m columns of Γn , and take C
as the top p rows of Ωn . Finding A is almost as easy. Notice that if an (exact)
observability matrix Ω is ‘shifted upwards’ by p rows to form the matrix Ω↑ , then
Ω↑ = ΩA. So if we obtain Ω↑n from Ωn by shifting it upwards by p rows, then we
can estimate a suitable A by solving the equation

Ω↑n = Ωn A (4.55)

This equation is usually overdetermined, so there is no exact solution, but it can be


solved in a least-squares sense. It can be shown that the least-squares solution is
given by

A = Σ−1/2
n U T U ↑ Σ1/2
n (4.56)

where U ↑ is the same as U , but shifted upwards by p rows.

The algorithm described here is due to Kung [Kun78] and to Zeiger and McEwen
[ZM74]. It can be shown that if n is taken as the largest possible value, namely n =
N × min(m, p), then the state-space model obtained reproduces the pulse response
(and hence the step response) exactly, and all the eigenvalues of A are then at zero,
so that it is a ‘deadbeat’ or ‘finite impulse response’ model.

Example 4.2 Applying this method to the problem of Example 4.1, with n = N = 3,
gives
   
−0.7021 0.5117 −0.0405 1.0430
A =  −0.5117 0.0023 0.4807  B =  −1.2499 
−0.0405 −0.4807 0.6998 0.6887
C = [1.0430, 1.2499, 0.6887] D=0

The reader can check that it reproduces the original step response exactly.
4.1. Step and Pulse Response Models 133

An interesting property of this algorithm is that, once one has a model for a given
value of n, it is possible to obtain the model for a smaller value, say q, by ‘truncating’
the matrices: Aq = An (1 : q, 1 : q), Bq = Bn (1 : q, :), and Cq = Cn (:, 1 : q), using
MATLAB notation. So the heavy computation involved in finding the SVD has to
be done only once, and a range of approximate linear realizations of various state
dimensions is then easily obtained. For more details of this, and the associated topic
of approximation by balanced truncation or balanced model reduction, see [Mac89,
ZDG96].

Example 4.3 Figure 4.1 shows the step responses of a high-fidelity, first-principles,
nonlinear simulation of a 3-input, 2-output distillation column. The solid curves
show the original responses, while the dotted curves show the approximate responses
achieved by a model obtained using the algorithm described above, with only 8 states.
Note that some of the responses have quite intricate shapes; yet a model with such a
low number of states was able to reproduce these quite accurately.

The original step response data was sampled at 10 second intervals, and 250 samples
were available (N = 250). A model of largest possible state dimension was first
obtained, namely one with min(2, 3) × 250 = 500 states. This matched the original
step responses exactly, as expected.

Figure 4.2 shows the first 15 singular values (of 500) of the block-Hankel matrix HN .
Assessing these ‘by eye’ indicates that about 8 states should be enough for a good
approximation. The 8-state model was obtained by following the algorithm described
above, with n = 8.

The data for this example is available in the DAISY database of data used for various
system identification exercises, which is available on the World-Wide Web1 . A brief
description of the data, and relevant references, are available in DAISY.

The state of the state-space model constructed above does not have any direct
physical interpretation. It is possible to otain state-space models from step reponses
in such a way that the elements of the state vector do have physical interpretations,
so long as one does not approximate the model by one with a smaller state vector.
For example, Lee et al give a way of constructing a state-space model in which the
state variables can be interpreted as future outputs [LMG94]. In [CC95, CC99]
an alternative is given, in which the state vector contains past values of the plant
outputs and control moves.

Note that the procedure:

step tests → step responses → state-space model


1
URL: http://www.esat.kuleuven.ac.be/sista/daisy/
134 4. Step Response and Transfer Function Formulations

4
x 10
2.45 0.287

2.44

2.43 0.286

2.42

2.41 0.285

2.4

2.39 0.284
0 100 200 300 0 100 200 300
step response from u1 to y1 step response from u1 to y2

4
x 10
1.215 0.1435

1.21
0.143

1.205

0.1425
1.2

1.195 0.142
0 100 200 300 0 100 200 300
step response from u2 to y1 step response from u2 to y2

5
x 10
1.2 1.45

1.18
1.445
1.16
1.44
1.14
1.435
1.12

1.1 1.43
0 100 200 300 0 100 200 300
step response from u3 to y1 step response from u3 to y2

Figure 4.1: Step response of 3-input, 2-output distillation column. Solid curves:
original responses. Dotted curves: responses of 8-state model.
4.2. Transfer Function Models 135

160

140

120

100

80

60

40

20

0
0 2 4 6 8 10 12 14 16

Figure 4.2: The first 15 singular values of H250 for the example.

is not a particularly good one. In general it is better to go directly from step or


other tests (or possibly normal operating data) to a state-space model, using meth-
ods of System Identification which have good statistical properties [Lju89, Nor86].
Recently, subspace methods have been developed which are particularly effective for
multivariable systems [vOdM96]; these are in some ways similar to the algorithm
described in this section, but they can be used with arbitrary input-output data,
not just with step or pulse responses.

4.2 Transfer Function Models

4.2.1 The Basics

We will use z to denote both the ‘time advance’ operator and the complex variable
used with z-transforms. Since z −1 is the transfer function of a one-step time delay,
there is no inconsistency between writing w̄(z) = z −1 ȳ(z) as the z-transform of a
delayed version of the signal {y(k)}, and writing w(k) = z −1 y(k) to denote that
w(k) = y(k − 1). For most purposes the interpretation of z −1 as a time delay
operator will be the one required. (Many texts use q −1 to denote the time delay
operator, perhaps to emphasise this interpretation rather than the transform one.)

We will take the plant to be described by the input-output difference equation

A(z −1 )y(k) = z −d B(z −1 )u(k). (4.57)


136 4. Step Response and Transfer Function Formulations

In the case of a single-input, single-output plant A(z −1 ) and B(z −1 ) are the poly-
nomials:

A(z −1 ) = 1 + a1 z −1 + · · · + an z −n (4.58)
−1 −1 −n
B(z ) = b 0 + b1 z + · · · + bn z (4.59)

so that (4.57) can also be written as the difference equation

y(k) + a1 y(k − 1) + · · · + an y(k − n) =


b0 u(k − d) + b1 u(k − d − 1) + · · · + bn u(k − d − n) (4.60)

The input-output delay d has been ‘pulled out’ of the polynomial B(z −1 ). This is
convenient, but not essential.

We can also define the polynomials Ã(z) and B̃(z) as

Ã(z) = z n A(z −1 ) = z n + a1 z n−1 + · · · + an (4.61)


−1
n
B̃(z) = z B(z n
) = b 0 z + b1 z n−1
+ · · · + bn (4.62)

If we take z-transforms of the input and output sequences, then we obtain the
transfer-function description

B(z −1 ) B̃(z)
ȳ(z) = P (z)ū(z) = z −d ū(z) = z −d ū(z) (4.63)
A(z −1 ) Ã(z)

For multivariable systems, A(z −1 ) and B(z −1 ) are the polynomial matrices:

A(z −1 ) = Ip + A1 z −1 + · · · + An z −n (4.64)
B(z −1 ) = B0 + B1 z −1 + · · · + Bn z −n (4.65)

where each Ai is a matrix of dimensions p × p, and each Bi is a matrix of dimensions


p × m. Polynomial matrices Ã(z) and B̃(z) can be defined as

Ã(z) = z n A(z −1 ) (4.66)


B̃(z) = z n B(z −1 ) (4.67)

and we now have a transfer function matrix description

ȳ(z) = P (z)ū(z) = z −d A(z −1 )−1 B(z −1 )ū(z) = z −d Ã(z)−1 B̃(z)ū(z) (4.68)

Note that pulling out the delay d is not very useful in the MIMO case, because
in general each input-output channel may have a different delay. However, setting
d = 1 represents the assumption that the input u(k) does not affect y(k) — the
model is ‘strictly proper’. These polynomial matrix and transfer function matrix
descriptions are much less useful and convenient than in the SISO case, although in
principle nearly everything can be carried over to the multivariable case. We will
therefore confine ourselves almost entirely to the SISO case in this Chapter.
4.2. Transfer Function Models 137

The transfer function matrix (4.68) with d = 1 corresponds to the multivariable


(vector) difference equation

y(k + 1) = −A1 y(k) − A2 y(k − 1) − · · · − An y(k − n + 1) +


B1 u(k) + B2 u(k − 1) + · · · + Bn u(k − n) (4.69)
where the matrices Ai and Bi are the same as those in (4.64) and (4.65). This form is
quite convenient for computing predictions, even in the multivariable case. Several
MPC products allow plant descriptions to be defined in this form. If a (vector) ‘white
noise’ term is added to the right-hand side of (4.69) then this model corresponds to
the form known in time-series analysis as AutoRegressive with eXogenous inputs or an
ARX model. Some of the MPC products use this terminology in their documentation
— see Appendix A.

It is important to be able to move between transfer-function and state-space de-


scriptions. Suppose we have a standard state-space model:
x(k + 1) = Ax(k) + Bu(k) y(k) = Cx(k) + Du(k). (4.70)

Take z-transforms of these:

z x̄(z) − x(0) = Ax̄(z) + B ū(z) ȳ(z) = C x̄(z) + Dū(z) (4.71)


from which we have, assuming x(0) = 0:
x̄(z) = (zI − A)−1 B ū(z) (4.72)

and hence

ȳ(z) = [C(zI − A)−1 B + D]ū(z) (4.73)


so that we have
P (z) = C(zI − A)−1 B + D (4.74)
This holds for both SISO and multivariable systems. It can be seen that it is easy to
obtain a transfer function matrix, given a state-space model. However, it is not easy
to obtain the polynomial matrices A(z −1 ) and B(z −1 ) in the multivariable case.
Going in the opposite direction, from a transfer function to a state-space model,
is not so straightforward, but there are algorithms for doing so (see [Kai80], for
example), which are quite reliable for SISO systems. MATLAB’s Control System
Toolbox has the functions ss2tf and tf2ss for performing these conversions.

We can also move between transfer function models and step response or pulse
response models. In fact, the transfer function is defined as the z-transform of the
pulse response, so that:

X
P (z) = z −k H(k) (4.75)
k=0
= H(0) + z −1 H(1) + z −2 H(2) + · · · (4.76)
= D + z −1 CB + z −2 CAB + · · · (4.77)
138 4. Step Response and Transfer Function Formulations

(where the last line applies if we have a state-space model). This means that, at
least in the SISO case, we can obtain the pulse response from the transfer function
by ‘long division’.

Example 4.4 Consider the transfer function

1 − 0.7z −1
P (z) = z −1 (4.78)
1 − 1.6z −1 + 0.6z −2
z − 0.7
= 2 (4.79)
z − 1.6z + 0.6

By long division we can expand P (z) as a series in z −1 :

0(z 2 − 1.6z + 0.6) + z − 0.7 z − 0.7


→0+
z 2 − 1.6z + 0.6 − 1.6z + 0.6
z2
z (z − 1.6z + 0.6) + 0.9 − 0.6z −1
−1 2 0.9 − 0.6z −1
→ 0 + 1z −1 + 2
z 2 − 1.6z + 0.6 z − 1.6z + 0.6
0.9z (z − 1.6z + 0.6) + 0.84z −1 − 0.54z −2
−2 2
→ 0 + 1z −1 + 0.9z −2 + · · ·
z 2 − 1.6z + 0.6

and so on.

Hence we have the pulse response H(0) = 0, H(1) = 1, H(2) = 0.9, . . . .

We can also see from (4.75) that a finite pulse response corresponds to a transfer
function with all its poles at 0.

Example 4.5 If H(0) = 3, H(1) = −2, H(2) = 1, H(k) = 0 for k > 2, then

3z 2 − 2z + 1
P (z) = 3 − 2z −1 + 1z −2 =
z2

4.2.2 Prediction Using Transfer Functions

We can rewrite (4.60) as

y(k) = −a1 y(k − 1) − · · · − an y(k − n) + b0 u(k − d) + · · · + bn u(k − d − n) (4.80)

and we can use this as the basis for prediction, if d ≥ 1. (Recall that we assume
u(k) is not yet known when we predict ŷ(k + i|k).)
4.2. Transfer Function Models 139

The obvious way of predicting the output is as follows:


X
n X
n
ŷ(k + 1|k) = − aj y(k + 1 − j) + bj ũ(k − d − j) (4.81)
j=1 j=0
X
n X
n
ŷ(k + 2|k) = −a1 ŷ(k + 1|k) − aj y(k + 2 − j) + bj ũ(k + 1 − d − j) (4.82)
j=2 j=0
..
. (4.83)

or, in general,
X
n X
n
ŷ(k + i|k) = − aj ỹ(k − j) + bj ũ(k − d − j) (4.84)
j=1 j=0

or

A(z −1 )ỹ(k + i) = z −d B(z −1 )ũ(k + i) (4.85)

where
(
u(`) if ` < k
ũ(`) = (4.86)
û(`|k) if ` ≥ k

and
(
y(`) if ` ≤ k
ỹ(`) = (4.87)
ŷ(`|k) if ` > k

(We referred to this earlier as ‘re-aligning’ the model — see sections 1.6 and 2.6.4.)
Since the prediction ŷ(k + i|k) depends on some other predicted outputs, which are
themselves obtained from measurements of past outputs, it is possible to find an
expression for ŷ(k + i|k) which depends only on the measured outputs y(k), y(k −
1), . . . (and of course, on actual past inputs and predicted future inputs). This
saves on computation, which is particularly important in applications to adaptive
control, where the predictors — as well as the predictions themselves — have to be
computed on-line. It also gives some insight into the way the predictor design affects
the predictive controller.

Suppose we have a polynomial Ei (z −1 ), of degree no greater than i−1, (i is a positive


integer), and a polynomial Fi (z −1 ), of degree n − 1, such that

1 −1
−1 −i Fi (z )
= Ei (z ) + z (4.88)
A(z −1 ) A(z −1 )
or

Ei (z −1 )A(z −1 ) = 1 − z −i Fi (z −1 ) (4.89)
140 4. Step Response and Transfer Function Formulations

Multiplying (4.85) by Ei (z −1 ) gives


[1 − z −i Fi (z −1 )]ỹ(k + i) = z −d Ei (z −1 )B(z −1 )ũ(k + i) (4.90)

or

ỹ(k + i) = z −i Fi (z −1 )ỹ(k + i) + z −d Ei (z −1 )B(z −1 )ũ(k + i) (4.91)


Now notice that z −i ỹ(k + i) is just y(k), and hence z −i Fi (z −1 )]ỹ(k + i) involves only
measured values of past outputs. So we can write the predicted output as
ŷ(k + i|k) = Fi (z −1 )y(k) + z −d Ei (z −1 )B(z −1 )ũ(k + i) (4.92)
which does not involve any predicted outputs on the right hand side of the equation.
All this depends on having solutions Ei (z −1 ) and Fi (z −1 ) to equation (4.89). This
is an example of a Diophantine equation, and much theory exists about solving such
equations — see Minitutorial 4.2.2.

There is an interesting interpretation that can be made of equation (4.92). Multiply


both sides of (4.88) by B(z −1 ):
B(z −1 ) −1
−i Fi (z )B(z ))
−1
Ei (z −1 )B(z −1 ) = − z (4.96)
A(z −1 ) A(z −1 )
Substituting this into (4.92) we get
 −1 −1 −1

−1 −d B(z ) −i Fi (z )B(z ))
ŷ(k + i|k) = Fi (z )y(k) + z −z ũ(k + i) (4.97)
A(z −1 ) A(z −1 )
 
B(z −1 ) −d B(z )
−1
= z −d ũ(k + i) + Fi (z −1
) y(k) − z u(k) (4.98)
A(z −1 ) A(z −1 )
This shows that the prediction has a ‘predictor-corrector’ structure. This is different
from the predictor-corrector structure used for the observer in Chapter 2, however.
Here the predictions z −d (B/A)ũ(k+i) and z −d (B/A)u(k) are ‘long-term’ predictions
made on the basis of input signals only, not corrected by output measurements at
any time. In Chapter 2 the observer predicts only one step ahead, on the basis of
output measurement y(k − 1), before it is corrected by the next measurement, y(k).
Nevertheless, we will be able to relate this prediction to predictions obtained by a
state observer in a later subsection.

4.2.3 Prediction with a Disturbance Model

In this section we will assume that the plant has an unmeasured output disturbance,
which is modelled as some other signal passed through a filter with transfer function
C(z −1 )/D(z −1 ):
B(z −1 )
y(k) = z −d u(k) + d(k) (4.99)
A(z −1 )
C(z −1 )
d(k) = v(k) (4.100)
D(z −1 )
4.2. Transfer Function Models 141

A Diophantine equation is one of the form

A(z −1 )X(z −1 ) + B(z −1 )Y (z −1 ) = C(z −1 ) (4.93)


or X(z −1 )A(z −1 ) + Y (z −1 )B(z −1 ) = C(z −1 ) (4.94)

where all the variables are either polynomials or polynomial matrices. We will
consider only the scalar case, when they are all polynomials, in which case these
two equations are the same. In these equations, A(z −1 ), B(z −1 ) and C(z −1 ) are
assumed to be known, while X(z −1 ) and Y (z −1 ) are unknown polynomials.
If X0 and Y0 is a pair of solutions of the Diophantine equation, then it is clear that
X = X0 − B2 P and Y = Y0 + A2 P is also a pair of solutions, if A2 and B2 are
polynomials such that B2 /A2 = B/A, and P is any polynomial. This follows since

A(X0 − B2 P ) + B(Y0 + A2 P ) = AX0 + BY0 + (BA2 − AB2 )P = C

So it is clear that the solution (pair) of a Diophantine equation is not unique. How-
ever, a solution in which either X or Y has the smallest possible degree is unique,
and can be obtained as follows. Find polynomials Q and Γ such that Y0 = A2 Q + Γ.
(This is itself a Diophantine equation, but simpler than the general one.) These
can be obtained by ‘long division’: Q is the quotient, and Γ the remainder, of the
division Y0 /A2 . The degree of Γ is necessarily smaller than the degree of A2 . Hence
we have Y = Y0 + A2 P = A2 (Q + P ) + Γ. Now take P = −Q to make the degree
of Y as small as possible. Then we have the unique solution pair X = X0 + B2 Q,
Y = Γ. Similarly, a solution pair in which either X or Y has a specified degree is
unique.
An important special case of Diophantine equations arises if C(z −1 ) = 1, in which
case the equation is also known as the Bezout identity. This has a solution if and
only if A and B are coprime — have no common factors. For suppose that they did
have a common factor D, so that A = P D and B = QD. Then the Bezout identity
would be D(P X + QY ) = 1, which is impossible unless D = 1. Because of this, the
Bezout identity plays a large role in the theory of feedback stability, and in system
theory.
When used for predicting stochastic processes we usually have B(z −1 ) = z −i when
finding an i-step-ahead prediction. Rewriting the Diophantine equation as

z −i C(z −1 )
Xi (z −1 ) + Y i (z −1
) = (4.95)
A(z −1 ) A(z −1 )

and imposing the requirement that Xi be of degree i − 1, shows that the coefficients
in Xi are the first i terms in the pulse response of the transfer function C/A. If
both A and C have degree n, then Yi must have degree n − 1. For more details see
[ÅW84]. There is an efficient recursive algorithm for computing the coefficients in
Xi and Yi for a sequence of values of i [Soe92].
Mini-Tutorial 5: Diophantine Equations
142 4. Step Response and Transfer Function Formulations

in which we assume that

C(z −1 ) = 1 + c1 z −1 + . . . + cν z ν (4.101)
−1 −1 ν
D(z ) = 1 + d1 z + . . . + dν z (4.102)
Note that we can take both C(z −1 ) and D(z −1 ) to be monic (their leading coefficients
are 1), because the magnitude of v(k) can be adjusted to compensate for this if
necessary.

This model is general enough to allow both deterministic and stochastic disturbances
to be modelled, as well as mixtures of these. Deterministic disturbances are usually
modelled by taking C(z −1 ) = 1 (ci = 0) and making only the first few values of v(k)
non-zero.

Example 4.6 Constant output disturbance. If we take C(z −1 ) = 1, D(z) = 1−z −1 ,


and v(0) = v0 , v(k) = 0 for k > 0, then we get
d(k) − d(k − 1) = v(k) (4.103)
and hence d(0) = v0 , d(1) = v0 , d(2) = v0 , . . . . That is, we have modelled a
constant output disturbance of unspecified magnitude v0 . So this would be equivalent
to the disturbance model assumed by the DMC scheme.

Example 4.7 Sinusoidal disturbance. To model a sinusoidal output disturbance of


known frequency ω0 , but unknown amplitude and phase, we can take C(z −1 ) = 1
and
 
D(z −1 ) = 1 − z −1 ejω0 Ts 1 − z −1 e−jω0 Ts (4.104)
= 1 − 2 cos(ω0 Ts )z −1 + z −2 (4.105)

where Ts is the sampling interval, and v(0) = v0 , v(1) = v1 . Then the z-transform
of d(k) is given by

¯ = v0 + v1 z −1
d(z) (4.106)
1 − 2 cos(ω0 Ts )z −1 + z −2
which is the z-transform of a signal of the form
d(k) = A cos(ω0 Ts k + φ) (4.107)

To model a stationary, zero-mean stochastic disturbance we can take v(k) to be


a ‘white noise’ process, namely E{v(k)2 } = σ 2 , E{v(k)v(k − `)} = 0 for ` 6= 0,
the probability distribution of v(k) being the same for all k, and each v(k) being
independent of v(`) if ` 6= k. Then, if C(z −1 )/D(z −1 ) is an asymtpotically stable
transfer function, d(k) will be a stationary process with spectral density
|C(e−jωTs )|2
Φdd (ω) = σ 2 . (4.108)
|D(e−jωTs )|2
4.2. Transfer Function Models 143

Note that since |C(e−jωTs )|2 = C(e−jωTs )C(e+jωTs ), it is always possible to choose
C(z −1 ) such that all its roots lie inside the unit disk — that is, without restricting
the spectral densities which can be modelled in this way. Also, for the same reason,
factors of z −j in C(z −1 ) do not affect the spectral density.

Example 4.8 Disturbances due to crew movements on board a spacecraft can be


modelled approximately as a stochastic process with a spectral density which has
a peak value at ω0 = 0.12 rad/sec, and becomes zero at low frequencies. With a
sampling interval Ts = 0.6 sec, we have ω0 Ts = 0.072 rad. Hence choose
C(z −1 ) 1 − z −1
= (4.109)
D(z −1 ) (1 − ρe−j0.072 z −1 )(1 − ρe+j0.072 z −1 )
with ρ < 1 determined by the sharpness of the peak. Figure 4.3 shows the spectral
density for ρ = 0.98 and σ = 1.
Singular Values

30

25

20

15
Singular Values (dB)

10

−5

−10

−15

−20
0.001 0.01 0.1 1 10
Frequency (rad/sec)

Figure 4.3: Spectral density of crew disturbance, modelled by (4.109) with ρ = 0.98.

(Note: This model of crew disturbances is probably more appropriate as a model of


input disturbances (eg torques) than of output disturbances — but it illustrates the
point. The details may not be correct for real crew disturbance spectra.)

When a disturbance model of the form (4.99) – (4.100) is present, solutions of a


Diophantine equation can again be used to obtain the predicted outputs. Now we
assume that we have polynomials Ei0 (z −1 ) and Fi0 (z −1 ) which solve the equation
C(z −1 ) F 0 (z −1 )
−1
= Ei0 (z −1 ) + z −i i −1 (4.110)
D(z ) D(z )
144 4. Step Response and Transfer Function Formulations

with Ei0 (z −1 ) of degree at most i − 1, and Fi0 (z −1 ) of degree at most ν − 1. That is,
these polynomials solve the Diophantine equation

Ei0 (z −1 )D(z −1 ) = C(z −1 ) − z −i Fi0 (z −1 ). (4.111)

Note that in this case the first term on the right hand side is the polynomial C(z −1 ),
whereas in (4.89) it was 1. This difference arises because the plant input u is known,
whereas the disturbance v is not. Using (4.110) in (4.100) we get
 0 (z −1 ) 
0
ˆ + i|k) = E (z ) + z −1 −i Fi
d(k v̂(k + i|k) (4.112)
i
D(z −1 )
F 0 (z −1 )
= Ei0 (z −1 )v̂(k + i|k) + i −1 v̂(k|k) (4.113)
D(z )
Now the difference from our previous use of the Diophantine equation is that al-
though we have split the prediction up into ‘future’ and ‘past’ terms, in this case we
do not know the ‘past’ process {v(k)}. This has to be estimated somehow.

From (4.99) and (4.100) we have

B(z −1 ) C(z −1 )
y(k) = z −d u(k) + v(k) (4.114)
A(z −1 ) D(z −1 )

Consequently we can estimate v(k) as


 
D(z −1 ) −1
−d B(z )
v̂(k|k) = y(k) − z u(k) (4.115)
C(z −1 ) A(z −1 )
D(z −1 )
= [y(k) − ŷ(k)] (4.116)
C(z −1 )

where ŷ(k) is the output prediction obtained by filtering the input u through the
model of the plant. Here we see the importance of ensuring that C(z −1 ) has all its
roots inside the unit disk — if it did not, this estimator would be unstable.

There is an ambiguity in the interpretation of (4.115). We can interpret it as meaning


that v̂(k|k) should be generated as shown in Figure 4.4. In this case ŷ(k) is a ‘long-
term’ prediction of y(k), obtained without correction by actual measured past values.
This is corrected at only one point in time, namely k, by the measurement y(k), and
the corrected value is filtered further, by D/C.

An alternative interpretation is obtained by multiplying through by C(z −1 )A(z −1 ),


which gives

A(z −1 )C(z −1 )v̂(k|k) = A(z −1 )D(z −1 )y(k) − z −d B(z −1 )D(z −1 )u(k) (4.117)

This can be solved as a ‘re-aligned’ difference equation, with the interpretation that
z −i v̂(k|k) = v̂(k − i|k − i). (Which is not the only possible one — for example one
could use the interpretation z −i v̂(k|k) = v̂(k − i|k), using some ‘smoothed’ estimate
of v(k − i).) These two interpretations are not the same; different estimates are
4.2. Transfer Function Models 145

u(k) −1
z −d B(z )
A(z −1 )
+
v̂(k|k)
D(z −1 )
C(z −1 )

y(k) −

Figure 4.4: Generation of v̂(k|k) — one interpretation.

obtained. The interpretation shown in Figure 4.4 seems to be more ‘correct’, while
that of (4.117) seems more sensible, since more information is being used, because
past measurements y(k), y(k − 1), . . . are being used at time k, rather than y(k)
only. In practice the difference equation (re-aligned model) interpretation is the one
used, and that is what we shall assume.

Now we have for the ‘i-step-ahead’ predicted output:

B(z −1 ) Fi0 (z −1 )
ŷ(k + i|k) = z −d ũ(k + i) + E 0 −1
(z )v̂(k + i|k) + v̂(k|k) (4.118)
A(z −1 ) i
D(z −1 )
B(z −1 )
= z −d ũ(k + i) + Ei0 (z −1 )v̂(k + i|k) +
A(z −1 )
 
Fi0 (z −1 ) −d B(z )
−1
+ y(k) − z u(k) (4.119)
C(z −1 ) A(z −1 )

where we have used (4.117) to get the second equality.

Before getting too alarmed at this expression, the reader should note that usually
some simplifications are introduced, as for example in the next subsection.

This prediction includes the term Ei0 (z −1 )v̂(k + i|k), which contains only predictions
of future values of v(k). The best way of making these predictions should depend
on the assumptions being made about the nature of the disturbance. However, it
is not sensible to assume that v(k) is a signal which is predictable in any way —
because if that was the case, then such a belief should already have been reflected
in the choice of the C and D polynomials. If we believe that the disturbance d(k)
is deterministic, then that usually corresponds to the belief that v(k) = 0, as we
saw in the earlier examples. In such a case the estimate v̂(k|k) serves as an ‘initial
condition’ (together with the previous one or two estimates, perhaps), but it is then
appropriate to assume that v̂(k + i|k) = 0 for i > 0.

On the other hand, if the disturbance is assumed to be stochastic, then one can
consider predicting v(k + i) in such a way as to optimise the prediction ŷ(k + i|k) in
some way. The usual choice at this point is to go for a minimum variance prediction.
The idea is to form the prediction in such a way that the variance of the error between
146 4. Step Response and Transfer Function Formulations

the predicted and the actual values, E{||y(k+i)− ŷ(k+i|k)||2 } is as small as possible.
But there is a theorem in probability theory which says that the minimum variance
prediction is obtained by choosing ŷ(k+i|k) = E{y(k+i)|k}, namely the conditional
mean value, the conditioning being on all the information available at time k. (See
[Mos95, ÅW84] for more details.) Now the conditional mean of a sum of terms is
the sum of the conditional means, so we should choose v̂(k + i) = E{v(k + i)|k}.
But in the stochastic case {v(k)} is assumed to be a zero-mean white-noise process,
so its conditional mean is the same as its unconditional mean, namely 0, so we set
v̂(k + i) = 0. Thus finally we have the minimum variance predictor:

B(z −1 )
ŷ(k + i|k) = z −d ũ(k + i) +
A(z −1 )
 
Fi0 (z −1 ) −1
−d B(z )
+ y(k) − z u(k) (4.120)
C(z −1 ) A(z −1 )

For the purpose of solving the predictive control problem, it is necessary to separate
out the ‘free response’ part of this — the predicted response which would occur if
∆û(k + i|k) = 0 — from the ‘forced response’, namely that part which depends on
∆û(k + i|k). In other words, it is necessary to separate out the part which depends
on the past from that which depends on future inputs. This can be done by solving
another Diophantine equation.

Since the only signal which crosses over the ‘past-future’ boundary in the prediction
(4.120) is ũ, and that is filtered by the transfer function z −d B/A, we need to extract
the first i − d + 1 terms of the pulse response of B/A when finding ŷ(k + i|k). (Only
i−d+1 because the signal is delayed by d steps, so we do not need to consider inputs
which occur later than k + i − d. Our ‘past-future’ boundary is between k − 1 and
k.) Thus we need to find the solution pair (Ei (z −1 ), Fi (z −1 )) of the Diophantine
equation

B(z −1 ) −1
−1
−(i−d) Fi (z )
= Ei (z ) + z (4.121)
A(z −1 ) A(z −1 )

with the degree of Ei no bigger than i − d. (Note that this is not quite the same as
4.2. Transfer Function Models 147

(4.88).) Substituting this into (4.120) we get


 
Fi (z −1 )
ŷ(k + i|k) = z −d Ei (z −1 ) + z −(i−d) ũ(k + i) +
A(z −1 )
 
Fi0 (z −1 ) −1
−d B(z )
y(k) − z u(k) (4.122)
C(z −1 ) A(z −1 )
= Ei (z −1 )û(k + i − d) +
| {z }
future
 
Fi (z −1 ) Fi0 (z −1 ) −1
−d B(z )
u(k − 1) + y(k) − z u(k) (4.123)
A(z −1 ) C(z −1 ) A(z −1 )
| {z }
past
= Ei (z −1 )û(k + i − d) +
| {z }
future
Fi0 (z −1 ) z −1 Fi (z −1 )C(z −1 ) − z −d Fi0 (z −1 )B(z −1 )
y(k) + u(k)
C(z −1 ) A(z −1 )C(z −1 )
| {z }
past
(4.124)

In order to express the set of output predictions ŷ(k + i|k) for i = 1, . . . , Hp in


a matrix-vector notation similar to that of (2.23), it is neccessary to compute the
filtered signals (1/C)y and (1/AC)u, which can be done by computing one new term
of each signal at each step. Since each prediction (that is, for each i) depends on
polynomial operations on these filtered signals, it is a linear combination of past
values of them, and hence the whole set of predictions can be given a matrix-vector
representation. For details see [Soe92, BGW90, Mos95, CC95, CC99]. There are
several ways of arranging these computations.

Note that using the minimum variance predictions does not necessarily lead to a
minimum mean value of the cost function (2.9), in the stochastic case. But that
is what is generally done; as in the state-space case, this is in general a heuristic
application of the ‘separation’ or ‘certainty equivalence’ principle.

Example 4.9 Suppose that

A(z −1 ) = 1 − 0.9z −1 , B(z −1 ) = 0.5


C(z −1 ) = 1 + 0.5z −1 , D(z −1 ) = 1 − z −1
d=1

Solution of (4.110): E10 (z −1 ) is to be of degree 0, namely a constant. We have

C(z −1 ) 1 − z −1 + 1.5z −1 1.5z −1


= = 1 +
D(z −1 ) 1 − z −1 1 − z −1
148 4. Step Response and Transfer Function Formulations

so

E10 = 1, F10 = 1.5

Solution of (4.121):

B(z −1 ) 0.5(1 − 0.9z −1 ) + 0.45z −1 0.45z −1


−1
= −1
= 0.5 +
A(z ) 1 − 0.9z 1 − 0.9z −1
so

E1 = 0.5, F1 = 0.45

4.2.4 The GPC Model

In the case of Generalised Predictive Control, or GPC, the disturbance is usually


assumed to be stochastic, and the denominator polynomial D(z −1 ) which appears
in (4.100) is always

D(z −1 ) = (1 − z −1 )A(z −1 ) (4.125)

Note that although a transfer function description of the plant is being used, diffi-
culties will arise if the stochastic interpretation is adopted for the disturbance and
the plant is unstable. Even with a stable plant, the disturbance is not stationary
if this model is used, because D(z −1 ) has a root at 1 — this implies that, even if
v(k) is white noise, the disturbance d(k) will be a ‘random walk’. A justification
for this choice of disturbance model is provided by the following, non-stochastic,
argument. If disturbances enter ‘inside’ the plant, rather than at its output — think
of disturbances entering the state equations, if we had any — then they will appear
at the output of the plant as if they had been filtered through a transfer function
of the form C(z −1 )/A(z −1 ). Since most realistic disturbances do in fact arise in
this way, it seems reasonable to include A(z −1 ) as a factor of D(z −1 ). Including the
factor (1 − z −1 ) in D(z −1 ) allows constant disturbances to be represented, which is a
rather common and important case. Furthermore, allowing v(k) to consist of pulses
occurring at random times leads to a disturbance which is piecewise-constant and
jumps at random times. This is often a realistic representation of phenomena such as
load disturbances in a plant — for example, a sudden increase in load torque, which
reduces the effective torque available from a controller. Also, and very importantly,
including the factor (1 − z −1 ) leads to the controller having ‘integral action’. One
could make the disturbance model more elaborate, but using (4.125) leads to some
nice interpretations and keeps things relatively simple.

Returning to (4.117), substituting (4.100), and cancelling A(z −1 ) from each term
gives

C(z −1 )v̂(k|k) = A(z −1 )(1 − z −1 )y(k) − z −d B(z −1 )(1 − z −1 )u(k) (4.126)


4.2. Transfer Function Models 149

and using the notation ∆y(k) = (1 − z −1 )y(k) — analogously to our use of ∆u(k)
— gives

C(z −1 )v̂(k|k) = A(z −1 )∆y(k) − z −d B(z −1 )∆u(k) (4.127)

from which v̂(k|k) is computed. Then the ‘minimum variance’ output prediction is
obtained as
B(z −1 ) C(z −1 )
ŷ(k + i|k) = z −d ũ(k + i) + v̂(k + i|k) (4.128)
A(z −1 ) A(z −1 )(1 − z −1 )
B(z −1 ) Fi0 (z −1 )
= z −d ũ(k + i) + v̂(k|k) (4.129)
A(z −1 ) A(z −1 )(1 − z −1 )

where we have put v̂(k + i|k) = 0 for i > 0 to get the second equality. Substituting
in for v̂(k|k) from (4.127) gives the same equation as (4.120).

4.2.5 State-Space Interpretations

Recall that in Chapter 2 we had the following equation, which describes the evolution
of the estimated state in an observer:

x̂(k + 1|k) = (A − LCy )x̂(k|k − 1) + B û(k|k) + Ly(k) (4.130)

Taking z transforms, we get

¯
x̂(z) = [zI − (A − LCy )]−1 [Lȳ(z) + B û(z)]
¯ (4.131)

All further predictions are based on x̂(k+1|k) — for example, x̂(k+i|k) = Ai−1 x̂(k+
1|k) + . . . . So we see that the output measurements y(k) get filtered by [zI − (A −
LCy )]−1 L before being used to generate predictions. But in the transfer function
approach we can see, for example from equation (4.120) or (4.124), that the output
measurements get filtered by 1/C(z −1 ) before being used to generate predictions.
Recalling that the inverse of a matrix is given by the formula X −1 = adjX/ det X,
we see that we have the following correspondence between the state-space and the
transfer function formulations:

z ν C(z −1 ) ↔ det[zIν − (A − LCy )] (4.132)

(Recall that factors of powers of z in C(z −1 ) have no effect on the spectral density
of the disturbance.)

We have the following consequences of this:

• The polynomial C(z −1 ) (or z ν C(z −1 )) in the transfer function formulation is


often called the observer polynomial. (This is true also in the ‘pole-placement’
literature.)
150 4. Step Response and Transfer Function Formulations

• Using the state-space formulation we can augment the model with additional
states to represent the effects of disturbances. The dynamics of these states
correspond to the polynomial D(z −1 ) in the transfer function formulation, and
we can choose the observer gain L such that the observer dynamics match any
desired numerator polynomial C(z −1 ).

• We do not have to believe that there is a real stochastic disturbance. In either


approach we can regard the polynomial C(z −1 ) or the observer gain L as
‘tuning parameters’, which are chosen to give the predictive controller desirable
performance characteristics. Actually the same is true of the denominator
polynomial D(z −1 ), as is made evident by the GPC model, for instance.

• When dealing with one signal at a a time, it is often easier to think in terms of
transfer functions than in terms of state-space models. Even in multivariable
systems, it is often enough to think of disturbances on each output being
independent of each other. In such cases some designers seem to find it easier
to think in terms of ‘C(z −1 ) and D(z −1 )’, but to compute and implement using
state-space methods.

Example 4.10 Returning to the crew disturbance example (Example 4.8), there we
had

C(z −1 ) = 1 − z −1 D(z −1 ) = (1 − ρe−jω0 Ts )(1 − ρe+jω0 Ts )

A state-space model equivalent to this is:

xd (k + 1) = Ad xd (k) + Bd v(k) d(k) = Cd xd (k)

where
   
0 1 0
Ad = Bd = Cd = [−1, 1]
−ρ2 2ρ cos(ω0 Ts ) 1

(This actually gives C(z −1 ) = z −1 (1 − z −1 ).) We can combine this with a plant
model

xp (k + 1) = Ap xp (k) + Bp u(k) y(k) = Cp xp (k)

as follows:
        
xp (k + 1) Ap 0 xp (k) Bp 0
= + u(k) + v(k) (4.133)
xd (k + 1) 0 Ad xd (k) 0 Bd
 
xp (k)
y(k) = [Cp , Cd ] (4.134)
xd (k)

Partitioning the observer gain matrix as L = [LTp , LTd ]T , the complete observer gain
matrix becomes
 
Ap − Lp Cy −Lp Cd
A − LC = (4.135)
−Ld Cy Ad − Ld Cd
4.2. Transfer Function Models 151

Assuming the plant is stable, a possible choice is Lp = 0 — that is, leave the open-
loop plant dynamics as part of the observer dynamics, in which case we get
 
Ap 0
A − LC = (4.136)
−Ld Cy Ad − Ld Cd
and we can choose Ld to get any eigenvalues we like for Ad −Ld Cd , providing that the
pair (Ad , Cd ) is observable. It is easy to see that we can place the eigenvalues of Ad −
Ld Cd at 1 and 0 — the roots of z −1 C(z −1 ) — by choosing Ld = [1, 2ρ cos(ω0 Ts )]T
for the crew disturbance example, because in this case we have
 
1 0
Ad − Ld Cd =
−ρ2 + 2ρ cos(ω0 Ts ) 0
Why did we set Lp = 0? Because if the transfer function model is written in the
common-denominator form
z −d D(z −1 )B(z −1 )u(k) + A(z −1 )C(z −1 )v(k)
y(k) =
A(z −1 )D(z −1 )
then it is clear that the open-loop plant pole polynomial should be included in the
observer dynamics.

This shows how we can recover the disturbance model using the state-space formula-
tion. It also shows, however, that there is more design freedom with the state-space
formulation. For example, there is no need to choose Lp = 0; other choices are
possible. In particular, with the state-space formulation it is possible to choose the
observer dynamics independently of the numerator polynomial of the disturbance
model. Whether this additional freedom is actually useful for the designer is debat-
able. If one has a physically based disturbance model, such as one for crew motions,
then it probably is useful, because C(z −1 ) represents known physical characteristics.
This is particularly true if one also has a statistical description of measurement noise,
because then the observer gain matrix L can be chosen optimally, using Kalman filter
theory.

There is another connection that can be made between the transfer function and
state-space formulations, through Kalman filter theory. It is known that whatever
combination of state and output noises act on a plant, a disturbance with the same
spectral density at the output can be obtained from the model

xd (k + 1) = Ad x(k) + Ld v(k) (4.137)


y(k) = Cd x(k) + v(k) (4.138)

which is known as the ‘innnovations’ representation of the disturbance [Mos95]. In


this model, Ld is the Kalman filter gain that should be used in an observer, to
estimate the state optimally. Applying the usual formula (4.74) for obtaining a
transfer function from a state-space model, we see that

ȳ(z) = [Cd (zI − Ad )−1 Ld + I]v̄(z) (4.139)


152 4. Step Response and Transfer Function Formulations

from which we make the association z ν D(z −1 ) → det(zI − Ad ), and we see that
C(z −1 ) is the polynomial whose roots are the same as the roots of det[Cd (zI −
Ad )−1 Ld +I]. In the single-output case this is just the polynomial [Cd (zI−Ad )−1 Ld +
1] det(zI − Ad ). This seems to be different from the association obtained in (4.132)
above. But, using the matrix inversion lemma2 it can be shown that

[zI − (Ad − Ld Cd )]−1 = (zI − Ad )−1 [Ld Cd (zI − Ad )−1 + I]−1 (4.140)

from which it follows easily (using (I + XY )−1 X = X(I + Y X)−1 ) that

[zI − (Ad − Ld Cd )]−1 Ld = (zI − Ad )−1 Ld [Cd (zI − Ad )−1 Ld + I]−1 (4.141)

The denominators on the two sides of the equation are det[zI − (Ad − Ld Cd )] on
the left, and det[Cd (zI − Ad )−1 Ld + I] on the right (det(zI − Ad ) cancels on the
right with the numerator). Thus we see that there is no contradiction in the two
associations we have made for C(z −1 ).

There are usually several ways of modelling a disturbance in the state space formula-
tion, which are all equivalent to a single output disturbance. If the GPC disturbance
model is adopted (D(z −1 ) = (1 − z −1 )A(z −1 )), most of its dynamics are shared with
those of the plant. It is only necessary to add m states, therefore, (where m is the
number of outputs) in order to model the additional disturbance poles at +1:

xp (k + 1) = Ap xp (k) + xd (k) + Bp u(k) (4.142)


xd (k + 1) = xd (k) + Bd v2 (k) (4.143)
 
xp (k)
y(k) = [Cp Cd ] (4.144)
xd (k)

We will now show how a state-space model and observer can be defined which
correspond precisely to the GPC model, and to the use of a ‘re-aligned’ model.
That is, we shall extend the development of section 2.6.4 to the case when there is
a disturbance which is modelled as in GPC. Using similar notation to that used in
equation (4.127) we can write the GPC model in the form

A(z −1 )∆y(k) = B(z −1 )∆u(k) + C(z −1 )v(k) (4.145)

(where we assume d = 1). Assume that the polynomial matrices A(z −1 ), B(z −1 ), C(z −1 )
— we can do everything for the multivariable case here — are given by

A(z −1 ) = I − A1 z −1 − · · · − An z −n (4.146)
−1 −1 −p
B(z ) = B1 z + · · · + Bp z (4.147)
−1 −1 −2 −q
C(z ) = Iz + C2 z + · · · + Cq z (4.148)

Notice that we can take the leading coefficient matrices of A(z −1 ) and C(z −1 ) to
be the identity I, without loss of generality. The model can be written in difference
2
(W + XY Z)−1 = W −1 − W −1 X(ZW −1 X + Y −1 )−1 ZW −1 .
In this case we apply it with W = (zI − Ad ), X = Ld , Y = I, Z = Cd .
4.2. Transfer Function Models 153

equation form as

y(k) − y(k − 1) = A1 [y(k − 1) − y(k − 2)] + · · · + An [y(k − n) − y(k − n − 1)] +


B1 [u(k − 1) − u(k − 2)] + · · · + Bp [u(k − p) − u(k − p − 1)] +
v(k − 1) + C2 v(k − 2) + · · · + Cq v(k − q) (4.149)
Now define the state vector to be

x(k) = [y(k)T , y(k − 1)T , . . . , y(k − n)T , u(k − 1)T , . . . , u(k − p)T ,
v(k − 1)T , . . . , v(k − q + 1)T ]T (4.150)
then (4.149) is equivalent to the (non-minimal) state-space model
x(k + 1) = Ax(k) + Bu u(k) + Bv v(k) (4.151)
y(k) = Cx(k) (4.152)
where
 
A11 A12 A13
A =  0 A22 0  (4.153)
0 0 A33
and the sub-matrices are given by:
 
I + A1 A2 − A1 · · · An − An−1 −An
 I 0 ··· 0 0 
 
A11 =  .. .. .. .. ..  (4.154)
 . . . . . 
0 0 ··· I 0
 
B2 − B1 · · · Bp − Bp−1 −Bp
 0 ··· 0 0 
 
A12 =  .. .. .. ..  (4.155)
 . . . . 
0 ··· 0 0
 
C2 · · · Cq
 0 ··· 0 
 
A13 =  .. .. ..  (4.156)
 . . . 
0 ··· 0
 
0 0 ··· 0 0
 I 0 ··· 0 0 
 
A22 =  .. .. .. .. ..  (4.157)
 . . . . . 
0 0 ··· I 0
| {z }
p blocks
 
0 0 ··· 0 0
 I 0 ··· 0 0 
 
A33 =  .. .. .. .. ..  (4.158)
 . . . . . 
0 0 ··· I 0
| {z }
q−1 blocks
154 4. Step Response and Transfer Function Formulations

The matrices Bu and Bv are given by

Bu = [B1T , 0, . . . , 0 , I, 0, . . . , 0 , 0, . . . , 0 ]T (4.159)
| {z } | {z } | {z }
n blocks p−1 blocks q−1 blocks

and

Bv = [C1T , 0, . . . , 0 , 0, . . . , 0, I, 0, . . . , 0 ]T (4.160)
| {z } | {z } | {z }
n blocks p blocks q−2 blocks

The output matrix C takes the form

C = [I, 0, . . . , 0] (4.161)

Note that discrete-time ‘integration’ is built in to this model; A has m eigenvalues at


+1, which can be seen as follows. Suppose that y(k) = y(k − 1) = · · · = y(k − n) =
y∞ , that u(k − 1) = · · · = u(k − p) = 0, and that v(k − 1) = · · · = v(k − q + 1) = 0,
and let x∞ be the state vector which corresponds to these values:
T T
x∞ = [y∞ , . . . , y∞ , 0, . . . , 0, 0, . . . , 0 ]T (4.162)
| {z } | {z } | {z }
n+1 times p times q−1 times

Then it is easily verified that

Ax∞ = x∞ (4.163)

which shows that any x∞ of this form is an eigenvector of A, with eigenvalue +1.
This is another way of saying that any set of constant outputs is an equilibrium
point for this system, when the inputs and disturbances are all zero.

Now consider the observer gain

L0 = [I, 0, . . . , 0 , I, 0, . . . , 0]T (4.164)


| {z }
n+p times

The first identity matrix in L0 gives ŷ(k|k) = y(k). As in section 2.6.4, the structure
of A and Bu then ensures that the top n + p + 1 elements of x̂(k|k) contain measured
outputs and inputs after max(n + 1, p) steps of running the observer. The second
identity matrix in L0 gives the disturbance estimate v̂(k|k) = y(k)− ŷ(k|k−1), where,
as usual, ŷ(k|k−1) = C x̂(k|k−1), and x̂(k|k−1) = Ax̂(k−1|k−1)+Bu u(k−1). This
is a reasonable estimate of the disturbance, given the model. Is this observer stable?
In section 2.6.4, with no disturbances, we found that the observer was deadbeat,
with all the eigenvalues of A − LC = A(I − L0 C) being zero. The situation now is a
little more complicated. The matrix A − LC = A(I − L0 C) is the same as the matrix
A, except that the first block column (that is, the first m columns, where m is the
number of outputs) is replaced by

[−C2T , 0, . . . , 0 , 0, −I, 0, . . . , 0]T (4.165)


| {z }
n+p times
4.2. Transfer Function Models 155

This matrix has its eigenvalues at zero, and at the roots of the polynomial C(z −1 ).
The observer is therefore stable, providing that C(z −1 ) has all of its roots inside
the unit disk. Recall that this is the same as the condition that was required when
estimating the disturbance from equation (4.116). The zero eigenvalues reflect the
fact that those elments of the state vector which correspond to past values of inputs
and outputs are estimated exactly after a finite number of steps.

Note that, as in section 2.6.4, this observer can be used even with unstable plants.

For further examples of state-space interpretations of the GPC model, see [OC93].

Note on use of Model Predictive Control Toolbox. The Model Predictive Control
Toolbox uses the alternative state-space representation (2.37), with the assumption
that y and z are the same (which is also assumed by GPC). The observer gain that
must be supplied to Model Predictive Control Toolbox functions must be compatible
with this choice of state vector. In this case using the observer gain
 0 
0 L
L = (4.166)
I
where L0 is given by (4.164), gives the GPC model — see Problem 11. L0 is the
matrix that must be supplied as the argument Kest in Model Predictive Control
Toolbox functions such as scmpc.

Example 4.11 Consider the unstable helicopter of Example 1.8. We saw in Chap-
ter 1 that the simple ‘DMC’ disturbance model is not adequate to give offset-free
tracking when the plant is unstable, because an independent model cannot be used
— see Problem 11 of Chapter 1. In order to overcome this problem the GPC model
(4.145) can be used.

With a sampling interval of 0.6 sec, the discrete-time transfer function of the heli-
copter is
6.472z 2 − 2.476z + 7.794
(4.167)
z 3 − 2.769z 2 + 2.565z − 0.7773
Dividing the numerator and denominator by z −3 gives
A(z −1 ) = 1 − 2.769z −1 + 2.565z −2 − 0.7773z −3 (4.168)
−1 −1 −2 −3
B(z ) = 6.472z − 2.476z + 7.794z (4.169)
so that n = p = 3. We need to choose the polynomial C(z −1 ), ensuring that its roots
are inside the unit disk. Let us choose the polynomial (q = 2)
C(z −1 ) = z −1 − 0.8z −2 = z −1 (1 − 0.8z −1 ) (4.170)
which has one root at z = 0.8 — see section 7.4.2 for some motivation for this
choice. Choosing the state vector as in (4.150) gives
x(k) = [y(k), y(k − 1), y(k − 2), u(k − 1), u(k − 2), v(k − 1)]T (4.171)
156 4. Step Response and Transfer Function Formulations

and
 
1 + A1 A2 − A1 A3 − A2 −A3 B2 − B1 B3 − B2 −B3 C2
 1 0 0 0 0 0 0 0 
 
 0 1 0 0 0 0 0 0 
 
 0 0 1 0 0 0 0 0 
A = 


 0 0 0 0 0 0 0 0 

 0 0 0 0 1 0 0 0 
 
 0 0 0 0 0 1 0 0 
0 0 0 0 0 0 0 0
 
−1.769 5.334 −3.3423 0.7773 −8.948 10.27 −7.794 −0.8
 1 0 0 0 0 0 0 0 
 
 0 1 0 0 0 0 0 0 
 
 0 0 1 0 0 0 0 0 
= 


 0 0 0 0 0 0 0 0  
 0 0 0 0 1 0 0 0 
 
 0 0 0 0 0 1 0 0 
0 0 0 0 0 0 0 0
Bu = [6.472, 0, 0, 0, 1, 0, 0, 0]
T

Bv = [−0.8, 0, 0, 0, 0, 0, 0, 1]T
Choosing the observer gain matrix L0 as in (4.164), namely
L0 = [1, 0, 0, 0, 0, 0, 0, 1]T (4.172)
gives the observer state-transition matrix
 
0.8 5.334 −3.3423 0.7773 −8.948 10.27 −7.794 −0.8
 0 0 0 0 0 0 0 0 
 
 0 1 0 0 0 0 0 0 
 
 0 0 1 0 0 0 0 0 
A − LC =   0

 0 0 0 0 0 0 0  
 0 0 0 0 1 0 0 0 
 
 0 0 0 0 0 1 0 0 
0 0 0 0 0 0 0 0
(4.173)
which has, as expected, 7 eigenvalues at 0 and one at 0.8.

The solid lines in Figure 4.5 show the response when GPC is applied, without con-
straints, with Hp = 5, Hu = 2, Q = 1, and R = 0, assuming a perfect model. The
set-point is s(k) = 1. The plant and internal model both have zero initial state, and
there are no disturbances for the first 10 seconds. Then an unmeasured step distur-
bance of -0.1 is added to the input. It can be seen that, after a transient lasting about
10 seconds, the output returns to its set-point. The input increases to compensate
for the disturbance.

The dashed lines in Figure 4.5 show the response when a deadbeat observer is used —
namely, when the observer pole is placed at z = 0 instead of z = 0.8. It is seen that
4.2. Transfer Function Models 157

1.4

1.2

1
Output

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25 30
Time (seconds)

0.4

0.3
Input

0.2

0.1

0
0 5 10 15 20 25 30
Time (seconds)

Figure 4.5: GPC applied to unstable helicopter.

the peak error from the set-point is reduced, compared with the previous response,
but the control actions are more agressive, and the transient is not finished any more
quickly. Note that the two responses are identical for the first 10 seconds. This is
because in this idealised situation the state of the internal model tracks the state of
the plant exactly, and hence the observer has no effect, until the disturbance occurs.

4.2.6 Multivariable Systems

Since everything that can be done with a transfer function formulation of predictive
control can also be done with a state-space formulation, and more, there seems to be
no reason for using transfer functions. This is particularly true for the multivariable
case. In the SISO case there are at least some nice interpretations which are not seen
so clearly with state-space models. But this is no longer true in the multivariable
case.

It is sometimes claimed that the transfer function formulation is more suitable for
adaptive applications. This claim does not appear to have been justified in detail.
Plant parameter estimation is no more difficult for state-space models than it is for
general transfer function models — in the SISO case it is equally difficult, whereas
in the multivariable case it is probably easier with state-space models — see [CM97],
158 4. Step Response and Transfer Function Formulations

for example. Arguably, estimation of ARX models is easier, because it is sufficient


to use linear regression. But that involves restricting the class of models for the sake
of a simpler algorithm, which may not be a worthwhile trade-off. Of course, even
if one estimates a multivariable ARX model, it can easily be transformed into an
equivalent state-space model, using standard algorithms.

For detailed treatments of the transfer function approach applied to multivariable


systems, see [Mos95]or [CC95, CC99].
4.3. Problems 159

4.3 Problems

1. Suppose you are given the sequence of step response matrices S(0), S(1), . . . , S(N )
for a plant. Show how to obtain the sequence of pulse response matrices
H(0), H(1), . . . . What is the last one you can obtain?

2. (a) Write a MATLAB function ss2step which computes the step response
matrices S(M ), S(M + 1), . . . , S(N ) of a state-space model, and stores
them in a three- dimensional array, so that Sij (t) is stored in S(i,j,t).
It should have the interface specification:
S = ss2step(A,B,C,D,M,N)
(b) Write MATLAB functions step2ups and step2the for computing the
matrices Υ (‘upsilon’) and Θ (‘theta’) from the step response sequence.
The input data should be the three- dimensional array created in part
(a), holding S(1), . . . , S(N ), where N ≥ Hp . Hw , Hp and Hu should be
input arguments. The interface specifications should be:
upsilon = step2ups(S,Hw,Hp)
theta = step2the(S,Hw,Hp,Hu)

3. Consider the case of a ‘square’ plant: ` = m, horizons Hp = Hw , and Hu = 1,


and no penalty on input moves: R = 0. Using (4.27) and (4.28), and the results
of Chapter 3, show that in the unconstrained case we have KM P C = S(Hw )−1 ,
and hence that, with full state measurements, the controller has no dynamics
in this case — that is, it consists of gains only.

4. A 2-input, 1-output system has the step response sequence S(0) = [0, 0],
S(1) = [0, 2], S(2) = [1, 3], S(k) = S(2) for k > 2. Find a state-space model
which reproduces this step response exactly. Note: You need 4 states.

5. Show that, as an alternative to equation (4.55), one could estimate A from the
equation

Γ←
n = AΓn

with a suitable definition of Γ←


n .

6. Solve the two Diophantine equations (4.110) and (4.121) for Example 4.9, for
the case when the 2-step-ahead predictor is required.

7. Show that an output disturbance which is a ramp (straight line) of unknown


slope can be modelled by taking D(z −1 ) = (1 − z −1 )2 in section 4.2.3. How
should C(z −1 ) and v(k) be chosen?

8. Suppose we have a state-space model, with a disturbance w(k) entering the


state equations:

x(k + 1) = Ax(k) + Bu(k) + W w(k) (4.174)


y(k) = Cy x(k) (4.175)
160 4. Step Response and Transfer Function Formulations

Show that the transfer functions from the vector w(k) to the output y(k) all
have the same denominator as the transfer function from the input u(k) to
y(k). (You may prefer to do this for a specific 2 or 3-state example rather
than in general.)
9. Verify that the model (4.142) – (4.144) corresponds to the GPC disturbance
model.
10. Verify that the state-space model (4.151)–(4.160) corresponds to the difference
equation (4.149).
11. Verify that the observer gain L0 given by (4.166) corresponds to the GPC
model when the state vector is chosen as
ξ(k) = [∆x(k)T , η(k)T ]T (4.176)
(that is, as in the Model Predictive Control Toolbox) and when the ‘A’ and ‘C’
matrices of the state-space model are chosen to be
 
A 0  
and 0 I (4.177)
CA I
by taking the following steps:
First observe that if
x̂(k|k) = (I − L0 C)x̂(k|k − 1) + L0 y(k)
then
∆x̂(k|k) = (I − L0 C)∆x̂(k|k − 1) + L0 [y(k) − y(k − 1)] (4.178)
Then show that use of the observer gain
 
0 L∆x
L =

gives η̂(k|k) = y(k) if Lη = I and hence that
∆x̂(k|k) = (I − L∆x C)∆x̂(k|k − 1) + L∆x [y(k) − y(k − 1)] (4.179)
from which the result follows.
12. Use the Model Predictive Control Toolbox function scmpc to reproduce the re-
sults shown in Figure 4.5 for Example 4.11. (The input disturbance used to
generate the figure changed from 0 to -0.1 in 3 increments: du (k) = (−0.03, −0.07, −0.1)
for k = 17, 18, 19 — recall that k counts time increments, and the sampling
interval is 0.6 second. This is obtained by passing the following argument wu
to function scmpc: wu=[zeros(16,1);-0.03;-0.07;-0.1]. Also note that
the observer gain argument Kest must be passed to the function scmpc in the
form shown in (4.166).)
Investigate the responses obtained for other values of the observer pole, such
as 0.3 and 0.99.
Chapter 5

Other Formulations of
Predictive Control

5.1 Measured Disturbances and Feedforward

It is frequently the case that the effects of some disturbances can be anticipated,
and approximately cancelled out by suitable control actions. When this is done it is
called feedforward control. It can be more effective than feedback control, because
the latter has to wait until the effect of the disturbance becomes apparent, before
taking corrective action. In order to anticipate the effect of the disturbance, it is
necessary to have some measurement which indicates that it is on its way. Examples
of measured disturbances which can be corrected in this way are:

• Upstream changes in raw material composition.

• Feed rate from an upstream process.

• Heat duty requirements of upstream and downstream oil fractionator columns.


(This assumes that each column is controlled individually, which is not the best
solution [PG88].)

• Windshear, measured by a look-ahead Doppler radar (in an aircraft).

Exact cancellation would require an exact model of the ‘disturbance to output’


transfer function, and an exact inversion of this model. Since neither of these is
possible, feedforward control has to be used in combination with feedback control;
the feedforward control removes most of the effect of the measured disturbance,
and the feedback control removes the rest — as well as dealing with unmeasured
disturbances, of course.

161
162 5. Other Formulations of Predictive Control

Measured
disturbance dm (k)
CONTROLLER

P̂1 (z)−1 P̂d (z) Pd (z)


PLANT

− +
r(k) + u(k) + y(k)
C(z) P1 (z) P2 (z)
Set−point +

Figure 5.1: Feedforward from measured disturbances

Conceptually, the control structure can be visualised as shown in Figure 5.1. The
plant is shown as a linear model, which is split up into several blocks, to allow for
the fact that often the control inputs and the disturbances pass through common
dynamics — in this case the transfer function matrix P2 (z). The measured distur-
bances are shown as passing first through the transfer function matrix Pd (z). Thus
their effect could be completely cancelled by adding the signal −P1 (z)−1 Pd (z)d(z)¯
to the control input. This is shown in the figure, except that the notation P̂1 (z) and
P̂d (z) is used, to emphasis that the transfer functions are never known exactly, and
that it is usually impossible to realise inverses exactly — P1 (z) may not even be a
square matrix, so it may be impossible to find an inverse even in principle.

Feedforward is easily incorporated into predictive control. All that has to be done
is to include the effects of the measured disturbances in the predictions of future
outputs. The optimiser will then take these into account when computing the control
signal. Looking back to Chapter 3, it will be seen that the only change that is
required is to include the effects of the measured disturbances in the vector Z(k) of
predicted outputs.

We shall modify the model (2.1)–(2.3) to include the measured disturbance vector
dm (k):
Plant Model With Measured Disturbance:

States: x̂(k + 1|k) = Ax̂(k|k) + Bu(k) + Bd dm (k) (5.1)


Measured outputs: ŷ(k|k) = Cy x̂(k|k) (5.2)
Controlled outputs: ẑ(k|k) = Cz x̂(k|k) (5.3)

where we assume that the disturbance has no effect on the outputs until some time
after it has been measured.

Example 5.1 Suppose that the transfer functions P1 (z), P2 (z) and Pd (z), which
5.1. Measured Disturbances and Feedforward 163

appear in Figure 5.1, have state-space realisations (A1 , B1 , C1 , D1 ), (A2 , B2 , C2 , D2 )


and (Ad , Bd , Cd , 0), with corresponding state vectors x1 , x2 , and xd . Assume that
D2 D1 = 0 so that there is no direct feed-through from u(k) to y(k). Then a complete
state-space model is given by
    
x1 (k + 1) A1 0 0 x1 (k)
 x2 (k + 1)  =  B2 C1 A2 B2 Cd   x2 (k)  +
xd (k + 1) 0 0 Ad xd (k)
   
B1 0
 B2 D1  u(k) +  0  dm (k) (5.4)
0 Bd
 
x1 (k)
z(k) = [D2 C1 C2 D2 Cd ]  x2 (k)  (5.5)
xd (k)

The state estimate x̂(k|k) is still given by (2.81) — with L0 designed using the model
(5.1)–(5.3) of course — but (2.82) has to be replaced by

x̂(k + 1|k) = Ax̂(k|k) + Bu(k) + Bd dm (k) (5.6)

To obtain Z(k) we must now replace (3.32) by

Z(k) = Ψx̂(k|k) + Υu(k − 1) + Θ∆U (k) + ΞDm (k) (5.7)

where
 
dm (k)
 ˆ
dm (k + 1|k) 
 
Dm (k) =  ..  (5.8)
 . 
dˆm (k + Hp − 1|k)

and
 
C z Bd 0 ··· 0
 Cz ABd Cz Bd ··· 0 
 
Ξ= .. .. .. ..  (5.9)
 . . . . 
Cz AHp −1 Bd Cz AHp −2 Bd · · · C z Bd

The matrices Ψ, Υ and Θ remain unchanged. We have assumed here that the
measurement dm (k) is made at the same time as the measurement y(k), and can be
used for the calculation of u(k).

The output predictions will clearly be influenced by what one assumes about the fu-
ture behaviour of the measured disturbance, as represented by dˆm (k+1|k), . . . , dˆm (k+
Hp − 1|k). Common practice is to assume that it will remain constant at the last
measured value, namely dm (k) = dˆm (k + 1|k) = . . . = dˆm (k + Hp − 1|k). (This is
the assumption made by the Model Predictive Control Toolbox, for instance.) Other
164 5. Other Formulations of Predictive Control

assumptions may be more appropriate in particular cases, if a better model of these


disturbances is available.

The only remaining change required is to redefine the ‘tracking error’ E(k) — see
(3.33) — as

E(k) = T (k) − Ψx̂(k|k) − Υu(k − 1) − ΞDm (k) (5.10)

Once this change has been made, the optimal solutions in the unconstrained and
constrained cases can be found as detailed in Chapter 3.

5.2 Stabilised Predictions

In Chapter 2 we remarked that care should be taken when forming predictions,


because of numerical problems that may arise. In particular, if the plant is unstable
then problems are very likely to arise. An effective way of reducing this problem is
to ‘stabilise’ the predictions. What is involved is a kind of re-parametrisation of the
plant’s input signal.

So far we have always computed predictions on the assumption that the plant is
running ‘open-loop’, and we have computed the control signals as changes from a
‘do-nothing’ policy. Furthermore, we have assumed that after the end of the control
horizon the input signal will remain constant. But this is not the only possibility.

Suppose that we assume that the ‘do-nothing’ policy will be to apply the linear
state-feedback control

u(k) = −K x̂(k|k) (5.11)

for the indefinite future. And of course we will assume that the state-feedback gain
K is one which stabilises the linear model, namely that all the eigenvalues of A−BK
lie inside the unit disk. Then the ‘do-nothing’ predictions are formed as follows:

x̂(k + 1|k) = Ax̂(k|k) + B û(k|k)


= (A − BK)x̂(k|k) (5.12)
x̂(k + 2|k) = Ax̂(k + 1|k) + B û(k + 1|k)
= (A − BK)x̂(k + 1|k)
= (A − BK)2 x̂(k|k) (5.13)
..
.
x̂(k + Hp |k) = (A − BK)Hp x̂(k|k) (5.14)

Now we can use optimization over a control horizon Hu to modify these baseline
‘do-nothing’ predictions, so as to minimise our cost function, and to ensure that the
5.2. Stabilised Predictions 165

predicted behaviour stays within the constraints. This means that the prediction of
the future input value û(k + i|k) will no longer be given by −K x̂(k + i|k), but by

û(k + i|k) = −K x̂(k + i|k) + q(i) (5.15)

with q(i) = 0 for i ≥ Hu , where the values q(i) (i = 0, 1, . . . , Hu − 1) are chosen by


the optimiser. Now we have

x̂(k + 1|k) = (A − BK)x̂(k|k) + Bq(1) (5.16)


x̂(k + 2|k) = (A − BK)x̂(k + 1|k) + Bq(2)
= (A − BK)2 x̂(k|k) + (A − BK)Bq(1) + Bq(2) (5.17)
..
.
x̂(k + Hu − 1|k) = (A − BK)Hu −1 x̂(k|k) + (A − BK)Hu −2 Bq(1) +
+ · · · + Bq(Hu − 1) (5.18)
Hu −1
x̂(k + Hu |k) = (A − BK) Hu
x̂(k|k) + (A − BK) Bq(1) +
+ · · · + (A − BK)Bq(Hu − 1) (5.19)
..
.
x̂(k + Hp |k) = (A − BK)Hp x̂(k|k) + (A − BK)Hp −1 Bq(1) +
+ · · · + (A − BK)Hp −Hu +1 Bq(Hu − 1) (5.20)

The important point here is that instead of high powers of A, which we had in the
expressions for the ‘open-loop’ predictions in Chapter 2, here we have high powers
of A − BK. And because K is chosen to be stabilising, we have (A − BK)i → 0 as
i → ∞, so the likelihood of numerical problems due to finite-precision arithmetic is
greatly reduced.

In this formulation the ‘decision variables’ of the optimization problem are the q(i)’s,
in place of the old ∆û(k+i)’s. We need to check whether we still have a QP problem.
Equation (5.15) shows that the predicted plant input û(k + i|k) is related linearly
to q(i). (x̂(k + i|k) is related linearly to q(j), j < i.) And clearly

∆û(k + i|k) = [−K x̂(k + i|k) + q(i)] − [−K x̂(k + i − 1|k) + q(i − 1)]
= −K∆x̂(k + i|k) + ∆q(i) (5.21)

This makes it clear that the ∆q(i)’s, and hence the q(i)’s themselves, are linearly
related to the ∆û(k + i|k)’s. So the linear inequalities in the variables ∆û(k + i|k)
remain as linear inequalities in the variables q(i). So we still have a QP problem to
solve.

The use of stabilised predictions was first introduced in [KR92, RK93]. The emphasis
in these papers was on the use of feedback to obtain deadbeat, or finite impulse
response FIR, behaviour prior to the use of optimization, as a stratagem to prove
closed-loop stability — see section 6.2. The numerical benefits for prediction were
noticed later [RRK98]. In [MR93b, MR93a, RM93, SR96b]a parametrisation of the
form u(k) = −K x̂(k|k) was assumed after the end of the control horizon, and was
166 5. Other Formulations of Predictive Control

an essential step in showing how constrained predictive control problems could be


solved over infinite horizons. (We shall return to this in section 6.2.) In [RRK98] it
was pointed out that such parametrisatons could be assumed over the whole horizon,
with consequent benefits for numerical conditioning of the predictions.

The remaining question is, which stabilising state-feedback gain K should be used?
In principle there are many possibilities to choose from, obtained for example by
pole-placement techniques. But in practice, with state dimensions bigger than about
5, it is very difficult to get pole-placement to work (because of the difficulty of
knowing what closed-loop pole locations are reasonably attainable), and the only
practical alternatives are to obtain K by solving a ‘Linear Quadratic’, or possibly an
‘H∞ ’ problem. In the context of predictive control with a quadratic cost function, the
natural choice is to obtain K as the solution to the infinite-horizon linear quadratic
problem, with the same cost function as that used in the formulation of the predictive
control problem. One proposal for obtaining ‘robust’ predictive control is to make
K the ‘decision variable’, namely to have K chosen (for each k) by an optimiser —
see section 8.4.

Using stabilised predictions has another benefit. It allows a predictive controller to


be more optimistic about the possibility of remaining feasible over the duration of
the prediction horizon, if there are disturbances which are not known accurately or
if there is some uncertainty about the true behaviour of the plant. With open-loop
predictions the controller may be too pessimistic, and wrongly conclude that there
is no way of ensuring a feasible solution [BM99b]. We shall examine this further in
Chapter 8.

5.3 Decomposition of Unstable Model

Richalet’s PFC approach uses a very different approach to dealing with unstable
systems, from the approach taken by GPC [Ric93b]. Since PFC insists on an ‘in-
dependent model’, namely one in which the plant outputs are not used to correct
the internal model, the poles of the internal model are necessarily cancelled by the
controller. But this is unacceptable if the internal model is unstable, since it leads
to loss of internal stability — for example, the transfer function from the plant input
to the plant output is unstable when the feedback loop is closed (see Chapter 6 for
details).

Richalet therefore represents the unstable plant by a feedback interconnection of two


stable systems, as shown in Figure 5.2. Such a representation, or ‘decomposition’
as Richalet calls it, can always be found, although it is not unique. The original
system P (z) and the two stable systems P1 (z), P2 (z) are related by

P (z) = P1 (z)[I − P2 (z)P1 (z)]−1 (5.22)


5.3. Decomposition of Unstable Model 167

or, more simply in the SISO case, by:

P1 (z)
P (z) = (5.23)
1 − P2 (z)P1 (z)

ŷ ŷ
u u
P (z) P1 (z)
+
+

P2 (z)

Figure 5.2: Decomposition of unstable plant as feedback interconnection of two


stable systems.

This representation is now redrawn as in Figure 5.3. This shows P1 (z) driven by the
input, but the feedback loop is replaced by the open-loop block P2 (z)P1 (z) driven
by the output of the model. The ingenious trick which Richalet uses at this point is
to take P1 (z) as the internal model, and to regard the effect of the model output,
passing through P2 (z), as a measured disturbance. Of course, some approximation
enters at this point, because the future output has to be estimated, in order to
obtain predictions of itself. Richalet suggests replacing the model output ŷ at the
input of P2 (z) by the actual plant output y, and deriving predictions from this by
making plausible assumptions. For example, if the set-point is constant one could
assume that future output values will be equal to the latest measured values.

u ŷ
P1 (z)
+
+


P1 (z)P2 (z)

Figure 5.3: Decomposition of unstable plant as stable model and ‘measured quasi-
disturbance’.

This idea can be generalised as follows. It is always possible to find a coprime


168 5. Other Formulations of Predictive Control

u y u ŷ
Ñ (z) I Ñ (z)
+ +
+ +

I − M̃ (z) I − M̃ (z)

Figure 5.4: Coprime factorisation of unstable system, and its approximation.

factorisation of a transfer function (matrix):

P (z) = M̃ (z)−1 Ñ (z) (5.24)

such that M̃ (z) and Ñ (z) are stable, and effective algorithms for doing this ex-
ist [Mac89, ZDG96]. (‘Coprime’ means that there are no unstable pole-zero cancel-
lations between the factors.) A block diagram which corresponds to this factorisation
is shown on the left of Figure 5.4. Note that the system I − M̃ (z) is stable, since
M̃ (z) is stable. On the right of Figure 5.4 is shown an approximation of the coprime
factorisation, using an estimate ŷ of the output as the input to the feedback block.

More details of PFC are given in section 5.6.

5.4 Non-quadratic Costs

5.4.1 Characteristics of LP and QP problems

It is possible to modify the cost function used in predictive control, so that absolute
values of errors are penalised, rather than squared values:

X X
Hp p
V (k) = |ẑj (k + i|k) − rj (k + i)|qj (5.25)
i=1 j=1

subject to the usual constraints on û(k + i|k), ∆û(k + i|k), and ẑ(k + i|k). (The qj ’s
are nonnegative weights.) This cost function was used in [CS83]. Such problems are
Linear Programming (LP) rather than Quadratic Programming (QP) problems,1 as
we shall show shortly.

One of the historical reasons for adopting such a formulation is that LP problems
can be solved more quickly than QP problems, and that there is more experience
(particularly in industrial and commercial environments) of solving LP problems,
1
Some authors have started to adopt the phrase Linear Optimization, because the meaning of
‘programming’ has changed since the 1940’s. While this is undoubtedly correct and logical, we
retain the traditional terminology for the sake of easy recognition.
5.4. Non-quadratic Costs 169

x2 Increasing V x2

x1 x1

Figure 5.5: Cost contours and constraints for LP (left) and QP (right) problems.
The black dot shows the optimal solution in each case.

with excellent and well-proven software available. The importance of this reason is
decreasing rapidly, because of the great strides being made in the development of
algorithms and software for solving QP and other convex problems — see section
3.3.

But another reason — and a better one — for adopting this alternative formulation
of the predictive control problem is that the resulting behaviour is different. The
solutions of LP problems are always at the intersection of constraints — occasionally
on a single constraint — whereas solutions of QP problems can be off constraints, on
a single constraint, or (relatively rarely) at an intersection of constraints. An attempt
to illustrate this behaviour is made in Figure 5.5 which shows a problem with only
two ‘decision variables’ x1 and x2 . The thick solid lines represent linear inequality
constraints, with the feasible region being the interior of the region bounded by these
lines. The dashed lines represent constant cost contours, those for an LP problem
being shown on the left — these are straight lines, or hyperplanes in general — and
those for a QP problem being shown on the right — these are ellipses, or hyper-
ellipsoids in general. For the LP problem the cost increases as one moves upwards
in the figure, and for the QP problem the cost increases as one moves out from the
centre of the ellipse.

It can be seen from the figure on the left, that the optimal solution to an LP problem
must always lie on at least one constraint. Also, it can be expected to lie at the
intersection of more than one constraint, the only exception being if the slope of
the cost contours is the same as the slope of at least one constraint. Furthermore,
the solution is relatively robust with respect to the cost function: the slope of the
cost contours can vary quite a lot before the optimal solution changes — but when
it does change, it jumps suddenly to one of the other corners of the feasible region.
On the other hand, the optimal solution is sensitive to the constraints, and changes
170 5. Other Formulations of Predictive Control

continuously (mostly) as these are changed.

The figure on the right shows that the optimal solution to a QP problem behaves
very differently. As shown, the optimal solution is on one of the constraints. But
it is easy to imagine a situation in which the centre of the ellipse is in the feasible
region, and the solution will then not be on any of the constraints. It is also easy
to see that it would be very unusual for the solution to be at the intersection of
more than one constraint. (In problems with particular structure it may not be
so unusual. For example, in the predictive control context, a big disturbance may
make an output constraint active over several steps of the prediction horizon. Seen
from the viewpoint of the QP algorithm this would mean that the solution is on the
intersection of several constraints.) In this case the optimal solution is completely
insensitive to changes in the constraints if it is in the interior of the feasible region,
but depends continuously on the cost function. If it is on the boundary of this region
— that is, some constraints are active — then it depends continuously on both the
cost function and the constraints.

Each of these behaviours has its merits. For example, if it is known that most prof-
itable operation is obtained with the plant at the intersection of several constraints,
and if the constraints are known precisely, and the model is reasonably accurate,
whereas the ‘true’ (economic) cost function is not known so precisely, then the ro-
bust behaviour of the LP solution is appropriate — it will try to keep the plant at
the true optimal operating point, despite the uncertainty about the true cost func-
tion. In practice, however, one would not risk trying to hold the plant at the real
constraints, so these would be replaced by synthetic constraints, which allowed some
margin for unavoidable constraint violations. Such violations will arise because of
unexpected disturbances, errors in the model of the plant, errors in measurements,
and errors in the constraint specifications themselves. So in practice the LP solution
would try to hold the plant robustly at a fixed operating point, but one which was
not the true optimum. In this case the QP solution looks more attractive.

In the situation just outlined, a QP formulation would try to hold the plant at a
point just inside the feasible region, close to the optimal operating point, as shown in
Figure 5.6. Because of the awareness that the predictive control formulation has of
constraints, and the resulting nonlinear action if the constraints are approached, this
operating point can be much closer to the constraints than could be contemplated
if a linear controller were used. The QP formulation now offers a lot of flexibility,
all of which can potentially be exercised on-line by plant operators:

1. The desired operating point, namely the centre of the iso-cost ellipsoids, can
be moved around within the feasible region in a natural way. (In an LP
formulation this can only be done by redefining the constraints.)
2. The relative weights in the cost function can be altered to change the uncon-
strained behaviour. For example the right half of Figure 5.6 shows the same
operating point defined, but a lower cost indicated for deviations of the x2
variable rather than the x1 variable.
5.4. Non-quadratic Costs 171

x2 x2

x1 x1

Figure 5.6: Using a QP formulation to place the desired operating point just inside
the feasible region. Left: x1 deviations cheaper than x2 deviations. Right: x2
deviations cheaper than x1 deviations.

3. If constraints are persistently active, as in Figure 5.5, then the location of


the operating point on the boundary of the feasible region can be altered by
altering the weights. (The optimal solution can be moved up and down the
solid line in Figure 5.5.)

As regards analysis of controller behaviour, a QP formulation has the very big


advantage that it gives linear behaviour so long as the constraints are inactive, or a
fixed set of constraints is active. All the tools of linear control theory can be applied
to analyse the controller in these circumstances. This is not so with LP formulations.

5.4.2 Absolute value formulations

We return now to the cost function (5.25). We want to demonstrate that minimising
this, subject to the usual constraints on input changes, inputs and outputs, is indeed
an LP problem. The standard form of an LP problem is:

min cT θ subject to Aθ ≥ b and θ ≥ 0 (5.26)


θ

where θ is the vector of decision variables, b and c are vectors, and A is a matrix.
A problem of the form

min |cT θ| subject to Aθ ≥ b and θ ≥ 0 (5.27)


θ
172 5. Other Formulations of Predictive Control

can be shown to be an LP problem as follows. It is equivalent to the problem




 γ ≥ cT θ

γ ≥ −cT θ
min γ subject to (5.28)
γ,θ 
 Aθ ≥ b

θ≥0

where γ is a new scalar variable, and hence to


   
  1 −cT   0  
γ γ γ
min[1, 0] subject to  1 cT  ≥  0  and ≥ 0 (5.29)
γ,θ θ θ θ
0 A b

which is in the standard form (5.26). (The constraint γ ≥ 0 is in fact redundant.)

In a similar way, the ‘1-norm’ problem


X
min kCθ − dk1 = min |cTj θ − dj | subject to Aθ ≥ b (5.30)
θ θ
j

where cTj is the j’th row of the matrix C, is equivalent to the LP problem
   
X I −C   −d
 I γ
min γj subject to C  ≥ d  (5.31)
γ,θ θ
j 0 A b

where γ is now a vector. This is now very close to the predictive control problem
we want to solve.

The cost function (5.25) can be written as

V (k) = kQ[Θ∆U (k) − E(k)]k1 (5.32)

where Θ, E(k) and ∆U (k) are as defined in section 3.1.1 and Q consists of Hu copies
of Q stacked on top of each other, where Q = diag{q1 , . . . , qp }. This has to be
minimised subject to inequality (3.41). This problem is in the same form as (5.30),
so we see that this is an LP problem.

5.4.3 Min-max formulations

In [CM86] it was proposed to solve the predictive control problem by minimising


the ‘∞-norm’ cost function:

V (k) = kQ[Θ∆U (k) − E(k)]k∞ = max max |ẑj (k + i|k) − rj (k + i)|qj (5.33)
i j

subject to the usual constraints. This attempts to minimise the peak deviation
from the set-points, over all the controlled outputs and over the prediction horizon.
Using the ‘1-norm’ as in (5.25) or the ‘2-norm’ as in (3.45) minimises something like
5.5. Zones, Funnels and Coincidence Points 173

the average deviation, loosely speaking, but can permit occasional large deviations.
Using the ‘∞-norm’ is an attempt to overcome this, if it is a problem.

This is again an LP problem, which can be seen as follows. The problem is of the
form

min kCθ − dk∞ subject to Aθ ≥ b (5.34)


θ

which is the same as

min max |cTj θ − dj | subject to Aθ ≥ b (5.35)


θ j

This is equivalent to
   
1 −C   −d
 1 γ
min γ subject to C  ≥ d  (5.36)
γ,θ θ
0 A b

where γ is now a scalar, and 1 denotes a vector, each element of which is 1. Clearly
this is an LP problem.

5.5 Zones, Funnels and Coincidence Points

We have represented the control objectives as a reference trajectory for the controlled
outputs to follow. In some applications the exact values of the controlled outputs
are not important, so long as they remain within specified boundaries, or ‘zones’, as
shown in Figure 5.7. This is easily accommodated within our ‘standard problem’ by
setting Q(i) = 0, and leaving only constraints on the controlled outputs to define the
performance objectives. If R(i) = 0 also, then something has to be done to ensure
that the optimization remains well-defined. The optimization problem typically
simplifies from a QP to an LP problem, if all the objectives are ‘zone’ objectives.

A variation of this is to represent the objectives by ‘funnels’, which are the same as
‘zones’, except that they become narrower over the prediction horizon. If moving
towards a set-point sj from a lower value zj (k), for example, one can define a ‘funnel’
whose upper boundary is sj , and whose lower boundary is a first-order ‘trajectory’:

(1 − αi )sj + αi z(k) ≤ ẑj (k + i|k) ≤ sj (0 < α < 1) (5.37)

as illustrated in Figure 5.8. The shaded areas in the figure show that the predicted
trajectory is penalised only when it leaves the funnel. The advantage of this, over
defining a reference trajectory

r(k + i) = (1 − αi )sj + αi z(k)

is that, in the multivariable case, the reference trajectories for different outputs can
be inconsistent with each other. Following one reference trajectory might cause
174 5. Other Formulations of Predictive Control

Zone

Predicted output

Latest output measurement Time

Figure 5.7: A zone objective

another output to return to its set-point more quickly than its reference trajectory
specifies. The use of funnels in this situation allows the controller to take advantage
of this benign turn of events, rather than impeding the return of both outputs to
their set-points unnecessarily.

A variation on this is to make the lower boundary of the funnel a straight line, as
shown in Figure 5.9. This is what is done in Honeywell’s RMPCT product.

According to [QB96], commercial products enforce funnel constraints as ‘soft’ con-


straints, by switching in large penalty weights when the funnel boundaries are
crossed or approached.

A third alternative is to use only a few coincidence points, rather than penalising
errors between r(k + i) and ẑ(k + i|k) over the whole prediction horizon, as we did
in the simple examples of Chapter 1. This is illustrated in Figure 5.10. This is
in some ways similar to the ‘zone’ idea; if the coincidence points are at the end of
the prediction horizon, this corresponds to expressing indifference about the precise
trajectory of the controlled outputs, so long as they are reasonably close to their set-
points eventually. If different controlled outputs respond with different time-scales,
then the coincidence points for some variables can be made different from those for
others. This idea is easily accommodated within our standard problem formulation:
just set most elements of Q(i) to zero for most i.
5.6. Predictive Functional Control (PFC) 175

Set-point

Funnel
Reference trajectory

Predicted output

Latest output measurement Time

Figure 5.8: A funnel objective

5.6 Predictive Functional Control (PFC)

Predictive Functional Control, frequently abbreviated to PFC, is a form of predictive


control which has been pioneered by Richalet [RRTP78, Ric93b] . In principle it
is no different to predictive control as we have presented it so far, but it places
emphasis on other features than those which have been emphasised in this book.
Two of these features, namely the use of relatively few coincidence points, and the
use of a reference trajectory which is distinct from the set-point trajectory, have
already been introduced in Chapter 1.

Perhaps the most distinctive feature of PFC is that the future input is assumed to
be a linear combination of a few simple basis functions. In principle these could be
any appropriate functions, but in practice a polynomial basis is usually adopted. In
this case the future input is assumed to be of the form

û(k + i|k) = u0 (k) + u1 (k)i + u2 (k)i2 + · · · + uc (k)ic (5.38)

Thus the future input profile is parametrised by the c+1 coefficients u0 (k), u1 (k), . . . , uc (k).
In practice low values of c are used, such as 1 or 2, so that the optimization is per-
formed over only 2 or 3 parameters, for single-input systems. The notion of ‘control
horizon’ therefore does not exist, but is replaced by the number of basis functions
used. The same idea extends to multi-input systems, by taking u0 (k), . . . , uc (k)
to be vectors of coefficients. The coefficients are shown here indexed by the time
argument (u0 (k) etc) in order to emphasise that the coefficients are chosen to be
optimal at each k, and so are different at each step.
176 5. Other Formulations of Predictive Control

Set-point Funnel

Reference trajectory

Predicted output

Latest output measurement Time

Figure 5.9: A funnel objective with a straight line boundary

An alternative parametrisation of the input used in PFC is by means of delayed


step functions — but that is exactly equivalent to the parametrisation by means
of increments ∆u(k) which we have been using since Chapter 2, so we shall not
consider it further here.

The time window over which the cost function is minimised, namely i = Hw to
i = Hp (called the coincidence horizon in the PFC literature) usually contains only
a few points, and often a single point, so that the cost function is frequently of the
form

V (k) = kr(k + Hp ) − ŷ(k + Hp |k)k2Q (5.39)

The number of coincidence points in the coincidence horizon is taken at least as


large as the number of basis functions used to parametrise the predicted input in
(5.38). It will be noticed that no penalty on input moves has been imposed here, for
reasons which will become apparent shortly. Such a penalty is sometimes imposed
in PFC, and if it is then, as usual, care is taken not to destroy steady-state accuracy,
and to allow offset-free tracking: moves ∆û(k + i|k) are penalised if the steady-state
input is expected to be a constant, second differences ∆2 û(k + i|k) are penalised if
the steady-state input is expected to be a ramp, and so on.

In the case of a SISO system, with the number of coincidence points equal to the
number of parameters in (5.38), no optimization is necessary, since one can solve
analytically for the input which makes V (k) = 0 — at least, if constraints are
ignored. We have already seen examples of this in Chapter 1.

Correction for plant-model mismatches in steady-state gains, and for persistent dis-
5.6. Predictive Functional Control (PFC) 177

Set-point

Coincidence points

Reference trajectory

Hp

Predicted output

Latest output measurement Time

Figure 5.10: A reference trajectory with only a few coincidence points

turbances, is achieved by ‘auto-compensation’, which is equivalent to modelling out-


put disturbances. For example, if the plant is asymptotically stable, then steady-
state gain errors in the model can be compensated for by forming an estimate of the
actual plant output, once it is in steady-state. This can be done, for example, by av-
eraging the last few measured values. It is then assumed that the error between this
estimated plant output and the previously predicted model output will continue into
the future. This is almost equivalent to the method of obtaining offset-free tracking
which was introduced in Chapter 1, and to the ‘DMC model’ of output disturbances
introduced in Chapter 2. The only difference is that there the ‘trend’ is taken to be
the last measured output, whereas PFC allows a more general estimate of the actual
plant output.

This can be generalised in the following way: if the set-point is a polynomial of


degree ν, then it can be tracked without error, even in the presence of plant-model
mismatch, providing that the input is structured as a polynomial of degree ν (take
c = ν in (5.38)). ‘Auto-compensation’ is achieved by fitting a polynomial of degree
ν to the plant output, then correcting the model prediction by extrapolating this
polynomial. In practice, ν = 1 or ν = 2 is used, for following ramp or parabolic set-
point trajectories. PFC places emphasis on this feature because it has been applied in
servomechanisms, where such set-points are common [RRTP78, ReADAK87, Ric93a]
. Let us suppose that the set-point trajectory is
s(k) = s0 + s1 k + · · · + sν kν (5.40)
and assume, for simplicity, that the reference trajectory coincides with the set-point
trajectory: r(k) = s(k). If the plant is asymptotically stable, and has reached a
‘steady-state’ in which its output is following a polynomial of degree ν, then the
178 5. Other Formulations of Predictive Control

k Time

k Time

k Time

Figure 5.11: A future input built up from a polynomial basis.

input must also be such a polynomial:

u(k) = v0 + v1 k + · · · + vν kν (5.41)

Since this input is applied to both the model and the plant, the error between the
model output and the plant output will, at worst, be a polynomial of degree ν.
Hence the predicted plant-model error is assumed to have the form
X
ν
ê(k + i|k) = e(k|k) + ej ij (5.42)
j=1

where e(k|k) = y(k)− ŷ(k|k−1) is the current error between the plant output and the
model output. The coefficients e1 , . . . , eν are obtained by fitting a trend to previous
errors in some way — for example, a least-squares fit. The model predictions are
corrected by this plant-model error, so that the future input trajectory is chosen to
minimise the cost
X
ν+1
V (k) = ks(k + Pi ) − ŷ(k + Pi |k) − e(k + Pi |k)k2 (5.43)
i=1

where ν +1 coincidence points have been chosen, at times k +P1 , . . . , k +Pν+1 . Since
the only term in the cost that depends on the future input trajectory is ŷ(k + Pi |k),
5.6. Predictive Functional Control (PFC) 179

the cost can be made zero by choosing the input trajectory such that

ŷ(k + Pi |k) = s(k + Pi ) − e(k + Pi |k) (i = 1, . . . , ν + 1) (5.44)

and this can be done if the number of inputs is at least as great as the number
of outputs. Now, by assumption, y(k + Pi ) = ŷ(k + Pi |k) + e(k + Pi |k), so we get
y(k +Pi ) = s(k +Pi ). (Otherwise our original assumption that the plant-model error
can be extrapolated by a polynomial would not be valid.) Note that this argument
does not depend on the model which produces ŷ(k + Pi |k) being accurate in any
respect, except for the feature that a polynomial input should result in the output
being a polynomial of the same degree.

An important point is that the polynomial parametrisation of the input is not nec-
essary to obtain error-free tracking. The essentials are:

1. To have ‘auto-compensation’ of sufficiently high degree (at least ν) — that is,


to have an ‘internal model’ of the persistent plant-model mismatch.

2. To have enough coincidence points so that matching the reference trajectory


at these points implies matching it everywhere else — that is, at least ν + 1
coincidence points.

3. To have enough degrees of freedom in the choice of future control actions to


enable the reference trajectory to be matched at the coincidence points.

Thus other forms of predictive control, which do not use such an input parametri-
sation, can achieve error-free tracking if they employ a suitably rich internal model
of the plant-model mismatch, if there are sufficiently many coincidence points, and
if the control horizon is long enough.

PFC generally uses a reference trajectory which is re-anchored at the latest output
measurement, as already described in Chapter 1. Recall that, if the current set-point
is s(k), then the current error is ε(k) = s(k) − y(k), and the reference trajectory
r(k + i|k) is defined so that s(k + i) − r(k + i|k) = ε(k + i) decreases from ε(k)
to zero gradually as i increases. Most commonly, the reduction is exponential:
ε(k + i) = λi ε(k), where 0 ≤ λ < 1.

λ is an important parameter for PFC, since it defines the aggressiveness of the


controller in recovering from disturbances. λ = 0 gives a fast, agressive response,
while λ ≈ 1 gives a slow, gentle response. If several outputs are being controlled,
it is possible to define a different value of λ for each output. But in a multi-output
system it may be difficult to define an appropriate reference trajectory for each
output, because different disturbances may result in different ‘natural’ or desirable
combinations of responses of the various outputs. In this case the idea of a reference
trajectory can be very usefully combined with the funnel idea which was described in
section 5.5. A value of λ can be defined for each output which defines, say, the slowest
reduction of the error which one would normally like to see on that output. But
180 5. Other Formulations of Predictive Control

only errors due to outputs being ‘on the wrong side’ of the reference trajectories
are penalised. This idea is implemented in Honeywell’s product RMPCT, which
is described in Appendix A. In this product, however, the reference trajectory
is a straight line from the current output to some point on the future set-point
trajectory, rather than an exponential curve. Some further discussion of how a
reference trajectory modifies the feedback loop is given in section 7.5.

There are two reasons why the cost function used in PFC often omits any penalty
on control moves. One is that the required performance is largely determined by the
reference trajectory, so that it is not necessary to use the weights Q and R in the cost
function as tuning parameters to obtain the required performance. The other is that
the polynomial structure of the future control signal results in relatively few degrees
of freedom being available to the optimiser — because low degree polynomials are
usually used — and this usually results in relatively smooth input trajectories being
obtained. It is therefore not necessary to use a control move penalty to reduce the
‘roughness’ of the input signal.

The results obtained above for error-free tracking of polynomial set-point trajec-
tories continue to hold if such reference trajectories are used, essentially because
the reference trajectory coincides (asymptotically) with the set-point trajectory if
steady disturbance-free conditions are assumed. For details see [Ric93b].

PFC deals with constraints in a heuristic manner — that is, in a way which does
not yield the true constrained optimal solution in general. This approach originates
in the application of PFC to high-bandwidth servomechanism systems, for which
computing the true optimal solution could not be done in real time — especially
in the 1970’s, when this version of predictive control was originally developed. It
is claimed, however, that in many applications the heuristic solution is adequate,
particularly with SISO plant.

Constraints on input levels and rates of change are dealt with in PFC simply by
‘clipping’. Consider a single-input plant for simplicity. Suppose that the constraints
on the input level are umin < u(k) < umax and on the input move are ∆umin <
∆u(k) < ∆umax , and that the solution algorithm computes an input move ∆u(k)∗ ,
without taking any constraints into account. Then the move actually applied to the
plant is (assuming umin < 0 and umax > 0)

min (∆u(k)∗ , ∆umax , umax − u(k − 1)) if ∆u(k)∗ > 0
∆u(k) = (5.45)
max (∆u(k)∗ , ∆umin , umin − u(k − 1)) if ∆u(k)∗ < 0
Of course the same move must be applied to the internal model as to the plant. This
not only helps to keep the predictions accurate, but also avoids problems analogous
to ‘integrator wind-up’. This heuristic approach will not give the true optimal
solution in general, but it often gives very similar results. (See Problem 6 for an
example.)

PFC does not have a clear strategy for dealing with state and output constraints.
The commercial product based on PFC, in common with several other MPC prod-
5.7. Continuous-time Predictive Control 181

ucts, adopts heuristics to find a sub-optimal solution when such constraints are
active.

5.7 Continuous-time Predictive Control

It was already remarked in section 1.3 that predictive control does not require a
discrete-time model; it is enough to know the values of the step response at the co-
incidence points. But it is possible to go further, and formulate the whole predictive
control problem, and its solution, in continuous time. This has been proposed by
Gawthrop et al [DG91, DG92, GDSA98].

They propose a quadratic cost function of the form


Z τ2 Z τ2
V (t) = kr(t + τ ) − ŷ(t + τ |t)k dτ + λ
2
kû(t + τ |t)k2 dτ (5.46)
τ1 τ1
and the use of a continuous-time model. Predictions of the output are formed by
using a truncated Taylor series expansion:
τ2 τ n (n)
ŷ(t + τ |t) = y(t) + τ ẏ(t) +
ÿ(t) + · · · + y (t) (5.47)
2! n!
A Taylor series is also used to parametrise the future input trajectory, the parameters
being the current input (to be applied to the plant) and its first m time derivatives:
τ2 τ m (m)
û(t + τ |t) = u(t) + τ u̇(t) + ü(t) + · · · + u (t) (5.48)
2! m!
m plays a role analogous to the control horizon Hu in the discrete-time formulation;
it restricts the complexity of the assumed future input trajectory, in the sense that
only the first m derivatives of û(t + τ |t) (with respect to τ ) are non-zero. (Note the
conceptual similarity of this to the polynomial basis used in PFC.)

If a linear model is used then the optimal parameters u(t), u̇(t), . . . , u(m) (t) can be
found by solving a least-squares problem, if there are no constraints. Suppose that
a state-space model is used:
ẋ(t) = Ax(t) + Bu(t), y(t) = Cx(t) (5.49)
Then
   
y(t) C
 ẏ(t)   CA 
   
Y(t) =  .. = ..  x(t) +
 .   . 
y (n) (t) CAn
  
0 0 ··· 0 0 u(t)
 CB 0 ··· 0 0  u̇(t) 
  
 .. .. .. .. ..  ..  (5.50)
 . . . . .  . 
CAn−1 B CAn−2 B · · · CB 0 u(n−1) (t)
182 5. Other Formulations of Predictive Control

so the prediction (5.47) can be obtained if it is assumed that the current state is
known, and it is linear in u(t), u̇(t), . . . , u(m) (t). Now if (5.47) is written in the form
 
τn
ŷ(t + τ |t) = 1, τ, . . . , Y(t) (5.51)
n!

then, assuming for simplicity that there is only one output, so that y and r are
scalars,
Z τ2 Z τ2
kr(t + τ ) − ŷ(t + τ |t)k dτ = Y(t) Φ(τ1 , τ2 )Y(t) − 2φ(τ1 , τ2 )Y(t) +
2 T
r(t + τ )2 dτ
τ1 τ1
(5.52)

where
 
1  
Z τ2 
 τ   τn
Φ(τ1 , τ2 ) =  . . .  1, τ, . . . , n! dτ (5.53)
τ1
τn
n!

and
Z τ2  
τn
φ(τ1 , τ2 ) = 1, τ, . . . , r(t + τ )dτ (5.54)
τ1 n!

One can find a similar expression for τ12 kû(t + τ |t)k2 dτ using (5.48).

Thus the cost function V (t) is a quadratic function of Y(t) and of the input and
its derivatives, and Y(t) is itself linear in the input and its derivatives, so V (t)
is a quadratic function of the parameters u(t), u̇(t), . . . , u(m) (t). So minimising it
requires the solution of a least-squares problem, as was claimed earlier. Although
it is not explored in the work of Gawthrop et al, the addition of linear inequality
constraints on the inputs and outputs, and possibly on their derivatives, would give
rise to a quadratic programming problem , just as in the discrete-time case.

While this formulation nicely parallels the discrete-time formulation, the proposal
is not complete, in that it does not specify how the solution should be implemented.
Conceptually, the optimal u(t) is computed and applied continuously — the deriva-
tives found as part of the solution are not used, which is analogous to discarding all
but the initial part of the optimal input trajectory in the discrete-time formulation.
In practice this would not be feasible, and presumably some kind of frequent update
would need to be implemented, with care being taken to impose sufficient smooth-
ness on the input trajectory actually applied to the plant, for it to be consistent
with the use of (5.50). The use of Taylor series for prediction is very vulnera-
ble to measurement errors, since it relies on knowing high-order time derivatives.
In [DG91, DG92, GDSA98] there is some discussion of how the robustness of the
continuous-time scheme can be increased.
5.8. Problems 183

5.8 Problems
1. Consider the swimming pool from Problem 3 of Chapter 3, with a sinusoidal di-
urnal variation of the ambient air temperature θa defined as in (3.96). Suppose
that the air temperature is now measured and used for feedforward. Assume
that weights and horizons remain the same as earlier.
(a) Show by simulation that if the model is perfect and there are no con-
straints on the input power then the control system compensates perfectly
for the variation in air temperature.
(b) If there is a modelling error, as in part (c) of Problem 3 of Chapter 3, show
that there is a residual variation of approximately 0.2 degC in the water
temperature. (Recall that when the air temperature is an unmeasured
disturbance and the power is unconstrained, the residual variation in θ is
approximately 0.5 degC, with both the perfect and the imperfect models.)
(c) If the input power is constrained to 0 ≤ q ≤ 40 kW, show that the
set-point is held much more accurately when the air temperature is mea-
sured and used for feedforward, but only in those periods when the input
constraints are not active. In those periods when the input power is con-
strained the water temperature variations are almost the same, regardless
of whether the air temperature is measured or not.
2. Suppose that the ‘1-norm’ cost function (5.25) is augmented by penalties on
input moves:

X X
Hp p
X
Hu X
m
V (k) = |ẑj (k + i|k) − rj (k + i)|qj + |∆ûj (k + i|k)|rj (5.55)
i=1 j=1 i=1 j=1

where the rj ’s are nonnegative weights. Show that minimising this, subject to
the usual constraints, is an LP problem.
3. Consider the unstable helicopter model of Example 4.11, with transfer function
6.472z 2 − 2.476z + 7.794
P (z) =
(z − 0.675)(z − 1.047 + 0.2352i)(z − 1.047 − 0.2352i)
Find a pair of coprime factors Ñ (z), M̃ (z), such that P (z) = Ñ (z)/M̃ (z) and
both Ñ (z) and M̃ (z) are stable. Ensure that each factor is proper (numerator
degree does not exceed denominator degree), so that each could be realised as
a state-space system. (Note: There are many possible solutions.)
Note that finding a ‘decomposition’ of the form (5.22) is harder.
4. Using the notation of sections 1.3 and 5.6, show that the predicted model
output resulting from the input u0 (k) + u1 (k)i is
ŷ(k + Hp |k) = S(Hp )u0 (k) + [S(Hp − 1) + · · · + S(1)]u1 (k) + ŷf (k + Hp |k)

(where ŷf denotes the predicted free response).


184 5. Other Formulations of Predictive Control

5. Suppose that an asymptotically stable plant has one controlled output, which
is to follow a ramp set-point without error, using PFC.

(a) What is the smallest number of coincidence points that must be used?
(b) If there is only one input, and a polynomial basis is used to structure
the assumed future input trajectory, what degree of polynomial should
be used?
(c) Suppose two inputs are available. Discuss the possibilities for structuring
the future input trajectories.
(d) What other feature must be included in the control scheme, if error-free
tracking of the ramp is to be obtained?

6. Consider the swimming pool from Problem 3 of Chapter 3, with a sinusoidal


diurnal variation of the ambient air temperature θa defined as in (3.96), and
with the input power constraint 0 ≤ q ≤ 40 kW.

(a) Show that in this case the behaviour obtained by ‘clipping’ the uncon-
strained solution is the same as that obtained by solving the QP problem.

(b) If there is also a slew rate constraint of |q̇| < 20 kW/hour, show that the
QP and clipped solutions are no longer the same, although they are still
very close.

Note: Use the Model Predictive Control Toolbox function smpcsim to get the
clipped solution.

7. Verify that the vector Y(t), containing y(t) and its time derivatives, is given
by (5.50).

8. Define a vector U(t), analogous to Y(t), which contains u(t) and its time
derivatives. Express the continuous-time cost V (t), defined by (5.46), as a
quadratic function of U (t).
Chapter 6

Stability

If one is designing a predictive controller off-line then nominal stability of the closed
loop is hardly an issue. It is quite easy to obtain stability by tuning the parameters
in the problem formulation, and very easy to check that the designed system is stable
(assuming the correct plant model). This at least is the typical situation with current
applications of predictive control. Current applications are invariably implemented
on stable plants, and the dynamic performance demanded from predictive controllers
is typically not very challenging. As predictive control is applied more widely, with
tight dynamic specifications, and especially if it is applied to unstable plants, then
this situation may change.

Closed-loop stability is much more of an issue if predictive control is being used in


a way which requires any on-line re-design. This includes adaptive control in the
traditional set-up, where re-estimation of the plant model and consequent re-design
of the controller is assumed to occur continuously. It also includes situations such
as occasional re-estimation followed by re-design, for example following a failure or
a change in the plant configuration.

In this chapter several ways of guaranteeing nominal stability are investigated. It


will be seen that there are now several ways of ensuring that the nominal closed
loop, at least — that is, with the assumption that the model is perfect — is stable.

Predictive control, using the receding horizon idea, is a feedback control policy.
There is therefore a risk that the resulting closed loop might be unstable. Even
though the performance of the plant is being optimised over the prediction horizon,
and even though the optimization keeps being repeated, each optimization ‘does not
care’ about what happens beyond the prediction horizon, and so could be putting
the plant into such a state that it will eventually be impossible to stabilise. This
is particularly likely to occur when there are constraints on the possible control
input signals. It is easy to construct an example where this happens, even without
constraints:

185
186 6. Stability

Example 6.1 Consider a discrete-time system consisting of two delays in series:

x1 (k + 1) = u(k)
x2 (k + 1) = x1 (k)

or, using vector-matrix notation:


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

Suppose the prediction horizon is Hp = 1, and the cost to be minimised is

V (k) = x̂1 (k + 1|k)2 + 6x̂2 (k + 1|k)2 + 4x̂1 (k + 1|k)x̂2 (k + 1|k)


 
T 1 2
= x̂(k + 1|k) x̂(k + 1|k)
2 6

(which is positive-definite). The predictive control problem is to find u(k) which will
minimise V (k).

Using the model, the predictions are x̂1 (k + 1|k) = u(k) and x̂2 (k + 1|k) = x1 (k).
Substituting these into V (k) gives

V (k) = u(k)2 + 6x1 (k) + 4u(k)x1 (k).

To find the minimum of this, differentiate and set the derivative to zero:

∂V
= 2u(k) + 4x1 (k)
∂u(k)
= 0 if u(k) = − 2x1 (k).

Substituting this back into the model gives the closed-loop equations:

x1 (k + 1) = −2x1 (k)
x2 (k + 1) = x1 (k)

or
 
−2 0
x(k + 1) = x(k).
1 0

Clearly this is unstable, since the closed-loop transition matrix has an eigenvalue at
−2, outside the unit circle.

One might guess that this problem arises in the Example because the prediction
horizon is too short, so that the control is too ‘short-sighted’. This is correct, and
it turns out that stability can usually be ensured by making the prediction horizon
long enough, or even infinite. We will see that later in this chapter.
6.1. Terminal Constraints Ensure Stability 187

6.1 Terminal Constraints Ensure Stability

Another way of ensuring stability is to have any length of horizon, but to add a
‘terminal constraint’ which forces the state to take a particular value at the end
of the prediction horizon. And it is surprisingly easy to prove this, even in a very
general case, by using a Lyapunov function, as was first shown by Keerthi and
Gilbert [KG88]. For the purpose of proving stability it is enough to consider the
case when the state is to be driven to the origin, from some initial condition.

Theorem 6.1 Suppose that predictive control is obtained for the plant

x(k + 1) = f (x(k), u(k))

by minimising the cost function

X
Hp
V (k) = `(x̂(k + i|k), û(k + i − 1|k))
i=1

where `(x, u) ≥ 0 and `(x, u) = 0 only if x = 0 and u = 0, and ` is ‘decrescent’,


subject to the terminal constraint

x̂(k + Hp |k) = 0

The minimisation is over the input signals {û(k + i|k) : i = 0, 1, . . . , Hu − 1}, with
Hu = Hp (for simplicity), subject to the constraints û(k+i|k) ∈ U and x̂(k+i|k) ∈ X,
where U and X are some sets. We assume that x = 0, u = 0 is an equilibrium
condition for the plant: 0 = f (0, 0). The receding horizon method is applied, with
only u0 (k|k) being used from the optimal solution {u0 (k + i|k) : i = 0, . . . , Hu − 1}.

Then the equilibrium point x = 0, u = 0 is stable, providing that the optimization


problem is feasible and is solved at each step.

Proof 6.1 The proof makes use of concepts from Minitutorial 6. Let V 0 (t) be the
optimal value of V which corresponds to the optimal input signal u0 , as evaluated at
time t. Clearly V 0 (t) ≥ 0, and V 0 (t) = 0 only if x(t) = 0 — because if x(t) = 0 then
the optimal thing to do is to set u(t + i) = 0 for each i. We are going to show that
V 0 (t + 1) ≤ V 0 (t), and hence that V 0 (t) is a Lyapunov function for the closed-loop
system.

As usual in stability proofs, we will assume that the plant model is perfect, so that the
predicted and real state trajectories coincide: x(t+i) = x̂(t+i|t) if u(t+i) = û(t+i|t).
188 6. Stability

With this assumption we have

X
Hp
0
V (t + 1) = min `(x(t + 1 + i), u(t + i))
u
i=1

XHp
= min `(x(t + i), u(t − 1 + i)) − `(x(t + 1), u(t))+
u 
i=1

`(x(t + 1 + Hp ), u(t + Hp ))}


≤ −`(x(t + 1), u0 (t)) + V 0 (t) +
min {`(x(t + 1 + Hp ), u(t + Hp ))}
u

since the optimum is certainly no worse than keeping the optimal solution found at
time t, which will take us up to time t + Hp , then doing the best we can for the final
step. But we have assumed that the constraint x(t + Hp ) = 0 is satisfied, since the
optimization problem was assumed to be feasible, so we can make u(t + Hp ) = 0 and
stay at x = 0, which gives

min {`(x(t + 1 + Hp ), u(t + Hp ))} = 0.


u

Since `(x(t), u0 (t)) ≥ 0, we can conclude that V 0 (t + 1) ≤ V 0 (t). So V 0 (t) is a Lya-


punov function, and we conclude by Lyapunov’s stability theorem that the equilibrium
x = 0, u = 0 is stable.

This sounds too good to be true. It seems too easy to guarantee stability. The
problem is with the assumption that the optimization problem has a solution at each
step, and that the global optimum can be found at each step. General constrained
optimization problems can be extremely difficult to solve, and just adding a terminal
constraint may not be feasible. But we will use the idea of this proof several times
later, in more realistic situations.

Example 6.2 If we look again at Example 6.1 and try to get stability by adding the
terminal constraint x(k + 1) = 0, we get an infeasible problem, because that could
only be achieved if x1 (k) = 0, which will not be true in general. (In general you need
at least 2 steps to drive a 2-state linear system to the origin.) Problem 2 shows that
for this example stability is obtained by increasing the prediction horizon to Hp = 2,
even without a terminal constraint.

The same basic idea can be applied in various ways. Two particular ways, associated
with GPC, have become quite well known and have been incorporated into particular
versions of GPC: ‘Stable input-output receding horizon control’, or SIORHC (see
[Mos95, Chapter 5.8]), and ‘Constrained receding horizon predictive control’, or
CRHPC (see [CC95, Chapter 6.5]).
6.1. Terminal Constraints Ensure Stability 189

Equilibrium: The equation x(k + 1) = f (x(k), u(k)) has an equilibrium (or ‘fixed
point’) at state x0 and input u0 if x0 = f (x0 , u0 ).
Note that we can always introduce a change of coordinates z(k) = x(k) − x0 , v(k) =
u(k) − u0 , so that the equilibrium is at (0, 0) in the new coordinates:

z(k + 1) = x(k + 1) − x0 = f (z(k) + x0 , v(k) + u0 ) − f (x0 , u0 )


= g(z(k), v(k))
0 = g(0, 0)

So we can always assume that an equilibrium is at (0, 0).


Stability: For nonlinear systems one has to consider the stability of a particular
equilibrium point, rather than the system. (Some equilibria may be stable, others
unstable.)
An equilibrium point (0, 0) is stable (in the sense of Lyapunov) if a small perturbation
of the state or input results in a ‘continuous’ perturbation of the subsequent state and
input trajectories. More precisely, given any  > 0, there is a δ > 0 (which depends
on  > 0 and the system) such that if ||[x(0)T , u(0)T ]|| <  then ||[x(k)T , u(k)T ]|| < δ
for all k > 0.
It is asymptotically stable if in addition ||[x(k)T , u(k)T ]|| → 0 as k → ∞.
For closed-loop systems u(k) itself depends on x(k), so we could have written x(k +
1) = f (x(k)), where f now represents the closed-loop state equation.
Lyapunov’s Theorem: If there is a function V (x, u) which is positive-definite,
namely such that V (x, u) ≥ 0 and V (x, u) = 0 only if (x, u) = (0, 0), and has the
(‘decrescent’) property that

||[xT1 , uT1 ]|| > ||[xT2 , uT2 ]|| ⇒ V (x1 , u1 ) ≥ V (x2 , u2 )

and if, along any trajectory of the system x(k + 1) = f (x(k), u(k)) in some neigh-
bourhood of (0, 0) the property

V (x(t + 1), u(t + 1)) ≤ V (x(t), u(t))

holds, then (0, 0) is a stable equilibrium point.


If, in addition, V (x(t), u(t)) → 0 as t → ∞ then it is asymptotically stable.
Such a function V is called a Lyapunov function.
Mini-Tutorial 6: Stability and Lyapunov Functions
190 6. Stability

However, since we shall see in the following sections that stability can be achieved
without imposing conditions as severe as single-point terminal constraints, we shall
not pursue this approach further.

A very important generalisation, and relaxation, of the idea of terminal constraints


is to specify a terminal constraint set X0 , which contains the origin, rather than a
single point. Usually, the idea is to use predictive control to drive the state into
such a set, and then to switch to some other control law, which can be guaranteed
to stabilise the system for initial conditions within X0 , assuring that the state will
be driven to the origin, providing that it has first been driven into X0 . It is assumed
that all constraints are inactive within X0 , so that conventional control (usually
but not necessarily linear) is adequate when the state is within this terminal set.
The idea of using a terminal constraint set was introduced in [MM93], as part of a
scheme for obtaining robustly stable predictive control of nonlinear systems. Some
more remarks about it can be found in sections 8.5.2 and 10.3. Schemes which
involve first using predictive control to drive the state into a terminal constraint set,
then switching to another control law, are often called dual-mode predictive control
schemes.

It has recently been argued [MRRS00]that all MPC schemes which have been pro-
posed to date and which guarantee closed-loop stability, have a terminal constraint
set built into them (possibly implicitly, and possibly consisting of a single point).
Furthermore they contain a control law defined on this terminal set which respects
all the constraints, and which keeps the state in the set, once the state trajectory
has entered it. Finally, they all contain (possibly implicitly) a terminal cost, that is,
a cost penalising non-zero states at the end of the prediction horizon; furthermore,
the terminal cost function is such that it is a Lyapunov function, when confined to
the terminal constraint set. In many of the published proposals one or more of these
elements are trivial — for instance, the terminal constraint set may consist of only
the origin, the control law on this set (point) may be the prescription u ≡ 0, and the
terminal cost function may be F (x) = ∞ if x 6= 0, F (x) = 0 if x = 0. Nevertheless,
the explicit identification of these elements may be valuable for future proposals; in
particular the recognition that both a terminal constraint set and a terminal cost
can usefully be part of a successful ‘prescription’ is a surprising revelation.

6.2 Infinite Horizons

The specific approach described in this section was originated in [RM93], and elabo-
rated upon in [MR93b, MR93a], although the underlying ideas are similar to those in
[KG88], where it was shown that infinite-horizon constrained control problems could
be approximated by finite-receding-horizon problems with a terminal constraint. It
had been known for some time (eg see [BGW90]) that making the horizons infinite
in predictive control leads to guaranteed stability, but it was not known how to
handle constraints with infinite horizons. The work of Rawlings and Muske made
6.2. Infinite Horizons 191

a break-through in this respect. The same ideas have also been applied to the
transfer-function formulation [Sco97]— not surprisingly, the whole development can
be repeated in that setting.

The key idea is to re-parametrise the predictive control problem with infinite horizons
in terms of a finite number of parameters (instead of the infinite number of control
decisions ∆u(k|k), ∆u(k + 1|k), . . . ), so that the optimization can still be performed
over a finite-dimensional space — in fact, it remains a QP problem. Since the
original work of Rawlings and Muske, several other proposals have been made, which
can be interpreted as different re-parametrizations of the infinite horizon problem
[RK93, SR96b].

In [Mor94] the opinion has been expressed that there is now no longer any reason
to use finite horizons — at least with linear models.

Let us begin by examining why the use of an infinite costing horizon guarantees
stability.

6.2.1 Infinite horizons give stability

Figure 6.1 shows an essential difference between a finite, receding horizon formulation
of predictive control, and an infinite horizon formulation. The top half of the figure
depicts the finite-horizon formulation, with the plant output heading towards a
constant set-point. At time k a particular trajectory is optimal over the prediction
horizon of length Hp . In the absence of disturbances, and with a perfect model, the
plant at time k + 1 is precisely in the state which was predicted at the previous time
step. One might expect, therefore, that the initial portion of the optimal trajectory
over the prediction horizon from time k + 1 to time k + 1 + Hp would coincide with
the previously computed optimal trajectory. But a new time interval now enters
the picture which had not been considered when the earlier optimization had been
performed — the interval between time k + Hp and time k + 1 + Hp . The presence of
this new time interval may lead to an optimal trajectory completely different from
the one computed at the earlier step.

The lower half of Figure 6.1 shows the situation with an infinite horizon. At time k an
optimal trajectory over the whole infinite horizon is determined (implicitly). At time
k + 1 no new information enters the optimization problem, so the optimal trajectory
from this time on is the same as the ‘tail’ of the previously computed trajectory.
(This is Bellman’s celebrated principle of optimality, which states that the tail of
any optimal trajectory is itself the optimal trajectory from its starting point. It does
not apply in the finite-horizon case, because there a different optimization problem
arises at each step.) This leads to the cost function V (k) decreasing as k increases
(under the no-disturbance, perfect-model assumption), which allows it to be used as
a Lyapunov function, hence establishing stability.
192 6. Stability

Hp

Hp
Time

k k+1

Time

k k+1

Figure 6.1: Finite and infinite horizons (no disturbances, perfect model)

Figure 6.2 shows a particular case for which closed-loop stability can be established
despite the use of a finite horizon. This is when deadbeat behaviour is enforced,
with settling to the set-point occuring within the prediction horizon. In this case
the situation is similar to the infinite-horizon case, in that at each step the optimal
trajectory is the ‘tail’ of the previously computed one. (It can also be regarded as
a finite-horizon case with terminal constraint.) So in this case V (k) is also decreas-
ing, and hence stability can be established. This strategy for ensuring closed-loop
stability was used in [KR92].

Hp

Hp
Time

k k+1

Figure 6.2: Finite horizon and deadbeat response


6.2. Infinite Horizons 193

Let us now consider the details of the infinite-horizon formulation. We modify our
standard set-up a little. First, we keep the weights constant across the prediction
horizon, so that Q(i) = Q and R(i) = R. Secondly, we penalise control levels as
well as moves over an infinite horizon. Thirdly, we assume a ‘regulator’ formulation,
namely that we want to drive the output to zero:

X 
V (k) = kẑ(k + i|k)k2Q + k∆û(k + i − 1|k)k2R + kû(k + i − 1|k)k2S (6.1)
i=1

although we still assume that only the first Hu control moves are non-zero:
∆û(k + i − 1|k) = 0 for i > Hu (6.2)
We assume that S > 0 and Q ≥ 0, R ≥ 0. (In [RM93]it was assumed that the
control levels were penalised, not the control moves. In [MR93b] both control levels
and control moves were penalised. A proof which holds in the general case is given
in [MR93a]. Unfortunately the weights R and S in our notation have the opposite
meanings to those used in [RM93, MR93b, MR93a].)

Suppose initially that we have full state measurement, so that x(k) = y(k), and that
the plant is stable. Then the following argument shows that closed-loop stability is
obtained for any Hu > 0, providing that the optimization problem is, and remains,
feasible, and that the global optimum is found at each step.

Let V 0 (k) be the optimal value of the cost function at time k, let u0 denote the
computed optimal input levels, and let z 0 denote values of the controlled output
obtained as a result of applying u0 . Note that, since u0 (k + i) = u0 (k + Hu − 1) for
all i ≥ Hu , and since the steady-state value of u0 needed to keep z at 0 is 0 (according
to the optimiser’s internal model), the optimiser will certainly put u0 (k + i) = 0 for
i ≥ Hu , since an infinite cost would otherwise result. Thus we have

X X
Hu

V 0 (k) = kẑ 0 (k + i|k)k2Q + k∆û0 (k + i − 1|k)k2R + kû0 (k + i − 1|k)k2S
i=1 i=1
(6.3)
Now if we assume, as usual in proofs of nominal stability, that our model is exact
and that there are no disturbances, then z 0 (k + 1) = ẑ 0 (k + 1|k). Thus the value of
V , evaluated at time k + 1, but maintaining the same control sequence û0 (k + i|k)
as computed at time k, would be
V (k + 1) = V 0 (k) − kz 0 (k + 1)k2Q − k∆û0 (k|k)k2R − kû0 (k|k)k2S (6.4)
But at time k + 1 the new optimization problem, with initial condition z 0 (k + 1) =
Cz x0 (k + 1) — which is known, since we assume full state measurement — is solved,
so that
V 0 (k + 1) ≤ V (k + 1) (6.5)
= V (k) − kz (k +
0 0
1)k2Q − k∆û 0
(k|k)k2R − kû 0
(k|k)k2S (6.6)
< V 0 (k) (6.7)
194 6. Stability

the strict inequality being due to the assumption that S > 0.

To infer stability we must now show that V 0 (k + 1) < V 0 (k) implies that ||x(k)|| is
decreasing. Since we have assumed that S > 0, it is clear that u0 (k) is decreasing
(since u0 (k) = û0 (k|k)), which implies that x0 (k) is eventually decreasing, since we
have assumed a stable plant. But we can relax the S > 0 condition, if we replace it
by something else. For example, assuming that Q > 0 and observability of the state
from z implies that ||x0 || must eventually be decreasing, even if S = 0, as in our
standard formulation. So there are a number of possible assumptions which ensure
that decreasing V 0 implies decreasing ||x0 ||, and that is enough to show that V 0 is
a Lyapunov function for the closed loop, which shows, in turn, that the closed-loop
system is stable.

Now we must consider the case of an unstable plant. The essential difference in this
case is that the unstable modes must be driven to 0 within Hu steps. Otherwise
these modes, which are uncontrolled for i ≥ Hu , would become unbounded, giving
an infinite cost value. But it is known that in general it is not possible to drive
the states of a system to zero in less than n steps, where n is the state dimension.
Since only the unstable modes need to be driven to zero, only nu steps are actually
needed, if nu is the number of unstable modes. Thus we have to take Hu ≥ nu for an
unstable plant. We also need to ensure that the unstable modes can be driven to zero
by some input. Technically, we have to assume that the pair (A, B) is stabilisable —
namely that the unstable modes are controllable from the input; the stable modes
do not have to be controllable, since they decay to zero anyway.

With these provisos, stability follows by the same argument as for stable plants,
providing that feasibility is maintained.

When full state measurement is not available (y(k) 6= x(k)) an observer must be
used to obtain the state estimate x̂(k|k). Subject to a few technical conditions,
and assuming a perfect model as usual, x̂(k|k) → x(k) as k → ∞ if the observer
dynamics are stable. Consequently, as k increases, the value of the optimal cost
function V 0 (k) will approach the same value as in the case of y(k) = x(k), and
stability can again be inferred.

In order to be able to pose problems which are feasible over the whole infinite horizon,
it is necessary to introduce two new parameters Cw and Cp , which are analogous to
the horizons Hw and Hp , but which refer to the times over which output constraints
are enforced. To be precise, suppose that the output constraints are of the form
zi,min ≤ ẑi (k + j) ≤ zi,max for j = Cw , Cw + 1, . . . , Cp . (6.8)
In order to apply the stability theorems, both Cw and Cp must be chosen large
enough. Cw must be chosen large enough that the problem is feasible at time k. Cp
must be chosen large enough that if the problem is feasible over the finite horizon
up to time k + Cp , then it will remain feasible over the rest of the infinite horizon.
In [RM93]it is shown that finite values of Cw and Cp always exist — although for
unstable plants they depend on x(k), in general.
6.2. Infinite Horizons 195

6.2.2 Constraints and infinite horizons — stable plant

Now we need to consider how constrained predictive control problems can be solved,
when the horizons are infinite. As we have already seen, for the regulator problem
the computed input signal û(k + i − 1|k) is necessarily zero for i ≥ Hu . The cost
function can therefore be written as

X X
Hu

V (k) = kẑ(k + i − 1|k)k2Q + kẑ(k + i − 1|k)k2Q +
i=Hu +1 i=1
+k∆û(k + i − 1|k)k2R + kû(k + i − 1|k)k2S (6.9)

Now consider the first term in this expression. Since û(k + i − 1|k) = 0 for i ≥ Hu ,
we have

ẑ(k + Hu |k) = Cz x̂(k + Hu |k) (6.10)


ẑ(k + Hu + 1|k) = Cz Ax̂(k + Hu |k) (6.11)
..
.
ẑ(k + Hu + j|k) = Cz Aj x̂(k + Hu |k) (6.12)

so that

" ∞
#
X X
kẑ(k + i|k)k2Q = x̂(k + Hu |k) T T i
(A ) CzT QCz Ai x̂(k + Hu |k) (6.13)
i=Hu +1 i=0

Now let

X
Q̄ = (AT )i CzT QCz Ai (6.14)
i=0

(the series converges if the plant is stable) then



X
T
A Q̄A = (AT )i CzT QCz Ai (6.15)
i=1
= Q̄ − CzT QCz (6.16)

This equation is known as the matrix Lyapunov equation, and it can be solved for
Q̄, given A, Cz and Q. (In MATLAB it can be solved using the function dlyap from
the Control System Toolbox.) Furthermore, it is well known that Q̄ ≥ 0 if Q ≥ 0
and A has all its eigenvalues inside the unit disk, namely if the plant is stable. Thus
the cost function can be written as

X
Hu

V (k) = x̂(k + Hu |k)T Q̄x̂(k + Hu |k) + kẑ(k + i − 1|k)k2Q +
i=1
+k∆û(k + i − 1|k)k2R + kû(k + i − 1|k)k2S (6.17)
196 6. Stability

This now looks like a predictive control problem formulated over a finite horizon of
length Hu , with a terminal cost penalty — which shows, incidentally, that imposing
a terminal equality constraint to obtain stability is unnecessarily restrictive.

If the controlled output is to follow a set-point with a non-zero final value, then it
is necessary to replace the term kû(k + i − 1|k)k2S by kû(k + i − 1|k) − us k2S in the
cost function in order to get a bounded cost, where us is a steady input value which
is predicted to bring the controlled output to the required steady value rs :

rs = P (1)us = Cz (I − A)−1 Bus (6.18)


But this is unnecessary if S = 0, as in our standard formulation. If a future target
trajectory is known over a horizon Hp longer than Hu , then the approach outlined
above is easily modified to handle this. It is simply necessary to rewrite the problem
as a finite-horizon problem with horizon Hp rather than Hu , with a terminal cost of
the form x̂(k + Hp |k)T Q̄x̂(k + Hp |k).

In order to formulate this predictive control problem as a standard QP problem,


we proceed as in Chapters 2 and 3. First we form the vector of predicted states
[x̂(k + 1|k)T , . . . , x̂(k + Hu |k)T ]T exactly as in equation (2.23) — but noting that
the number of predictions needed now is Hu . The only other change that is needed
is that Q in (3.3) should be replaced by
 
Q 0 ··· 0 0
 0 Q ··· 0 0 
 
 
Q =  ... ... . . . ... ...  (6.19)
 
 0 0 ··· Q 0 
0 0 · · · 0 Q̄
| {z }
Hu blocks

(Note that the last block is different from the others).

Example 6.3 In [BGW90] the following plant is used as an example of one which
is difficult to control:
−0.0539z −1 + 0.5775z −2 + 0.5188z −3
P (z) = (6.20)
1 − 0.6543z −1 + 0.5013z −2 − 0.2865z −3
One state-space realization of this has
 
0.6543 −0.5013 0.2865
A =  1.0000 0 0  Cz = [−0.0536, 0.5775, 0.5188] (6.21)
0 1.0000 0
Suppose that Q = I3 , then
 
1.2431 −0.1011 0.1763
Q̄ =  −0.1011 0.8404 0.1716  (6.22)
0.1763 0.1716 0.3712
6.2. Infinite Horizons 197

6.2.3 Constraints and infinite horizons — unstable plant

With an unstable plant there are two reasons why we cannot proceed exactly as
before:

• We need to impose the constraint that the unstable modes must be at zero at
the end of the control horizon.

• The infinite series in (6.14) does not converge.

We proceed by decomposing the plant into its stable and unstable parts, by means
of an eigenvalue-eigenvector (Jordan) decomposition:1

A = W JW −1 (6.23)
  
Ju 0 W̃u
= [Wu , Ws ] (6.24)
0 Js W̃s

The unstable and stable modes can be obtained from this as


   
ξu (k) W̃u
= x(k) (6.25)
ξs (k) W̃s

and they evolve according to


      
ξu (k + 1) Ju 0 ξu (k) W̃u
= + Bu(k) (6.26)
ξs (k + 1) 0 Js ξs (k) W̃s

The terminal equality constraint on the unstable modes becomes

ξu (k + Hu ) = W̃u x(k + Hu ) = 0 (6.27)

Because of this constraint, only the stable modes contribute to the infinite sum in
(6.9), which therefore has a finite value:

X ∞
X
kẑ(k + i − 1|k)k2Q = kCz W̃s x̂(k + i − 1|k)k2Q (6.28)
i=Hu +1 i=Hu +1

= x̂(k + Hu |k)T Q̄x̂(k + Hu |k) (6.29)

where, proceeding as before, we find that

Q̄ = W̃sT ΠW̃s (6.30)


1
There is no numerically stable algorithm for performing the Jordan decomposition. But there
are numerically stable algorithms for finding the subspaces of the state space spanned by the unstable
and stable modes, respectively [Mac89, Chapter 8]. Since it would be enough to find these spaces,
and the corresponding projection matrices, it would be advisable to do this in an implementation.
198 6. Stability

and Π is the solution of the matrix Lyapunov equation:

Π = WsT CzT QCz Ws + JsT ΠJs (6.31)

Again Q should be as in (6.19), with Q̄ being obtained from (6.30). Predictions are
obtained as before.

The significant difference now is the appearance of the equality constraint (6.27).
This can be simply added to the QP formulation as an equality constraint. But,
as pointed out by Scokaert in the GPC context [Sco97], this equality constraint re-
moves some degrees of freedom from the optimization (as many as there are unstable
modes), and it is possible to reparametrize the problem so that the optimization is
over a smaller number of decision variables.

In the state-space setting this can be done as follows. From equation (2.66) we see
that

ξ̂u (k + Hu |k) = W̃u x̂(k + Hu |k) (6.32)


(
u −1
HX
= W̃u AHu x̂(k|k) + Ai Bu(k − 1)+
i=0
"H −1 # )
X
u

+ A B · · · B ∆U (k)
i
(6.33)
i=0

This represents nu equations, if there are nu unstable modes. Now we can use these
equations to express any nu of the variables in the vector ∆U (k) in terms of the
remaining ones, and thus eliminate these variables from the optimization. Scokaert
[Sco97] considers single-input systems, and expresses the last nu elements in ∆U (k),
namely the last nu elements of the computed input signal, in terms of the other. The
same can be done with multi-input systems, but other possibilities may be equally
sensible, such as selecting the last nu elements of the j 0 th input signal ∆ûj (k + i|k)
for i = Hu − nu , Hu − nu + 1, . . . , Hu − 1. But it is not clear whether it matters how
these nu elements are selected, even in the single-input case. The computational
saving is small — typically one has only one or two unstable modes — so it may be
as well to let the optimiser decide how to ‘use’ the equality constraints.2

6.3 Fake Algebraic Riccati Equations

In [BGW90, Mos95] it is shown that stability can sometimes be guaranteed with


finite horizons, even when there is no explicit terminal constraint. The finite hori-
zon predictive control problem is associated with a time-varying Riccati difference
equation which is intimately related to the optimal value of the cost function. The
2
With multivariable unstable models a state-space formulation is almost essential. It is almost
impossible to recover the correct number of unstable modes from a transfer function matrix, because
of numerical sensitivities.
6.3. Fake Algebraic Riccati Equations 199

Fake Algebraic Riccati Technique replaces this equation with an algebraic (time-
invariant) Riccati equation which looks like the one that occurs in infinite-horizon
LQ problems. If this equation has properties analogous to those which occur for
the (real) algebraic Riccati equation of infinite-horizon control, then stability can be
inferred. In order to develop the details we shall need to refer to Minitutorial 7, on
linear-quadratic optimal control.

We need to note some differences between the finite-horizon problem treated in


the Minitutorial and our standard predictive control problem. First, note that the
indices on Q and R ‘run backwards’ in the Minitutorial, in the sense that x(t) is
weighted by QN −1 , whereas x(t + N − 1) is weighted by Q0 . Similarly, the state-
feedback gain applied at time t is KN −1 , while that applied at time t + N − 1 is
K0 .

Secondly, the LQ cost function weights ||x(k)|| and ||u(k)||, whereas in our standard
problem we weight ||z(k)|| and ||∆u(k)||. We can put our standard problem into the
LQ framework as follows. Introduce the augmented state ξ, and the new matrices
à and B̃:
     
x(k) A B B
ξ(k) = Ã = B̃ = (6.42)
u(k − 1) 0 I I
then the two models

x(k + 1) = Ax(k) + Bu(k) and ξ(k + 1) = Ãξ(k) + B̃∆u(k) (6.43)

are equivalent (with our usual definition ∆u(k) = u(k) − u(k − 1)). Furthermore,
||z(k)||Q = ||ξ(k)||Q̃ , where
 T 
Cz QCz 0
Q̃ = (6.44)
0 0

(where z(k) = Cz x(k) — recall (2.3)). So our standard predictive control problem
is the same as the LQ problem, if we replace A and B in the plant model by à and
B̃, and the weight QN −j−1 by Q̃N −j−1 in the cost function. (The weight RN −j−1
stays unchanged in the cost function, but of course it is now interpreted as the
weight which penalises ∆u(k).) The optimal control is obtained as ∆u(t + N − j) =
−K̃j−1 ξ(t + N − j), where K̃ is the state-feedback gain matrix obtained from (6.36)
when these substitutions have been made.

Thirdly, a single horizon N is used in the LQ cost function, whereas we use the two
horizons Hp and Hu . This is no problem so long as Hu ≤ Hp , because we can always
set RN −j−1 = ∞ for j ≥ Hu , which will effectively reduce the control horizon to
Hu .3

When we apply the receding horizon control strategy, we always apply the first
part of the finite-horizon control strategy, which means that we apply the constant
3
Note that the Riccati difference equation (6.35) becomes the Lyapunov equation Pj+1 =
A Pj A + Qj when Rj = ∞.
T
200 6. Stability

Finite Horizon:
We consider the problem of having an initial state x(t) at time t, and finding a
control sequence which will minimise the finite-horizon cost function

X
N −1
VN (x(t)) = {||x(t + j)||2QN−j−1 + ||u(t + j)||2RN−j−1 } + ||x(t + N )||2P0 (6.34)
j=0

where Qj ≥ 0, Rj ≥ 0 and P0 ≥ 0. The optimal control is found as follows


[BH75, KR72, Mos95, BGW90]: Iterate the Riccati Difference Equation

Pj+1 = AT Pj A − AT Pj B(B T Pj B + Rj )−1 B T Pj A + Qj (6.35)

and form the state-feedback gain matrix

Kj−1 = (B T Pj−1 B + Rj−1 )−1 B T Pj−1 A. (6.36)

The optimal control sequence is given by

u(t + N − j) = −Kj−1 x(t + N − j) (6.37)

and the optimal value of the cost (6.34) obtained in this way is VN (x(t))0 =
||x(t)||2PN .
Infinite Horizon:
Now suppose that the horizon becomes infinite (N → ∞), we consider the infinite-
horizon cost

V∞ (x(t)) = lim VN (x(t)) (6.38)


N →∞

and the weighting matrices are constant: Qj = Q, Rj = R. Then, if R > 0, the pair
(A, B) is stabilizable, and the pair (A, Q1/2 ) is detectable, then Pj → P∞ ≥ 0 (as
j → ∞), and (6.35) is replaced by the Algebraic Riccati Equation:

P∞ = AT P∞ A − AT P∞ B(B T P∞ B + R)−1 B T P∞ A + Q. (6.39)

Hence

Kj → K∞ = (B T P∞ B + R)−1 B T P∞ A (6.40)

and the optimal control becomes the constant state-feedback law:

u(t + j) = −K∞ x(t + j). (6.41)

It can be proved that this feedback law is stabilising — otherwise the cost V∞ (x(t))
would be infinite — so that all the eigenvalues of the closed-loop state-transition
matrix A − BK∞ lie strictly within the unit circle (if the stated conditions hold).
The optimal cost is now V∞ (x(t))0 = ||x(t)||2P∞ .
Mini-Tutorial 7: Linear Quadratic Optimal Control
6.3. Fake Algebraic Riccati Equations 201

state-feedback law

∆u(t) = −K̃N −1 ξ(t) (6.45)

(assuming no constraints for the present discussion). The big question now is, when
can this law be guaranteed to be stabilising? That is, when will all the eigenvalues
of à − B̃ K̃N −1 be guaranteed to lie inside the unit circle?

We now revert to using the notation which appears in the LQ problem, namely
we use A, Q, K, etc, with the understanding that these are replaced by Ã, Q̃, K̃
etc when necessary. (See Problem 6.) From the infinite-horizon LQ problem, it is
apparent (subject to the technical conditions: Q ≥ 0, (A, B) stabilisable, (A, Q1/2 )
detectable) that so long as the algebraic Riccati equation (6.39) has a positive semi-
definite solution (P ≥ 0), and a constant state feedback gain matrix is obtained from
this solution by the formula (6.40), then the resulting feedback law will be stable.
In the finite horizon problem we have the Riccati difference equation (6.35) instead
of (6.39). Let us suppose that we use constant weighting matrices: QN −j−1 = Q
and RN −j−1 = R, so that (6.35) becomes

Pj+1 = AT Pj A − AT Pj B(B T Pj B + R)−1 B T Pj A + Q. (6.46)

Now introduce the matrix

Qj = Q − (Pj+1 − Pj ) (6.47)

then, substituting for Pj+1 in (6.46) gives

Pj = AT Pj A − AT Pj B(B T Pj B + R)−1 B T Pj A + Qj . (6.48)

But this is an algebraic Riccati equation (because the same matrix Pj appears on
both left and right hand sides). It has been called the Fake Algebraic Riccati Equa-
tion (or F ARE) because it does not arise directly from an infinite-horizon LQ prob-
lem. If this equation has a solution Pj ≥ 0, and if Qj ≥ 0, then applying the constant
state-feedback gain Kj (ie apply the same gain Kj at each time) will give a stable
feedback law, where Kj is obtained from Pj using (6.40). So, one way of ensuring
a stable (unconstrained) predictive control law is to ensure that the fake algebraic
Riccati equation

PN −1 = AT PN −1 A − AT PN −1 B(B T PN −1 B + R)−1 B T PN −1 A + QN −1 (6.49)

(with A replaced by à etc) with QN −1 ≥ 0 has a solution PN −1 ≥ 0. Note that


standard algorithms are available for solving the algebraic Riccati equation; In MAT-
LAB’s Control System Toolbox it can be solved using the function dare.

Since we start with Q ≥ 0, we will have QN −1 ≥ Q ≥ 0 providing that PN ≤


PN −1 . In [BGW90]the following monotonicity property is proved: if Pt+1 ≤ Pt ,
then Pt+j+1 ≤ Pt+j for all j ≥ 0. This shows that stability can be ensured by
introducing a suitable P0 into the predictive control problem, which is the same
as introducing a suitable terminal cost (see (6.34)). In fact, Q0 ≥ Q is sufficient
202 6. Stability

to give stabililty. In [BGW90]it is shown that it is not enough just to make P0


‘very large’, although there are some specific ways of making P0 ‘large’ which have
the desired effect. One particular way of doing this is to set W0 = P0−1 = 0, and
propagating Wj = Pj−1 instead of Pj .4 Note that this is a particular way of making
P0 infinite, and hence is equivalent to imposing a terminal constraint, which provides
an alternative explanation of why this choice of P0 guarantees stability.
1/2
There is one further technicality involved: the pair (A, QN −1 ) should be detectable.
But it is shown in [BGW90] that, if (A, Q1/2 ) is detectable and QN −1 ≥ Q, then
1/2
(A, QN −1 ) is detectable. So there is no problem. There are several other related and
interesting results in [BGW90]. In particular, the Fake Algebraic Riccati Equation
(FARE) approach can be interpreted as producing a predictive control law which
is the same as the law which would result from posing a particular infinite-horizon
problem, which ‘explains’ why the approach is effective. Also the monotonicity prop-
erty mentioned above is related to a similar monotonicity property of the optimal
cost, which implies that the optimal cost can serve as a Lyapunov function, and
hence gives another explanation of the efficacy of this approach.

It should be emphasised that the FARE approach gives sufficient but not necessary
conditions for stability of predictive control laws. In particular, if the GP C formu-
lation of predictive control is used, in which P (0) is fixed as P (0) = Q = CyT Cy and
R = λI, and if the prediction and control horizons are made the same, Hp = Hu ,
then Pj can be shown to be monotonically nondecreasing, rather than nonincreas-
ing [BGW90]. Nevertheless, GP C laws can be stabilising, even with this choice of
horizons.

We have examined three ways of ensuring stability: imposing terminal constraints,


using infinite horizons, and using the FARE approach. We have seen that they can
all be regarded as modifying the weight on the terminal control error in some way. In
that sense the three approaches are not so different from each other. But we can note
that the first and most obvious way of achieving stability, namely imposing terminal
constraints, is in general unnecessarily severe — one does not have to make the
terminal weight infinitely large in order to obtain stability. We also mention again
the survey paper [MRRS00], in which alternative common elements are identified
for these and other ways of ensuring stability while using predictive control.

The authors of [BGW90] conclude by suggesting the use of infinite horizons, so


perhaps the FARE method is only of historical interest now. However, recently the
method has been generalised to a Fake Hamilton-Jacobi-Bellman Equation method
for obtaining stability with nonlinear internal models in unconstrained problems
[MS97a].

4
As is done in ‘information filter’ versions of the Kalman filter, and in recursive least-squares.
6.4. Using the Youla Parametrization 203

6.4 Using the Youla Parametrization

If the plant is stable, then it is known that the feedback system shown in Figure
6.3 is internally stable if and only if the block labelled Youla parameter is stable,
providing that the internal model is an exact model of the plant [Mac89, ZDG96].
This holds under rather general conditions; all the blocks shown in the figure can be
nonlinear operators, for example. Furthermore, for linear systems it is known that
every stable feedback system can be represented in this way (if the plant is stable)
— so nothing is lost by assuming this form. (The term ‘parameter’ here comes from
the fact that as the Youla parameter ranges over all stable systems, so it generates
all possible stabilising controllers for the given plant. But it is not just a number!)

d(k)
+
YOULA
u(k) + y(k)
PLANT
PARAMETER

+
INTERNAL −
MODEL

CONTROLLER

Figure 6.3: Youla parametrisation of all stable feedback systems (if the plant is
stable).

Let the Youla Parameter shown in Figure 6.3 have transfer function (matrix) Q(z),
and let both the Plant and the Internal Model have transfer function P (z). We have

u(z) = Q(z)[y(z) − P (z)u(z)] (6.50)

so that

[I + Q(z)P (z)]u(z) = Q(z)y(z) (6.51)

and hence

u(z) = [I + Q(z)P (z)]−1 Q(z)y(z) (6.52)

Comparing this with the more conventional representation of a feedback system


shown in Figure 7.1, in which we have u(z) = −K(z)H(z)y(z) (if we ignore the
reference signal r and the noise n), we see that the following correspondence holds:

K(z)H(z) = −[I + Q(z)P (z)]−1 Q(z) (6.53)


204 6. Stability

From this, it is very easy to obtain the correspondence in the other direction:
Q(z) = −K(z)H(z)[I + P (z)K(z)H(z)]−1 (6.54)

If the plant is unstable (and linear) then closed-loop stability can still be char-
acterised by the stability of the Youla parameter, but its definition in terms of the
controller becomes more complicated [Mac89, ZDG96]. Figure 6.3 has to be replaced
by a more complicated block diagram.

Mathematically, the set of all stable Youla parameters is an infinite-dimensional


space, so optimising over it can only be done for particular problems (such as un-
constrained LQG or H∞ problems). But it is also possible to parametrise some
subset of all stable systems by a finite number of parameters, which converts the
optimization into a finite-dimensional one. Furthermore, if the parametrisation is
linear and the cost function is quadratic then the problem remains convex. This
is due to the remarkable property of the Youla parameter, that all the closed-loop
transfer functions which are of interest are affine in this parameter — that is, they
all have the form XQY + Z, where Q is the Youla parameter, and X, Y and Z are
some (fixed) transfer function matrices.5 There have been some proposals to solve
the constrained predictive control problem with this approach [RK93, vdBdV95].

Example 6.4 All SISO FIR systems of order n are parametrized linearly by the n
terms of their pulse responses H(0), H(1), . . . , H(n − 1).

From Figure 6.3 it is apparent that u(z) = Q(z)d(z), where d is the output distur-
bance. But if Q(z) is an FIR filter of order n then Q(z) = H(0) + z −1 H(1) + . . . +
z −n H(n). Hence the control signal can be computed as
X
n
û(k + j|k) = ˆ + j − i|k)
H(i)d(k (6.55)
i=0
or, equivalently,
X
n
∆û(k + j|k) = ˆ + j − i|k) − d(k
H(i)[d(k ˆ + j − i − 1|k)] (6.56)
i=0

Note that ∆û(k + j|k) is linear in the pulse response coefficients H(0), . . . , H(n).
Furthermore, the disturbance estimates d(kˆ + j − i|k) do not depend on future inputs
û(k + j|k). So substituting (6.56) into (2.66), for instance, makes the state predic-
tions depend linearly on the pulse response coefficients, and hence the cost function
(2.19) is quadratic in these coefficients. So the problem remains quadratic.

Note, however, that the constraints on the input levels and the input moves are now
related to the ‘decision variables’, namely to the pulse response coefficients, through
transfer functions.
5
One consequence of this is that the minimisation of any induced norm of a closed-loop transfer
function, ||XQY + Z||, is a convex optimisation problem. The book [BB91] is devoted to exploiting
this.
6.5. Problems 205

6.5 Problems
1. Simulate the model and control law from Example 6.1 using MATLAB, and
check that the closed loop is unstable.
Recommended procedure: Create the state-space matrices a,b,c,d corre-
sponding to the closed-loop system, then create a Matlab object representing
this closed-loop system using:
clsys=ss(a,b,c,d,1);
(Use help ss to see what this does.) Then get the response from initial con-
dition x0=[1;0] — or some other initial condition — by typing
initial(clsys,x0);

2. Consider the plant given in Example 6.1 again. But now suppose that the
prediction horizon is Hp = 2, with the cost being
   
T 1 2 T 1 2
V (k) = x̂(k + 1|k) x̂(k + 1|k) + x̂(k + 2|k) x̂(k + 2|k)
2 6 2 6
(a) Keep Hu = 1, so that only u(k) is to be optimised, with the assumption
that u(k + 1) = u(k). Show that the predictive control law is u0 (k) =
− 16 x1 (k), and hence that the closed loop is stable.
(b) Now let Hu = 2, so that u(k) and u(k+1) have to be optimised. By setting
both derivatives (∂V /∂u(k)) and (∂V /∂u(k + 1)) to zero (or ∇u V = 0 if
you are happy with that notation) show that the predictive control law
is u0 (k) = − 23 x1 (k), and hence that the closed loop is stable.
(c) Simulate the closed-loop behaviours for these two cases, using MATLAB.
(Note that the Model Predictive Control Toolbox does not allow non-diagonal
weights.)
3. Consider Example 6.1 again, and Problem 2. Solve and simulate them using
the Model Predictive Control Toolbox. However, the Toolbox only allows diago-
nal weighting matrices to be specified. If you have solved Problem 7 of Chapter
3, then you can keep the original non-diagonal weight. Otherwise change the
weight to diag(1,6) (that is, just keep the diagonal elements). Unfortunately
this will not give the same results, but it is still a good exercise to see how the
results differ for the cases
• Hp = Hu = 1
• Hp = 2, Hu = 1
• Hp = Hu = 2
4. Verify that Q̄ is given by (6.30) and (6.31) in the case of an unstable plant.
5. For the plant
x(k + 1) = 0.9x(k) + 0.5u(k), y(k) = x(k)
suppose that the infinite-horizon case (Hp = ∞) is to be solved.
206 6. Stability

(a) Formulate an equivalent finite-horizon problem if Q(i) = 1, R(i) = 0, and


Hu = 2.
(b) Find the predictive controller and simulate the set-point response.
(c) What feature of the Model Predictive Control Toolbox would prevent you
from following this procedure in general?

6. The infinite-horizon LQ problem requires the assumptions that (A, B) is a


stabilisable pair and that (A, Q1/2 ) is a detectable pair. To put the standard
predictive control problem into the LQ framework, we need to use the matrices
Ã, B̃, and Q̃, as defined in (6.42) and (6.44). Show that, if (Ã, B̃) is stabilisable
then so is the pair (A, B), and that if (Ã, Q̃1/2 ) is detectable then so is the
pair (A, Q1/2 C). (Note that you can take Q̃1/2 = [Q1/2 C, 0].)

7. Consider the finite-horizon LQ problem for a plant with


   
0 2 1
A= B= (6.57)
2 0 0

Verify that if
 
16 0
PN −1 = (6.58)
0 16

and R = 1 then the corresponding state-feedback gain matrix is KN −1 =


[0, 1.8824] and that this gives a stable feedback law. Show, nevertheless, that
this solution corresponds to a value of QN −1 which is not positive-definite.
(This underlines the fact that the FARE approach gives a sufficient, but not
necessary, condition for stability.)
Chapter 7

Tuning

There are many adjustable parameters in predictive control, even in the standard
formulation:

• Weights

• Horizons

• Disturbance Model and Observer Dynamics

• Reference Trajectory

In this chapter we shall examine the effects of these, try to obtain some insight into
the effects of these parameters, and some systematic methods of adjusting them.

It will be seen that tuning can be based on a few theorems, but it is mostly a matter
of ‘rules of thumb’, based largely on experience gained from simulations of ‘typical’
problems.

More can be said in the case of single-input, single-output (SISO) plant, than in
the (more important) case of multivariable plant. In particular, Soeterboek [Soe92]
gives more details for the SISO case than we give here.

7.1 What Are We Trying To Do?

It should always be borne in mind that

• Feedback is dangerous.

• The only purpose of using feedback is to reduce the effects of uncertainty.

207
208 7. Tuning

Feedback is dangerous because it can, among other things, destabilise systems which
are themselves quite stable. The reason for using feedback is that it can be a very
effective strategy for reducing the effects of unexpected and unmeasurable distur-
bances, and for reducing the effects of uncertainty about the behaviour of a system.
It is important to realise that this is the only justifiable reason for using feedback.
(One important application of feedback is to stabilise unstable plant. But it can
be argued that this is also necessary because of some uncertainty: if the model and
initial conditions were known perfectly, then it would be possible to stabilise an
unstable plant using an open-loop strategy.)

It follows that simulating the response to a step set-point change is not a meaningful
way of assessing a feedback system, except under very special circumstances. If we
really wanted to follow a set-point, and there were no uncertainty, then the best way
to do it would be by using an open-loop pre-computed control signal. Looking at
set-point step responses is meaningful only under the following circumstances:

• If the set-point step response allows us to deduce something about the robust-
ness — insensitivity — of the closed-loop behaviour to modelling errors.
This is typically the case with linear control systems.

• If the set-point step response can be easily related to the way in which the
feedback loop deals with disturbances.
This is true for ‘one degree of freedom’ linear feedback systems, in which the
set-point response completely determines the disturbance response. This is
typically not true for predictive control systems.

• If the step response allows us to deduce how the system would respond to
other signals.
This is true for linear systems. It is therefore true for most predictive control
systems so long as the constraints are inactive, but not otherwise.

Figure 7.1 shows a ‘two degree of freedom’ feedback system. It shows the set-point
signal being filtered by the pre-filter F (z) before becoming the ‘reference’ input
to the feedback loop. It also shows the part of the controller which is inside the
feedback loop split into two transfer functions, K(z) in the ‘forward path’, and H(z)
in the feedback path. This is done to have a similar structure to that shown for the
unconstrained predictive controller in Figure 3.2. We will assume, for simplicity,
that the measured and controlled outputs are the same: z(k) = y(k).

Apart from the set-point signal s, the figure shows an output disturbance d and
measurement noise n entering the system. We need to find the transfer functions
relating these input signals to the plant input and output signals u and y. We do this
for the general case, with each signal being a vector, and so each transfer function
being a matrix. We write ȳ(z) for the z-transform of y(k), and similarly for other
7.1. What Are We Trying To Do? 209

PLANT d
+
s r e u +
F (z) K(z) P (z)
+ y

H(z)
CONTROLLER +
n +

Figure 7.1: Two degree of freedom feedback system.

signals.
¯ + P (z)K(z)ē(z)
ȳ(z) = d(z) (7.1)
ē(z) = F (z)s̄(z) − H(z)[n̄(z) + ȳ(z)] (7.2)

so

¯ + P (z)K(z){F (z)s̄(z) − H(z)[n̄(z) + ȳ(z)]} (7.3)


ȳ(z) = d(z)

and hence

¯ + P (z)K(z)F (z)s̄(z) − P (z)K(z)H(z)n̄(z)


[I + P (z)K(z)H(z)]ȳ(z) = d(z) (7.4)

Finally, we have
¯ + S(z)P (z)K(z)F (z)s̄(z) − T (z)n̄(z)
ȳ(z) = S(z)d(z) (7.5)

where

S(z) = [I + P (z)K(z)H(z)]−1 (7.6)


−1
T (z) = [I + P (z)K(z)H(z)] P (z)K(z)H(z) (7.7)

The last two transfer functions are fundamental in feedback theory:

• S(z) — The Sensitivity function.

• T (z) — The Complementary Sensitivity function.

Roughly speaking, the ‘smaller’ the sensitivity function, the better the feedback
action, in the sense that the effect of the output disturbance d is kept small. It
210 7. Tuning

can also be shown that the sensitivity of the closed-loop performance to open-loop
changes depends on S(z), and is small if S(z) is ‘small’ in some sense. On the other
hand, the ‘smaller’ the complementary sensitivity T (z), the smaller is the effect of
measurement noise. It can also be shown that the ‘gain’ of T (z) is a kind of stability
margin: if T (z) is ‘large’ in some sense, then a small plant-model mismatch may
cause the feedback loop to be unstable. Note that S(z) and T (z) are completely
determined by each other, because
S(z) + T (z) = I (7.8)
It is therefore not possible to have both S(z) and T (z) very ‘small’ (near 0) simul-
taneously. However, if measured by their frequency responses, it is possible to have
both S(z) and T (z) very large simultaneously (because the frequency responses are
complex quantities); so it is certainly possible to have very bad feedback designs,
although there are limits to how good they can be.

Note that the response of the output to the set-point can be designed independently
of the response to disturbances or noise, by means of the pre-filter F (z). Actually,
even without F (z) it can be designed independently if K(z) and H(z) can be de-
signed independently. However in the predictive controller it is not easy to influence
these two independently of each other. But it should be noted that, even without
a pre-filter (F (z) = I), the response of the output to set-point changes — trans-
fer function S(z)P (z)K(z) — is significantly different from the response to output
disturbances — transfer function S(z).

The formulation of the predictive control problem emphasises tracking the reference
signal r, subject to constraints. This is supposed to be a nice, intuitive formulation
which can be easily related to real-world requirements. But we can see that this is
only partly true. It is easily related to tracking requirements and to real constraints,
but not at all easily related to good feedback properties.

Recall that the main reason for using predictive control is its ability to handle
constraints. This means that when tuning a predictive controller, we should consider
its performance — including its feedback properties — when constraints are active.
Unfortunately, we have few theoretical tools to help us do this — or even to formulate
appropriate measures of performance under these conditions. We have to rely on
simulation to assess performance with active constraints, because we have little else
for the time being. In this chapter we shall devote most space to the case when
constraints are not active, because then the controller is linear and we can do some
analysis. But the reader should be aware that this is a rather distorted emphasis,
forced by necessity.

7.2 Some Special Cases

We can look at some special choices of parameters, and deduce heuristically how the
predictive controller will then behave.
7.2. Some Special Cases 211

7.2.1 Effect of Control Weighting

Note first that increasing the weights R(i) on the control moves relative to the
weights Q(i) on the tracking errors has the effect of reducing the control activity
— recall the cost function (2.19). (In some MPC products the elements of R(i) are
called move supression factors for this reason.) Increasing these weights indefinitely
will reduce the control activity to zero, which ‘switches off’ the feedback action.
If the plant is stable, this will result in a stable system, but not otherwise. Thus
with a stable plant, we can expect to obtain a stable closed loop by increasing the
control weighting sufficiently. The penalty of doing this will be slow response to
disturbances, since only small control actions will result. With an unstable plant we
can expect an unstable feedback loop, if the R(i)’s are increased too much.

We have already seen in Chapter 6 that there are better ways of ensuring closed-loop
stability than using heavy penalty weights R(i).

7.2.2 Mean-Level Control

Suppose that the plant is stable. Choose Hu = 1 and R(i) = 0. Suppose that the
reference trajectory changes to a new constant value: r(k +i) = r1 . So the predictive
controller tries to minimise

X
Hp
||ŷ(k + i|k) − r1 ||2Q(i) (7.9)
i=Hw

using only one control move ∆u(k). If Hw is fixed and Hp → ∞, clearly the optimal
thing to do is to move the control to that level which will give y = r1 in the
steady-state. So in the absence of any disturbances the control signal will be a
step (vector). The transient response at the plant output will therefore just be the
open-loop response of the plant. That is, we will have, assuming a ‘square’ plant:
r1
ȳ(z) = P (1)−1 P (z) (7.10)
1 − z −1

where the ‘zero-frequency plant gain’ P (1) has been introduced to adjust the steady-
state level correctly. Comparing this with (7.5) we see that

S(z)P (z)K(z) = P (1)−1 P (z) (7.11)

If the plant is SISO then we can deduce that

1
S(z) = (7.12)
P (1)K(z)

which is the transfer function that governs the response to output disturbances. It
turns out that making the observer dead-beat (placing all the eigenvalues of A − LC
212 7. Tuning

at zero) leads to dead-beat response to a disturbance, in the shortest possible time.


A detailed discussion of the ‘mean-level controller’ is available in [CM89].

Note that the discussion here is consistent with Problem 3 of Chapter 4, which shows
that the controller is non-dynamic if the parameters are chosen as for mean-level
control, and with full state measurement.

It has been argued that mean-level control is suitable for many applications: it
allows the plant to follow set-point changes at its ‘natural’ rate, while being able to
react to disturbances very quickly — at a rate determined by the observer design
(or the choice of the polynomial C(z −1 ) in the transfer-function formulation).

7.2.3 Deadbeat Control

Now suppose that Hw = Hu = n, the number of states in the plant, together with
any additional states needed for the disturbance model. Again take R(i) = 0, assume
that r(k + i) = r1 , and this time choose Hp ≥ 2n. So now the cost function being
minimised is
X
2n
||ŷ(k + i|k) − r1 ||2Q(i) (7.13)
i=n

Now the idea is that the controller has enough time to drive the output to r1 and
leave it there thereafter — in general, at most n steps are needed to do this. Since
Hw = n, errors do not start entering the cost function until the set-point has been
achieved exactly. Consequently this strategy achieves zero cost, and hence it is the
optimal one.

The reason for making Hp ≥ 2n is to have a long enough costing interval. This
ensures that the output remains at zero for at least n steps, which is enough to
ensure that there are no ‘delayed modes’ inside the controller which might emerge
in the future.

This behaviour can only be explained by a ‘dead-beat’ closed loop. That is, all the
closed-loop poles are at zero. So we have, from (7.5):

S(z)P (z)K(z) = z −n N (z) (7.14)

where N (z) is a polynomial matrix in z (just numerator polynomial in the SISO


case) such that N (1) = I. In the SISO case we can deduce that

N (z)
S(z) = (7.15)
z n P (z)K(z)

which shows that S(z) (and hence T (z)) is likely to contain the zeros of the plant
among its poles (if they are not cancelled by poles of K(z) or zeros of N (z)). This
would lead to instability if P (z) had zeros outside the unit disk, and to very resonant
7.2. Some Special Cases 213

behaviour if P (z) had zeros close to the unit disk. (Plants with zeros outside the
unit disk usually exhibit ‘inverse response’, and are often called non-minimum-phase
plants.) Again a detailed treatment of dead-beat control is given in [CM89].

If the sampling interval is small then the control signals needed to achieve dead-beat
control may be too agressive to be usable, in which case the expected behaviour will
not be obtained because input constraints will be active. But in a sense ‘mean-
level’ control and ‘dead-beat’ control are two extremes obtained with R(i) = 0.
The main ‘parameter’ for moving between them is the combination of control and
window horizons, Hu and Hw . (Note that the dead-beat behaviour is not obtained
if Hw < n.)

7.2.4 ‘Perfect’ Control

Now we examine the case which the Model Predictive Control Toolbox User’s Guide
calls the ‘perfect’ controller. This is obtained by choosing Hu = Hp = 1 and
R(i) = 0. In this case the cost being minimised is ||ŷ(k + 1|k) − r(k + 1)||2Q(i) .
Clearly the ‘optimal’ thing to do in this case is to choose the input signal so that the
next output matches the reference as closely as possible, without taking any account
of future consequences. The easiest way to see the result of this is to consider the
scalar case:
B(z −1 )
ȳ(z) = P (z)ū(z) = ū(z) (7.16)
A(z −1 )

and write this, using the difference equation interpretation, as

b0 u(k) = y(k + 1) + . . . + an y(k + 1 − n) − b1 u(k − 1) − . . . − bn u(k − n) (7.17)

Clearly we can choose u(k) such as to make y(k + 1) = r(k + 1) by setting

b0 u(k) = r(k + 1) + a1 y(k) + . . . + an y(k + 1 − n) − b1 u(k − 1) − . . . − bn u(k − n)


(7.18)

But if this is done at each step, then we will eventually have — assuming no distur-
bances — y(k) = r(k), y(k − 1) = r(k − 1), etc, so that eventually we will have

b0 u(k) = r(k + 1) + a1 r(k) + . . . + an r(k + 1 − n) − b1 u(k − 1) − . . . − bn u(k − n)


(7.19)
or

B(z −1 )u(k) = A(z −1 )r(k + 1) (7.20)

which shows that the controller is essentially the inverse of the plant in this case.

As with the dead-beat controller, this will lead to an unstable feedback loop if the
plant has zeros outside the unit disk, and unacceptable performance if it has zeros
214 7. Tuning

close to the unit disk — but for a different reason. This time the zeros of B(z −1 )
will not show up in the poles of S(z) or T (z), because they will be cancelled when
forming the product of the controller and the plant transfer functions P (z)K(z)H(z).
But there will be ‘internal instability’ due to the cancellation of unstable poles with
unstable zeros, which will show up as an unstable transfer function between the
disturbance d and the plant input u.

Example 7.1 We apply predictive control, without constraints, to the Paper Ma-
chine Headbox described in Example 2.2. Recall that there are 2 inputs:

The stock flowrate


The white water flowrate

and 3 measured outputs:

The headbox level


The feed tank consistency
The headbox consistency.

But we will control only outputs 1 and 3, which is achieved in the Model Predictive
Control Toolbox by setting the output weight to ywt=[1,0,1] (as in the Toolbox
demo file pmlin.m).

Throughout this example we set R(i) = 0 — no penalty on control moves ∆u.

First a little analysis of the open-loop plant:

Poles: 0.0211, 0.2837, 0.4266, 0.4266


Zeros: −0.4937, −0.2241

So the plant is stable, with real negative zeros. (Using variable names as in the demo
file pmlin.m, the poles are computed using eig(PHI), while the zeros are computed
using
tzero(PHI,GAM,C([1,3],:),D([1,3],:))
where only the first and third rows of C and D are used, since we are only controlling
outputs 1 and 3.)

Mean-level Control. Hu = 1, Hp = 10 (M=1, P=10). Recall that Hp → ∞ for mean-


level control; but the responses do not change significantly for Hp > 10.
Responses to step set-point changes are shown in Figures 7.2 and 7.3. These show
responses consistent with what one expects from the open-loop poles — the slowest
poles, at 0.4266, taking 4 steps to reduce to below 5% of initial values (0.42664 <
0.05).
7.2. Some Special Cases 215

Outputs
1

0.8

0.6

0.4

0.2

−0.2

−0.4
0 5 10 15 20 25 30
Time (minutes)

Inputs
1.6

1.4

1.2

0.8

0.6

0.4

0.2
0 5 10 15 20 25 30
Time (minutes)

Figure 7.2: Mean-level control: set-point change on r1 .

Outputs
1.4

1.2

0.8

0.6

0.4

0.2

0
0 5 10 15 20 25 30
Time (minutes)

Inputs
0.4

0.2

−0.2

−0.4
0 5 10 15 20 25 30
Time (minutes)

Figure 7.3: Mean-level control: set-point change on r3 .

Figures 7.4 and 7.5 show the responses to a unit step unmeasured disturbance acting
on the states. Of these the first shows the responses with the default (DMC) observer
gain of [0, I]T , while the second shows the response with a deadbeat observer. In the
latter case the oscillatory nature of the input signals shows the presence of negative
216 7. Tuning

real observer poles, which originate from the negative real zeros of the plant. The
disturbance is reduced more effectively, however. In each case the response to set-
point changes is exactly the same — the observer design does not affect it.
Outputs
0.6

0.5

0.4

0.3

0.2

0.1

−0.1
0 5 10 15 20 25 30
Time (minutes)

Inputs
0.3

0.2

0.1

−0.1

−0.2

−0.3

−0.4
0 5 10 15 20 25 30
Time (minutes)

Figure 7.4: Default (DMC) observer: response to step disturbance.

Outputs
0.6

0.5

0.4

0.3

0.2

0.1

−0.1
0 5 10 15 20 25 30
Time (minutes)

Inputs
0.3

0.2

0.1

−0.1

−0.2

−0.3

−0.4
0 5 10 15 20 25 30
Time (minutes)

Figure 7.5: Deadbeat observer: response to step disturbance.

Observer design in the Model Predictive Control Toolbox needs a few tricks, because
7.2. Some Special Cases 217

the Toolbox uses the augmented state vector [∆xT , y T ]T , as described in section 2.4.
This model is obtained from the ordinary one using function mpcaugss. The deadbeat
observer was designed as follows:

[phia,gama,ca] = mpcaugss(PHI,GAM,C); % Augmented model


% Dual pole placement:
Kest = place(phia’,ca’,[0,0,0,0.01,01,0.01,0.005]);
Kest = Kest’; % Transpose because dual problem

Here the function place is used to place the observer poles at the locations specified
in the vector. (The augmented system has 7 states.) Ideally these would all be at
0, but place allows the multiplicity of each pole to be no greater than the number
of outputs, which is 3 in this case. So 3 poles were placed at 0, 3 at 0.01, and 1 at
0.005. This should result in behaviour rather close to deadbeat.

Deadbeat Control. Figure 7.6 shows the set-point response with Hw = Hu = 4,


Hp = 8. Since the plant has 4 states this should give deadbeat response. It can be
seen that this is achieved.
Outputs
1.5

0.5

−0.5

−1
0 5 10 15 20 25 30
Time (minutes)

Inputs
1.5

0.5

0
0 5 10 15 20 25 30
Time (minutes)

Figure 7.6: Deadbeat set-point response. Step demand on r1 .

Hw = 4 was represented in the Toolbox by defining the output weights as follows,


which gives zero weight for the first 4 steps:

ywt = [ 0 0 0
0 0 0
218 7. Tuning

0 0 0
0 0 0
1 0 1 ]

Perfect Control. Finally, Figures 7.7 and 7.8 show the set-point step responses with
Hu = Hp = 1. This gives the so-called ‘perfect’ controller; as expected, the negative
real plant zeros now appear as poles of the closed-loop set-point response, which is
seen by the oscillatory nature (‘ringing’) of both the control inputs, and one of the
plant outputs.

Outputs
2

−1

−2

−3

−4

−5
0 5 10 15 20 25 30
Time (minutes)

Inputs
5

−1
0 5 10 15 20 25 30
Time (minutes)

Figure 7.7: ‘Perfect’ controller: Set-point response. Step demand on r1 .

7.3 Frequency-Response Analysis

Examining time responses gives only part of the story about feedback performance.
Frequency response analysis helps to complete the picture — see Minitutorial 8 for
an introduction. Frequency responses can be generated directly from a state-space
model, without computing a transfer function first. For example, using (4.74) the
frequency response of P (z) can be obtained by evaluating

P (ejωTs ) = C(ejωTs I − A)−1 B + D (7.21)

for a set of values of ω. Since we can write all the equations governing the closed loop
plant-controller combination in state-space form, it is straightforward to compute
7.3. Frequency-Response Analysis 219

Outputs
3

2.5

1.5

0.5

−0.5
0 5 10 15 20 25 30
Time (minutes)

Inputs
1.5

0.5

−0.5

−1

−1.5
0 5 10 15 20 25 30
Time (minutes)

Figure 7.8: ‘Perfect’ controller: Set-point response. Step demand on r3 .

any frequency response we like, connected with a predictive control system - so long
as constraints are not active.1

Note: In the Model Predictive Control Toolbox it should be easy to compute the
frequency responses of the sensitivity and complementary sensitivity functions S(z)
and T (z) using functions mod2frsp and smpccl, and using plotfrsp or svdfrsp to
see the corresponding Bode plots. However the closed-loop model formed by smpccl
has additional inputs and outputs which must be removed in order to get T (z) —
you have to select the first ` inputs and the first m outputs, using mod2ss to get at
the individual state-space matrices, and ss2mod to put them together again.

Example 7.2 Figure 7.9 shows the singular values of the sensitivity S(z) and the
complementary sensitivity T (z) for the mean-level control of the paper machine head-
box, using the default (DMC) observer. This shows that σ̄[T (z)] reaches a peak value
of almost 2. This √is a little higher than is usually considered acceptable for a good
feedback design. ( 2 is often taken as a ‘good’ peak value, but this is application-
dependent to some extent.)

Note that there are two singular values of each of S and T at each frequency, because
only two outputs have been retained — the headbox level and the headbox consistency
— so that S(z) and T (z) are 2 × 2 transfer function matrices. The plots are shown
1
Since we showed in Chapter 3 that a predictive controller is linear and time-invariant so long
as the set of active constraints remains fixed, it is also possible to perform a frequency response
analysis for a given fixed set of active constraints.
220 7. Tuning

SISO feedback design is often performed using open-loop frequency responses, us-
ing Nyquist’s theorem to ensure stability of the closed loop, and judging stability
margins by the ‘closeness’ of the Nyquist locus to the point −1. With multivariable
systems it is not so useful to examine open-loop frequency loci (although Nyquist’s
theorem still holds, in a generalised form [Mac89]). But if SISO design rules are
interpreted in terms of the closed-loop transfer functions S(z) and T (z), then it is
possible to generalise them to the multivariable case quite easily.
With reference to Figure 7.1, if we let C(z) = K(z)H(z) then S(z) = [I +
P (z)C(z)]−1 , or in the SISO case, S(z) = 1/[1 + P (z)C(z)]. So in the SISO case,
the reciprocal of the smallest distance between the point −1 and the Nyquist locus
of P (z)C(z) is the peak value of |S(ejωTs )|. So the bigger this peak, the smaller the
stability margin. This generalises to the multivariable case as follows.
The ‘gain’ of a multivariable system depends on the ‘direction’ of the input signal.
If a finite-energy signal is applied at the input of a stable system, the output is
also a finite-energy signal. At a given frequency ω, we can define the ‘gain’ of a
multivariable system as the largest amplification (output energy / input energy) for
any possible input direction. It turns out that this can be measured as the largest
singular value of the frequency response matrix evaluated at the given frequency.
This is a consequence of the fact that the largest singular value is an induced norm
for matrices — see Minitutorial 4:

kS(ejωTs )k = σ̄[S(ejωTs )] (7.22)

where σ̄ is used to denote the largest singular value. So in the multivariable case
one can display σ̄[S(ejωTs )] on a Bode plot, and take the peak value as an indication
of the stability margin. (Rigorous interpretations in terms of robustness to plant
modelling error can be given [Mac89, ZDG96].)
Another criterion traditionally used for SISO design is the ‘peak M -value’, and is
another measure of how closely the open-loop Nyquist locus approaches the point
−1. But this is nothing other than the peak value of |T (ejωTs )|. Again this can
be generalised to the multivariable case: plot σ̄[T (ejωTs )] on a Bode plot, and read
off the peak value. Again this value can be interpreted rigorously as a robustness
measure. Note that large peak values of σ̄[S(ejωTs )] or σ̄[T (ejωTs )] can only occur
as a result of ‘resonant’ closed-loop poles lying very close to the unit circle. So not
only do they indicate a danger of losing stability, but also the fact that some signals
in the loop are likely to exhibit ‘ringing’ (lightly damped oscillations).
Apart from the peak values, the plots of σ̄[S(ejωTs )] and σ̄[T (ejωTs )] can be used to
see the frequencies at which the feedback loop rejects disturbances (small σ̄[S(ejωTs )]
is good), and how well it filters out measurement noise (small σ̄[T (ejωTs )] is good).
These two objectives conflict with each other.
Singular values of other closed-loop transfer functions can also be plotted if appro-
priate. Modern multivariable robust control theory emphasises the importance of
examining the transfer functions S(z)P (z) and C(z)S(z) in addition to S(z) and
T (z).
Note that the singular value plots do not indicate whether the closed loop is stable.
That has to be checked independently (eg by computing the closed- loop poles). If
it is stable, they can be used to indicate whether the stability is ‘robust’ or ‘fragile’.
Mini-Tutorial 8: Interpreting Frequency Responses
7.4. Disturbance Models and Observer Dynamics 221

1
10

0
10

−1
10

−2
10

−3
10
−3 −2 −1 0 1
10 10 10 10 10
Frequency (rad/min)

Figure 7.9: Singular values of S(z) (solid line) and T (z) (broken line) for mean-level
control of the headbox.

up to the Nyquist frequency π/Ts = π/2 rad min−1 (recall that the sampling interval
is Ts = 2 minutes for the headbox).

This example shows that the mean-level controller for the paper machine headbox is
not very good, as a feedback controller. The design parameters can be altered to try
to improve its performance in this respect. But at present there is little knowledge
of how to change them systematically, so as to improve performance. So we have
good analysis tools, but the design is still to a large extent a matter of trial and
error. Some progress towards a systematic approach has been reported in [LY94].

7.4 Disturbance Models and Observer Dynamics

7.4.1 Disturbance models

Two very important tuning ‘parameters’ in predictive control are the choice of dis-
turbance model, and the choice of observer dynamics. In the transfer function
formulation this corresponds to the choice of the D(z −1 ) and C(z −1 ) polynomials,
222 7. Tuning

respectively. In GPC D(z −1 ) = (1−z −1 )A(z −1 ) is fixed, so only the choice of C(z −1 )
remains. In DMC both are fixed.

The essential fact about the disturbance model is that its poles become poles of
the (open-loop) controller. So both the DMC and the GPC disturbance models
(poles at +1) result in the controller having integral action, and hence offset-free
tracking (zero steady-state error) in the presence of constant output disturbances.
This is an example of a more general phenomenon, known as the Internal Model
Principle [Won74].2 Suppose that a ‘persistent’ deterministic disturbance acts on
a system — that is, one which does not decay to zero. Examples encountered in
practice can often be approximated by constant, ramp or sinusoidal signals, but in
principle the discussion applies to any signals which have poles on or outside the
unit circle. Then a feedback controller can compensate perfectly for that disturbance
— asymptotically with time — only if the poles of the disturbance signal appear
among the poles of the controller. (The detailed requirements are a little stronger:
the controller must have an ‘internal model’ whose state-space structure is the same
as that of the disturbance.) When we augment the internal model of a predictive
controller by a disturbance model, we are responding to the requirements of this
principle.

Example 7.3 Using the DMC/GPC disturbance model gives integral action in the
controller. Consequently constant disturbances are rejected perfectly (asymptotically
with time). Therefore the steady-state gain from output disturbances to controlled
outputs should be zero. But this is the zero-frequency response of the transfer function
relating d to y in Figure 7.1. So, from (7.5), we expect S(1) = 0. (Remember that
ω = 0 corresponds to z = 1.) Looking at the frequency response plots for Example
7.2, we see that indeed σ̄[S(ejωTs )] approaches zero as ω → 0. Furthermore, the slope
of the graph is 20 dB per decade of frequency, as expected from a single integrator
in the controller — there are actually two integrators in this controller, one for each
output.

Since T (z) + S(z) = I, we also expect T (1) = I. This is confirmed by the fact that
both singular values of T (z) become 1 (0dB) at low frequencies.

Augmenting the plant model with a disturbance model certainly makes it possible
for the controller to exhibit the disturbance poles, but does not seem to be sufficient
to ensure that this occurs. After all, the poles of the plant do not usually appear
as poles of the controller, even though the plant model is made available to the
controller in a similar way.

It is possible to understand how the DMC model leads to integral action without a
technical derivation. One explanation was already given in section 1.5; here we give
2
The Internal Model Principle, due to Wonham, should not be confused with Internal Model
Control, a way of looking at feedback systems due to Morari [GM82, MZ88], and originally intended
as a way of understanding predictive control.
7.4. Disturbance Models and Observer Dynamics 223

another one. The essential property of a controller with integral action is that it is
impossible for the closed-loop system to be at an equilibrium unless the error e, as
shown in Figure 7.10, is zero. (The figure shows a ‘PI’ controller for illustration.)
Because if it is non-zero, then the output of the integrator will change, and so the
plant input u will not remain constant. Now consider a predictive controller with the
DMC disturbance model. Suppose, for simplicity, that all set-points are constant.
At each step the controller estimates the magnitude of an output disturbance, and
produces a control signal to counteract it. Typically the estimate will be incorrect,
so that the plant outputs will move to different values than those predicted. The
ˆ
predictive controller attributes this difference to a changed disturbance (d(k|k) =
y(k) − ŷ(k|k − 1)), and revises its estimate, thus producing a new control signal.
If the disturbance is actually constant — and the closed-loop is stable — then
the controller iteratively ‘learns’ the magnitude of the disturbance in this way, and
eventually compensates for it exactly. It is therefore impossible for the closed-loop
system to be at an equilibrium unless the outputs are at their set-points, which
is precisely the key property of integral action. (This discussion assumes that no
constraints are active. Similarly for the PI controller, the discussion assumes that
the integrator is not saturated.)

PI CONTROLLER
u y
e
Kp PLANT
+ +
− +
Ki
s

Figure 7.10: A ‘proportional + integral’ (PI) controller

In general the ‘internal model principle’ works for persistent disturbances, such as
ramps and sinusoids, because such disturbances can be predicted perfectly, and hence
corrected for, once the initial conditions which specify a particular ramp or sinusoid
have been estimated. The principle demands that the dynamic equation governing
such a disturbance should be included in the controller, and a (stable) observer
should then be used to estimate the initial conditions. The disturbance dynamics
in the augmented model are not controllable from the plant input u. Recall that a
typical augmented model is of the form:
      
xp (k + 1) Ap X xp (k) Bp
= + u(k) (7.23)
xd (k + 1) 0 Ad xd (k) 0
These dynamics therefore remain unchanged as eigenvalues of the closed-loop, be-
cause in effect there is no feedback loop around them. They do not, however, appear
224 7. Tuning

in any of the closed-loop transfer functions, since only modes which are both con-
trollable and observable appear as poles of transfer functions.

7.4.2 Observer dynamics

The remaining question to be considered in this section is that of the observer


dynamics. In this case we can give a detailed derivation of the transfer function
H(z) which appears in Figure 7.1, which will clarify the significance of this question.
Figure 7.11 shows the controller in block-diagram form, for the unconstrained case.
This diagram is obtained from Figure 3.2 by including the details of the observer.

T (k) E(k) ∆u(k) u(k)


z
KM P C z−1 I
+
− −

Ψ u(k − 1)
Υ z −1 I

x̂(k|k) A

+
x̂(k|k − 1) +
z −1 I B
+
+

Cy
L0
OBSERVER

+ y(k)

Figure 7.11: Predictive controller, unconstrained case.

This block-diagram can be simplified slightly to the one shown in Figure 7.12, and
then again to the one shown in Figure 7.13.

Comparing Figures 7.1 and 7.13 we can see that


 −1 0
H(z) = Ψ I − z −1 A(I − L0 Cy ) L (7.24)
= zΨ [zI − (A − LCy )]−1 L0 (7.25)

This confirms that the measured outputs are filtered before affecting anything in the
controller, and that the poles of the filter are the observer eigenvalues. This filtering
7.4. Disturbance Models and Observer Dynamics 225

T (k) E(k) ∆u(k) u(k)


z
KM P C z−1 I
+ −

Ψ u(k − 1)
Υ z −1 I

x̂(k|k) A

+
+
I − L 0 Cy z −1 I B
+
+
y(k)
L0
OBSERVER

Figure 7.12: Predictive controller, simplified.

will clearly affect the response of the controller to disturbances — since it detects
them only through the measured outputs — and the stability of the closed loop.

One could go on to obtain an expression for the forward path transfer function
K(z), but that would give a rather complicated expression which would not be very
illuminating.

Note that if constraints are active, the measured outputs y(k) are still filtered by a
filter with the same poles, in order to form the state estimate x̂(k|k). The nonlinear
effects arise afterwards, in the optimization.

So how should one choose the observer dynamics? Choosing deadbeat dynamics
gives a fast response to disturbances. But if the magnitudes of typical disturbances
are such that this leads to frequent saturation of actuators, then it may be better to
accept a slower response to disturbances, reserving actuator saturation for dealing
with exceptional large disturbances. Also, if the observer dynamics are made fast,
then the system will react relatively strongly to high-frequency variations in the
measured output signal. If there is an appreciable amount of measurement noise
in this signal, it may be better to have slower observer dynamics, in order to have
some low-pass filtering of the noise. (This is the usual feedback design trade-off
between small S(z) and small T (z).) If statistical information is available about
the relative strengths of disturbances and noise, then the optimal trade-off for state
226 7. Tuning

T (k) h i−1 u(k)


z 1
z−1 KM P C I+ z−1 ΥKM P C
+

 −1
z −1 (I − L0 Cy ) I − z −1 A(I − L0 Cy ) B
+
+

 −1 y(k)
I − z −1 A(I − L0 Cy ) L0

Figure 7.13: Predictive controller, simplified again.

estimation can be made by using Kalman filter theory to design the observer. If such
information is not available, Clarke [Cla94] advocates using the observer polynomial
C(z −1 ) = A(z −1 )(1 − βz −1 )Hw , noting that β = 0.8 seems to be always satisfactory.
(This assumes the GPC disturbance model, so that D(z −1 ) = (1 − z −1 )A(z −1 ).)

Example 7.4 Swimming pool

Consider the swimming pool of Problem 3 of Chapter 3. That problem showed that
a predictive controller with the standard ‘DMC’ disturbance model does not com-
pensate perfectly for a sinusoidal diurnal variation of the air temperature if the air
temperature is not measured. With the particular choice of parameters used there
and a 10 degC amplitude of the air temperature, the water temperature oscillates
with an amplitude of about 0.5 degC if there are no constraints on the heater power.
Problem 1 of Chapter 5 then showed that if the air temperature is measured and used
for feedforward control, then the air temperature is perfectly compensated, providing
that the model is perfect. If there is some modelling error then a residual oscillation
of the water temperature remains, although it typically has smaller amplitude than
when the air temperature is not measured.

Such a small oscillation would be acceptable in a swimming pool, but it may be


important to remove it completely in some industrial process. This can be done by
modelling the sinusoidal disturbance and designing a suitable observer, even if the air
temperature is not measured. Furthermore it can be done robustly — the oscillation
7.4. Disturbance Models and Observer Dynamics 227

can be removed completely, even if the model is not perfect. This can be done as
follows.

First, note that it is reasonable to assume that we know that the air temperature
variation is sinusoidal, and its period, from our knowledge of the physical situation.
The amplitude and phase of the variation, however, are not known in advance. Thus
we can model the air temperature by the differential equation
 2

θ̈a + θa = 0 (7.26)
24

with unknown initial conditions on θ and θ̇, which will determine the amplitude and
phase. Choosing state variables θa and θ̇a gives the state-space model
    
d θa 0 1 θa
= 2 (7.27)
dt θ̇a − 2π 24 0 θ̇a

The complete state-space model is thus:


      
θ −1/T 1/T 0 θ k/T
d   
θa = 0 0 1   θa  +  0  q (7.28)
dt 
2π 2
θ̇a 0 − 24 0 θ̇a 0

The corresponding discrete-time model for the nominal parameters T = 1 hour and
k = 0.2 degC/kW, when the sampling interval is Ts = 0.25 hour, is
      
θ 0.7788 0.2210 0.0288 θ 0.0442
 θa  (k + 1) =  0 0.9979 0.2498   θa  (k) +  0  q(k)
θ̇a 0 −0.0171 0.9979 θ̇a 0
(7.29)

which has two eigenvalues on the unit circle, as expected.

If this plant model is used for predictive control, together with the standard ‘DMC’
estimator, then no improvement of performance is obtained — a residual oscillation
of the water temperature remains, as before. The reason is that the ‘DMC’ estimator
yields an observer whose poles are the plant’s poles and a pole at 0 — see the analysis
in section 2.6.3. But the plant poles include the two disturbance poles on the unit
circle, so the observer is not asymptotically stable. The result is that any initial
error in estimating the initial conditions θ(0), θ̇(0) results in an oscillating, but not
reducing, error as measurements of θ become available. The remedy for this is to
use an alternative observer gain, which will make the observer asymptotically stable.

In Example 7.1 we used ‘pole placement’ to obtain the observer gain. Here we
will pretend that the model of the air temperature disturbance is subject to random
disturbances, and that measurements of the water temperature are subject to random
noise. We will then use Kalman filter theory to obtain the observer gain. When
228 7. Tuning

the state vector has only 3 elements, as here, both methods will work; but when the
state dimension becomes larger than about 5, only the Kalman filter method remains
useful in practice. In order to do this, the model (7.29) has to be modified to admit
another input w, which is the random disturbance on θ̇:
      
θ 0.7788 0.2210 0.0288 θ 0.0442 0  
 θa  (k + 1) =       q(k)
0 0.9979 0.2498 θa (k) + 0 0
w(k)
θ̇a 0 −0.0171 0.9979 θ̇a 0 1
(7.30)
and the output equation has to be modified to admit measurement noise v:
 
  θ
θ(k) = 1 0 0  θa  (k) + v(k) (7.31)
θ̇a
Now making various assumptions about the variances W and V of w and v, respec-
tively, gives various observer gains, and hence various observer pole locations. Note
that this modification of the model is needed only for computing the observer gain;
it is not needed for the internal model in the controller, which should be (7.29).

Since the Model Predictive Control Toolbox uses the augmented state vector (2.37)
described in section 2.4, there are 4 state variables when working through this ex-
ample with the Model Predictive Control Toolbox, and hence 4 observer poles. The
choice W = 1, V = 10−6 gives observer poles (eigenvalues of A(I − L0 C) in (7.24))
at −0.5402, −0.1783, and 0.0562 ± 0.0618i. These are all within the unit circle, so
the observer is asymptotically stable, as expected. Since V is very small relative to
W , the measurements are considered to be very accurate, and hence the estimation
of θa (0) and θ̇a (0) by the observer is very fast, as shown by the two poles very close to
the origin. (Deadbeat estimation —poles at zero — would be expected with V = 0.3
This leads to relatively agressive control action. Figure 7.14 shows the resulting
performance of the predictive controller. This figure was produced using the Model
Predictive Control Toolbox function scmpc, which sets the initial states of both the
plant and the internal model to zero at the beginning of the simulation. There is
therefore an initial transient, lasting about 10 samples, or 2.5 hours, during which
the air temperature disturbance is estimated and the water temperature is brought
up to its set-point of 20 degC. Once this transient has been completed, the set-point
is held very accurately, with perfect compensation for the sinusoidal air temperature
variation. Note that, in addition to compensating for the sinusoidal variation, which
is due to the inclusion of the model (7.27), the controller also compensates for the
mean air temperature (15 degC), even though it does not know the value of k/T
accurately; this is due to the use of the augmented state, which results in the DMC
constant-disturbance model being included implicitly.

The results shown in Figure 7.14 were obtained with the controller having a perfect
model of the plant — that is, correct estimates of the parameters T and k (1 hour and
3
The observer gain was computed using the Model Predictive Control Toolbox function smpcest.)
This function requires V to be positive definite.
7.4. Disturbance Models and Observer Dynamics 229

Water (solid) and Air (broken) Temperatures


30

25
Temperature (deg C)

20

15

10

0
0 5 10 15 20 25 30 35 40 45 50
Time (hours)

Manipulated Variables
600

400
Heater power (kW)

200

−200

−400
0 5 10 15 20 25 30 35 40 45 50
Time (hours)

Figure 7.14: Control of water temperature with perfect plant model, and model of
air temperature disturbance. W = 1, V = 10−6 . The broken line shows the air
temperature.

0.2 degC/kW, respectively). If the same controller is applied when the parameters
change to T = 1.25 hour and k = 0.3 degC/kW then the closed loop is unstable. If the
observer is re-designed on the assumption that W = 1 and V = 1 then the observer
poles become 0.7397± 0.3578i and 0.6118± 0.1136i. Since the measurements are now
assumed to be much more noisy, the observer estimates the disturbance more slowly,
but remains asymptotically stable. The control is now less agressive, as is shown by
the solid line in Figure 7.15. The initial transient lasts longer than before: about 20
samples, or 5 hours. The benefit of this ‘de-tuning’ is that the control is now much
more robust. If the same controller is applied to the pool when the parameters change
to T = 1.25 hour and k = 0.3 degC/kW then the closed loop remains stable, and the
response is almost unchanged — this is shown by the broken line in Figure 7.15. The
most important thing to notice here is that the compensation of the sinusoidal air
temperature variation remains perfect, although the controller now has the incorrect
values of the parameters T and k. This illustrates that modelling the disturbance
correctly gives robust disturbance compensation, even when the disturbance is not
measured.

The responses shown in Figures 7.14 and 7.15 were obtained with no constraints on
the heater power. In particular, the heater power was allowed to be negative at those
230 7. Tuning

Water temperature
30

25

20
Temperature (deg C)

15

10

0
0 5 10 15
Time (hours)

Figure 7.15: Control of water temperature with model of air temperature distur-
bance. Perfect (solid line) and imperfect (broken line) models. W = 1, V = 1.

times when the air temperature exceeded the set-point temperature. If the heater
power is limited to

0 ≤ q ≤ 60 kW

then the responses shown in Figure 7.16 are obtained when the same controller as
used in Figure 7.15 is used, with an imperfect model. The controller now cannot
correct for the air temperature rising above the set-point, but the notable feature is
that it still compensates perfectly at other times. It is able to do this only because it
is aware of the actual power that the heater is providing, so that its estimate of the
air temperature remains accurate, even when it cannot provide effective control.

The model of an unmeasured persistent disturbance does not have to be perfect; even
a mild improvement on the ‘constant disturbance’ assumption can lead to a big im-
provement in performance. Problem 6 demonstrates that a big improvement can be
obtained by assuming that the air temperature varies as a ramp, even if it actually
varies sinusoidally. The explanation of this is that the observer is constantly re-
estimating the disturbance as a ramp, and this allows the controller to predict the
sinusoidal disturbance quite well over a short interval.

All the responses shown for this example were computed and displayed using the
7.5. Reference Trajectory and Pre-Filter 231

Water (solid) and Air (broken) Temperatures


25

20
Temperature (deg C)

15

10

0
0 5 10 15 20 25 30 35 40 45 50
Time (hours)

Manipulated Variables
60

50
Heater power (kW)

40

30

20

10

−10
0 5 10 15 20 25 30 35 40 45 50
Time (hours)

Figure 7.16: Control of water temperature with model of air temperature distur-
bance, heater power constraints, and imperfect model. W = 1, V = 1.

MATLAB function swimpool, which is available on this book’s web site. This func-
tion enables the reader to experiment with the disturbance model, the observer design,
the plant/model error, and the heater constraints.

7.5 Reference Trajectory and Pre-Filter

Another tuning parameter in predictive control is the choice of reference trajecto-


ries for each controlled output. Reference trajectories, in the sense introduced by
Richalet[Ric93b], were already discussed in sections 1.2 and 5.6, where the effects
of various reference trajectories were presented. As Soeterboek points out [Soe92],
initialising the reference trajectory at the latest output measurement introduces
another feedback loop. Although one expects, intuitively, that a slower reference
trajectory should lead to less agressive feedback action, and hence greater robust-
ness to modelling errors, this need not always be so. However, only a few particular
cases seem to have been analysed; there is scope for more complete analysis of the
effects of reference trajectory specifications.

To see how the use of a reference trajectory modifies the feedback loop, we can
232 7. Tuning

proceed as follows.4 Assume first that future set-point changes are not known.
A set of exponential reference trajectories, one for each controlled output, can be
represented by

r(k + ip |k) = (I − Λip )s(k) + Λip z(k) (7.32)

where s(k) is the current set-point and z(k) the current value of the controlled
output, Λ = diage−Ts /Tref ,1 , e−Ts /Tref ,2 , . . . , e−Ts /Tref ,n , and Tref ,j is the time constant
applicable to the j’th output zj . T (k) in equation (3.2) becomes
   
I − ΛHw ΛHw
 I − ΛHw +1   ΛHw +1 
   
T (k) =  ..  s(k) +  ..  z(k) (7.33)
 .   . 
I − ΛHp ΛHp

This modification of T (k) is shown in block-diagram form in Figure 7.17 for the
(over-simplified) case when the controlled output z(k), the measured output y(k),
and the state x(k), are all the same. This figure clearly exhibits the additional
feedback loop, compared with Figure 3.1.

+ ∆u(k|k) 1 u(k|k)
KMPC 1−z −1
I Plant
T (k|k) - -
z(k)

z −1 I
u(k−1)
Υ

Ψx(k)
Ψ

   
s(k) I − ΛH w ΛH w
   . 
 ..   . 
 .  + +  . 
I −Λ pH ΛH p

Figure 7.17: Controller structure with reference trajectories: Non-anticipated set-


point.

If the controller is aware of future set-point changes, then this information can be
exploited in the definition of the reference trajectory. The easiest way to generate
exponential reference trajectories in this case is with an iterative loop, in which ytraj
is a ‘dummy’ variable:

• let ytraj = y(k)

• for i = 1 : p
4
The development in this section, and the figures, are due to my student Simon Redhead.
7.5. Reference Trajectory and Pre-Filter 233

• ytraj = s(k + i) − Λ{s(k + i) − ytraj }

• r(k + i|k) = ytraj

• end

which is equivalent to
   
(I − Λ)s(k + Hw ) Λr(k + Hw − 1|k)
(I − Λ)s(k + Hw + 1)  Λr(k + Hw |k) 
   
T (k) =  .. + ..  (7.34)
 .   . 
(I − Λ)s(k + Hp ) Λr(k + Hp − 1|k)

If Hw = 1 then
     
r(k + 1|k) (I − Λ)s(k + 1) Λr(k|k)
 r(k + 2|k)   (I − Λ)s(k + 2)   Λr(k + 1|k)
     
T (k) =  .. = .. + ..  (7.35)
 .   .   . 
r(k + Hp |k) (I − Λ)s(k + Hp ) Λr(k + Hp − 1|k)

where r(k|k) is initialised to the current controlled output: r(k|k) = z(k). Using z
to also denote the forward shift operator, equation (7.35) can then be rewritten as:
 
    0 0 ... 0 0
(I − Λ)z Λ Λ 0 . . . 0 0
 (I − Λ)z 2  0  
    0 Λ 0 0 
T (k) =  ..  s(k) +  ..  z(k) +   T (k) (7.36)
 .   .   .. .. .. 
 . . . 
(I − Λ)z Hp 0
0 0 ... Λ 0

or, equivalently,
 −1
I 0 ... 0 0     
−Λ I 0 0 
 (I − Λ)z Λ 

       

 .. ..   (I − Λ)z 2
 0
 
T (k) = 
 0 −Λ . .  ..  s(k) +  ..  z(k) (7.37)
 .. .   

 .  . 


 . .. I 0  (I − Λ)z Hp 0

0 0 ... −Λ I

It transpires that this is equivalent to


 
I 0 0 ... 0 0
 Λ     
 I 0 ... 0 0  (I − Λ)z Λ 
 Λ2  
 Λ I 0 0 
  (I − Λ)z 2  0 

   
T (k) = 
 Λ3 .. ..    s(k) +  ..  z(k)
 Λ2 Λ . . 
..
.  . 

 .. .. .. .  

 . . . .. I 0  (I − Λ)z H p
0
H
Λ p −1 H
Λ p −2 H
Λ p −3 ... Λ I
(7.38)
234 7. Tuning

Figure 7.18 shows this in block diagram form. This is just a particular filter with
inputs z(k) and s(k + i|k) (i = 1, . . . , Hp ), and output T (k). More complicated
reference trajectories can be represented by replacing it by other filters. Note that
in Figure 7.18 Ξ(z) represents the vector of transfer functions
 
(I − Λ)z
 (I − Λ)z 2 
 
Ξ(z) =  .. 
 . 
(I − Λ)z Hp

+ ∆u(k|k) 1 u(k|k)
KMPC 1−z −1
I Plant
T (k|k) - -
z(k)

z −1 I
u(k−1)
0 0 . . . 00
Υ
Λ 0 . . . 00
0 Λ 00
. .
 .. 
. . .
. + +
.
0 0 . . . Λ0 Ψx(k)
Ψ
 
Λ
s(k) 0
.
Ξ(z) .
+ + .
0

Figure 7.18: Controller structure with reference trajectories: Anticipated set-point.


The Model Predictive Control Toolbox function scmpc has been modified to allow
reference trajectories to be defined, both without and with anticipation of the set-
point. The modified functions, called scmpc3 and scmpc4, respectively, are available
on this book’s web site.

Reference trajectories are often confused with set-point pre-filtering. A pre-filter


is located outside the feedback loop, and hence does not affect the stability or
robustness properties of the loop, and has no effect on the response to disturbances.
The block with transfer function F (z) in Figure 7.1 shows the location of a set-point
pre-filter. The primary effect of the pre-filter is that it defines the ideal plant response
to set-point changes. It can be thought of as a ‘reference model’ — if the plant
controlled output followed it exactly, the ‘tracking error’ vector in the predictive
control problem formulation would be zero. A similar effect can be achieved by
varying the weights Q(i) over the prediction horizon. But it is much easier to design
an appropriate filter than to choose the corresponding pattern of weights — and, as
shown in [HM97], it is also computationally more efficient to use a filter. It should
be said, however, that if the plant output does not follow the reference signal r(k)
closely, then the effects of changing the pre-filter may not be obvious.

In traditional controllers a pre-filter is often used to reduce actuator saturation. The


idea is that if operators make ‘step’ changes in the set-point, and if the typical or
7.5. Reference Trajectory and Pre-Filter 235

maximum amplitudes of such changes are known, then passing this change through
a low-pass filter before forming the error can be used to limit the error amplitude
to such a magnitude that the actuators do not become saturated. With predictive
control there seems to be less reason to do this, since we have a more systematic way
of handling constraint violations, so there is no particular reason to avoid activating
constraints. But there are still good reasons for avoiding saturation:

• The behaviour of the closed loop is not understood so well when constraints
are active.

• It seems a good idea to keep some control authority ‘in reserve’ for dealing
with unexpected disturbances.

So it seems sensible to use pre-filtering to avoid actuator saturation in response


to set-points, while still relying on input constraints to handle fast recovery from
disturbances — for example, with a deadbeat observer, getting as fast a recovery
as the constraints will allow. A sophisticated development of the idea of set-point
pre-filtering is that of a reference governor [GKT95, BCM97, MKGW00] .

In the GPC literature a polynomial, usually denoted by P (z), is used to represent


the effects of specifying a reference trajectory in some papers, and of set-point pre-
filtering in others. Authors do not always clearly distinguish between these two.
236 7. Tuning

7.6 Problems
1. Prove equation (7.8): S(z) + T (z) = I.

2. Consider a SISO plant with transfer function P (z) = B(z)/A(z), and suppose
that K(z)H(z) = X(z)/B(z), as in the case of ‘perfect’ control, where X(z) is
some transfer function. Show that the transfer function from the disturbance
d to the plant input u has B(z) as a factor of its denominator. (Hence the
feedback loop is internally unstable if B(z) has any zeros outside the unit disk.)

3. (a) Design a mean-level controller for the plant used in the mpctutss demo in
the Model Predictive Control Toolbox. (An easy way to load the data is to
run the demo first. You can then save it to file using the save command
and retrieve it with the load command.)
(b) With horizons set as for ‘perfect’ control, investigate whether you can
achieve similar responses to those achieved with mean-level control, by
using non-zero weights R(i) on the input moves. (Consider both set-point
and disturbance responses.)
(c) Investigate the sensitivity and complementary sensitivity functions for
some of your designs.

4. (a) For the paper machine headbox (demo pmlin in the Model Predictive
Control Toolbox), find (by trial and error) the best combination of hori-
zons and weights that you can, with the default (DMC) observer. (Ignore
constraints.)
(b) Try improving your best design so far by changing the observer design.

5. A SISO plant with transfer function


−10s + 1
(s + 1)(s + 30)
is to be controlled using predictive control with a sampling interval of Ts = 0.2
sec.

(a) Design and simulate a ‘perfect’ controller for this plant, and explain the
results.
(b) Explain why increasing Hp will eventually give closed-loop stability (as-
suming no active constraints). Find the smallest Hp which gives stability,
if Hu = 1 and R(i) = 0. What are the closed-loop poles in this case?
Roughly what is the time constant of the set-point response in this case?
(c) Simulating this system with predictive control, with Hu = 2, Hp = 30,
Q(i) = 1 and R(i) = 0.1 shows that stability is obtained, but the response
to set-point step changes shows that the output moves in the ‘wrong’
direction initially. Show (by simulation) that this effect can be reduced
by limiting the input moves to |∆u(k)| < 0.1 for each k.

6. Consider the swimming pool of Problem 3 of Chapter 3, and of Example 7.4.


7.6. Problems 237

(a) Verify, using the Model Predictive Control Toolbox, that if the plant model
(7.29) is used with the default (DMC) observer, then an oscillating water
temperature will result when the air temperature varies sinusoidally as
in (3.96).
(Note: The model (7.29) should be used only for the controller’s internal
model, namely the argument imod of function scmpc. The argument
pmod, which represents the plant, should remain the same as in Problem
3 of Chapter 3.)
(b) Modify the function swimpool (which is available on this book’s web site)
so that the air temperature is modelled as a ramp rather than a sinusoidal
disturbance, although the actual disturbance remains a sinusoid with pe-
riod 24 hours. Show, by simulation, that a residual sinusoidal variation of
the water temperature remains, but that it is much smaller than the one
obtained by assuming a constant disturbance. (For example, with V = 1,
T = 1.25, and k = 0.3, a residual variation with amplitude approximately
0.01 degC is obtained. In Problem 3 of Chapter 3 an amplitude of ap-
proximately 0.5 degC is obtained when the disturbance is assumed to be
constant.)
(c) Investigate the sensitivity functions obtained when the air temperature
disturbance is modelled as a sinusoid, and as a ramp, respectively, assum-
ing that all constraints are inactive. Verify that in each case the frequency
response of the sensitivity becomes zero at the frequency of the assumed
disturbance, namely 2π/24 if the sinusoid is assumed, and 0 if the ramp
is assumed. Comment on the rate at which the sensitivity approaches
zero as ω → 0. (Note: Use the Model Predictive Control Toolbox function
smpccon to obtain the linear controller for the unconstrained case.)

7. (a) Verify that, if Λ = 0 in (7.36), then the controller anticipates set-point


changes, and the reference trajectory coincides with the future set-point
trajectory.
(b) Suppose a second-order reference trajectory is preferred to a first-order
exponential trajectory:

eαj eβj
r(k + j|k) = s(k + j) − [s(k + j) − z(k)] − [s(k + j) − z(k)]
2 2

where α and β are either negative real numbers, or complex conjugates


of each other (with negative real parts). Make the corresponding modifi-
cations to the development of section 7.5.
238 7. Tuning
Chapter 8

Robust Predictive Control

8.1 Formulations of Robust Control

Most formulations of robust control problems take the following general form. The
plant is assumed to be known only approximately; this is represented by assuming
that the plant lies in a set which can be characterised in some quantitative way.
The objective of robust control design is then to ensure that some performance
specification is met by the designed feedback system, so long as the plant remains
in the specified set.

Most robust control theory assumes that the controller is linear. But, as we have
seen, predictive controllers are nonlinear if constraints become active. Nevertheless,
this theory remains useful even for predictive control, because many predictive con-
trollers operate in their unconstrained mode most of the time, or at a fixed set of
active constraints for long periods of time. In either case, predictive controllers for-
mulated with quadratic costs, linear models, and linear constraints, behave linearly
in these conditions.

In this chapter we begin by examining two approaches to tuning for robust control
which assume a linear controller, then go on to look at approaches which acknowledge
the presence of constraints.

An interesting but untypical early result on the robustness of unconstrained MPC


was given by Åström in [Åst80]. The problem considered was, in our terms, that of
MPC of a SISO system with Hp = Hu = 1 and R = 0, for an asymptotically stable
plant with model
y(k + 1) = bu(k) (b > 0) (8.1)
It was shown that closed-loop stability is obtained if this MPC controller is applied
to any linear SISO plant whose continuous-time step response Sc (t) is monotonic
and positive (t1 > t2 ⇒ Sc (t1 ) > Sc (t2 )), providing that the sampling interval Ts is

239
240 8. Robust Predictive Control

chosen such that


Sc (∞)
Sc (Ts ) > (8.2)
2
and that the model gain is assumed to be large enough:
Sc (∞)
b> (8.3)
2
This good robustness is obtained at the cost of performance; the closed-loop settling
time is longer than the settling time of the open-loop plant if Ts and b are chosen in
this way. Although this is a very special result, it shows one rather general feature:
stability is frequently obtained with MPC if the prediction horizon is made large
enough — in this case, the prediction horizon is the same as the sampling interval
Ts , since Hp = 1.

8.1.1 Norm-bounded uncertainty

The most common specification of plant uncertainty is ‘norm-bounded’. It is as-


sumed that one has a nominal model of the plant, say a transfer function P0 (z), but
that the real plant P (z) is given by a description such as:

P (z) = P0 (z) + ∆ (8.4)


P (z) = P0 (z)[I + ∆] (8.5)
−1 −1
P (z) = [M0 (z) + ∆M ] [N0 (z) + ∆N ] where P0 (z) = M0 (z) N0 (z) (8.6)

where, in each case, ∆ is a stable bounded operator, and P0 (z) is often normalised in
such a way that ||∆|| ≤ 1. Of course one does not know exactly what ∆ is. Various
assumptions can be made about the nature of ∆: nonlinear, linear time-varying,
linear parameter-varying, linear time-invariant being the most common ones. Also
various norms can be used; the most commonly used one is the ‘H-infinity’ norm
||∆||∞ , which is defined even for nonlinear systems, as the worst-case ‘energy gain’
of an operator.

A linear feedback controller K(z) designed for the nominal plant P0 (z) will certainly
give a stable closed-loop if the plant is exactly the same as the model P0 (z). But
it will not necessarily be stable when used with the real plant P (z). It is therefore
important to have some way of testing whether it will remain stable for all possible
plants allowed by the uncertainty description. Suppose that the uncertainty about
the plant is represented by the additive model (8.4). Then the feedback combination
of the real plant with the controller can be drawn as shown in Figure 8.1. The
uncertainty ∆ is in parallel with the nominal plant model P0 , but the figure has
been drawn to show it as being in feedback around the closed loop formed by the
controller K and P0 (which is enclosed by the broken line). The transfer function
(matrix) of the block within the broken line can be shown to be K(z)S(z), where
S(z) = [I + P0 (z)K(z)]−1 is the sensitivity function introduced in section 7.1, and
8.1. Formulations of Robust Control 241

this transfer function is of course stable, by design. Thus the ‘loop gain’ transfer
function is KS∆. It then follows from the small-gain theorem1 that the feedback
combination of this system with the uncertainty block ∆ will remain stable if
σ̄[K(ejωTs )S(ejωTs )]k∆k∞ < 1 (8.7)
where σ̄[.] denotes the largest singular value — see Minitutorial 8 and section 7.3.

K(z)
+

P0 (z)

Figure 8.1: Feedback combination of controller and plant, with additive uncertainty
model.

Inequality (8.7) can be tested for a given design, to check whether robust stability
is guaranteed for any plant within the set allowed by the uncertainty description.
When tuning a controller, one can try to influence the frequency response properties
in such a way as to make (8.7) hold. Note that (8.7) is only a sufficient condition
for robust stability; if it is not satisfied, robust stability may nevertheless have been
obtained.

Other uncertainty descriptions lead to other tests for robust stability. For example,
the ‘input multiplicative’ uncertainty model (8.5) leads to the following sufficient
condition for robust stability:
σ̄[K(ejωTs )P0 (ejωTs )(I + K(ejωTs )P0 (ejωTs ))−1 ]k∆k∞ < 1 (8.8)
(Note that for multivariable systems, KP0 6= P0 K, so that the transfer function
which appears in (8.8) is not the same as the complementary sensitivity introduced in
section 7.1.) And the ‘coprime factor’ uncertainty model (8.6) leads to the condition:
  
K(ejωTs ) jωTs −1 jωTs −1
σ̄ [I + P0 (ejωTs
)K(e )] M0 (e ) k[∆M , ∆N ]k∞ < 1 (8.9)
I
1
Alternatively, from a generalisation of the classical Nyquist stability theorem
242 8. Robust Predictive Control

Descriptions such as those given in (8.4)–(8.6), in which the only specification on the
uncertainty ∆ is a norm-bound, are known as unstructured uncertainty descriptions.
In practice much more specific information is available about the way in which the
plant behaviour can vary. For example it may be known that specific physical pa-
rameters, such as mass or resistance, can vary within known limits. In such cases
a norm-bounded description can still be used, but the operator ∆ then is restricted
to have a fixed structure. It can usually be arranged that this structure is that of a
block-diagonal transfer function, with specified sizes of the blocks. The advantage
of doing this is that robust stability tests can then be used which are less conser-
vative than singular-value tests such as (8.7) or (8.8). This is due to the fact that
the singular-value tests check whether any perturbation ∆ of the permitted ‘size’
(as measured by the norm) could destabilise the closed loop, even a perturbation
whose structure does not correspond to any possible parameter variation. A more
refined test, which checks only perturbations of the permitted size and structure, is
the structured singular value, also commonly referred to as µ. Even this gives suffi-
cient conditions only for robust stability, because it checks for plant perturbations
which may be complex-valued (such as phase perturbations in frequency-response
properties), even if only real-valued perturbations are known to occur in the plant.
In principle, a necessary and sufficient test of robust stability can be obtained by
a further refinement, the real structured singular value, or ‘real-µ’. In practice, it
is known that ‘real-µ’ can be extremely difficult to compute (its computation is
known to be ‘NP-hard’), and one has to be content with upper and lower bounds
for it. Consequently, there is usually some conservativeness in the robust stability
robustness test, even if a ‘real-µ’ test is employed.2

One of the important attributes of the structured singular value is that it can be
used to assess not only whether stability is robustly preserved, but a similar test
can be performed for robust preservation of performance, if this can be expressed in
terms of norm-bounds.

For further details of the norm-bounded approach to modelling plant uncertainty,


and corresponding tests for robustness, see [Mac89, ZDG96]. In section 9.1.6 this
approach is illustrated in a case-study. In [PG88] it is argued that structured singular
values, together with predictive control, can be made the basis of a systematic
approach to process control.

8.1.2 Polytope uncertainty

Another approach to specifying the uncertainty of a plant model is to define regions


in which the parameters defining the model must lie. The difficulty is to do this in
such a way that some analysis is possible on the resulting description.
2
Singular values can be computed using the Model Predictive Control Toolbox function svdfrsp.
µ and ‘real-µ’ can be estimated using the function mu in the Mu-Analysis and Synthesis Toolbox for
MATLAB.
8.2. The Tuning Procedure of Lee and Yu 243

Early approaches to robust predictive control assumed that the model was defined
as an FIR system of fixed order, and the uncertainty was in the form of bounds
on the pulse response coefficients [CM87]. This had the advantage that the uncer-
tainty appeared linearly in the model description. But unfortunately it was later
shown that design methods based on such descriptions did not guarantee robustness
[ZM95b].

A more recent approach is to assume that a number of ‘corner’ points are known:

x(k + 1) = Ai x(k) + Bi u(k) i = 1, 2, . . . , L (8.10)

and that the real plant lies in the polytope3 which is the convex hull of these corners:

X
L X
L
[A, B] = λi [Ai , Bi ], λi = 1 (8.11)
i=1 i=1

The real plant does not need to be fixed. It can vary with time, so long as it remains
within this polytope [KBM96]. We shall use this uncertainty description in section
8.4.

8.2 The Tuning Procedure of Lee and Yu

8.2.1 Simplified disturbance and noise model

In this section we shall outline a tuning procedure proposed by Lee and Yu in


[LY94]. They adopt the disturbance and noise model shown in Figure 8.2, which was
introduced in [LMG94]. Only output disturbances are assumed to act on the plant,
as in the DMC model, but they are not assumed to be step disturbances. Instead the
disturbances are assumed to be generated by independent stochastic ‘white noise’
processes (shown as the vector ∆w(k) in the figure), which are integrated to form
the vector of stochastic processes w(k), and these are then filtered by first-order low-
pass filters to form the stochastic output disturbance vector d(k). The disturbance
on the i’th output is passed through a filter with a pole at αi , which corresponds to
a time constant of −Ts / ln αi ≈ Ts /(1 − αi ) if αi is close to 1, where Ts is the update
interval — note that 0 ≤ αi ≤ 1 for stability of the filter. The plant output vector
is then assumed to be corrupted by the white measurement noise vector v(k), each
element of which is independent of the others.

This model generalises the DMC disturbance model, which is obtained if each αi = 0
and the covariance of v(k) is zero. The use of integrated white noise ensures offset-
free performance in the face of constant disturbances and plant/model steady-state
3
A polytope is a finite region of n-dimensional space bounded by a finite number of hyperplanes.
It is not necessarily convex, though the particular polytope referred to here is convex. The set
of solutions to the vector inequality Ax ≤ b, where x has n elements, is a convex n-dimensional
polytope, if it is bounded. A 3-dimensional polytope is usually referred to as a polyhedron.
244 8. Robust Predictive Control

z 1
∆w(k) z−1 w(k) z−α1 Disturbance
.. ..
. .
z 1
z−1 z−αp
d(k)
Measured
+ output
Input +
PLANT
u(k) + y(k)
+
v(k) Noise

Figure 8.2: The disturbance and noise model used by Lee and Yu [LY94]

gain mismatches. The filters allow the designer to specify that disturbances on vari-
ous outputs appear with different ‘speeds’, and hence that the disturbance rejection
can be performed with a different speed of response on each output. This allows
the disturbance rejection to be less agressive than it would be with the DMC model
(assuming the same cost function is used), and thus provides a useful additional
set of tuning parameters. These parameters can be used to enhance the robust-
ness of the controller: the intuition that control has to be ‘de-tuned’ in order to
increase robustness is usually sound,4 and one can perform rigorous analysis of the
robustness for various choices of the αi parameters, at least for the case of inactive
constraints. In addition to the filter time constants, one can adjust the covariances
of the processes ∆w(k) and v(k), namely the relative strengths of the disturbance
and the measurement noise on each output. This again influences the response of
the controller to apparent disturbances — if an output measurement is specified as
being very noisy, then the estimator, if designed properly, should regard most vari-
ations as being due to noise, and so ‘tell’ the predictor — and hence the controller
— that there is not much disturbance on that output, and hence not much response
is needed. (Note that this is a frequency-independent effect, whereas adjusting the
filter time constants ‘shapes’ the frequency response.)

It seems plausible that the filter parameters αi and the relative strengths of dis-
turbances and noises could be made available to plant operators as on-line tuning
parameters, since their meanings can be easily understood. But that depends on the
extent to which the effects of adjusting these parameters corresponds to intuition.
Lee at al [LMG94] and Lee and Yu [LY94] have performed a detailed investigation
of these effects. We will give only a summary of their analysis and findings.

4
‘De-tuned’ here is used in the traditional sense, referring to less agressive control action. Of
course if one’s objectives include increasing robustness then the tuning is actually being improved
by ‘de-tuning’.
8.2. The Tuning Procedure of Lee and Yu 245

An appropriate estimator and predictor, which corresponds to the assumptions on


the disturbances and noise, can be obtained by using Kalman filter theory. In order
to use this theory, we have to put our plant and assumptions into the standard form
(omitting measured disturbances, since we do not need them here):

ξ(k + 1) = Ãξ(k) + B̃u(k) + Γ∆w(k) (8.12)


y(k) = C̃ξ(k) + v(k) (8.13)

where ξ(k) is a suitable state vector, and we can use ∆w(k) and v(k) because they
are already assumed to be white, as required in the standard form. Now, using our
usual plant model, our assumptions correspond to:

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


y(k) = Cx(k) + d(k) + v(k) (8.15)

where x(k) is the state of the plant itself, and we need a state-space model of the
disturbance process d(k). It is convenient to obtain this in two steps: first a model
of d(k) obtained from w(k), then a model of w(k) obtained from ∆w(k). For the
first step we have:

xw (k + 1) = Aw xw (k) + w(k) (8.16)


d(k) = xw (k) (8.17)

where w, xw and d all have the same dimensions, and Aw = diag{αi }. Combining
this with (8.14) and (8.15) gives
        
x(k + 1) A 0 x(k) B 0
= + u(k) + w(k) (8.18)
xw (k + 1) 0 Aw xw (k) 0 I
 
x(k)
y(k) = [C I] + v(k) (8.19)
xw (k)

Since ∆w(k) = w(k)−w(k −1) we can take the second step by using the ‘differenced’
or ‘velocity’ form of the model as developed in section 2.4. By analogy with that
development, we have:
    
∆x(k + 1) A 0 0 ∆x(k)
 ∆xw (k + 1)  =  0 Aw 0   ∆xw (k)  +
η(k + 1) CA Aw I η(k)
   
B 0
+  0  ∆u(k) +  I  ∆w(k) (8.20)
CB I
 
∆x(k)
y(k) = [0 0 I]  ∆xw (k)  + v(k) (8.21)
η(k)

This is now in the form of the standard model (8.12)–(8.13), with u replaced by ∆u.
Note that the stochastic disturbance ∆w(k) does not excite the plant state ∆x(k),
246 8. Robust Predictive Control

which means that any unstable modes in the plant model will not be stabilised by
the Kalman filter (estimator) gain. So, just like the DMC model, this disturbance
model can only be used with asymptotically stable plants. This is true for any model
which treats all disturbances as being output disturbances which do not affect the
plant state.

To complete the model, the covariance matrices of ∆w(k) and v(k) must be specified.
By assumption these are both digaonal: W = diag{ρi }, V = diag{σi }, with ρi ≥ 0
and σi ≥ 0.

The Kalman filter gain can now be computed by solving the appropriate discrete-
time Riccati equation — see (8.27). (In [LMG94] the plant state vector is chosen
to be made up of predicted values of the plant output. It is pointed out that this
choice reduces the dimension of the Riccati equation which must be solved. But
this is now a minor issue, given current computing power, and considering that this
equation needs only be solved off-line.5 ) It is also shown in [LMG94] that the DMC
estimator/predictor is obtained if αi = 0 and V = 0.

Note that the Model Predictive Control Toolbox function smpcest has an option in
which this disturbance/noise model is assumed, and only the αi , ρi and σi parameters
need to be specified.

It is easy to verify that the Riccati equation (8.27) for the model (8.20)–(8.21) has
a solution with the structure
 
0 0 0
P =  0 P22 P23  (8.31)
0 P23T P33
(assuming an asymptotically stable plant, of course) where the dimensions of the
blocks correspond to the dimensions of the vectors x, xw and y. Consequently the
Kalman filter gain matrix is given by
 
0
L =  P23  [P33 + V ]−1 (8.32)
P33
Furthermore, since Aw , W and V are all diagonal, the blocks P22 , P23 and P33 are
all diagonal (and square). Consequently L has the form
   
0 0
L =  L∆w  =  diag{φi }  (8.33)
Lη diag{ψi }
In [LY94] it is shown that
ψi2
φi = (8.34)
1 + αi − αi ψi
5
Computing the Kalman filter gain for a random system with 100 states and 20 outputs, using
the MATLAB Control System Toolbox’s function dlqe takes about 30 seconds on a Pentium II
processor running at 333 MHz with 128Mb of main memory.
8.2. The Tuning Procedure of Lee and Yu 247

Consider a plant model

x(k + 1) = Ax(K) + Bu(k) + Γw(k) y(k) = Cx(k) + v(k) (8.22)

in which w and v are white noise processes with covariance matrices E{wwT } =
W ≥ 0, E{vv T } = V > 0, and E{wv T } = 0 (ie w and v are uncorrelated). w is
supposed to be a disturbance which affects the plant behaviour (and must therefore
be ‘tracked’ by the filter in some sense), whereas v is supposed to be a measurement
noise (which must therefore be ‘rejected’ by the filter in some sense). An optimal
(minimum error variance) estimate of the state x can be obtained by iterating the
following equations which define the Kalman filter [AM79, BGW90, BH75, KR72]:

Correction: x̂(k|k) = x̂(k|k − 1) + L0 (k) [y(k) − C x̂(k|k − 1)] (8.23)


Prediction: x̂(k + 1|k) = Ax̂(k|k) + Bu(k) (8.24)

where the Kalman filter gain L0 (k) is given by


 −1
L0 (k) = P (k)C T CP (k)C T + V (8.25)

and
 −1
P (k + 1) = AP (k)AT − AP (k)C T CP (k)C T + V CP (k)AT + ΓW ΓT (8.26)

The model and covariances can be time-varying, but if they are all constant then the
Riccati equation (8.26) converges to P∞ ≥ 0, which is a solution to the (filtering)
algebraic Riccati equation:
 −1
P∞ = AP∞ AT − AP∞ C T CP∞ C T + V CP∞ AT + ΓW ΓT (8.27)

and from which the ‘stationary’ Kalman filter gain is obtained as


 −1
L0∞ = P∞ C T CP∞ C T + V (8.28)

Note that the Kalman filter equations have the form of an observer, with a special
choice of observer gain. If the pair (A, ΓW 1/2 ) is stabilisable and the pair (C, A) is
detectable, then the closed-loop observer state-transition matrix A(I − L0∞ C) has
all its eigenvalues within the unit disk, so that the observer is stable. Also, note
that V ≥ 0 or even V = 0 is allowed, providing that CP∞ C T > 0.
Optimal predictions are obtained by assuming that future values of the disturbance
and noise will be equal to their mean values (ie 0) and hence are obtained from the
optimal filtered state estimate x̂(k|k) by using the recursion

x̂(k + 1|k) = Ax̂(k|k) + Bu(k) (8.29)


x̂(k + l|k) = Ax̂(k + l − 1|k) + B û(k + l − 1) for l > 1. (8.30)

Mini-Tutorial 9: The Kalman Filter


248 8. Robust Predictive Control

and that ψi → 0 as ρi /σi → 0. Note that ψi → 1 as σi → 0. It can be shown that


0 < ψi ≤ 1 for all values of ρi /σi .

In [LY94] the tuning procedure is expressed in terms of adjusting the gain ψi directly,
rather than adjusting the variances ρi and σi .

8.2.2 Tuning procedure

Lee and Yu [LY94] suggest a two-step tuning procedure. The first step is concerned
with choosing cost-function weights and horizons such as to obtain nominal stability
(ie closed-loop stability, assuming that the linear plant model is perfect). They
therefore suggest choosing the control penalty weighting matrix as R = 0, making
the control horizon as large as practically possible, and the prediction horizon at
least as large as the control horizon, possibly infinite. The reason for making the
horizons as large as possible is to make the ‘regulator’ part of the controller behave
as closely as possible to an infinite-horizon linear quadratic state-feedback controller,
since such a controller usually exhibits very good feedback properties. (More will
be said about this in section 8.3.) In the light of section 6.2 a better suggestion now
is to make both horizons infinite, so that the exact ‘linear quadratic’ behaviour is
obtained, so long as all the constraints are inactive. The reason for choosing R = 0
is so as not to limit the controller action unnecessarily at this stage — but a further
reason will be seen in section 8.3.

The second step consists of ‘de-tuning’ the controller so as to obtain robustness with
respect to plant/model mismatch. This is done by adjusting the disturbance and
noise parameters αi , ρi and σi , or (almost) equivalently the parameters αi and ψi .

If there is only one output being controlled then there is only one filter parameter,
α1 , and one gain, ψ1 , to adjust. The situation is then identical to adopting a second-
order ‘observer polynomial’ C(z) in GPC — see sections 4.2.4 and 4.2.5, and Problem
2. Broadly speaking, increasing ψ1 (or ρi /σi ) increases the bandwidth of the closed
loop with the whole predictive controller in place. More precisely, it increases the
frequency at which the gain of the sensitivity function |S(ejωTs )| becomes close to 1,
and at which the gain of the complementary sensitivity |T (ejωTs )| begins to deviate
significantly from 1. Increasing α1 has the effect of improving (ie reducing) the
sensitivity at low frequencies, but at the cost of increasing both the sensitivity and
the complementary sensitivity at high frequencies, and hence reducing robustness to
modelling errors and leading to underdamped (‘ringing’) behaviour. The appropriate
performance/robustness trade-off has to be decided by examining the Bode plots of
these functions for specific cases.

For the multivariable case, Lee and Yu [LY94] give an extensive discussion of how
the tuning should be related to what is known about the uncertainty structure
of the plant, as referred to either its inputs or outputs. They suggest that the
disturbance/noise parameters should be used to tune for robustness in the face
8.3. The LQG/LTR Tuning Procedure 249

of output uncertainty, but that the control penalty matrix R should be used to
tune for robustness against input uncertainty. However, in most cases information
about the uncertainty structure is not available sufficiently precisely to allow one
to follow this advice. In such cases one is reduced to adjusting the αi and ψi
(or ρi , σi ) parameters, using one’s understanding of their effects in the single-output
case, monitoring the singular values of the sensitivity and complementary sensitivity
functions, and accepting that their effects interact with each other.

Disadvantages of increasing R from its initial value of 0 are that its effects are some-
times counter-intuitive, and that they can be completely lost if output constraints
become active, since the need to respect constraints then takes precedence over min-
imisation of the cost. On the other hand, the functioning of the state estimator is
not affected by the constraints, so some of the benefits achieved by tuning the esti-
mator may remain in place even if output constraints become active. This is a very
heuristic argument, but there is some practical experience which indicates that it
has some validity.

8.3 The LQG/LTR Tuning Procedure

‘Loop Transfer Recovery’, or LTR, is a tuning technique developed for use with the
‘Linear Quadratic Gaussian’, or LQG, design approach. LQG theory says that if
we have a Linear plant model, Quadratic penalty cost, and disturbance and noise
signals with Gaussian probability distributions, then the optimal control problem
separates into two sub-problems, which can be solved independently:

1. Estimate: Use a Kalman filter to obtain the optimal estimate x̂(k|k) of the
plant state (from plant input and output signals). See Minitutorial 9 for
details.

2. Control: Find the optimal state feedback gain matrix KLQ for the determin-
istic (ie no disturbance or noise) control problem with the same cost function
for the same plant. (See Minitutorial 7 for details.) Then use the optimal state
estimate as if it were a measurement of the true state: apply the feedback law
u(k) = −KLQ x̂(k|k).

We have already used the LQG approach in the previous section. The proposal to
use the LQG/LTR tuning procedure is very close to the procedure proposed in the
previous section, namely the Lee and Yu procedure. It generalises it, by using a
more general disturbance model. This allows more freedom to shape the frequency
response, if required, and it removes the restriction to stable plants. Also, it allows
the disturbance model to include correlated disturbances, which is an advantage
in those applications in which strong correlation is present, and is known precisely
enough to be worth modelling — for example in the control of ships, in which state
disturbances are highly correlated because they are due to common causes such
250 8. Robust Predictive Control

u(k) ξ(k) y(k)


B̃ DELAY C̃
+
+

LLQ

−K∞

Figure 8.3: The LQ state feedback regulator

as waves. On the other hand, the complexity is not increased very much — if at
all — because the weights in the cost function are fixed in advance, and only the
noise model is adjusted. Also, the tuning can be pursued by monitoring an open-
loop frequency response (that of the Kalman filter), which makes it easier to take
inherent plant characteristics into account while tuning.

The authors of [BGW90] advocated using LQG/LTR to design adaptive predictive


controllers. Since the approach requires the use of infinite horizons, it did not seem
possible, at that time, to apply this idea to constrained predictive control. Now,
however, since we know how to solve constrained predictive control problems with
infinite horizons — especially since the work of [SR96b], in which both the prediction
and the control horizons are infinite — it is possible to use LTR methods for these
problems. In [LMG94] it is also proposed that the LQG/LTR idea can be combined
with the use of the simplified disturbance model which was described in the previous
section.

At the heart of the LQG/LTR approach is the recognition that both the (infinite
horizon) ‘LQ state-feedback’ scheme and the (steady-state) Kalman filter are them-
selves feedback systems. This is shown in Figures 8.3 and 8.4. Furthermore, each
of them usually exhibits excellent ‘feedback properties’. In continuous time, it is
known that each of the feedback loops identified by LLQ and LKF in these figures
has infinite gain margin against gain increases in individual input channels, a gain
margin of at least 2 against gain decreases in individual input channels, and at least
60◦ phase margin against unmodelled phase lags in individual input channels, etc
[Kal64, SA77]. In discrete time, these properties are not achieved exactly, and can-
not be guaranteed. Nevertheless, providing that reasonable demands are made of
these feedback systems — usually, that the loop gains have fallen to small values
well before the Nyquist frequency π/Ts is approached — then they usually exhibit
comparable properties.
8.3. The LQG/LTR Tuning Procedure 251

u(k) + ξ̂(k|k − 1) ŷ(k|k − 1)


B̃ DELAY C̃
+
+

à LKF


+
ÃL∞
y(k)

Figure 8.4: The Kalman filter as a feedback system

LLQ
y(k)
B̃ DELAY C̃ −K∞ PLANT
+ u(k)
++

à LKF
LLQG

+
ÃL∞
CONTROLLER

Figure 8.5: The closed loop with LQG controller

The fact that the complete closed-loop system containing the plant and an LQG
controller is made up of these two feedback systems, each of which has such good
feedback properties, was often held to imply that the complete system would have
good feedback properties. In other words, that the loop identified by LLQG in
Figure 8.5 would inherit these good properties. Rosenbrock [Ros71] pointed out
that this was not necessarily the case, and Doyle [Doy78] showed that LQG loops
could exhibit arbitrarily bad feedback behaviour — in particular, arbitrarily small
stability margins. These and similar observations motivated the development of ‘H∞
control theory’; but in the meantime the LTR tuning techniques was developed for
use with the LQG approach [DS81, Mac85, SA87].

LQG/LTR theory shows that, under certain circumstances, if the state feedback
gain K∞ is obtained by solving the LQ problem with Q = C T C and R → 0, then
LLQG → LKF . To be more precise, the return-ratio, the sensitivity function, and the
252 8. Robust Predictive Control

complementary sensitivity function, evaluated at the output of the plant, converge


to the corresponding functions for the loop LKF , evaluated at the output of the plant
model (assuming that the plant model is exact). The convergence is ‘pointwise-in-
frequency’, which means that the frequency responses get closer at each frequency as
R is reduced towards 0 — although convergence at some frequencies may be slower
than at others. So the Kalman filter feedback properties are ‘recovered’ at the plant
output by this procedure.

Here we will concentrate on how to use this procedure for tuning predictive con-
trollers, and not derive this convergence result. For the technical details the reader
is referred to [DS81] for the original development, in continuous time, and to [Mac85]
and [BGW90] for the development in discrete time (which is surprisingly different).
The latter reference discusses how to apply LQG/LTR to unconstrained predictive
control. Extensive discussions of the use of LQG/LTR in continuous time design are
available in [SA87, Mac89, SCS93]. But a few points about the details are in order:

1. The convergence theorem assumes that the linear plant model is square — has
equal numbers of inputs and outputs. The technique can still be used if there
are more outputs than inputs, by adding ‘dummy inputs’.

2. The convergence theorem assumes that the linear plant model is minimum-
phase — that is, that there are no zeros outside the unit disk, and that the
product CB is non-singular. If this does not hold, convergence is still usually
obtained in practice, at least for frequencies below those at which the effects of
the non-minimum-phase zeros become significant. This is not usually a signifi-
cant restriction, because such zeros in any case limit the achievable bandwidth
obtained using any feedback control. In particular, any non-minimum-phase
zeros introduced by discretisation (ie which do not arise from right half-plane
zeros in the continuous-time system) place no practical restriction on the tech-
nique.

3. In continuous time there is a complete duality between the Kalman filter and
the LQ state feedback controller. Consequently, one can follow a dual proce-
dure, namely tuning the LQ state-feedback loop, then recovering its properties
at the input of the plant by choosing the disturbance and noise covariances
according to a formula (W = BB T , V → 0). This allows, among other things,
the use of the LTR technique when there are more inputs than outputs. In dis-
crete time the duality is not so complete, and hence the corresponding theorem
does not hold. But again, in practice, enough recovery occurs in practice to be
useful, providing that the sampling frequency is high enough, relative to the
demanded bandwidth. (Basically, if the sampling frequency is high enough,
then all the continuous-time results hold approximately enough.)
8.3. The LQG/LTR Tuning Procedure 253

Instead of the model (8.14)–(8.15) which we used in the previous section, we will
now use the model:
x(k + 1) = Ax(k) + Bu(k) + Γx d(k) (8.35)
y(k) = Cx(k) + v(k) (8.36)
The disturbance d now acts on the state rather than the output. It can be generated
by the model
xw (k + 1) = Aw xw (k) + Γw w(k) (8.37)
d(k) = Cw xw (k) + Dw w(k) (8.38)
where now the dimensions of xw and d are not fixed, and Aw need not be diagonal.
Now (8.18)–(8.19) is replaced by
        
x(k + 1) A Γ x Cw x(k) B Γx Dw
= + u(k) + w(k)
(8.39)
xw (k + 1) 0 Aw xw (k) 0 Γw
 
x(k)
y(k) = [C 0] + v(k) (8.40)
xw (k)
One could take w(k) to be white noise and Dw = I, which would allow any desired
spectral density to be modelled for d(k) by (8.37)–(8.38). But since we usually want
to make the spectrum of d unbounded at frequency ω = 0, in order to obtain offset-
free tracking, it is more convenient to consider w(k) to be integrated white noise, as
we did in the previous section. That is, we assume ∆w(k) to be white noise. In this
case we get (by analogy with the development in section 2.4) the ‘differenced’ form
    
∆x(k + 1) A Γ x Cw 0 ∆x(k)
 ∆xw (k + 1)  =  0 Aw 0   ∆xw (k)  +
η(k + 1) CA CΓx Cw I η(k)
   
B Γx Dw
+  0  ∆u(k) +  Γw  ∆w(k) (8.41)
CB CΓx Dw
 
∆x(k)
y(k) = [0 0 I]  ∆xw (k)  + v(k) (8.42)
η(k)
In many cases the full complexity of this model is not needed. The return-ratio which
is recovered by the LTR procedure is that of the Kalman filter shown in Figure 8.4,
with the loop broken at the output of the plant model, namely C̃[zI − Ã]−1 ÃL0∞ .
Suppose that the disturbance d(k) is just taken to be integrated white noise. In that
case the state xw is not needed and we can take Dw = I (so that d(k) = w(k)), so
the model simplifies to
    
∆x(k + 1) A 0 ∆x(k)
= +
η(k + 1) CA I η(k)
   
B Γx
+ ∆u(k) + ∆w(k) (8.43)
CB CΓx
 
∆x(k)
y(k) = [0 I] + v(k) (8.44)
η(k)
254 8. Robust Predictive Control

Hence the Kalman filter return-ratio is


 −1  
−1 zI − A 0 L∆x
C̃[zI − Ã] ÃL∞ = [0 I] (8.45)
−CA (z − 1)I Lη
" # 
(zI − A)−1 0 L∆x
= [0 I] CA(zI−A)−1 I (8.46)
z−1 z−1

CA(zI − A)−1 L∆x + Lη
= (8.47)
z−1
This shows that the return-ratio has integral action (poles at +1), as expected
because of the ‘integrated white noise’ disturbance model,6 and that there are enough
degrees of freedom in the Kalman filter gains L∆x and Lη to adjust the gains of the
return-ratio (and hence of the closed-loop bandwidth). There is also some freedom
to adjust the ‘loop shape’, namely the behaviour of the return-ratio with frequency,
by adjusting the relative magnitudes of these filter gains. Of course, L∆x and Lη
cannot be adjusted directly, but by means of adjustments to the parameters of the
disturbance/noise model, namely Γx and the covariance matrices W and V . But
these parameters have some intuitive meaning, whereas L∆x and Lη do not. If the
outputs are ‘not too noisy’ then one can set V = 0, which gives Lη = I. This gives
‘deadbeat tracking’ of the measured outputs — see section 2.6.3 — and still leaves
considerable degrees of freedom to adjust the return-ratio. So this simplification still
leaves enough tuning freedom for many applications. Note that, in contrast to the
tuning procedure presented in the previous section, it is not limited to stable plants.

If more ‘shaping’ of the return-ratio with frequency is needed — for example to


boost the gain in a frequency region in which disturbance power is known to be
high — then the full model (8.41)–(8.42) must be used. A block diagram of the
disturbance/noise model used in this section is shown in Figure 8.6. This should be
compared with Figure 8.2.

Once the disturbance model has been adjusted so that the Kalman filter return-
ratio, and the associated sensitivity and complementary sensitivity functions, have
‘good’ frequency characteristics across the whole frequency range, then the ‘recovery
step’ is taken. In relation to the standard LQG system shown in Figure 8.5, this is
done by using the cost function
∞ n
X o
V (k) = ||ξ̂(k + l|k)||2C̃ T C̃ + ρ||∆û(k + l − 1|k)||2
l=1

X 
= ||η̂(k + l|k)||2 + ρ||∆û(k + l − 1|k)||2
l=1

X 
= ||ŷ(k + l|k)||2 + ρ||∆û(k + l − 1|k)||2 (8.48)
l=1
6
The number of integrators is given by the rank of the residue matrix of the return-ratio at
z = 1, namely by limz→1 (z − 1)C̃[zI − Ã]−1 ÃL0∞ = CA(I − A)−1 L∆x + Lη . Usually the rank of
this matrix is the same as the number of outputs, so that there is an integrator for each output.
8.3. The LQG/LTR Tuning Procedure 255

∆w(k)
z
z−1 I

w(k)

Cw (zI − Aw )−1 Γw + Dw

Disturbance d(k)
Measured
+ output
Input x(k)
+
B DELAY C
+ y(k)
u(k)
+ +
v(k)
A Noise

Figure 8.6: Disturbance and noise model used for LQG/LTR.

where the last equality follows because the mean value of future measurement noise
is always zero, so v̂(k + l|k) = 0. Recovery of the Kalman filter characteristics is
then obtained at the plant output as ρ → 0 (under the conditions specified earlier).
But this is in the standard form of a predictive control cost function, with infinite
horizons and fixed weights (except for the scalar parameter ρ). So all the tuning has
been transferred to the design of the disturbance model, and a fixed, but sensible,
control cost function remains.

How far should one reduce ρ? It is possible to set ρ = 0 (in fact, for discrete-time
LQG/LTR the main convergence theorem relates to this extreme case), but it is usu-
ally not a good idea. The continuous-time Kalman filter (and LQ state-feedback)
has excellent feedback properties only because it behaves like a set of first-order
lags at high frequencies. In the single-outptut case, the phase lag never exceeds
90◦ . This has an associated penalty, which is that the loop gain decreases rela-
tively slowly at high frequencies — slope −1 on log-log scales, or −20 decibels per
decade of frequency. Since all real plants exhibit larger high-frequency phase lags,
and steeper attenuation of gain with frequency, it would only be possible to recover
these characteristics perfectly by making the controller have ‘high-pass’ character-
istics at high frequencies — that is to have increasing gain at high frequencies. But
this is always very undesirable, because there is usually no useful frequency content
at high frequencies, and the result would only be to amplify measurement noise,
with consequent rapid actuator movements and increased risk of hitting actuator
constraints. Now as ρ is reduced the usual effect is for the transfer functions eval-
256 8. Robust Predictive Control

uated at the plant output to converge to the Kalman filter transfer functions over
an increasing range of frequencies. The convergence is usually most rapid at low
frequencies. Therefore one should monitor the return-ratio, and the sensitivity S(z)
and complementary sensitivity T (z) as ρ is reduced, and stop reducing ρ once the
feedback properties have become adequately good over a wide enough range of fre-
quencies. ‘Wide enough’ means to at least the desired closed-loop bandwidth, and a
little way beyond. This whole procedure is based on ‘continuous-time thinking’, so
it cannot be expected to work if the sampling interval Ts is too long, relative to the
desired closed-loop bandwidth. The Nyquist frequency π/Ts should be (at least) a
factor of 10, say, larger than the required bandwidth.

In [RM00] it is shown how MPC can be tuned to replicate the behaviour of an


H∞ design, rather than that of an LQG design, when the predictive controller is
operating in its linear mode — that is, when all constraints are inactive. This is
done while retaining a quadratic cost function.

8.4 LMI Approach

8.4.1 Overview

In [KBM96] a proposal is made to address the issues of maintaining stability as well


as respecting constraints despite the uncertainty in the model description. That is,
robust stability and robust constraint satisfaction are addressed. This work exploits
the very powerful methods which have recently become available for solving Linear
Matrix Inequalities (or LMI’s), and the connections which exist between LMI’s and
control theory [BGFB94]. The approach can be applied to both norm-bounded
structured uncertainty descriptions, and to polytope descriptions.

Although the formulation no longer leads to a QP problem, it does lead to an


LMI optimization problem which is a convex problem. The algorithms available
for solving LMI optimization problems appear to be very fast, so that the whole
proposal seems to be a plausible candidate for on-line use.

The formulation of [KBM96] looks rather different from the one that we have been
considering. The cost function and the constraints are similar to the ones we have
used, the difference being that ||u|| is penalised rather than ||∆u|| — but this differ-
ence can be overcome by reformulating the problem as in Section 6.3. (If this is not
done then properties such as integral action will not be obtained.) The bigger dif-
ference is that the optimization is performed over state feedback matrices Kk , such
that û(k + i|k) = −Kk x(k) for all i > 0. (This is similar to the approach taken
in [SR96b].) At each step it is assumed that the same state feedback matrix will
be used over an infinite prediction horizon, and this guarantees that this matrix is
stabilising. But in addition to stabilising the nominal plant, it is guaranteed that
any plant in the uncertainty set will be stabilised. This is achieved by obtaining Kk
8.4. LMI Approach 257

as a solution to an LMI problem.

Satisfaction of constraints is also guaranteed by solving an LMI problem. If it is


assumed that the current state satisfies x(k)T Xx(k) < 1 for some X > 0, the
problem of finding a Kk which ensures that x(k + i)T Xx(k + i) < 1 for all i > 0 can
be posed as an LMI problem. This LMI problem can be combined with the previous
one, which gives robust stability, resulting in a bigger LMI problem.7

Further LMI problems can be posed to handle input constraints, and certain aspects
of performance requirements (such as speed of response). These can all be combined
with the previous LMI’s.

An important property of the proposed approach is that if feasibility is obtained at


time k, then it is maintained over the whole infinite prediction horizon.

There are potential problems with this formulation. Firstly, it is not clear whether it
all extends to the case when an observer is used to estimate the state. Secondly, the
LMI optimization problems always minimise an upper bound for the quantity which
is really of interest. It is possible that such upper bounds are very conservative in
some cases, which could seriously reduce the practicality of the approach. However,
in [KBM96]it is claimed that typically the bounds are not too conservative. And
thirdly, although algorithms for solving LMI problems are fast, the problem size
becomes very substantial for real applications, so the use of this approach in real
time will be restricted to applications with relatively slow dynamics.

8.4.2 Robustness without constraints

It is assumed that the system is modelled by a time-varying linear model:

x(k + 1) = A(k)x(k) + B(k)u(k) (8.49)


z(k) = Cz (k)x(k) (8.50)

in which the notation A(k), etc, means that the matrices in this model can change
at each step, but it is not meant to imply that their variation is known ahead of
time (as a function of k). Because their precise variation is not known, the model
behaviour is uncertain. The ‘amount’ of uncertainty is prescribed by the assumption
that

[A(k), B(k)] ∈ Ω (8.51)

where Ω is a convex polytope derived from either a ‘norm-bounded’ uncertainty


description or from a ‘polytope’ uncertainty description.
7
A basic property of LMI’s is that a set of LMI’s can be expressed as a single LMI — see
Minitutorial 8.4.2.
258 8. Robust Predictive Control

The cost function is defined to be



X
V∞ (k) = {||x̂(k + j|k)||2Q1 + ||û(k + j|k)||2R } (8.52)
j=0

Robustness against the effects of uncertainty is obtained by choosing the input to


solve the following ‘min-max’ problem:

min max V∞ (k) (8.53)


U (k) [A(k+j),B(k+j)]∈Ω

where U (k) = [û(k|k)T , . . . , û(k + Hu − 1|k)T ]T , and the maximization is over all
j ≥ 0.

Now suppose that a function V (x) = xT P x exists, with P > 0, such that for any
pair x̂(k + j|k), û(k + j|k) corresponding to the uncertain model (8.49),

V (x̂(k + j + 1|k)) − V (x̂(k + j|k)) ≤ −||x̂(k + j|k)||2Q1 − ||û(k + j|k)||2R (8.54)

for each j ≥ 0. Then such a function is an upper bound for the cost V∞ (k). This
can be shown as follows. Assume that V∞ (k) < ∞, then x̂(∞|k) = 0, and hence
V (x̂(∞|k)) = 0. Now sum both sides of (8.54) from j = 0 to j = ∞, which gives

−V (x(k|k)) ≤ −V∞ (k) (8.55)

Since (8.54) was assumed to hold for any model in the assumed uncertainty set, we
have that

max V∞ (k) ≤ V (x(k|k)) (8.56)


[A(k+j),B(k+j)]∈Ω

Consequently we can replace the nasty problem (8.53) by the nicer problem:

min V (x(k|k)) (8.57)


U (k)

subject to the constraints that (8.54) holds and P > 0. Some conservativeness
enters the problem formulation here, because V (x(k|k)) is only an upper bound for
the cost that we really want to minimise. But it is stated in [KBM96] that this is not
a source of much conservativeness in practice. The reason that (8.57) is a relatively
nice optimization problem is that it is convex, whereas (8.53) is not. Problem (8.57)
can be solved with the aid of LMI’s.

Solving problem (8.57) is equivalent to solving the problem

min γ subject to x(k|k)T P x(k|k) ≤ γ (8.66)


γ,P

where we understand that the solution P depends on U(k) in some way, which
will become clear shortly. But P > 0, so we can define Q = γP −1 > 0, which
makes the inequality constraint equivalent to 1 − x(k|k)T Q−1 x(k|k) ≥ 0. From the
8.4. LMI Approach 259

A Linear Matrix Inequality, or LMI, is a matrix inequality of the form


F (v) = F0 + vi Fi ≥ 0 (8.58)
i=1

where each Fi is a symmetric matrix, and the scalar variables vi appear in the
inequality affinely. It is clear that a set of LMIs, F1 (v) ≥ 0, . . . , Fm (v) ≥ 0 is the
same as one large LMI, obtained by assembling all the matrices Fi (v) into one large
block-diagonal matrix.
The importance of LMIs is due to the fact that optimization problems of the kind

min cT v subject to F (v) ≥ 0 (8.59)


v

where F (v) ≥ 0 is an LMI, are convex problems, that very many convex problems
can be written in this form [BGFB94], and that there are very efficient algorithms
for solving problems of this kind [Mat].
One of the major reasons why LMIs can be used to represent such a wide range of
problems is that convex quadratic inequalities are equivalent to LMIs. In particular,
if Q(v) = Q(v)T and R(v) = R(v)T , and Q(v), R(v) and S(v) are all affine in v,
then the pair of inequalities

Q(v) > 0 (8.60)


−1
R(v) − S(v) Q(v)T
S(v) ≥ 0 (8.61)

is equivalent to the LMI


 
Q(v) S(v)
≥0 (8.62)
S(v)T R(v)

Example: Consider the convex QP problem (Q ≥ 0):

min xT Qx + q T x + r subject to Ax ≥ b (8.63)


x

This is equivalent to

γ − xT Qx − q T x − r ≥ 0
min γ subject to (8.64)
γ,x Ax ≥ b

which is equivalent to

min γ subject to
γ,x
 
  (Ax − b)1 · · · 0
I Q1/2 x  .. .. .. 
≥ 0 and  . . .  ≥ 0 (8.65)
xT Q1/2 γ − r − qT x
0 ··· (Ax − b)m

where (Ax − b)i denotes the i’th element of Ax − b, which is in the form of (8.59)
— see Problem 5.
Mini-Tutorial 10: Linear Matrix Inequalities
260 8. Robust Predictive Control

equivalence between the pair of conditions (8.60) and (8.61), and (8.62), we see that
this constraint is equivalent to the LMI
 
Q x(k|k)
≥0 (8.67)
x(k|k)T 1

Now we assume that the control signal will be determined by the state feedback law
û(k + j|k) = Kk x̂(k + j|k), for some matrix Kk , and we substitute for û(k + j|k) in
inequality (8.54). This gives the inequality

x̂(k + j|k)T {A(k + j) + B(k + j)Kk }T P {A(k + j) + B(k + j)Kk }−

−P + KkT RKk + Q1 x̂(k + j|k) ≤ 0 (8.68)

which will be true for all j ≥ 0 if

{A(k + j) + B(k + j)Kk }T P {A(k + j) + B(k + j)Kk } − P + KkT RKk + Q1 ≤ 0


(8.69)

This inequality turns out to be another LMI. It can be pre- and post-multiplied by
Q, since Q > 0, and then the substitution P = γQ−1 made. Defining Y = Kk Q
then gives the inequality

Q − {A(k + j)Q + B(k + j)Y }T Q−1 {A(k + j)Q + B(k + j)Y } −


1 1
− QQ1 Q − Y T RY ≥ 0 (8.70)
γ γ

which, using (8.61), is the same as the LMI (with variables γ, Q, Y ):


 
Q 0 0 A(k + j)Q + B(k + j)Y
 1/2 
 0 γI 0 Q1 Q 
 ≥0
 0 0 γI R1/2 Y 
T /2
QA(k + j) + Y T B(k + j)T
T QQ1 Y T RT /2 Q
(8.71)

Now suppose that [A(k + j), B(k + j)] belongs to the convex polytope Ω = [A, B]
defined by (8.11). Since the LMI (8.71) is affine in A(k + j) and B(k + j), it is
satisfied for every [A(k + j), B(k + j)] ∈ Ω if and only if it is satisfied at its ‘corners’,
namely for every pair (Ai , Bi ). So we need the following set of LMIs to be satisfied:
 
Q 0 0 Ai Q + Bi Y
 1/2 
 0 γI 0 Q1 Q 
  ≥ 0 for every i = 1, . . . , L
 0 0 γI R1/2 Y 
T T T T /2 T T /2
QAi + Y Bi QQ1 Y R Q
(8.72)
8.4. LMI Approach 261

So finally we see that we obtain a robust solution to the predictive control problem
without constraints by solving the convex problem:
min γ subject to (8.67) and (8.72) (8.73)
γ,Q,Y

and, if it has a solution, setting Kk = Y Q−1 and û(k + j|k) = Kk x̂(k + j|k). As
remarked earlier, this solution assumes that the state vector is measured, because
x(k|k) = x(k) appears as data in (8.67).

Note that the state-feedback matrix Kk may change with k, since it depends on
x(k), even though we have so far considered the unconstrained problem. This is a
distinct difference from the ‘standard’ formulation, in which the model uncertainty
is not considered. In that case, of course, we get a time-invariant feedback law.

If the uncertainty description arises from using a norm-bounded ∆ model, then


a robust feedback law can be found by solving a slightly different LMI problem
[KBM96].

8.4.3 Robustness with constraints

Input and output constraints can be included in the robust predictive control for-
mulation, by adding further LMIs. Thus the nature of the solution algorithm does
not change, although the complexity of the problem increases, of course. In this
section we again assume that [A(k + j), B(k + j)] belongs to the convex polytope
Ω = [A, B] defined by (8.11). Similar results for a norm-bounded uncertainty model
are available in [KBM96].

If problem (8.73) is solved and the corresponding control law is assumed to be


applied, then (8.54) holds, and hence, if ||x̂(k + j|k)||P ≤ ρ then ||x̂(k + j + 1|k)||P ≤
ρ. Hence if the current state x(k|k) satisfies ||x(k|k)||P ≤ ρ then the ‘currently
predicted’ state x̂(k + j|k) satisfies ||x̂(k + j|k)||P ≤ ρ. So the ellipsoid Eρ = {z :
||z||P ≤ ρ}, where ρ = ||x(k|k)||P , is an invariant set for the predicted state. Note
that this holds for all predicted states which might arise from the uncertain plant
model.

Now suppose that we have symmetric constraints on the levels of the input signals:
|ûi (k + j|k)| ≤ ui (8.74)
We can get a (probably conservative) sufficient condition for this as follows:
 2
max |ûi (k + j|k)|2 = max Y Q−1 x̂(k + j|k) i (8.75)
j j
 2
≤ max Y Q−1 v i
(8.76)
v∈Eρ
  2
≤ ρ2 Y Q−1/2 (8.77)
i 2
−1 T

= ρ2 Y Q Y ii (8.78)
262 8. Robust Predictive Control


where Y Q−1/2 i denotes the i’th row of Y Q−1/2 , and (8.77) is a consequence of the
Cauchy-Schwarz inequality.8 Now, using the fact that A ≥ B ⇒ Aii ≥ Bii , we can
be sure that this is satisfied if there exists X = X T , such that
 
X ρY
≥ 0 with Xii ≤ u2i , i = 1, . . . , m. (8.79)
ρY T Q

This condition is an LMI in the variables X, Y and Q.

Suppose that we have symmetric output constraints:

|ẑi (k + j|k)| ≤ zi (8.80)

Again we can get a (probably conservative) condition for this:

|ẑi (k + j|k)| ≤ max |Ci x̂(k + j|k)| (8.81)


j≥0

where we use Ci here to denote the i’th row of Cz . Hence

|ẑi (k + j|k)| ≤ max |Ci [A(k + j) + B(k + j)Kk ]v| (8.82)


v∈Eρ
q
= ρ ||Ci [A(k + j) + B(k + j)Kk ]Q1/2 ||22 (8.83)

So the constraint |ẑi (k + j|k)| ≤ zi will be satisfied if x̂(k|k) ∈ Eρ and


q
ρ ||Ci [A(k + j) + B(k + j)Kk ]Q1/2 ||22 ≤ zi . (8.84)

But this is equivalent to


 
Q ρ[A(k + j)Q + B(k + j)Y ]T CiT
≥ 0 for each j.
ρCi [A(k + j)Q + B(k + j)Y ] zi2
(8.85)

Since this is affine in A(k + j) and B(k + j), this inequality will be satisfied for every
[A(k + j), B(k + j)] ∈ Ω if
 
Q ρ[Aj Q + Bj Y ]T CiT
≥ 0 for j = 1, . . . , L. (8.86)
ρCi [Aj Q + Bj Y ] zi2

Again, this is a set of LMIs.

Of course simultaneous satisfaction of all the input and output constraints is ensured
by simultaneous satisfaction of the LMIs (8.79) and (8.86).

In [KBM96] it is also shown that ‘energy’ constraints on ||û(k + j|k)||2 and ||ẑ(k +
j|k)||2 can be satisfied by the satisfaction of similar LMIs.

The feedback control law obtained by minimising γ over the variables γ, Q, X, Y


while satisfying the LMIs (8.67), (8.72), (8.79) and (8.86) is stable (over all plants
8
For real vectors, |aT b| ≤ ||a||2 ||b||2 .
8.5. Robust feasibility 263

in the specified uncertainty set Ω), providing that it is feasible. The argument is
essentially the same as that used in section 6.2.1. Let V (x(k|k)) = x(k|k)T Pk x(k|k),
where Pk = γk Q−1 k and γk , Qk are the values of γ and Q obtained by solving the
LMI problem at time k. If we assume, as usual in stability proofs, that no new
disturbances occur after time k, then

max x(k + 1|k + 1)T Pk x(k + 1|k + 1) = max x̂(k + 1|k)T Pk x̂(k + 1|k).
[A,B]∈Ω [A,B]∈Ω

But x̂(k + 1|k) ∈ EV (x(k|k)) , so

max x(k + 1|k + 1)T Pk x(k + 1|k + 1) ≤ V (x(k|k)).


[A,B]∈Ω

Furthermore, the solution obtained at time k remains feasible at time k + 1 — see


Problem 8. Therefore the solution obtained at time k + 1 will be at least as good as
that obtained at time k, and hence

V (x(k + 1|k + 1)) = x(k + 1|k + 1)T Pk+1 x(k + 1|k + 1) ≤


x(k + 1|k + 1)T Pk x(k + 1|k + 1) ≤ V (x(k|k)). (8.87)

Thus the function V (x(k|k)) is a Lyapunov function for the uncertain system, and
hence the closed loop is robustly stable.

8.5 Robust feasibility

The use of soft constraints greatly ameliorates the problem of unexpectedly running
into infeasibility, but the problem of avoiding constraint violations remains a very
important one. If a system is frequently violating the specified constraints then it is
clearly not working as intended, even though constraint softening may be keeping the
control algorithm running. Contraints cannot always be softened. Input constraints,
for instance, usually cannot be softened. Also, recall that in section 6.2.3 there was a
constraint that the unstable modes of the plant should be brought to equilibrium by
the end of the control horizon; this constraint cannot be softened if that particular
predictive control algorithm is used in order to guarantee stability. So the possibility
of softening constraints certainly does not remove the necessity of considering the
question of feasibility.

Although infeasibility can occur even if there is no uncertainty about the plant model
or about disturbances, it arises most commonly as a result of such uncertainty, or of
mismodelling — for example, a mismatch between the linearised internal model and a
nonlinear plant. Therefore the essential problem facing the user of predictive control
is that of robust feasibility: designing the predictive controller so that it maintains
feasibility despite uncertainty about the plant being controlled, and its environment.
It bears repeating that the question of robust feasibility is also closely connected with
the question of robust stability when constraints are present. The reason for this is
264 8. Robust Predictive Control

that most stability proofs for predictive control rely on the assumption that the
on-line optimization problem is solved correctly at each step, and this implicitly
assumes that the problem is feasible at each step. In fact, a variation of predictive
control in which the horizon is not fixed, but is one of the variables chosen by the
optimiser, was proposed by Michalska and Mayne [MM93]; the robust stability of
this scheme relies only on having a feasible solution at each step, rather than an
optimal solution [May96]. (Also see section 10.3 and [SMR99].)

8.5.1 Maximal output admissible sets

In section 8.4 one approach to ensuring robust feasibility was described. A major
problem with that approach is that the state is forced to remain within an invariant
set whose nature is chosen to fit with the mathematical framework being used,
rather than matching the real constraints. For example, in section 8.4.3 the state
was confined to the ellipsoid Eρ = {z : ||z||P ≤ ρ}, which could be a much smaller
set than that implied by the real constraints. This makes the LMI approach very
conservative; indeed, it may lead one to conclude wrongly that no robust solution
exists.

The key to reducing such conservativeness is to estimate the set within which the
state must be confined as accurately as possible. A very important contribution to
this was made by Gilbert and Tan [GT91], who introduced the notion of maximal
output admissible sets and showed how they could be computed. If an autonomous
(no input) time-invariant linear system x(k + 1) = F x(k), y(k) = Hx(k) has to
satisfy an output constraint y(k) ∈ Y for each k, then a set O is output admissible
if x(0) ∈ O implies that y(k) ∈ Y for all k > 0, which is equivalent to HF k x(0) ∈ Y
for all k > 0. The maximal output admissible set O∞ is the largest such set, namely
the set of all initial conditions x(0) for which HF k x(0) ∈ Y holds for all k > 0.
Note that the set Y is assumed to be constant, which is not always the case in
predictive control; the definitions could be generalised to allow for Y changing with
k. A set X is positively invariant if x(0) ∈ X implies that x(k) ∈ X for all k > 0.
In general, output admissible sets are not necessarily positively invariant, but the
maximal output admissible set is always positively invariant.

As in section 8.4, we shall assume that the objective is to drive the system to the
origin, so that 0 ∈ Y for consistency. In fact we shall assume for simplicity that 0
is in the interior of Y (rather than on the boundary), so that a steady-state at the
origin corresponds to all constraints being inactive. So far we have not mentioned
inputs; that is because the definitions are going to be applied to closed-loop systems,
in which the input depends on the state. For example, suppose that linear state
feedback u(k) = −Kx(x) is applied to the system x(k + 1) = Ax(k) + Bu(k),
z(k) = Cx(k), with constraints u(k) ∈ U and z(k) ∈ Z. Then we have

x(k + 1) = (A − BK)x(k) = F x(k) (8.88)


8.5. Robust feasibility 265

and the constraints −Kx(k) ∈ U , Cx(k) ∈ Z, which can be written as

 
−K
y(k) = Hx(k) = x(k) ∈ Y (8.89)
C

In predictive control the constraints are usually defined by linear inequalities, and
these include bounds on input and output amplitudes. This results in Y being
a convex polytope. In [GT91] it is shown that this results in O∞ being convex,
bounded (provided that (F, H) is an observable pair), and containing the origin in
its interior (provided that F is stable, possibly including simple eigenvalues on the
unit circle, such as those due to integrations). Furthermore, O∞ scales with Y : if
Y is scaled by a factor α, then O∞ is scaled by the same factor, without changing
shape.

The set Ot is defined as the set of initial conditions x(0) such that the output satisfies
the constraints for t steps, namely such that HF k x(0) ∈ Y for k = 1, 2, . . . , t.
Clearly Ot2 ⊂ Ot1 if t2 > t1 . Now it may happen that the sequence of sets Ot
(t = 1, 2, . . . ) stops getting smaller as t increases. That is, there may be a value
t∗ , such that Ot = Ot∗ for all t > t∗ . In that case it is clear that O∞ = Ot∗ , and
O∞ is said to be finitely determined. The maximal output admissible set O∞ can
be computed relatively easily if and only if it is finitely determined. An important
theorem states that O∞ is finitely determined if and only if Ot = Ot+1 for some t.
In [GT91] it is shown that if F is asymptotically stable and (F, H) is an observable
pair, and if Y is bounded with 0 in its interior, then O∞ is finitely determined. It is
also shown that if the stability assumption is relaxed to allow simple eigenvalues on
the unit circle then O∞ can be approximated arbitrarily closely, and an algorithm
for doing so is given.

If Y is a convex polytope, then the following is an algorithm for computing O∞ .


Suppose Y is defined by the linear inequalities P y ≤ p, with the matrix P having
s rows. Fix t > 0. For each i = 1, 2, . . . , s maximise Ji (x) = Pi HF t+1 x over x,
subject to Pj HF k x ≤ pj for j 6= i and k = 0, 1, . . . , t, where Pi denotes the i’th row
of P and pi denotes the i’th element of the vector p. Let Ji∗ denote the maximised
value of Ji (x). If Ji∗ ≤ pi for each i then stop. Otherwise increase t and repeat. If
O∞ is finitely determined then this algorithm will terminate for some value t = t∗ ,
and

O∞ = {x : P HF t x ≤ p, 0 ≤ t ≤ t∗ } (8.90)

The maximisations required in this algorithm are linear programming problems, so


they can be solved efficiently and without difficulty.9

9
If Y is not a polytope then a similar algorithm, with Y defined by more general inequalities,
works conceptually, but finding the global maximum of Ji (x) may not be possible, even if Y is
convex.
266 8. Robust Predictive Control

8.5.2 Robust admissible and invariant sets

In order to apply these ideas to predictive control, three further ideas have to be
introduced. Firstly, suppose that an unmeasured disturbance w acts on the system,
so that

x(k + 1) = F x(k) + w(k) (8.91)

If it is known that w(k) ∈ W , where W is some bounded set, then one can define
the robust maximal output admissible set as the set of all current states x(k), such
that Hx(k + j) ∈ Y for all j > 0 for all possible w(k + i), i = 0, 1, . . . , j − 1. This
is the same as the set of states x(k) such that

X
j
HF j x(k) + H F i−1 w(k + j − i) ∈ Y (8.92)
i=1

If Y and W are convex polytopes then this robust maximal output admissible set
can be computed using similar methods to those outlined above [DH99, GK95].

Secondly, in the predictive control context F is not fixed. If linear state feedback is
used then F = A − BK, and there is some freedom in choosing K. More generally,
the control sequence u(k + i) can be chosen, not necessarily according to a linear
law. For this reason, the notion of a maximal (A, B)-invariant admissible set was
introduced in [DH99]. This is the set of current states x(k), such that a sequence
of future inputs u(k + j) exists for which y(k + j) ∈ Y for all j > 0 (and for
all w(k + j) ∈ W , if there are disturbances). Given a current state x(k) and a
disturbance set W , one does not know, in general, whether x(k) is in this maximal
(A, B)-invariant set. Several authors [CM87, GN93, ZM95b] have suggested that in
such problems the future inputs u(k +j) should be determined by solving a min-max
problem, of the type

X
N
min max L(x(k + j), u(k + j − 1)) (8.93)
u(k+j)∈U w(k+j)∈W
j=1

subject to

Hx(k + j) ∈ Y

where L(., .) denotes some suitable cost function — usually quadratic, but various
proposals have been made. If this problem is solved successfully then one not only
discovers that x(k) is in the maximal (A, B)-invariant set, but one also discovers a
suitable future input trajectory which maintains y(k + j) ∈ Y .

This is essentially an ‘open-loop’ approach, in which the disturbance-attenuating


effects of future feedback action are not taken account of. It therefore tends to be
excessively conservative: the optimization may fail, even if x(k) is in the maximal
(A, B)-invariant set. For this reason, proposals for closed-loop min-max strategies
8.5. Robust feasibility 267

have been advanced by Lee and Yu [LY97] and Scokaert and Mayne [SM98]. Adopt-
ing the notation of [SM98], let the set of possible future disturbance trajectories
be
`
wk+j|k ∈ W, j>0 (8.94)

Then the optimization (8.93) is replaced by

X
N
min max L(x`k+j|k , u`k+j−1|k ) (8.95)
u`k+j|k ∈U `
j=1

subject to

Hx`k+j|k ∈ Y (8.96)
x`k+N |k ∈ X0 (8.97)
x`k+j|k
1
= x`k+j|k
2
⇒ u`k+j|k
1
= u`k+j|k
2
(8.98)

The main point here is that the optimization is performed over a whole set of pos-
sible input trajectories, rather than selecting a single trajectory. x`k+j|k and u`k+j|k
denote the state and input trajectories which correspond to the disturbance tra-
`
jectory wk+j|k , and (8.98) is a causality constraint which prevents the optimization
from ‘cheating’ by assuming knowledge of future disturbances — that is, the value
of the disturbance wk+j+i which occurs at time k + j + i, for i > 0, is not allowed
to influence the value of uk+j|k .

The mathematical notation here can disguise the radical difference between the
closed-loop, or feedback, optimization (8.95) and the open-loop optimization (8.93).
As in the LMI approach of [KBM96]described in section 8.4, the proposal here is to
optimise over feedback policies10 rather than over input trajectories. The difference
is perhaps best illustrated by an example, which is taken from [SM98].

Example 8.1 The plant equation is

x(k + 1) = x(k) + u(k) + w(k) (8.99)

where x, u and w are scalars. The disturbance w is bounded by |w(k)| ≤ 1, and


the state constraint |x(k)| ≤ 1.2 is imposed. Suppose that the prediction horizon is
Hp = 3. The prediction of the state x(k + 3) (assuming the state x(k) is known) is
given by

x̂(k + 3|k) = x(k) + û(k|k) + û(k + 1|k) + û(k + 2|k) +


ŵ(k|k) + ŵ(k + 1|k) + ŵ(k + 2|k) (8.100)
10
A feedback policy is a function from the state-space (or alternatively from the space of input-
output measurement histories) to input signals; that is, a rule which assigns input signals on the
basis of state values (or input-output histories).
268 8. Robust Predictive Control

Over the 3-step horizon there are 8 (= 23 ) possible realisations of the disturbance
sequence in which the disturbances take their extreme values ±1 at each step. Two
of these possible realisations are
1
wk|k 1
= wk+1|k 1
= wk+2|k = −1 (8.101)
and
8 8 8
wk|k = wk+1|k = wk+2|k = +1 (8.102)
The corresponding state predictions are
x̂1k+3|k = x(k) + û(k|k) + û(k + 1|k) + û(k + 2|k) − 3 (8.103)
and
x̂8k+3|k = x(k) + û(k|k) + û(k + 1|k) + û(k + 2|k) + 3 (8.104)
Now to perform the open-loop optimization (8.93) one has to find a single sequence
of input signals, û(k|k), û(k + 1|k), û(k + 2|k) which will satisfy the state constraints
|x̂1k+3|k | ≤ 1.2 and |x̂8k+3|k | ≤ 1.2. Clearly this is impossible, since x̂8k+3|k − x̂1k+3|k >
2 × 1.2. So in this case the optimization would fail, since the problem is infeasible.

For the closed-loop optimization (8.95), however, one can look for a different se-
quence of input signals for each different realisation of the disturbance sequence.
The space W of possible disturbance sequences,
W = {wk+i|k
`
: i = 0, 1, 2, |wk+i|k
`
| ≤ 1} (8.105)
is a convex polyhedron with 8 vertices:
1
(wk|k 1
, wk+1|k 1
, wk+2|k ) = (−1, −1, −1) (8.106)
2
(wk|k 2
, wk+1|k 2
, wk+2|k ) = (+1, −1, −1) (8.107)
3
(wk|k 3
, wk+1|k 3
, wk+2|k ) = (−1, +1, −1) (8.108)
4
(wk|k 4
, wk+1|k 4
, wk+2|k ) = (+1, +1, −1) (8.109)
5 5 5
(wk|k , wk+1|k , wk+2|k ) = (−1, −1, +1) (8.110)
6
(wk|k 6
, wk+1|k 6
, wk+2|k ) = (+1, −1, +1) (8.111)
7 7 7
(wk|k , wk+1|k , wk+2|k ) = (−1, +1, +1) (8.112)
8 8 8
(wk|k , wk+1|k , wk+2|k ) = (+1, +1, +1) (8.113)
Since the plant model is linear, these 8 disturbance sequences are the worst cases, as
regards feasibility. If the control problem is feasible for each of these sequences, it
will be feasible for any other disturbance sequence in W . Now consider the following
4 input sequences:
(u1k|k , u1k+1|k , u1k+2|k ) = (−x(k), 1, 1) (8.114)
(u2k|k , u2k+1|k , u2k+2|k ) = (−x(k), −1, +1) (8.115)
(u3k|k , u3k+1|k , u3k+2|k ) = (−x(k), 1, −1) (8.116)
(u4k|k , u4k+1|k , u4k+2|k ) = (−x(k), −1, −1) (8.117)
8.5. Robust feasibility 269

5
Since wk+i|k 1
= wk+i|k for i = 0, 1, and the causality constraint (8.98) holds, we get
xk+i|k = xk+i|k for i = 1, 2. This leads to u5k+i|k = u1k+i|k , and similarly we get
5 1

u6k+i|k = u2k+i|k , u7k+i|k = u3k+i|k , and u8k+i|k = u4k+i|k for i = 0, 1, 2. This gives the
state predictions:

x`k+i+1|k = wk+i|k
`
= ±1 ` = 1, 2, . . . , 8, i = 0, 1, 2 (8.118)

Thus all the predicted states satisfy the constraint |x(k)| ≤ 1.2, so the problem
is feasible even if worst-case disturbances occur, providing that the search is over
feedback policies.

In [SM98] a dual-mode control law is assumed, of the type introduced in [MM93];


a linear state-feedback gain −K is used if the state is in a ‘terminal constraint set’
X0 , and the terminal constraint (8.97) insists that the state should be driven into
this terminal set in N steps. (Driving the state to a single point such as the origin is
not an achievable objective when persistent disturbances are present.) The set X0
must be such that once a state is in X0 , the linear feedback law can keep it in X0 ,
despite the disturbances. That is, the set inclusion

F X0 + W = (A − BK)X0 + W ⊂ W (8.119)

must hold, and for any state in X0 all the constraints must be satisfied. Such a
set is called robust control invariant. If all the eigenvalues of A − BK are at the
origin, so that F s = (A − BK)s = 0 for some s, then a suitable candidate for X0
is the set W + F W + . . . + F s−1 W . Although the optimization must be performed
over infinitely many possible disturbance trajectories, it is pointed out in [SM98]
that if W is convex then with a linear model the search is over a convex polytope,
and it is sufficient to search over the (finitely-many) vertices of this polytope. On
each vertex a convex optimization is required, the exact nature of which depends on
the cost function L(.) in (8.95) — usually one would envisage an LP or QP being
needed here. Nevertheless, the number of vertices increases exponentially with the
horizon length, so closed-loop min-max is computationally a relatively demanding
procedure.

Example 8.2 In Example 8.1 we established feasibility, but the particular input
signals considered there were not necessarily optimal. If the cost function L(., .) is
convex then the optimal solution to the min-max problem (8.95) will occur for one
of the 8 worst-case disturbance sequences considered in that example, so 8 convex
optimizations need to be performed to find the optimal solution.

In [Bem98] an alternative, compromise, proposal is made, namely that the optimiza-


tion (8.93) should be performed, but that a fixed stabilising state-feedback gain K
should be assumed. This allows relatively simple determination of whether x(k) is
in the maximal (A, B)-invariant set, but it retains some of the conservativeness of
the open-loop approach, so there is a risk of falsely concluding that it is not. If it
270 8. Robust Predictive Control

is found that x(k) is in the maximal (A, B)-invariant set then determination of a
future input trajectory can proceed by optimising deviations from the control law
u(k+j) = −Kx(k+j). This is in effect identical to the use of ‘stabilised predictions’,
which we discussed in section 5.2. Roughly speaking, making A − BK ‘more stable’,
in particular placing its eigenvalues closer to 0, gives a better chance of concluding
that a feasible solution exists, if x(k) is in the maximal (A, B)-invariant set. (If all
the eigenvalues are at zero, so that (A − BK)s = 0 for some s, then the maximal
(A, B)-invariant set depends on only a finite portion (of length s) of the disturbance
trajectory.) An example in [Bem98] shows that, if one uses ‘open-loop’ predictions,
namely K = 0, F = A, then one may falsely conclude that no feasible trajectory
exists, because the uncertainty about the disturbance accumulates with time, and
can result in an empty output admissible set being indicated. This is most likely to
happen if A has eigenvalues close to the unit circle, namely slowly decaying dynam-
ics. A further proposal is made in [KRSar]. This uses stabilised predictions again,
but chooses K for (possibly robust) performance of the unconstrained system, then
chooses deviations from this fixed control law in order to maximise the volume of a
positively-invariant ellipsoid which is output admissible. The computations required
for this are based on LMI’s.

The third idea that is needed relates to horizon lengths. Infinite-horizon predictive
control formulations require the constraints to be enforced over a finite horizon only.
In general, the minimum length of that horizon, which ensures that the constraints
will not be active beyond the horizon, depends on the current state — recall section
6.2. Let t∗ be the smallest t, such that Ot = Ot+1 , and hence that O∞ = Ot . t∗
indicates the length of the horizon over which the constraints must be enforced,
beyond the end of the control horizon. That is, one should choose Hp − Hu > t∗ . (In
this case, F , and hence Ot∗ , depends on the linear law implemented by the predictive
controller when the constraints are inactive.)

The literature on the concepts discussed in this section is growing rapidly. Robust
feasibility is an active current research area. It addresses a most important problem
for predictive control, but it is probably fair to say that the solutions advanced to
date are still some way from implementation in real applications. Some possibilities
of what to do if one finds that infeasibility is unavoidable are discussed in section
10.2. Most of the concepts introduced in this section can be applied to nonlinear
systems and arbitrary (non-convex) sets [KM00a], but computation of the relevant
sets then becomes very difficult, in general.
8.6. Problems 271

8.6 Problems

1. Suppose an ‘output multiplicative’ uncertainty description of the plant is as-


sumed:

P (z) = [I + ∆]P0 (z) (8.120)

where ∆ is a stable operator, and the controller K(z) stabilises the nominal
plant P0 (z). Show that the feedback connection of the controller with the
actual plant P (z) can be represented as the feedback connection of the uncer-
tainty ∆ with the complementary sensitivity function T (z) = P0 (z)K(z)[I +
P0 (z)K(z)]−1 (see section 7.1). Hence infer that a sufficient condition for ro-
bust stability is

σ̄[T (ejωTs )]k∆k∞ < 1 (8.121)

2. Show that the observer poles obtained from using the simplified disturbance/noise
model of section 8.2 are the plant poles, together with the eigenvalues of the
matrices
 
αi −φi
(8.122)
αi 1 − ψi

for i = 1, 2, . . . , p.

3. Show that, if the plant model (8.41)–(8.42) is used, and cov{v(k)} = V = 0,


then Lη = I, where the Kalman filter gain is partitioned as
 
L∆x
L∞ =  L∆w 

4. Show that any inequality of the form F (v) ≥ 0, in which F (v) is symmetric
and affine in the vector v, is an LMI.

5. (a) Verify that the minimisation problem (8.65) corresponds to the QP prob-
lem (8.63).
(b) Verify that (8.65) is in the form of (8.59) — use Problem 4.

6. Show that the standard LP problem: minx cT x subject to Ax ≥ b is equivalent


to a problem in the form of (8.59).

7. Show that the inequality (8.84) is equivalent to the LMI (8.85).

8. Supply the missing step in the proof of robust stability in section 8.4.3: Note
that the only LMI which depends explicitly on the state measurement x(k|k)
is (8.67). Use the fact that x(k + 1|k + 1) is obtained by the state feedback law
272 8. Robust Predictive Control

Kk , and that EV (x(k|k)) is an invariant set for x(k + j|k + j) (in the absence of
disturbances), to show that
 
Qk x(k + 1|k + 1)
≥0 (8.123)
x(k + 1|k + 1)T 1

and hence that the solution obtained at time k remains feasible at time k + 1.

9. Prove that the maximal output admissible set is positively invariant (unless it
is empty).
Chapter 9

Two Case Studies

9.1 Shell Oil Fractionator

9.1.1 Process description

In this section we shall consider the well-known ‘Shell’ heavy oil fractionator (dis-
tillation column) problem, as defined in [PM87]. This is a linear model which does
not represent a real, existing process, but was devised to exhibit the most significant
control engineering features faced on real oil fractionators. It was intended to serve
as a standard problem on which various control solutions could be demonstrated (in
simulation). We shall simplify the problem definition of [PM87] slightly, and adopt
the problem definition assumed in [PG88].

The fractionator is shown in Figure 9.1. A gaseous feed enters at the bottom of the
fractionator. Three product streams are drawn off, at the top, side and bottom of
the fractionator (shown on the right-hand side in the figure). There are also three
circulating (reflux) loops at the top, middle (subsequently referred to as intermedi-
ate) and bottom of the fractionator, which are shown on the left-hand side of the
figure. Heat is carried into the fractionator by the feed, and these circulating reflux
loops are used to remove heat from the process, by means of heat exchangers. The
heat removed in this way is used to supply heat to other processes, such as other
fractionators. The amount of heat removed by each reflux loop is expressed as heat
duty; the larger the duty, the more heat is recirculated back into the fractionator,
and thus the smaller the amount of heat removed. The gains from heat duties to
temperatures are therefore positive. The heat removed in the top two reflux loops
is determined by the requirements of other processes, and these therefore act as
disturbance inputs to the fractionator. An important difference between them is
that the Intermediate Reflux Duty is considered to be measured, and is therefore
available for feedforward control, whereas the Upper Reflux Duty is an unmeasured
disturbance. The Bottoms Reflux Duty, by contrast, is a manipulated variable,

273
274 9. Two Case Studies

which can be used to control the process. The Bottoms Reflux is used to generate
steam for use on other units; so, although the Bottoms Reflux Duty can be used to
control the oil fractionator, keeping it as low as possible corresponds to generating
as much steam as possible, and is therefore economically advantageous. There are
two additional manipulated variables (that is, control inputs): the Top Draw and
the Side Draw, namely the flow rates of the products drawn off at the top and side
of the fractionator. Again, these are defined in such a way that a positive change
leads to an increase of all temperatures in the fractionator. Altotgether, then, there
are 5 inputs to the fractionator, of which three are manipulated variables (control
inputs) and two are disturbances.

Top
Temperature T
Top
Draw
Upper
Reflux Duty
A Top End Point
Composition
T
Upper
Reflux Temperature

Intermediate
Reflux Duty Side
T Draw
T
Intermediate
Reflux Temperature A Side End Point
Composition
Bottoms
Reflux Duty Side Draw
Temperature
Bottoms
Reflux Temperature T

Feed

Figure 9.1: The ‘Shell’ heavy oil fractionator.

There are 7 measured outputs from the fractionator. The first two outputs are the
compositions of the Top End Point product and of the Side End Point product.
These are measured by analysers, and the composition is represented by a scalar
variable in each case. The remaining 5 outputs are all temperatures: the Top Tem-
perature, the Upper Reflux Temperature, the Side Draw Temperature, the Inter-
mediate Reflux Temperature, and the Bottoms Reflux Temperature. Only three of
these outputs are to be controlled: the Top End Point and Side End Point composi-
tions, and the Bottoms Reflux temperature. The remaining 4 output measurements
are available for use by the controller. (In the original problem definition of [PM87]
the possibility is raised that the two analysers may be unreliable, in which case
9.1. Shell Oil Fractionator 275

these additional output measurements play an important role in allowing control to


continue without having the analyser measurements available.)

The transfer function from each input to output is modelled as a first-order lag
with time delay. We shall order the inputs and outputs as shown in Table 9.1.
The transfer functions from the control inputs (manipulated variables) to all the
outputs are shown in Table 9.2. Note that all the time constants and time delays are
expressed in minutes. The transfer functions from the two disturbance inputs to the
outputs are shown in Table 9.3. These tables show the nominal transfer functions.
The gain in each transfer function is uncertain, the uncertainties associated with
each input being correlated with each other. Table 9.4 specifies the uncertainty in
each gain. The nominal model is obtained when δj = 0 for each j; but it is assumed
that each δj can vary in the range −1 ≤ δj ≤ 1.

Variable Role Symbol


Top Draw Control input u1
Side Draw Control input u2
Bottoms Reflux Duty Control input u3 , z4
Intermediate Reflux Duty Measured disturbance dm
Upper Reflux Duty Unmeasured disturbance du
Top End Point Controlled and measured output y1 , z1
Side End Point Controlled and measured output y2 , z2
Top Temperature Measured output y3
Upper Reflux Temperature Measured output y4
Side Draw Temperature Measured output y5
Intermediate Reflux Temperature Measured output y6
Bottoms Reflux Temperature Controlled and measured output y7 , z3

Table 9.1: Names, roles and symbols of input and output variables.

u1 u2 u3
y1 , z1 4.05e−27s 1
1.77e−28s 1
5.88e−27s 1
50s+1 60s+1 50s+1
y2 , z2 5.39e−18s 1
5.72e−14s 1
6.90e−15s 1
50s+1 60s+1 40s+1
y3 3.66e−2s 9s+1
1
1.65e−20s 30s+1
1
5.53e−2s 40s+1
1

y4 5.92e−11s 1
2.54e−12s 1
8.10e−2s 1
12s+1 27s+1 20s+1
y5 4.13e−5s 8s+1
1
2.38e−7s 19s+1
1
6.23e−2s 10s+1
1

y6 4.06e −8s 1
4.18e −4s 1
6.53e −1s 1
13s+1 33s+1 9s+1
y7 , z3 4.38e−20s 33s+1
1
4.42e−22s 44s+1
1 1
7.20 19s+1

Table 9.2: Transfer functions from control inputs to all outputs.

Figure 9.2 shows the nominal unit step response from each input — including the two
disturbance inputs, the columns being arranged in the order u1 , u2 , u3 , dm , du — to
each output of the fractionator. This confirms that the fractionator is asymptotically
stable, and that the settling times range from about 10 minutes (for element (5,4)
— from the Intermediate Reflux Duty to the Side Draw Temperature) to about 250
276 9. Two Case Studies

dm du
y1 , z1 1.20e−27s 1
1.44e−27s 1
45s+1 40s+1
y2 , z2 1.52e −15s 1
1.83e−15s 1
25s+1 20s+1
1 1
y3 1.16 11s+1 1.27 6s+1
1 1
y4 1.73 5s+1 1.79 19s+1
1 1
y5 1.31 2s+1 1.26 22s+1
1 1
y6 1.19 19s+1 1.17 24s+1
1 1
y7 , z3 1.14 27s+1 1.26 32s+1

Table 9.3: Transfer functions from disturbance inputs to all outputs.

u1 u2 u3 dm du
y1 , z1 4.05 + 2.11δ1 1.77 + 0.39δ2 5.88 + 0.59δ3 1.20 + 0.12δ4 1.44 + 0.16δ5
y2 , z2 5.39 + 3.29δ1 5.72 + 0.57δ2 6.90 + 0.89δ3 1.52 + 0.13δ4 1.83 + 0.13δ5
y3 3.66 + 2.29δ1 1.65 + 0.35δ2 5.53 + 0.67δ3 1.16 + 0.08δ4 1.27 + 0.08δ5
y4 5.92 + 2.34δ1 2.54 + 0.24δ2 8.10 + 0.32δ3 1.73 + 0.02δ4 1.79 + 0.04δ5
y5 4.13 + 1.71δ1 2.38 + 0.93δ2 6.23 + 0.30δ3 1.31 + 0.03δ4 1.26 + 0.02δ5
y6 4.06 + 2.39δ1 4.18 + 0.35δ2 6.53 + 0.72δ3 1.19 + 0.08δ4 1.17 + 0.01δ5
y7 , z3 4.38 + 3.11δ1 4.42 + 0.73δ2 7.20 + 1.33δ3 1.14 + 0.18δ4 1.26 + 0.18δ5

Table 9.4: Extent of gain uncertainty in each transfer function. |δj | ≤ 1 for each j.

minutes (for element (2,2) — from the Side Draw to the Side End Point). The
various time delays can also be seen clearly in the figure.

9.1.2 Control specifications

The focus of the control performance specifications is on rejecting disturbances,


while minimising the Bottoms Reflux Duty (u3 ) and satisfying constraints. There
are set-point specifications on the Top End Point and Side End Point compositions.
Since we have a linearised model, we may as well assume that the set-points are at
0. There is a requirement that at steady state these two outputs should be within
±0.005 of the set-point. The dynamic response requirement is more ambiguous,
being that ‘closed-loop speed of response should be between 0.8 and 1.25 of the
open-loop speed’. We shall assume that this refers to set-point response, rather
than disturbance response; that removes most of the ambiguity because the open-
loop response speed of the Top End Point and the Side End Point compositions to
each of the three control inputs is nearly the same, with similar time delays and
time constants. For disturbance rejection, the requirement is to return the Top and
Side End Point compositions to their set-points as quickly as possible, subject to
satisfying constraints. The trade-off between returning these compositions to their
set-points and minimising the Bottoms Reflux Duty, should these conflict, is not
specified. (It is very common to have significant parts of a specification missing; not
9.1. Shell Oil Fractionator 277

Step Response

10

0
10

0
10

0
Amplitude

10

0
10

0
10

0
10

0
0 120 2400 120 2400 120 2400 120 2400 120 240

Time (minutes)

Figure 9.2: Open-loop step responses of the ‘Shell’ heavy oil fractionator.

because it does not matter, but because it is too difficult to articulate in advance.)
In addition there are constraints on inputs and outputs as shown in Table 9.5. The
variables have been scaled so that they all have similar constraints, and the input
move constraints, which are 0.05 per minute for each input, have been expressed
as limits on |∆uj |, consistently with our earlier notation, in terms of the sampling
and control update interval Ts . Note that the Bottoms Reflux Temperature has
constraints but no set-point, so it has a ‘zone’ objective, as discussed in section 5.5.

Input move constraints: |∆uj | ≤ 0.05Ts for j = 1, 2, 3


Input range constraints: |uj | ≤ 0.5 for j = 1, 2, 3
Output constraints: |zj | ≤ 0.5 for j = 1, 2, 3

Table 9.5: Input and output constraints for the oil fractionator. (Ts is the control
update interval.)

The two disturbance inputs are known to take values in the range ±0.5, but they
are otherwise unspecified.
278 9. Two Case Studies

9.1.3 Initial controller design

One of the objectives is to minimise the Bottoms Reflux Duty, which is one of the
control inputs. The most straightforward way to do this is to make this input also
an output, and make its set-point equal to its lowest permitted value, which is −0.5.
Since we require the model to be strictly proper (no direct feed-through from input
to output — see section 2.1) we define a new controlled output z4 as

z4 (k) = u3 (k − 1) (9.1)

and its set-point will be s4 (k) = −0.5 for all k. This approach is not ideal, however,
because this set-point cannot be held in the steady state without violating the con-
straints, even when the model is exact and there are no disturbances. To see this,
consider the matrix of steady-state gains from the control inputs to the controlled
outputs:
   
z1 4.05 1.77 5.88  
 z2   5.39 5.72 6.90  u1
    
 z3  =  4.38 4.42 7.20  u2 (9.2)
u3
z4 0 0 1

In order to hold the vector [z1 , z2 , z4 ] at the set-point vector [0, 0, −0.5], the input
vector would have to be [u1 , u2 , u3 ] = [0.7860, −0.1375, −0.5], so the Top Draw (u1 )
would have to violate its upper constraint. Furthermore, this input vector would
give z3 = −0.7651, so the Bottoms Reflux Temperature would have to violate its
lower constraint. The unsatisfactory aspect of this formulation is that the distinction
between genuine set-points for z1 and z2 , and the constraint on z4 , has been lost.
Making the outcome reflect the real objectives may require tuning the weights in the
MPC formulation, and there is no guarantee that the same weights will be suitable
for various combinations of disturbances and model errors.

The real solution is to adopt one of the strategies discussed in section 10.1.2. But
here we will continue to use the simple approach, of defining a set-point for z4 (= u3 ).

One way of alleviating the difficulty is to find a set-point which does not lead to
constraint violations at steady-state. Assuming no disturbances and a perfect model,
obtaining z1 = z2 = 0 requires
 
    u1
0 4.05 1.77 5.88 
= u2  (9.3)
0 5.39 5.72 6.90
u3

This can be attained by any vector u in the null-space of the matrix in (9.3), which
is one-dimensional:
   
u1 1
 u2  = α  −0.175  (9.4)
u3 −0.6361
9.1. Shell Oil Fractionator 279

Choosing α = 0.5 gives u = [0.5, −0.0875, −0.3181]T , which satisfies the input con-
straints, and this in turn gives z3 = −0.4867, which satisifies (just!) the lower
constraint on the Bottoms Reflux Temperature. So −0.3181 may be a better set-
point for u3 than −0.5. However, there may be some combinations of disturbances,
and some departures of the real fractionator gains from the modelled ones, which
will allow a lower value of u3 to be held.

The next issue to consider is the sampling interval to be used, Ts . There are three
aspects to consider:

1. The impact on the closed-loop behaviour.

2. The impact on the computation time.

3. The impact on memory storage requirements.

The last of these is the least important, given modern memory capacities. Table
9.6 shows the storage requirements of z-transform transfer function models, of exact
state-space models, and of step response models for various sampling times.1 Later
we shall see that approximate state-space models of considerably smaller state di-
mension can in fact be used, and their storage requirements are considerably smaller
than those shown in the Table. The transfer function models are represented as LTI
objects in MATLAB’s Control System Toolbox, whereas the state-space models are
in the Model Predictive Control Toolbox’s MOD format, and the step response mod-
els are in the Model Predictive Control Toolbox’s STEP format. The step response
model is truncated after 250 minutes (and so gets smaller as the sampling time is
increased), and all variables are stored in double precision. It should be emphasised
that the table shows the amount of storage needed just to represent the model, not
the amount required by the controller algorithm. In each case the state-space model
has had redundant modes removed, using the Control System Toolbox’s minimal re-
alization function minreal. The dependence of the state dimension on the sampling
inerval is due to the fact that each delay requires a state variable to represent it,
and the number of delays is reduced by increasing the sampling interval. (The state
dimension includes the one additional state required because of definition (9.1).)

Since we have no information about measurement noise, and very little about the
disturbances, there is not much scope for being clever with observers and disturbance
models in this case. In addition the model is asymptotically stable, so all three model
representations — that is, step response, transfer function, or state-space — can be
used. In these circumstances, each of the three model representations could be used
equally well.

The impact of the sampling time on computational requirements is more significant.


Closed-loop settling times in response to set-point changes are required to be in the
1
All these models can be created using the function mkoilfr which is available from this book’s
web site.
280 9. Two Case Studies

Sampling State Transfer State-space Step


interval dimension function model response
Ts (minutes) n (LTI object) (MOD format) (STEP format)
1 363 17.7 1098.1 80.4
2 204 15.1 357.8 40.4
4 122 13.9 134.1 20.6
8 86 13.3 69.9 10.3

Table 9.6: Memory storage, in kilobytes, needed for various model representations
and various sampling times. (State-space models are exact.)

region of 120–250 minutes (the relevant open-loop time constants range from 40 to
60 minutes; closed-loop time constants are to be between 80% and 125% of these
values; take the settling time to be 3× time constant and add the time delay of
between 14 and 28 minutes). Recall from section 7.2.2 that ‘mean-level’ design gives
a closed-loop set-point response speed similar to the open-loop speed, and is achieved
by making the prediction horizon very large and the control horizon very small. We
will not go to the extreme of Hp = ∞ and Hu = 1, but, guided by that example, we
will try a relatively long prediction horizon. Since constraints are to be enforced at
all times, the option of choosing a small number of coincidence points is not available,
at least for constraint enforcement — it remains a possibility for penalising tracking
errors in the cost function. Choosing a small sampling interval will therefore lead to
a large prediction horizon, which will be computationally demanding. On the other
hand, the effect of the Intermediate Reflux Duty, which is a measured disturbance,
on the Bottoms Reflux Temperature, is relatively fast, with no time delay and a
time constant of 27 minutes. Therefore choosing a sampling interval as large as 10
minutes may not give enough opportunity for effective feedforward action. We shall
therefore try Ts = 4 minutes — the same value as chosen in [PG88].

If only the Top and Side End Point compositions and the Bottoms Reflux Temper-
ature have been retained as outputs, and the Bottoms Reflux Duty is brought out
as an additional output (with a one-step delay), then a minimal state-space real-
ization of a discrete-time model, with Ts = 4 minutes, has 80 states. Reducing the
number of states would speed up the controller computations, and reduce the risks
of hitting numerical problems. A lower-order approximation can be obtained in a
number of ways. One way is to simulate the pulse response, and use the algorithm
presented in section 4.1.4. Since a state-space model is already available, a related
but better way is to first obtain a balanced realization of the 80-state system, and
(from the same computation) its Hankel singular values. The balanced realization
has the property that its state variables are ordered according to the contribution
they make to the input-output behaviour, loosely speaking, and approximations can
therefore be obtained by truncating the state vector, and truncating the matrices
of the state-space model correspondingly. The Hankel singular values can be used
as a guide to how many state variables should be truncated. (State variables which
make no contribution to the input-output behaviour correspond to zero Hankel sin-
9.1. Shell Oil Fractionator 281

gular values.) This approach to obtaining low-order approximate systems is known


as balanced truncation, and is described in detail in [Mac89, ZDG96]. This method
was applied to the 80-state oil fractionator model.2

Figure 9.3 shows the Hankel singular values of the fractionator model, when only the
Top and Side End Point compositions and the Bottoms Reflux Temperature have
been retained as outputs, and the Bottoms Reflux Duty has been brought out as
an additional output (with a one-step delay). On the left these singular values are
shown on a linear scale, while on the right their logarithm (to base 10) is shown.
The logarithmic plot suggests that a ‘natural’ choice of order would be either 30 or
50, since that is where reductions of several orders of magnitude occur. But in fact
reducing to only 20 states gives step responses which are almost indistinguishable
from those of the full 80-state model. We shall use the 20-state approximate model
for all our investigations.3
10 2

9 0

−2
8

−4
7
Log10 of Hankel singular values

−6
Hankel singular values

6
−8
5
−10
4
−12

3
−14

2
−16

1 −18

0 −20
0 10 20 30 40 50 60 70 80 0 10 20 30 40 50 60 70 80

Figure 9.3: Hankel singular values of the ‘Shell’ heavy oil fractionator, with Ts = 4
minutes.

Table 9.7 shows the storage requirements for the full 80-state and the approximate
20-state models. These are seen to be much smaller than for the exact model of the
dynamics of all the measured outputs. In fact the 20-state model requires about
50% less memory than the step response model.

In order to predict beyond the expected settling time — up to 300 minutes, say
— the choice of sampling interval Ts = 4 minutes will require a prediction horizon
Hp = 75. Because of the significant time delays in many of the transfer functions
between control inputs and controlled outputs, it will be advisable not to enforce
2
Obtaining a balanced realization proved problematic. The Control System Toolbox function
balreal did not work, because of numerical finite-precision effects — the 80-state model is too
close to being uncontrollable. But the Robust Control Toolbox function dobal worked without
difficulty.
3
This model is available in the MATLAB-readable file oilfr20.mat on this book’s web site.
282 9. Two Case Studies

State Memory
dimension required
n (kbytes)
80 58.5
20 5.2

Table 9.7: Memory storage, in kilobytes, needed for the exact and approximate
state-space models for outputs z1 , z2 and z3 only, with Ts = 4 minutes.

constraints over the initial part of the prediction horizon, or to soften them, or both.
The largest time delay is 28 minutes, which corresponds to 7 steps into the prediction
horizon.

The choice of control horizon will have a large impact on the computational load on
the controller algorithm. Since there is a large spread of slow and fast dynamics in the
various transfer functions of the fractionator, the use of blocking, namely non-uniform
intervals between control decisions — see Problem 14 of Chapter 1 and Problem 4
of Chapter 3 — seems appropriate here, as that allows control adjustments to be
made throughout the predicted transient period without having too many decision
variables in the optimization problem. Guided by the responses shown in Figure 9.2,
we guess that it may be appropriate to keep û(k|k), û(k + 1|k), û(k + 3|k), û(k + 7|k)
and û(k + 15|k) as the decision variables, so that the blocking pattern is as follows,
each block being twice as long as the previous one:

û(k|k) (9.5)
û(k + 1|k) = û(k + 2|k) (9.6)
û(k + 3|k) = û(k + 4|k) = û(k + 5|k) = û(k + 6|k) (9.7)
û(k + 7|k) = û(k + i|k) for i = 8, 9, . . . , 14 (9.8)
û(k + 15|k) = û(k + i|k) for i = 16, 17, . . . (9.9)

In this way we have only 15 decision variables (3 control inputs × 5 decision times),
but control decisions are taken up to 60 minutes into the prediction horizon.

Next we must choose weights for the cost function. Since the Bottoms Reflux Tem-
perature (z3 ) has a zone objective only, the tracking error weight for it is 0. For the
Top End Point and Side End Point compositions we have very little information on
which to base our choice. We assume that the variables have already been scaled
such that equal errors on each of these are equally important, and hence give them
equal weight. We will also keep the weights constant over the prediction horizon,
except that we will not weight the Top End Point errors during the first 7 steps, or
the Side End Point errors during the first 4 steps, because of the long time delays in
the transfer functions involved. The Bottoms Reflux Duty (z4 ) tracking error will
also be given equal weight with the others, since there is no clear reason for any
other choice. This weight in particular may be adjusted in the light of experience,
in order to change the trade-off between tracking the Top End Point and Side End
9.1. Shell Oil Fractionator 283

Point compositions, and minimising the Bottoms Reflux Duty. Thus we have
 
0 0 0 0
 0 0 0 0 
Q(i) =  
 0 0 0 0  for i ≤ 4 (9.10)
0 0 0 1
 
0 0 0 0
 0 1 0 0 
Q(i) =  
 0 0 0 0  for 5 ≤ i ≤ 7 (9.11)
0 0 0 1
 
1 0 0 0
 0 1 0 0 
Q(i) =  
 0 0 0 0  for i ≥ 8 (9.12)
0 0 0 1

No penalties will be imposed on control moves initially; the specification does not
require input moves to be minimised. If the response is later found to be too erratic,
or too sensitive to model uncertainty, then this decision will be reviewed. Thus we
have R(i) = 03,3 for each i.

9.1.4 Controller performance and refinement

Figure 9.4 shows the response with these tuning parameters, when the set-points for
z1 and z2 are both 0, the set-point for u3 is initially −0.32, and is changed to −0.5
after 300 minutes. This response was obtained using the Model Predictive Control
Toolbox function scmpc; the 80-state model was taken as the plant, and the 20-state
approximation as the controller’s internal model. Both the plant and the internal
model had zero initial state vectors. In the initial transient z3 violates its lower
constraint for about 150 minutes by a small amount before settling at the constraint
value. z1 and z2 take about 200 minutes to settle to their set-points, and during this
time u1 gradually increases up to its constraint. After 300 minutes all the variables
have settled to the values expected from our earlier steady-state analysis. We note
that the settling time of about 200 minutes is in accordance with the specification. It
is also noteworthy that the control activity does not appear to be excessive, despite
the fact that control moves have not been penalised.

After 300 minutes the set-point for u3 is changed to −0.5, in order to encourage it
to become as close as possible to its lower constraint. u1 does not change at all,
since it is already on its upper constraint. u2 and u3 change very slightly, with
the result that z1 and z2 depart from their set-points, and settle at +0.025 and
−0.05, respectively, which is outside the steady-state specification. This indicates
that the current weighting of tracking errors, as defined by (9.10)–(9.12), gives too
much importance to the u3 set-point, relative to the z1 and z2 set-points, since we
want the latter two to be the primary objectives of control. We therefore increase
284 9. Two Case Studies

0.1

−0.1
Outputs

−0.2 z1
z2
−0.3
z3
−0.4

−0.5

−0.6
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.6

0.4 u1
u2
u3
0.2
Inputs

−0.2

−0.4
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.4: Response with initial tuning parameters.

the z1 and z2 weights (namely element (2, 2) in (9.11) and elements (1, 1) and (2, 2)
in (9.12)) from 1 to 10, leaving the weight on u3 unchanged at 1. This was found
to reduce the steady-state errors on z1 and z2 to +0.001 and −0.001, respectively,
which is within specification. But the inputs, especially u2 and u3 , were now seen
to be oscillating considerably during the transient, and z3 showed some oscillation
about its constraint before settling down. The penalty weighting R(i) = I3 was
therefore imposed on control moves. This removed the oscillations, but now caused
the steady-state error on z1 to increase to just outside the specified value of ±0.001.
The weight on z1 tracking errors was therefore increased from 10 to 20, which had
the desired effect. The corresponding response is shown in Figure 9.5.

Next we examine the effect of a disturbance on the Intermediate Reflux Duty (dm ),
which is a measured disturbance, and can therefore be countered by feedforward
action. Figure 9.6 shows the fractionator initially at the same steady-state as reached
at the end of the run shown in Figure 9.5. A disturbance occurs as follows — this
is expressed in steps, each step lasting 4 minutes:


 0 for k ≤ 12


 +0.5 for 12 < k ≤ 37
dm (k) = 0 for 37 < k ≤ 62 (9.13)


 −0.5 for 62 < k ≤ 87


0 for k > 87
9.1. Shell Oil Fractionator 285

0.2

0
z1
Outputs

z2
−0.2
z3

−0.4

−0.6
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.6

0.4
u1
u2
0.2
Inputs

u3

−0.2

−0.4
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.5: Response with increased weight on z1 and z2 tracking errors, and pe-
nalised control moves.

Recall that an increase in the Intermediate Reflux Duty corresponds to less heat
being taken away from the fractionator. Thus the initial disturbance of +0.5 allows
the Bottoms Reflux Duty (u3 ) to be reduced at first. This, however, leads to the
Bottoms Reflux Temperature (z3 ) falling below its constraint, so u3 increases again,
this being compensated by a reduction of u1 away from its constraint. u2 follows
a similar pattern to u3 . When the disturbance ceases, there is a transient lasting
about 100 minutes, by the end of which all the variables have returned to their initial
values. Then the disturbance dm = −0.5 arrives; u1 cannot increase now, since it is
already at its upper constraint, so u3 has to increase (from −0.32 to −0.22) for as
long as the disturbance lasts. Note that the Bottoms Reflux Temperature (z3 ) now
moves away from its lower constraint, since it is a ‘zone’ rather than a ‘set-point’
variable. Finally (for k > 87, namley after about 350 minutes) the disturbance
ceases again, and all the variables return to their initial values.

We now consider the response to a change of the Upper Reflux Duty, which is an
unmeasured disturbance, so that feedforward cannot be used to correct its effects.
We will apply the same pattern of disturbance as defined by (9.13). But we expect
the control to be less effective in this case, since only feedback action is available.
Figure 9.7 shows that this is indeed the case. The departures of z1 and z2 from
their set-points are much bigger now, and take longer to correct, and the controller
barely manages to keep the outputs within their constraints — in fact several minor
286 9. Two Case Studies

0.2

0
z1
Outputs

z2
−0.2 z3

−0.4

−0.6
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.6

0.4
u1
0.2 u2
Inputs

u3

−0.2

−0.4
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.6: Response to measured disturbance.

constraint violations occur.

9.1.5 Constraint softening

All the results shown so far were obtained with hard constraints enforced on outputs
as well as inputs. For more severe disturbances it is necessary to soften the output
constraints. For example, if measured and unmeasured disturbances occur together
with the following form:

 0 for k ≤ 12
dm (k) = du (k) = +0.5 for 12 < k ≤ 62 (9.14)

−0.5 for k > 62

then infeasibility occurs when both disturbances take the value −0.5. (Note that not
only do both disturbances occur together, but they both suddenly jump from +0.5
to −0.5, which is a much bigger change than in the simulations shown up to now.)
If, however, the constraints are softened using an exact ∞-norm penalty function,
with penalty coefficient ρ = 103 (see section 3.4), then the result is shown in Figure
9.8 — larger values of ρ give essentially the same results. When both disturbances
are positive, there is no particular difficulty. All output variables are kept within
constraints, and all inputs come off their constraints. When both disturbances
9.1. Shell Oil Fractionator 287

1
z1
z2
0.5 z3
Outputs

−0.5

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.5
Inputs

u1
−0.5 u2
u3

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.7: Response to unmeasured disturbance.

become negative (after about 250 minutes), however, it is not possible to hold any
of the three outputs within their constraints initially.

Very similar results are obtained if hard constraints are enforced, but not for the first
three steps in the prediction horizon. That is, if there are no constraints enforced
on ẑ(k + i|k) for i = 1, 2, 3. The results are shown in Figure 9.9. Although this is
an alternative way of recovering feasibility, it can be seen that there are more z3
constraint violations than seen in Figure 9.8, and the peak violations are slightly
larger. In particular, note the small but sustained z3 constraint violation from about
100 to about 250 minutes into the simulation, which is not present in Figure 9.8.

In both the cases shown in Figures 9.8 and 9.9 the steady-state values eventually
assumed by z1 and z2 are within the ±0.001 range permitted by the specification.
(This is not visible on the figures, as the variables do not reach their steady-state
values within the 500 minutes shown.) This is to be expected, because the steady-
state values are determined by the same trade-off as in Figure 9.5. The disturbances
cause the inputs to have different steady-state values now (u1 = 0.5, u2 = −0.0525,
u3 = −0.1042). The first two of these play no role in the cost function; the third does
play a role, but the weight on its tracking error (away from its set-point of −0.5)
is sufficiently small, compared with the weights on z1 and z2 , that the primary
objectives are met within specification. Note that the set-point for u3 prevents
offset-free tracking from being obtained, despite the low error weight associated
288 9. Two Case Studies

1
z1
z2
0.5
z3

0
Outputs

−0.5

−1

−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

1
u1
u2
0.5 u3
Inputs

−0.5

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.8: Response to measured and unmeasured disturbances, and soft con-
straints.

with it.

9.1.6 Robustness to model errors

It is not enough that our controller works when the plant is exactly as expected. The
gains of the real fractionator may vary as described in Table 9.4, and the controller
must continue to work satisfactorily as they do so.

Recall from sections 7.3 and 8.1.1 that singular values of multivariable frequency
responses give some indication of the robustness of a feedback design to modelling
errors. However, these can only be computed for the linear controller which is
obtained when all the constraints are inactive. Figure 9.10 shows the largest singular
values of the sensitivity and complementary sensitivity functions, S(s) and T (s)
respectively, for the linear controller which results from the design presented in the
previous section, when all the constraints are inactive. Since only outputs z1 and
z2 are controlled to set-points, these singular values have been computed on the
assumption that these two are the only outputs. (The singular values are shown for
frequencies ω up to the Nyquist frequency π/Ts .) It will be seen that σ̄[T (ejωTs )],
the largest singular value of T (z), has a value 1 (0 dB) at low frequencies. This
indicates offset-free tracking, which is expected so long as constraints are not active.
9.1. Shell Oil Fractionator 289

1
z1
z2
0.5
z3

0
Outputs

−0.5

−1

−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

1
u1
u2
0.5 u3
Inputs

−0.5

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.9: Response to measured and unmeasured disturbances, and hard con-
straints on ẑ(k + i|k) for i > 3.

It has a peak value barely larger than 1; this can be shown to imply reasonably
good robustness of the design to multiplicative perturbations of the plant’s transfer
function [Mac89, ZDG96]. It can also be seen that σ̄[T (ejωTs )] falls to about 0.5
(-6 dB) at ‘high’ frequencies, namely near ω = π/Ts . This indicates that not much
attenuation of any measurement noise takes place, so that z1 and z2 will tend to
follow any measurement noise that is present on the analyser outputs. This is not
a serious problem, since the Nyquist frequency is rather low (0.78 rad min−1 , or
0.002 Hz), so that any electrical noise can be assumed to have been removed from
the measurements; however, no specification of measurement noise is given in the
problem definition [PM87].

The plot of σ̄[S(ejωTs )] shown in Figure 9.10 shows it falling to zero at low fre-
quencies, which is again what is expected of the unconstrained behaviour, since it
indicates offset-free tracking and is consistent with the behaviour of σ̄[T (ejωTs )].
Its peak value is 2 (6 dB), however, which is usually a little too large for comfort.
It crosses the 0 dB line just above 0.03 rad min−1 , which shows that a sinusoidal
(unmeasured) output disturbance with period shorter than about 200 (= 2π/0.03)
minutes will be amplified rather than reduced by the feedback action.

We can employ the robust stability tests introduced in section 8.1.1 to get a more ac-
curate indication of the designed system’s vulnerability to the possible gain changes
290 9. Two Case Studies

10

−5
Singular values (dB)

−10

−15

−20

−25

−30

−35
−3 −2 −1 0
10 10 10 10
Frequency (rad/min)

Figure 9.10: Largest singular values of sensitivity S(z) (broken line) and comple-
mentary sensitivity T (z) (solid line).

defined in Table 9.4. The nominal (continuous-time) plant model P0 (s) is defined in
Table 9.2. The actual plant can be represented as

P (s) = P0 (s) + W (s)∆ (9.15)

where ∆ = diag{δ1 , δ2 , δ3 }, and W (s) is a transfer function matrix with the same
lag and delay structure as P0 (z), but gains taken from Table 9.4. So, for example,

2.11e−27s
W (s)11 = . (9.16)
50s + 1
We shall abuse notation slightly and refer to the transfer functions corresponding to
P0 (s), P (s) and W (s), after conversion to discrete-time representations, as P0 (z),
P (z) and W (z). Note that the diagonal block ∆ remains unchanged in the discrete-
time representation.4

This is an example of ‘structured uncertainty’, as discussed in section 8.1.1. Since


we have the bounds |δ| ≤ 1, it is certainly true that k∆k∞ ≤ 1. But we have much
more information than that about the structure of the uncertainty: only diagonal
elements in ∆ can be non-zero, and furthermore these elements must be real. Since
we have an additive representation of plant uncertainty, the test (8.7) for robust
stability would be applicable if the uncertainty were unstructured. Adapted to this
case, in which the uncertainty is W (z)∆, and k∆k∞ ≤ 1, the sufficient condition for
4
The model W (z) can be created by the MATLAB function mkdelta.m, which is available on
this book’s web-site.
9.1. Shell Oil Fractionator 291

robust stability becomes

σ̄[K(ejωTs )S(ejωTs )W (ejωTs )] < 1 (9.17)

As was said in section 8.1.1, this test is likely to be too conservative — if it is not
satisfied, this does not mean that the closed loop is not robustly stable. A less
conservative condition is

µ[K(ejωTs )S(ejωTs )W (ejωTs )] < 1 (9.18)

where µ[.] denotes the structured singular value for the diagonal uncertainty struc-
ture. But this is still conservative, because it allows for possibly complex gain
perturbations. The conservativeness can be reduced further by checking the ‘real-µ’
condition

µR [K(ejωTs )S(ejωTs )W (ejωTs )] < 1 (9.19)

where µR [.] denotes the real structured singular value.

Figure 9.11 shows the largest singular value σ̄[KSW ], the complex structured sin-
gular value µ[KSW ], and an upper bound for the real structured singular value
µR [KSW ], computed for an uncertainty structure of 1 × 1 blocks — these cor-
respond to the scalar uncertainties δi in the process gains. Although this figure

50

25

−25

−50
−3 −2 −1 0
10 10 10 10

Figure 9.11: Largest singular value (solid line), and estimates of complex µ (broken
line) and real µ (chained line) of K(z)S(z)W (z).

suggests that the designed controller should give instability with one of the possible
plants, it is difficult to find such a plant — recall that the small-gain and complex-µ
292 9. Two Case Studies

robustness tests give only sufficient, not necessary, conditions for robust stability,
and that only an upper bound is available for µR . With δ1 = −1, δ2 = δ3 = 1, very
underdamped closed-loop behaviour is obtained, which suggests that the system is
close to instability for this perturbation. Figure 9.12 shows the response with this
plant perturbation, when the same unmeasured disturbance is present as defined
in (9.13) and δ5 = 1. This response was obtained with soft constraints (ρ = 103 ),
since the optimization became infeasible with hard constraints, as a result of the
plant-model mismatch. Although not technically unstable, the response is now so
erratic that the controller is in effect useless.

1.5
z1
1 z2
z3
0.5
Outputs

−0.5

−1

−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.5
Inputs

u1
−0.5 u2
u3

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.12: Response with plant-model mismatch, unmeasured disturbance, and


soft constraints.

The simplest way of trying to increase robustness to plant-model mismatch is to


reduce the controller gain. This is not always a successful strategy (because there
are feedback systems in which a reduction of loop gain reduces the stability margins),
but we saw from Figures 9.10 and 9.11 that σ̄(S) is quite small at all frequencies,
whereas σ̄(KSW ) is very large. Also it can be checked that σ̄(W ) is relatively
small, so that decreasing the controller gain is indeed indicated as a good strategy
for increasing robustness. This is achieved most easily by increasing the control
move penalty weighting matrices R(i) in the MPC cost function. In the design
discussed so far, we used R(i) = I. The easiest alternative is R(i) = rI, for some
r > 1; the drawback to be expected, however, is that the control action will be
slower and less effective. After some experimentation, R(i) = 10I was found to be
a reasonable compromise between good robustness and good control. Figure 9.13
shows the response to the same unmeasured disturbances as in Figure 9.12. The
control of the outputs is a little better, but the movements of the inputs are much
9.1. Shell Oil Fractionator 293

less erratic.
1
z1
z2
0.5 z3
Outputs

−0.5

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.5
Inputs

u1
−0.5 u2
u3

−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.13: Response with plant-model mismatch, unmeasured disturbance, soft


constraints, and increased control move penalty.

Figure 9.14 shows the response with R(i) = 10I when the model is exact (δi = 0 for
all i). Comparing this figure with Figure 9.7, it is seen that not very much has been
lost in nominal performance — the control of the outputs is not much worse than
with the original design. Figure 9.15 shows the largest singular value, complex µ and
real µ of KSW for the reduced-gain controller. Comparing this figure with Figure
9.11, it can be seen that a significantly more robustly stable system is indicated for
the reduced-gain controller.

In cases where the control specification is more demanding, the simple solution of
reducing the controller gain by increasing R(i) may not be sufficient. It may be
necessary to introduce disturbance models in order to control the controller gain
more selectively in some frequency ranges. (The Lee-Yu tuning procedure presented
in section 8.2 offers one way of doing this.)
294 9. Two Case Studies

0.5

0
Outputs

−0.5

z1
−1 z2
z3
−1.5
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

0.5
Inputs

−0.5 u1
u2
u3
−1
0 50 100 150 200 250 300 350 400 450 500
Time (minutes)

Figure 9.14: Response with correct model, unmeasured disturbance, and increased
control move penalty.

50

25

−25

−50
−3 −2 −1 0
10 10 10 10

Figure 9.15: Largest singular value (solid line), complex µ (broken line) and real µ
(chained line) of K(z)S(z)W (z) with the reduced-gain controller.
9.2. Newell and Lee Evaporator 295

9.2 Newell and Lee Evaporator

The main objective of this case-study is to illustrate the implementation of predictive


control with a nonlinear plant. A nonlinear Simulink model of an evaporator serves
as the plant to be controlled, and the Model Predictive Control Toolbox is used to
control it using MPC.

This case study is based on the forced-circulation evaporator described by Newell


and Lee [NL89], and shown in Figure 9.16. A feed stream enters the process at con-
centration X1 and temperature T1 , with flow rate F1 . It is mixed with a recirculating
liquor, which is pumped through the evaporator at a flow rate F3 . The evaporator
itself is a heat exchanger, which is heated by steam flowing at a rate F100 , with entry
temperature T100 and pressure P100 . The mixture of feed and recirculating liquor
boils inside the heat exchanger, and the resulting mixture of vapour and liquid enters
a separator, in which the liquid level is L2 . The operating pressure inside the evap-
orator is P2 . Most of the liquid from the separator becomes the recirculating liquor;
a small proportion of it is drawn off as product, with concentration X2 , at a flow
rate F2 and temperature T2 . The vapour from the separator flows to a condenser at
flow rate F4 and temperature T3 , where it is condensed by being cooled with water
flowing at a rate F200 , with entry temperature T200 and exit temperature T201 .

Cooling water
T201

F200, T200
Vapor
F4,T3
Condenser

L2 Condensate
P2 Separator F5

Steam

F100 P100
T100

Evaporator

F3

Condensate

Feed
Product
F1, X1, T1
F2, X2, T2

Figure 9.16: Forced-circulation evaporator


296 9. Two Case Studies

The three controlled outputs, together with their initial equilibrium (steady-state)
values and constraints, are given in Table 9.8. The three manipulated variables
(control inputs) to be considered in this study, together with the corresponding
equilibrium values and their constraints, are given in table 9.9. There are no rate
constraints on the manipulated variables; the first-order lags, combined with the
amplitude constraints, result in rate constraints being satisfied without imposing
them explicitly.

Output Equilibrium Lower Upper


variable value limit limit
Separator level L2 1m 0 2
Product composition X2 25 % 0 50
Operating pressure P2 50.5 kPa 0 100

Table 9.8: Evaporator output variables

Input Equilibrium Lower Upper


variable value limit limit
Product flow rate F2 2.0 kg/min 0 4
Steam pressure P100 194.7 kPa 0 400
Cooling water flowrate F200 208.0 kg/min 0 400

Table 9.9: Evaporator input variables

There are five disturbance variables, although in this study we will leave them fixed.
These, together with their corresponding equilibrium vaues, are given in Table 9.10.5
The nonlinear equations describing the operation of the evaporator are given in
[NL89], and will not be repeated here.

Disturbance Equilibrium
Circulating flow rate F3 50.0 kg/min
Feed flow rate F1 10.0 kg/min
Feed concentration X1 5.0 %
Feed temperature T1 40.0 degC
Cooling water entry temperature T200 25.0 degC

Table 9.10: Evaporator disturbance variables

A Simulink simulation model which implements these equations has been imple-
mented, and is shown in Figure 9.17. The three manipulated variables, and the
circulation flow rate F3 , would in practice be controlled by local servos operating
valves. These are not modelled in detail, but are represented by first-order lags
with time-constants of 1.2 minutes. For this reason inputs to the model are labelled
5
In Chapter 12 of [NL89] the circulating flow rate F3 is considered to be another manipulated
variable.
9.2. Newell and Lee Evaporator 297

as F2SP rather than F2 (etc), to denote that they are set-points for the manipu-
lated variables, rather than the variables themselves. This model is available on this
book’s web site, including the lower-level sub-models, namely the heat exchanger,
the condenser, the separator, and the steam-jacket (in file evaporator.mdl) . The
model is in a form suitable for use with the Model Predictive Control Toolbox func-
tion scmpcnl, and its modified version scmpcnl2, which is also available on the web
site.

Since the model is nonlinear, it is linearised in order to get a linear internal model
to be used by the predictive controller. An initial linearisation is performed at
the equilibrium condition defined in Tables 9.8–9.10. Figure 9.18 shows the result
of using predictive control, when the set-point for the product concentration X2 is
ramped down linearly from 25% to 15% over a period of 20 minutes (between 20 and
40 minutes into the simulation run), and the operating pressure P2 is simultaneously
ramped up from 50.5 kPa to 70 kPa. It should be noted that the controller had no
advance information about the planned set-point trajectories, so it was reacting to
tracking errors, rather than anticipating set-point changes.

The sampling interval used was Ts = 1 minute, and the MPC tuning parameters
used to obtain these results were:
Hp = 30, Hu = 3, Q(i) = diag(1000, 100, 100), R(i) = I3 (9.20)
These parameters were not tuned carefully, but were almost the first set of parame-
ters tried, the objective here being to show the effects of nonlinearities. The penalty
on L2 tracking errors is 10 times larger than those on X2 and P2 because L2 is
confined between 0 and 2 m, whereas the numerical values of X2 and P2 are consid-
erably larger; these penalty weights indicate that a 1 m error in the separator level
is considered equally undesirable as a 10% error in the product concentration, or a
10 kPa error in the operating pressure.

It is seen from Figure 9.18 that control is initially satisfactory. The initial set-points
are held quite closely (after a brief initial transient during which all the variables in
the simulation settle to their equilibrium values), even when X2 and P2 start chang-
ing as they follow their ramp set-points. But about half-way through the ramp the
separator level L2 drifts considerably off its set-point and does not return to it. Al-
though the product concentration X2 tracks the set-point change quite closely, and
settles correctly at the required steady-state level, all the other variables indicate
underdamped closed loop behaviour, with the operating pressure P2 oscillating and
drifting away from its set-point. The manipulated variables show undesirable os-
cillation, with the cooling water flow rate F200 being particularly erratic, switching
between shutting off the water flow completely and restoring it to its initial value.

This deterioration of closed-loop behaviour is due to the fact that the linearised
model used by the predictive controller has become a very inaccurate representation
of the small-deviation behaviour of the evaporator at the new operating conditions.
Figure 9.19 shows the same scenario, but with the internal model used by the predic-
tive controller re-linearised 70 minutes into the simulation run, namely 30 minutes
5
F1 F1
10.0 P2 3
9. Two Case Studies

F2
Constant3 T2
P2
1 Q100 T2
1 40.0 F4
1.2s+1 F2
F2SP F5
F2 Lag Saturation Constant X2 2
7 T1
T3
X2
T1 6 X1

Figure 9.17: Simulink model of the evaporator


X1 heat exchanger
5.0

Constant1
1
3 F200 Terminator
1.2s+1 F200
F200SP T3’ F5’
F200 Lag Saturation2
8 T200
T200 condenser
1
2 P100
1.2s+1 P100
P100SP Q100’
Saturation1 25.0 Q100
P100 Lag T2’
Constant2
F1’’
F100
1 F100
4 F3’
1.2s+1 F3
F3SP steamjacket
F3 Lag F1’ Saturation3
50.0
F2’ L2 1
Constant4
L2
F4’
separator
298
9.2. Newell and Lee Evaporator 299

Separator Level Product Concentration


1.6 30

1.4 25

X2 (%)
L2 (m)

1.2 20

1 15

0.8 10
0 20 40 60 80 100 0 20 40 60 80 100
Operating Pressure Product Flow Rate SP
75 4

70 3.5

F2 (kg/min)
P2 (kPa)

65 3

60 2.5

55 2

50 1.5
0 20 40 60 80 100 0 20 40 60 80 100
Steam Pressure SP Water Flow Rate SP
300 400

250 300
F200 (kg/min)
P100 (kPa)

200 200

150 100

100 0
0 20 40 60 80 100 0 20 40 60 80 100
Time (minutes) Time (minutes)

Figure 9.18: Simulation with single linearised model, obtained at the initial equilib-
rium condition. (Broken lines show the set-points.)

after the new operating conditions have been (approximately) reached. Large tran-
sients are seen on all three manipulated variables as the new model is switched in —
no attempt has been made to achieve ‘bumpless transfer’ in the simulation. Both L2
and P2 are brought back close to their set-points within 10 minutes of updating the
inernal model, and the manipulated variables have become less oscillatory within
this time.

Figure 9.20 shows the results when the internal model is re-linearised every 10
minutes. Now it remains a reasonably good representation of the plant behaviour
throughout the change of operating conditions, and it is clearly seen that the qual-
ity of control is much better. The product concentration and operating pressure are
both held very close to their set-points throughout, and the separator level, although
still undergoing considerable deviations from its set-point, is now controlled much
more satisfactorily than before.

Re-linearisation, or adaptation, of the linear internal model, is the most common


way of dealing with plant noninearities in practice. It is not always adequate, partic-
ularly if the nonlinearities are more severe than those encountered in the evaporator.
Section 10.3 discusses some other possibilities for dealing with nonlinear plants.

The reader is encouraged to experiment with re-linearising the evaporator model at


300 9. Two Case Studies

Separator Level Product Concentration


1.6 30

1.4 25

X2 (%)
L2 (m)

1.2 20

1 15

0.8 10
0 20 40 60 80 100 0 20 40 60 80 100
Operating Pressure Product Flow Rate SP
75 4

70 3.5

F2 (kg/min)
P2 (kPa)

65 3

60 2.5

55 2

50 1.5
0 20 40 60 80 100 0 20 40 60 80 100
Steam Pressure SP Water Flow Rate SP
300 400

250 300
F200 (kg/min)
P100 (kPa)

200 200

150 100

100 0
0 20 40 60 80 100 0 20 40 60 80 100
Time (minutes) Time (minutes)

Figure 9.19: Simulation with a re-linearised internal model, obtained 70 minutes


into the simulation run. (Broken lines show the set-points.)

different intervals, using the MATLAB program contained in file simevap.m, and
with different scenarios. It should be noted, however, that this program does not
implement any of the checks which would be required in practice, to check that
a reasonable model has been obtained. Also, the linearised model obtained is not
quite correct if the plant is not at equilibrium — see section 2.1.2.
9.3. Problems 301

Separator Level Product Concentration


1.3 30

1.2
25
1.1

X2 (%)
L2 (m)

20
1
15
0.9

0.8 10
0 20 40 60 80 100 0 20 40 60 80 100
Operating Pressure Product Flow Rate SP
75 4

70 3.5

F2 (kg/min)
P2 (kPa)

65 3

60 2.5

55 2

50 1.5
0 20 40 60 80 100 0 20 40 60 80 100
Steam Pressure SP Water Flow Rate SP
300 400

250 300
F200 (kg/min)
P100 (kPa)

200 200

150 100

100 0
0 20 40 60 80 100 0 20 40 60 80 100
Time (minutes) Time (minutes)

Figure 9.20: Simulation with a re-linearised internal model obtained every 10 min-
utes of simulated time. (Broken lines show the set-points.)

9.3 Problems

These problems are based on the two case-studies which appear in this chapter. They
require use of the Model Predictive Control Toolbox and of files provided on this
book’s web site. They are open-ended in the sense that there is no unique correct
answer, and they may require considerable time to solve. The problems related to
the Evaporator require some familiarity with Simulink.

1. In the design developed in section 9.1.4, ‘blocking’ was used, corresponding


to the parameter M=[1,2,4,8] in Model Predictive Control Toolbox function
scmpc (or scmpc2). Investigate use of the simpler alternative of not using
blocking, but still retaining 5 decision times (namely Hu =M=5). Simulate the
same scenarios as shown in Figures 9.5 to 9.9. Show that the responses are not
very different from the ones shown in these figures. (Use the Model Predictive
Control Toolbox and the function scmpc2 available from this book’s web-site.)
2. Continue problem 1: Show that the singular values of the linear controller
obtained in unconstrained operation are not affected much by abandoning
‘blocking’. (Use the Model Predictive Control Toolbox’s functions smpccon,
smpccl, svdfrsp.)
302 9. Two Case Studies

3. Investigate by simulation the use of longer prediction horizons than used in


section 9.1.4, as regards both resulting performance of the closed-loop system
and computation time requirements.

4. Investigate alternative choices of the prediction horizon Hp , the control hori-


zon Hu , and the weights Q and R, for the evaporator. Consider how well the
controller deals with disturbances on the feed flow rate F1 , the feed concentra-
tion X1 , and the cooling water temperature T200 . (To simulate disturbances,
attach suitable Source blocks in place of the input ports on the disturbance
variables in the Simulink model evaporator.mdl .)
Suppose the evaporator is to operate with product concentrations (X2 ) of 25%,
15%, and 40%, all at an operating pressure of 50 kPa. Investigate whether you
can find a single set of tuning parameters which gives good performance at all
these concentrations, including transitions between them.
Is there a significant advantage in re-linearising the internal model as the
product concentration changes?
Note: Use, and modify as necessary, the file simevap.m, which is available on
this book’s web site.

5. Simulate the same scenario as shown in Figures 9.18–9.20, but with the sep-
arator level treated as a zone variable — namely with no set-point, but only
the constraints 0.5 < L2 < 1.5. (See section 5.5.)

6. It makes more sense to re-linearise the internal model when the operating point
has changed significantly, rather than at regular intervals of time. Examine
the MATLAB script file simevap.m. It allows the evaporator model to be
re-linearised at regular intervals of time. Modify it so that the model is only
re-linearised if the state has changed by more than some threshold amount.
(You will still need to interrupt the simulation at regular intervals, then test
whether the state has changed significantly.)
Using the modified file, simulate the same scenario as shown in Figures 9.18–
9.20, re-linearising the model whenever the product concentration X2 has
changed by more than 5%.
Chapter 10

Perspectives

This chapter introduces a few topics which are potentially very important, but which
are mostly still at the research stage.

10.1 Spare Degrees of Freedom

10.1.1 Ideal resting values

If the plant has more inputs than outputs, then a particular constant set-point
ys can be held by a whole family of constant input vectors us . There may be good
reasons for preferring one of these, usually because there are different economic costs
associated with the different control inputs. (Reducing air flow may be cheaper than
burning more fuel, for instance.) The traditional story in optimal control has been
to say that such preferences should be reflected in the choice of the R(i) matrices.
But in practice that is not so easy as it sounds, since Q(i) and R(i) have complicated
effects on the dynamic performance. The desirable constant values of the inputs are
usually determined at the same time as the set-points are determined, using static
optimization — usually by solving an LP problem.

If for some reason set-points are known, but the control inputs are not determined
uniquely, then the solution sometimes adopted is to first do a steady-state least-
squares optimization, to find the best combination of steady-state inputs which will
give a desired set-point vector. If the numbers of inputs and outputs are equal and
the steady-state gain matrix is nonsingular, then this is unnecessary because the
solution is unique. If there are more inputs than outputs, then the equation

ys − S(∞)Wu us = 0 (10.1)

is solved in a least-squares sense, where S(∞) is the steady-state gain matrix and
Wu is a diagonal weighting matrix. This gives the solution with the smallest value

303
304 10. Perspectives

of ||Wu us ||. (If there are more outputs than inputs then it is usually impossible to
reach the correct set-point, and in this case the equation

Wy (ys − S(∞)us ) = 0 (10.2)

is solved in a least-squares sense.)

When there are more inputs than outputs the elements of us are called the ideal
resting values of the plant inputs for the given set-points. Once they have been found
the cost function
PHused in the predictive control problem formulation is augmented
u −1
with the term i=0 ||û(k + i|k) − us ||2Σ(i) , to encourage the inputs to converge to
these ‘ideal’ values. A danger of this is that, if the steady-state gains are not known
accurately, or if there are constant disturbances, then the computed values of us will
not be exactly correct for attaining ys at the output, and offset-free tracking may
be lost as a result.

10.1.2 Multiobjective formulations

It is difficult to express all the objectives of control into a single cost function. For
example, assigning a high weight to the control of a particular output is not really
the same as assigning it a high priority. It does not express the objective ‘Keep
output j near its set-point only if you can also keep output ` at its set-point’. A
‘multiobjective’ formulation makes it easier to do this. This can be applied also in
situations in which it may be impossible to meet all the objectives simultaneously.
There are several approaches to multiobjective optimization, but one well-suited to
the situation in which there are various priorities for various objectives is to have
a hierarchy of optimization problems. The most important one is solved first, then
this solution is used to impose equality constraints when performing the second
optimization, and so on. For example, the ‘ideal resting value’ problem treated
above may be better solved by making the achievement of set-points the primary
objective, and the achievement of ideal resting values a secondary objective to be
pursued only when the controlled outputs are close to their set-points, and imposing
the equality constraints that the outputs should equal their set-points.

The complexity of the optimization problem to be solved may not increase, and may
even decrease, as a result of adopting such a strategy. Predictive control problems
solved in this way can keep a QP formulation at each step, and it is generally quicker
to solve several small problems than one large equivalent problem. In particular, the
first, most important problems to be solved have the smallest number of conflicts
and the largest number of degrees of freedom, so have the best prospects of a good
solution being found, and of this being done quickly. If one runs out of comput-
ing time before the next control signal must be produced, then the still-unsolved
problems are the least-important ones.
10.1. Spare Degrees of Freedom 305

10.1.3 Fault tolerance

Predictive controllers seem to offer very good possibilities for fault-tolerant control.
If a sensor of a controlled output fails, for example, it is possible to abandon control of
that output by removing the corresponding output from the cost function (by setting
the corresponding elements of Q(i) to zero). An actuator jam is easily represented by
changing the constraints (|∆uj | = 0). If a failure affects the capabilities of the plant,
then it is possible to change the objectives, or the constraints, or both, accordingly.
This is also possible with other control strategies, but it is particularly clear, in the
predictive control formulation, how the required changes should be introduced into
the controller. This is mainly due to the fact that the control signal is re-computed
at each step by solving an optimization problem, so that one can make changes in
the problem formulation. This is a very different proposition to changing the gains
or time constants in a pre-computed controller.1

Note that it may not be an easy problem to know how to change the problem
formulation if a failure occurs. All that can be said is that, if an appropriate change
is known, then it is easy to introduce it and implement it in the predictive control
framework.

In [Mac97] it is argued that predictive control offers the possibility of a generic


approach to achieving fault-tolerance by reconfiguring the controller in response
to a serious failure. This proposal relies on combining predictive control with the
increasing use of detailed ‘high-fidelity’ first-principles models to represent complex
processes, and with progress in the area of Fault Detection and Identification (FDI).

But it has also been noticed that predictive control has certain fault-tolerant prop-
erties even in the absence of any knowledge of the failure. In [Mac98] it is shown
that predictive control, with the standard ‘DMC’ model of disturbances and with
hard constraints on the input levels, can automatically redistribute the control effort
among actuators, if there are more actuators than controlled outputs, and one (or
more) actuator fails.

Some of these capabilities are illustrated in Figure 10.1, which is taken from [Mac97].
It shows a predictive controller responding to a step demand in the yaw angle of a
large civilian aircraft when the rudder is jammed.

Case 1 is the normal response when the rudder is working correctly. Case 2 shows the
response when the rudder is jammed, and the predictive control problem formulation
has no constraints; even in this situation the set-point is eventually achieved, which
indicates that other control strategies could achieve this too. Case 3 shows the
response when the controller is aware of the usual ±20◦ rudder angle limit. The
response is now faster, because after a few seconds the controller ‘thinks’ that it
has driven the rudder to the limit, and starts to move the other control surfaces;
1
However, it might be possible to re-compute on-line controllers for other strategies, which have
traditionally been pre-computed off-line, rather like ‘classical’ adaptive control proposals.
306 10. Perspectives

Yaw angle Roll angle


1 1.5

0.8
1
0.6

0.4
0.5
0.2

0 0
0 20 40 60 80 100 0 20 40 60 80 100
Time [s] Time [s]

Sideslip angle
0.2

0
Case 1
−0.2 Case 2
−0.4 Case 3
−0.6 Case 4

−0.8 Case 5

−1
0 20 40 60 80 100
Time [s]

Figure 10.1: Execution of a step change in yaw angle with a jammed rudder.

but the controller has no knowledge of the failure in this case. Case 4 shows the
response when the rudder failure is communicated to the controller by reducing
the ‘rudder move’ constraint to zero. This makes surprisingly little difference in
this case (the curves for Cases 3 and 4 are indistinguishable); the only difference is
that the controller knows immediately that it cannot move the rudder, whereas in
Case 3 it took about 3 seconds before it realised this. This does not make much
difference to the complete manoeuvre. Case 5 shows that better response can be
achieved by changing the weights — in this case the weight on keeping the roll angle
set-point was reduced, so that the controller made more use of roll angle to reach
its objective; this also shows a potential difficulty of this approach to fault-tolerant
control, namely that in general some re-tuning may be necessary, and this may not
be an easy thing to do on-line.

Another example of the ‘daisy-chaining’ property arises in connection with a plant


for producing liquefied natural gas (LNG), shown in Figure 10.2, which is taken
from [Row97]. It has 6 inputs: the compressor speed, and the positions of the
5 valves; and 5 outputs: the levels of liquid in the two separators, and the exit
10.1. Spare Degrees of Freedom 307

temperatures of the three heat exchangers (of the natural gas). The compressor
speed is limited to the range 25 to 50 revs/sec; the valve fully-closed to fully-open
range is represented by -500 to +500. In the example considered the sampling
interval is 10 sec, and at this long interval the input rates are effectively unlimited.
Each separator level is limited to the range -2 to +2 m (relative to the operating
point), and the evaporator exit temperatures are limited to the ranges -6 to +30 K,
-13 to +7 K, and -11 to +4 K, relative to their nominal values.

Figure 10.3 shows the simulated response to a step demand of +10 K on the exit
temperature of heat exchanger C, when there is no failure, the set-points for both
separators and heat exchanger F are zero, and the exit temperature of heat exchanger
E is not controlled, providing it remains within its constraints. The horizons are
Hp = 80 and Hu = 5.

Figure 10.4 shows the response in the same situation, but with valve H stuck at
+60, and with the controller unaware that this failure has occured. It will be seen
that the inputs have been reconfigured to adjust for the failure, with all outputs
eventually returning to their set-points, except for the uncontrolled one, which re-
mains within its allowed constraints. Note that the time-scale is different in this
figure; the transient takes much longer than in normal operation, but all constraints
are respected, and effective control over the process is maintained. Typically the
penalty of such reconfiguration will be reduced production rate (valve K not at its
nominal position), but at least continued production is possible.

When the controller is aware that valve H is stuck, and of its position then, not
surprisingly, the transient is finished much more quickly, and in fact resembles very
closely the one obtained in normal operation. (All the simulations shown here were
performed on a linearised model.)

G
J

E
B C C F
I
H

Natural gas LNG

Figure 10.2: LNG liquefaction plant

The potential of predictive control for fault-tolerant control has also been considered
in [GBMR98, GMR99].
308 10. Perspectives

Outputs
15

10

−5

−10
0 100 200 300 400 500 600 700 800 900 1000
Time

Manipulated Variables
300

200

100

−100
0 100 200 300 400 500 600 700 800 900 1000
Time

Figure 10.3: LNG plant: Response in normal operation

10.2 Constraint Management

A major problem with using constrained predictive control is reacting to infeasibili-


ties. In general this requires some change to be made to the constraints. The strat-
egy recommended by Rawlings and Muske [RM93], and (previously) implemented in
DMC, is to have a constraint window within which constraints are enforced (defined
in our notation by Cw and Cp in Chapter 6). Infeasibilities can always be removed
from the problem formulation by opening the constraint window late enough. Of
course this may not remove ‘real-world’ infeasibilities from the plant, and is only a
useful strategy if some constraints can be relaxed without causing serious damage,
or posing an unacceptable risk.

One school of thought argues that infeasibility is such an unacceptable situation to


face, that ‘hard’ output constraints should never be used, but should be replaced by
‘soft’ constraints, as described in section 3.4. Again, this is only a useful prescription
if some violation of the constraints can be tolerated; in practice this means that one
has to impose relatively conservative constraints. ‘Hard’ input constraints, on the
other hand, are acceptable, both because constraints on inputs are really ‘hard’
in nature, and because input constraints do not cause infeasibilities (with stable
plants).
10.2. Constraint Management 309

Outputs with stuck valve, without FDI


15

10

−5
0 500 1000 1500 2000 2500 3000
Time

Manipulated Variables
300

200

100

−100

−200

−300

−400
0 500 1000 1500 2000 2500 3000
Time

Figure 10.4: LNG plant: Valve H stuck, controller unaware

It is widely accepted that the ‘correct’ thing to do in case of infeasibility is to decide


on the relative importance of the constraints, and to release the relatively unimpor-
tant ones until feasibility is recovered. It has recently been proposed [TM99] that a
systematic way of integrating this process into the predictive control framework can
be developed, by using propositional logic. The idea is that statements about pri-
orities of constraints and objectives can be translated into statements expressed in
propositional logic. These can be put into a canonical form, which can be tranlsated
into an integer-valued optimization problem. Finally this problem can be combined
with the standard QP problem of predictive control, to give a mixed integer quadratic
program (MIQP) — or a mixed integer linear program if the underlying predictive
control problem is formulated as an LP problem (see section 5.4). Global optima of
such problems can be obtained reliably, but the computational complexity involved
is much greater than for ordinary QP or LP problems.

Example 10.1 This example is taken from [TM99, Example 1]. For the steady-
state model
     
y1 0 1   d1
 y2  =  1 0  u1 +  d2  (10.3)
u2
y3 1 1 d3

the most important constraint is maxj |yj | ≤ 2, while a secondary objective is |y2 | ≤
310 10. Perspectives

, where  > 0 is very small. The top-priority constraint can be represented by the
conjunction (simultaneous satisfaction) of three pairs of inequalities such as (for
|y1 | ≤ 2):

u2 + d1 ≤ 2 + 10(1 − `1 ) (10.4)
−u2 − d1 ≤ 2 + 10(1 − `1 ) (10.5)

where `1 = 0 or `1 = 1, and 10 is chosen as being sufficiently large that it is an upper


bound on |yj | under any circumstances. The secondary priority can be represented
by the pair of inequalities:

u1 + d2 ≤  + 10(1 − `2 ) (10.6)
−u1 − d2 ≤  + 10(1 − `2 ) (10.7)

where again `2 ∈ {0, 1}. The idea is that `1 = 1 corresponds to the first constraint
being enforced, and `2 = 1 corresponds to the second one being enforced. Now the
clever trick is that the priorities are represented by the linear inequality

`1 − `2 ≥ 0 (10.8)

because this cannot be satisfied if `2 = 1 unless `1 = 1 also.

The optimal control can now be found by solving the (mixed-integer) optimization
problem:

min −`1 − `2 (10.9)


u1 ,u2

(In this case the only objective is the satisfaction of the constraints. There is no
linear or quadratic penalty of deviations from the set-point.)

A refinement of this ensures that if one or both constraints cannot be met, then the
amount by which the highest-priority constraint is violated is minimised.

This approach has recently been extended to a very promising framework for han-
dling a variety of hybrid system problems that involve mixtures of numerical and
logical variables [BM99a]. A Mixed Logical Dynamical (MLD) system is one of the
form

x(k + 1) = Ax(k) + B1 u(k) + B2 δ(k) + B3 z(k) (10.10)


y(k) = Cx(k) + D1 u(k) + D2 δ(k) + D3 z(k) (10.11)
E1 δ(k) + E2 z(k) ≤ E3 u(k) + E4 δ(k) + E5 (10.12)

in which the state vector x, the input vector u and the output vector y all contain
both real-valued and {0, 1}-valued elements. δ is a vector of binary {0, 1}-valued
auxiliary variables, and z a vector of real-valued auxiliary variables. These auxil-
iary variables are needed for transforming propositional logic statements into linear
10.3. Nonlinear Internal Models 311

inequalities. Inequality (10.12) specifies all the constraints on the system, as well as
specifying priorities for objectives and constraints (as was done in (10.8)).

In a parallel development [VSJ99] it has been shown how the magnitudes of low-
priority constraint violations can be minimised, without the use of mixed-integer
optimization. In fact, only a single linear programme is required, provided that the
objective function is properly chosen, which gives a great simplification compared
with the use of mixed-integer programming. The idea is to formulate an optimization
problem such that a lower-priority constraint violation cannot be decreased without
increasing a higher-priority constraint violation. The solution to such a problem is
called a lexicographic minimum of the violated constraints (by analogy with the way
in which entries are ordered in a telephone directory, for example). The solution
proposed in [VSJ99] is to minimise a linear combination of the slack variables which
appear in a penalty function, such as was introduced in section 3.4 for softening
constraints. If the slack variables are ordered such that the first one corresponds
to the highest-priority constraint, and the last one to the lowest-priority constraint,
then a lexicographic minimum can be ensured by choosing a sufficiently large ratio
between succeeding weights in the linear combination. Determining how large this
ratio needs to be involves solving another LP problem (but off-line).

In [KBM+ 00] a similar idea to that of [VSJ99] is used in combination with MLD sys-
tems. Mixed-integer optimization is relied on, but greater flexibility of specification
is gained. For example, the satisfaction of the greatest number of constraints, either
taking priorities into account or not, can be enforced, as can prioritised minimisation
of the duration of constraint violations. It is also shown how the same approach can
be used to formulate multiobjective problems, and prioritising multiple objectives
as well as constraints.

10.3 Nonlinear Internal Models

10.3.1 Motivation and approaches

If the plant exhibits severe nonlinearities, the usefulness of predictive control based
on a linearised model is limited, particularly if it is used to transfer the plant from
one operating point to another one. The obvious solution is to use a nonlinear model,
and quite a lot of research is going on into this possibility. The main disadvantage is
that convexity of the optimization problem is then lost, which is a serious drawback
for on-line application. The disadvantage is not so much that the global optimum
may not be found, since the use of a linearised model only gives the illusion of
finding a global optimum — one finds the global optimum of the wrong problem.
The real disadvantage for on-line use is that one has very little idea of how long each
optimization step will take to complete, whether it will ever terminate, what to do
if a feasible solution cannot be found, and so on.
312 10. Perspectives

The most straightforward approach to the nonlinear MPC problem is to retain the
formulation of MPC as we have developed it in this book, simply replacing the
linear model by a nonlinear one, and rely on suitable optimization methods to try
to overcome the loss of convexity. This approach may lead to perfectly acceptable
performance in practice, at least in suitable applications, but is usually very difficult
or impossible to analyse. Lack of analysis, however, has not been an obstacle to the
application of predictive control in the past.

A compromise solution, and the one which is most commonly used in practice, is
to re-linearise the nonlinear model as the plant moves from one operating point to
another, and to use the latest linear model as the internal model at each step. The
linearised model is not necessarily updated at each step, but may be left unaltered
as long as the plant is in the vicinity of a particular operating condition. This results
in a QP problem to be solved at each step, although the model changes from time
to time. If the nonlinearity is expected to be significant because set-points are due
to be changed — for example from one production rate to another — then one can
use a time-varying linear model which varies during the prediction horizon [HM98].
At each point in the horizon one uses the linearisation corresponding to the state at
which one expects to be at that time. Note that this linearisation cannot depend on
the optimised input trajectory if convexity of the optimization is to be maintained.

Another problem which becomes very prominent with nonlinear MPC is state esti-
mation. In most applications the true state x(k) is not measured, and an estimate
x̂(k|k) must be obtained. This becomes much more problematic when the model is
nonlinear [GZ92, Beq91, QB99].

10.3.2 Sequential quadratic programming

If a nonlinear internal model is used, then several optimization algorithms are avail-
able. The one which is closest to the algorithms introduced in chapter 3 is sequential
quadratic programming (or ‘SQP’). Suppose that a general constrained optimization
problem is to be solved, of the form:

min{V (θ) : Hi (θ) = 0, Ωj (θ) ≤ 0} (10.13)


θ

where {Hi (.)} and {Ωj (.)} are sets of nonlinear functions, and that an iterate θk has
been obtained. The SQP algorithm makes a quadratic approximation to V (θk ):

1 T 2
qk (d) = d ∇θθ L(θk , λk )d + ∇V (θk )T d (10.14)
2
P P
where L(θ, λ) = V (θ)+ i λi Hi (θ)+ j λj Ωj (θ) is the Lagrangian. The next iterate,
θk+1 , is given by

θk+1 = θk + dk (10.15)
10.3. Nonlinear Internal Models 313

where dk is found by solving the quadratic programming problem which results from
minimising qk (d), subject to local linear approximations of the constraints:

min{qk (d) : Hi (θk ) + ∇Hi (θk )T d = 0, Ωj (θk ) + ∇Ωj (θk )T d ≤ 0} (10.16)


d

This is the basic idea of SQP, but there are several variations, for example taking
different approaches to estimating the vector of Lagrange multipliers, λk , or the
Hessian matrix ∇2θθ L(θk , λk ). The iterate θk may well violate the original constraints,
since it only satisfies the local linear approximations to the constraints. A variation
which may be of particular significance for predictive control is feasible SQP, which
ensures that each iterate satisfies the original nonlinear constraints. This may be
an important feature for real-time optimization, if there is insufficient time to allow
the iterates to converge, and one has to take the best iterate found so far.

The models used in nonlinear MPC can be either detailed ‘first-principles’ models,
or ‘black-box’ models such as neural nets or Volterra models. Both kinds lead to the
basic problem of a non-convex optimization problem. Bock et al [BDLS99, BDLS00]
propose a multiple shooting approach for solving nonlinear MPC problems, which is
particularly intended for use with complex ‘first-principles’ nonlinear models, con-
sisting of large sets of differential or differential-algebraic equations. When such
models are used, solution of the model by numerical integration is not trivial, and
should be considered together with the problem of solving the optimization prob-
lem to find the control input trajectory. The proposed ‘multiple shooting’ approach
exploits the structure of the nonlinear MPC problem, taking the numerical integra-
tion into account, in particular by suitable adaptations of the SQP algorithm. The
term ‘multiple shooting’ refers to the solution strategy, which divides the prediction
horizon up into smaller intervals, and initially finds almost-independent iterates on
each interval, gradually reconciling the iterates with each other so that a continuous
input trajectory is obtained as the solution.2 This strategy lends itself naturally to
parallelisation, if multiple processors are available for the optimization.

In [DOP95] a ‘black-box’ model in the form of a second-order Volterra series model


is used. It is shown that this results in an MPC controller which has the structure
of a ‘standard’ MPC controller for the linear part of the model, together with a ‘cor-
rection’ for the nonlinear behaviour. This paper also contains a brief but interesting
discussion of how such Volterra models may be obtained.

10.3.3 Neural net models

For our purposes, neural net-based models are just one class of black-box nonlinear
models. They are of interest because they are increasingly being used with success
in a wide range of applications, because they have theoretically attractive approx-
imating power, and because there are established techniques for estimating them.
2
On each interval, the input trajectory is assumed to be structured as a low-order polynomial,
which makes an interesting connection with predictive functional control — see section 5.6.
314 10. Perspectives

Here we will outline two specific ways of using neural nets for nonlinear MPC which
have been proposed, without going into any details of the neural nets themselves.
In order to find such details the reader is referred to [NRPH00], which includes a
section on the use of neural nets for predictive control. Also see [Lee00], and [LD99]
for an interesting application.

One interesting attempt to use nonlinear neural net models, while retaining the
advantages of convex optimization, is presented in [LKB98], in which it is suggested
that the nonlinear system should be approximated by a set of neural-net predictors
which are affine in the inputs. A different predictor in the set is used for each
prediction length:

1 −1
PX
x̂(k + P1 |k) = f (x(k)) +
1
gi1 (x(k))û(k + i|k) (10.17)
i=0
..
.
c −1
PX
x̂(k + Pc |k) = f c (x(k)) + gic (x(k))û(k + i|k) (10.18)
i=0

where the functions f j (.) and gij (.) (for j = 1, . . . , c) are nonlinear functions imple-
mented by the set of c neural nets. This results in a convex optimization problem,
so long as the cost function is linear or quadratic (or some other convex function).
This approach may be of particular interest if the number of coincidence points c is
small. The identification of suitable neural nets is discussed in [LKB98]. (The idea
of using a separate predictor for each prediction interval can also be found in the
research literature emphasising the use of predictive control schemes for adaptive
control, such as MUSMAR. There linear models are used, and the benefit of sepa-
rate predictors is that implicit system identification algorithms can be kept relatively
simple, because only linear regression is required [Mos95].)

Neural net models are used differently in the commercial MPC product Process
Perfecter developed by Pavilion Technologies [PSRJG00]. Here a neural net is used
to approximate the steady-state input-output map. It is assumed that the plant is
to be transferred from one initial steady state, say yi , to another final steady state,
say yf . Steady-state optimization is performed to find suitable steady-state input
values, say ui and uf , respectively. Consider a single-input, single-output plant, for
simplicity — the ideas carry over to multivariable plant, but the notation becomes
messy.3 The neural net model is then used to obtain the ‘local’ input-output gains,
at the initial and final steady states:
   
∂y ∂y
gi = , gf = (10.19)
∂u ui ,yi ∂u uf ,yf

(These are the steady-state gains of the locally linearised models at the two steady
states.) Finally a second-order dynamic model is assumed, in difference-equation
3
In essence we need a multivariate Taylor series expansion, up to quadratic terms.
10.3. Nonlinear Internal Models 315

form, which is quadratic in the inputs:

δy(t) = −a1 δy(t − 1) − a2 δy(t − 2) + v1 δu(t − d − 1) + v2 δu(t − d − 2) +


w1 [δu(t − d − 1)]2 + w2 [δu(t − d − 2)]2 (10.20)

where δ now signifies deviations from initial steady-state values: δu(t) = u(t) − ui ,
δy(t) = y(t) − yi , and d is an input-output delay. The coefficients a1 and a2 are
fixed, as in a linear difference equation model, but v1 and v2 depend on gi , while w1
and w2 depend on both gi and gf . In an exact Taylor series expansion one would
have vj = ∂y(t)/∂u(t − d − j), and wj = ∂ 2 y(t)/∂u(t − d − j)2 . It is not surprising,
then, that these coefficients are given a gain-dependence of the following form:
gf − gi
vj = bj gi , wj = bj (j = 1, 2) (10.21)
uf − u i
where b1 and b2 are some fixed coefficients. If the vj and wj coefficients were fixed,
a nonlinear model would still be obtained; but allowing them to vary in this way
results in a much better approximation being obtained while retaining the simple
quadratic model, because the coefficients are ‘tuned’ for the particular transient that
needs to be performed. Note that since the resulting dynamic model is quadratic in
the inputs, the optimization which needs to be performed for MPC is not convex,
in general. However, the model has been kept very simple, so that the optimization
needs to be performed over relatively few decision variables. The hope is that this
results in a tractable optimization problem, and apparently this turns out to be the
case in many applications [PSRJG00]. The assumption behind the form of (10.21)
is that the change in steady-state gains is the principal nonlinearity in the plant.
The identification of suitable models of this form is aided by the fact that there is
often an extensive database of historical data available, from which one can estimate
steady-state gains for a wide range of operating conditions.

10.3.4 Sub-optimal nonlinear MPC

A more radical way of avoiding the problems associated with non-convex optimiza-
tion, or at least of ameliorating them, is to shift the emphasis away from opti-
mization, and towards the satisfaction of constraints as the primary objective. An
interesting proposal in this direction has been made by Scokaert, Mayne and Rawl-
ings [SMR99]. This involves a dual-mode strategy, in which the state is steered
towards a terminal constraint set X0 , as in [MM93] and [SM98]. It is assumed
that, once the state has entered X0 , a robust asymptotically stabilising controller
u(k) = hL (x(k)) is available which drives the state to the origin, and such that
X0 is a positively-invariant set for x(k + 1) = f (x(k), hL (x(k))). (The subscript L
denotes a ‘local’ controller.) The original feature of the proposal, however, is the
MPC strategy which is used while the state is outside X0 . The system is assumed
to be nonlinear:

x(k + 1) = f (x(k), u(k)) (10.22)


316 10. Perspectives

with input and state constraints of the general form:


u(k) ∈ U, x(k) ∈ X (10.23)
The cost function is also assumed to be of a general form:
X
N
V (k) = L(x̂(k + j|k), û(k + j − 1|k)) (10.24)
j=1

and it is assumed that the cost falls to zero once the state has entered X0 , namely
L(x, hL (x)) = 0 if x ∈ X0 . The following terminal constraint is imposed:
x̂(k + N |k) ∈ X0 (10.25)
Now the control is chosen not by minimising the cost (10.24), but by finding a
predicted control trajectory which gives a sufficient reduction of the cost. Any
control trajectory which gives
V (k) ≤ V (k − 1) − µL(x̂(k|k − 1), û(k − 1|k − 1)) (10.26)
where 0 < µ ≤ 1, is acceptable, providing that (10.23) and (10.25) are satisfied.
As usual in MPC, the applied control is u(k) = û0 (k|k), where û0 (k + j − 1|k),
j = 1, . . . , N is the selected input trajectory. It is shown in [SMR99] that, under
mild technical conditions, which we omit, this sub-optimal MPC strategy gives an
asymptotically stable closed loop, and the region of attraction — namely the set of
initial states which are driven to the origin by this strategy — is precisely the set of
states which can be driven to X0 in N steps without violating the constraints. It is
also shown that, in the absence of disturbances, the state is driven into X0 in a finite
number of steps. In order to prove these results, a generalised Lyapunov stability
theorem is proved in [SMR99], which allows the control law to be nonunique and
discontinuous — both features being needed because of the way the future control
trajectory is chosen.

The main significance of this result is that it removes the need for finding the global
minimum of a non-convex function. In fact, it is not even necessary to find a local
minimum. All that is needed is to find a solution which gives a sufficient reduction
in the cost function at each step, as defined in (10.26). If sufficient time is available
for the computation, one can continue searching for solutions which give a bigger
reduction, but that is not necessary. Also, the difficulty of finding such a solution
can be controlled by adjusting the value of µ. Values close to zero make it relatively
easy to find a solution, though of course at the cost of poor performance, in the sense
of relatively small reduction of the cost function at each step. Such small values may
be appropriate if there are large modelling errors, or large disturbances, so that it
is difficult to find a feasible trajectory. Another interesting feature of this MPC
strategy is that, if there were no modelling errors or disturbances, then one would
only need to calculate the future trajectory initially (at k = 0), and not recalculate it
again. This is because the initially calculated trajectory is feasible and provides the
required cost reduction at each step — optimality is no longer an issue. In practice,
of course, recalculation is necessary, but previously calculated trajectories provide
good initial guesses (‘hot starts’).
10.4. Moving-Horizon Estimation 317

10.4 Moving-Horizon Estimation

The standard way of estimating the state of a dynamic system from input-output
measurements is to use a state observer. For a linear model there is a complete theory
— see Minitutorial 2 — and if statistical information is available about disturbances
and measurement noise then optimal estimates can be obtained by using the Kalman
filter. Although there is some observer theory for use with nonlinear models, it is
much less complete. Optimal state estimation problems can still be defined, but
usually they cannot be solved exactly, and ad hoc approximations must be used,
such as the Extended Kalman Filter. One such ad hoc approach is moving-horizon
estimation, which is a kind of ‘dual’ of predictive control.

Instead of predicting ahead, one looks back at input-output data over a finite horizon,
and tries to find an estimated state trajectory which is consistent with an assumed
model, and which fits the measured data as closely as possible. For example, with
a linear model and a moving horizon of length N , one can pose a problem such as

X
N −1
min {kŷ(k − i|k) − y(k − i)k2Q + kx̂(k − N |k) − x0 k2 } (10.27)
x̂(k−i|k)
i=0

subject to

x̂(k − i + 1|k) = Ax̂(k − i|k) + Bu(k − i) (10.28)


ŷ(k − i|k) = C x̂(k − i|k) (10.29)

where the data u(k − i), y(k − i) : i = 0, 1, . . . , N are given, and the last term in
(10.27) is an initial cost which penalises deviations of the initial estimate x̂(k − N |k)
from some known value x0 , which may perhaps be the corresponding estimate ob-
tained at the previous step, x̂(k − N |k − 1). This is a linear least-squares problem;
but if the real state variables are known to be bounded, from physical considera-
tions, or more general linear constraints are known to hold, then linear inequality
constraints of the form

Mik x̂(k − i + 1|k) ≤ mki (10.30)

can be added, and the problem becomes a quadratic programming problem. This
problem is outside the scope of conventional state estimation theory.

We have given only the simplest formulation here; the problem can be generalised,
especially to the use of nonlinear models. Similar questions arise as in predictive
control, in particular:

• How to deal with lack of convexity when nonlinear models are used?

• How to ensure stability of the estimator — that is, how to ensure that the
estimate x̂(k|k) converges to x(k), assuming the model is correct?
318 10. Perspectives

• How to ensure that the stability of the estimator is robust with respect to
errors in the model?

The investigation of such questions has begun [SR95, RR99a]. The use of moving
horizon estimation has also been suggested with systems described in the mixed
logical-dynamic (MLD) framework — see (10.10)–( 10.12) — for estimating states
in hybrid systems, for detecting faults, etc [BMM99].

Constrained moving horizon estimation has also been proposed for the related prob-
lem of data reconciliation [LEL92]. This arises when one has not only a partly
unknown state, but also limited confidence in the correctness of the measurements,
and possibly uncertainty about the model. The objective is to modify the mea-
surements so that they become consistent with the model. The model is often a
nonlinear first-principles model, and one frequently knows constraints on the real
values of measured variables, and on states. This approach has also been suggested
for detecting failed sensors and other faults.

10.5 Concluding Remarks

A recent survey, quoted in [QB96], states that a conservative estimate of the number
of predictive control installations in industry worldwide in 1996 was 2200. Most of
these were in refining and petrochemical applications, but some penetration into
other industries such as food processing and pulp-and-paper was evident. (The
company Adersa reported 20 applications in the aerospace, defence and automotive
industries. No other vendor reported any applications in these industries.) The
largest of these was an olefines plant, with 283 inputs and 603 outputs.

Clearly predictive control technology is a successful technology. Where does this


success come from? In particular, why has it been so much more successful than
‘classical’ LQ control, which uses a similar quadratic cost function, which offers
stability and (since about 1980) robustness guarantees, but which has had very
little application in the process industries?4 I believe that its success is due to a
combination of the following factors, listed here in decreasing order of importance:

1. Systematic handling of constraints. No other technique provides this. This


reduces the need for ad-hoc ‘safety-jacket’ software to handle things like inte-
grator wind-up, unexpected conditions, etc. It probably also provides some
robustness, in the sense that if the unconstrained control does not do a good job
and the plant moves towards dangerous regions, then the constraints ‘catch’ it
and return it to safer regions. This property is probably quite robust, because
it depends largely on ‘coarse’ information, such as signs of gains rather than
the precise values.
4
But LQ control has been successful in aerospace applications, and in high-peformance servos,
such as those used in disk drives.
10.5. Concluding Remarks 319

2. Commercial predictive control software does a lot more than solve predictive
control problems as formulated in this book. A hierarchy of optimization prob-
lems is solved typically, and there are features which aid constraint and goal
management in case of failures or unusually large disturbances. Combining
such functionality with other control strategies might be equally effective —
and there is no particular reason why this could not be done.

3. Commercial vendors usually supply a ‘turnkey’ system. In addition to selling


the software, they model the plant and tune the controller before handing it
over to the customer. The great majority of the time goes into modelling
and identification. It is not customary for vendors of PI controllers, say, to
provide a similar service, or for the customer to devote a comparable effort to
modelling and tuning. 5

4. The basic ideas behind predictive control are easy to explain and understand.
Although the technicalities can become very intricate when plant-wide con-
strained optimization is implemented, it is still possible to present information
to plant operators in such a way that they retain confidence in the actions taken
by a predictive controller. This has been very important for the acceptance of
predictive control.

I believe that these features of predictive control will lead to its very wide use in
control engineering, beyond the process industries. One can already find references
to its use in flight control [LP95, SSD95, PHGM97] , submarines [SB98] and medical
applications [ML98], for example. For a practitioner’s view of future applications of
predictive control see [San98].

5
In fact, predictive control vendors usually insist on ‘tuning up’ the low-level PI controllers which
receive set-points from the predictive controllers. One wonders how much of the success is already
due to this preliminary activity.
320 10. Perspectives
References

[AM79] B.D.O. Anderson and J.B. Moore. Optimal Filtering. Prentice Hall,
1979.

[AM90] B.D.O. Anderson and J.B. Moore. Optimal Conrol, Linear Quadratic
methods. Prentice Hall, 1990.

[Åst80] K.J. Åström. A robust sampled regulator for stable systems with
monotone step responses. Automatica, 16:313–315, 1980.

[ÅW84] K.J. Åström and B. Wittenmark. Computer Controlled Systems: The-


ory and Design. Prentice Hall, 1984.

[ÅW89] K.J. Åström and B. Wittenmark. Adaptive Control. Addison-Wesley,


1989.

[AZ00] F. Allgöwer and A. Zheng, editors. Nonlinear Model Predictive Con-


trol. Birkhäuser, 2000.

[BB91] S. Boyd and C. Barratt. Linear Controller Design, Limits of Perfor-


mance. Prentice-Hall, 1991.

[BCM97] A. Bemporad, A. Casavola, and E. Mosca. Nonlinear control of con-


strained linear systems via predictive reference management. IEEE
Transactions on Automatic Control, 42:340–349, 1997.

[BDLS99] H.G. Bock, M. Diehl, D. Leineweber, and J. Schlöder. Efficient di-


rect multiple shooting in nonlinear model predictive control. In Keil,
Mackens, Voss, and Werther, editors, Scientific Computing in Chem-
ical Engineering II: Simulation, Image Processing, Optimization, and
Control. Springer, 1999.

[BDLS00] H.G. Bock, M. Diehl, D. Leineweber, and J. Schlöder. A direct mul-


tiple shooting method for real-time optimization of nonlinear DAE
processes. In Allgöwer and Zheng [AZ00], pages 245–267.

[Bem98] A. Bemporad. Reducing conservativeness in predictive control of con-


strained systems with disturbances. In Proceedings, 37th IEEE Con-
ference on Decision and Control, pages 1384–1391, Tampa, 1998.

321
322 REFERENCES

[Beq91] B.W. Bequette. Nonlinear predictive control using multi-rate sam-


pling. Canadian Journal of Chemical Engineering, 69:136–143, 1991.

[BGFB94] S. Boyd, L. El Ghaoui, E. Feron, and V. Balakrishnan. Linear Matrix


Inequalities in System and Control Theory. SIAM, Philadelphia, 1994.

[BGW90] R.R. Bitmead, M. Gevers, and V. Wertz. Adaptive Optimal Control:


The Thinking Man’s GPC. Prentice Hall, Englewood Cliffs, NJ, 1990.

[BH75] A.E. Bryson and Y-C. Ho. Applied Optimal Control; Optimization,
Estimation, and Control. Hemisphere, Washington, 1975.

[Bla99] F. Blanchini. Set invariance in control. Automatica, 35:1747–1767,


1999.

[BM99a] A. Bemporad and M. Morari. Control of systems integrating logic,


dynamics, and constraints. Automatica, 35:407–427, 1999.

[BM99b] A. Bemporad and M. Morari. Robust model predictive control: a


survey. In A. Garulli, A. Tesi, and A. Vicino, editors, Robustness in
Identification and Control, volume 245 of Lecture Notes in Control
and Information Sciences. Springer, 1999.

[BMDP] A. Bemporad, M. Morari, V. Dua, and E.N. Pistikopoulos. The


explicit solution of model predictive control via multiparametric
quadratic programming. In Proceedings, American Control Confer-
ence, Chicago, June 2000. IEEE. (CD-ROM).

[BMDP99] A. Bemporad, M. Morari, V. Dua, and E.N. Pistikopoulos. The ex-


plicit linear quadratic regulator for constrained systems. Technical Re-
port AUT 99-16, Automatic Control Laboratory, ETH Zurich, 1999.

[BMM99] A. Bemporad, D. Mignone, and M. Morari. Moving horizon estimation


for hybrid systems and fault detection. In Proceedings, American
Control Conference, San Diego, 1999.

[CA98] H. Chen and F. Allgöwer. A quasi-infinite horizon nonlinear model


predictive control scheme with guaranteed stability. Automatica,
34:1205–1217, 1998.

[CBB94] E.F. Camacho, M. Berenguel, and C. Bordons. Adaptive generalized


predictive control of a distributed collector field. IEEE Trans. Control
Systems Technology, 2:462–468, 1994.

[CC95] E.F. Camacho and C.Bordons. Model Predictive Control in the Process
Industry. Advances in Industrial Control. Springer, Berlin, 1995.

[CC99] E.F. Camacho and C.Bordons. Model Predictive Control. Advanced


Textbooks in Control and Signal Processing. Springer, London, 1999.
REFERENCES 323

[Cla88] D.W. Clarke. Application of generalized predictive control to indus-


trial processes. IEEE Control Systems Magazine, 122:49–55, 1988.

[Cla94] D.W. Clarke, editor. Advances in Model-Based Predictive Control.


Oxford University Press, Oxford, 1994.

[CM86] P.J. Campo and M. Morari. ∞-norm formulation of model predic-


tive control problems. In Proceedings, American Control Conference,
pages 339–343, 1986.

[CM87] P.J. Campo and M. Morari. Robust model predictive control. In


Proceedings, American Control Conference, pages 1021–1026, 1987.

[CM89] D.W. Clarke and C. Mohtadi. Properties of generalised predictive


control. Automatica, 25:859–875, 1989.

[CM97] C.T. Chou and J.M. Maciejowski. System identification using bal-
anced parameterizations. IEEE Transactions on Automatic Control,
42:965–974, July 1997.

[CMT87] D.W. Clarke, C. Mohtadi, and P.S. Tuffs. Generalised predictive con-
trol — Parts I and II. Automatica, 23:137–160, 1987.

[CN56] J.F. Coales and A.R.M. Noton. An on-off servo mechanism with pre-
dicted change-over. Proc. Institution of Electrical Engineers, Part B,
103:449–462, 1956.

[CR80] C.R. Cutler and B.L. Ramaker. Dynamic matrix control — a com-
puter control algorithm. In Proceedings, Joint American Control Con-
ference, San Francisco, 1980.

[CRSV90] J.E. Cuthrell, D.E. Rivera, W.J. Schmidt, and J.A. Vergeais. Solution
to the Shell standard control problem. In Prett et al. [PGR90].

[CS83] T.S. Chang and D.E. Seborg. A linear programming approach to mul-
tivariable feedback control with inequality constraints. International
Journal of Control, 37:583–597, 1983.

[DG91] H. Demircioglu and P.J. Gawthrop. Continuous-time generalised pre-


dictive control. Automatica, 27:55–74, 1991.

[DG92] H. Demircioglu and P.J. Gawthrop. Multivariable continuous-time


generalised predictive control. Automatica, 28:697–713, 1992.

[DH99] C.E.T. Dorea and J.C. Hennet. (A,B)-invariant polyhedral sets of


linear discrete-time systems. Journal of Optimization Theory and
Applications, 103:521–542, 1999.

[DOP95] F.J. Doyle, B.A. Ogunaike, and R.K. Pearson. Nonlinear model-based
control using second-order volterra models. Automatica, 31:697–714,
1995.
324 REFERENCES

[Doy78] J.C. Doyle. Guaranteed margins for LQG regulators. IEEE Transac-
tions on Automatic Control, AC-23:756–757, 1978.

[DS81] J.C. Doyle and G. Stein. Multivariable feedback design: concepts


for a classical/modern synthesis. IEEE Transactions on Automatic
Control, AC-26:4–16, 1981.

[Fle87] R.R. Fletcher. Practical Methods of Optimization. Wiley, 2nd edition,


1987.

[FPEN94] G.F. Franklin, J.D. Powell, and A. Emami-Naeini. Feedback Control


of Dynamic Systems. Addison-Wesley, 3rd edition, 1994.

[Fra74] P.M. Frank. Entwurf von Regelkreisen mit vorgeschriebenem Verhal-


ten. G. Braun, Karlsruhe, 1974.

[GBMR98] M. Gopinathan, J.D. Boskovic, R.K Mehra, and C. Rago. A multiple


model predictive scheme for fault-tolerant flight control design. In
Proc. 37th IEEE Conference on Decision and Control, Tampa, USA,
1998.

[GDSA98] P.J. Gawthrop, H. Demircioglu, and I. Siller-Alcala. Multivariable


continuous-time generalised predictive control: a state-space approach
to linear and nonlinear systems. IEE Proceedings, Part D, 145:241–
250, 1998.

[GK95] E.G. Gilbert and I. Kolmanovsky. Maximal output admissible sets


for discrete-time systems with disturbance inputs. In Proceedings,
American Control Conference, pages 2000–2005, 1995.

[GKT95] E.G. Gilbert, I. Kolmanovsky, and K.T. Tan. Discrete-time reference


governors and the nonlinear control of systems with state and control
constraints. International Journal of Robust and Nonlinear Control,
5:487–504, 1995.

[GL89] G.H. Golub and C.F. Van Loan. Matrix Computations. Johns Hopkins
University Press, Baltimore, MD, 2nd edition, 1989.

[GM82] C.E. Garcia and M. Morari. Internal model control 1. a unifying


review and some new results. Ind.Eng.Chem. Process Design and
Development, 21:308–323, 1982.

[GM86] C.E. Garcia and A.M. Morshedi. Quadratic programming solution of


dynamic matrix control (QDMC). Chemical Engineering Communi-
cations, 46:73–87, 1986.

[GMR99] M. Gopinathan, R.K Mehra, and J.C. Runkle. A model predictive


fault-tolerant control scheme for hot isostatic pressing furnaces. In
Proc. American Control Conference, San Diego, 1999.
REFERENCES 325

[GMW81] P.E. Gill, W. Murray, and M.H. Wright. Practical Optimization. Aca-
demic Press, London, 1981.
[GN93] H. Genceli and M. Nikolau. Robust stability analysis of constrained
`1 -norm model predictive control. American Institute of Chemical
Engineers’ Journal, 39:1954–1965, 1993.
[GT91] E.G. Gilbert and K.T. Tan. Linear systems with state and control
constraints: the theory and application of maximal output admissible
sets. IEEE Transactions on Automatic Control, 36:1008–1020, 1991.
[GZ92] G. Gattu and E. Zafiriou. Nonlinear quadratic dynamic matrix control
with state estimation. Ind. Eng. Chem. Research, 31:1096–1104, 1992.
[HM97] M. Huzmezan and J.M. Maciejowski. Notes on filtering, robust track-
ing and disturbance rejection used in model based predictive control
schemes. In Preprints, 4th IFAC Conference on System Structure and
Control, Bucharest, October, pages 238–243, 1997.
[HM98] M. Huzmezan and J.M. Maciejowski. Reconfiguration and scheduling
in flight using quasi-LPV high-fidelity models and MBPC control. In
Proc. American Control Conference, Philadelphia, 1998.
[Kai80] T. Kailath. Linear Systems. Prentice Hall, 1980.
[Kal64] R.E. Kalman. When is a linear control system optimal? Journal of
Basic Engineering (Trans. ASME D), 86:51–60, 1964.
[KBM96] M.V. Kothare, V. Balakrishnan, and M. Morari. Robust constrained
model predictive control using linear matrix inequalities. Automatica,
32, 1996.
[KBM+ 00] E.C. Kerrigan, A. Bemporad, D. Mignone, M. Morari, and J.M. Ma-
ciejowski. Multi-objective prioritisation and reconfiguration for the
control of constrained hybrid systems. In Proceedings, American Con-
trol Conference, Chicago, June 2000.
[KG88] S.S. Keerthi and E.G. Gilbert. Optimal infinite-horizon feedback laws
for a general class of constrained discrete-time systems: stability and
moving-horizon approximations. Journal of Optimization Theory and
Applications, 57:265–293, 1988.
[KGC96] J.C. Kantor, C.E. Garcia, and B. Carnahan, editors. Conference on
Chemical Process Control, CPC V, Tahoe City, 1996.
[Kle70] D. Kleinman. An easy way to stabilise a linear constant system. IEEE
Transactions on Automatic Control, AC-15, 1970.
[KM00a] E.C. Kerrigan and J.M. Maciejowski. Invariant sets for constrained
nonlinear discrete-time systems with application to feasibility in
model predictive control. In Proceedings, IEEE Control and Decision
Conference, Sydney, December 2000.
326 REFERENCES

[KM00b] E.C. Kerrigan and J.M. Maciejowski. Soft constraints and exact
penalty functions in model predictive control. In Control 2000 Con-
ference, Cambridge, September 2000.

[KP75] W.H. Kwon and A.E. Pearson. On the stabilization of a discrete


constant linear system. IEEE Transactions on Automatic Control,
AC-20, 1975.

[KP77] W.H. Kwon and A.E. Pearson. A modified quadratic cost problem
and feedback stabilization of a linear system. IEEE Transactions on
Automatic Control, AC-22:838–842, 1977.

[KR72] H. Kwakernaak and R.Sivan. Linear Optimal Control Systems. Wiley,


New York, 1972.

[KR92] B. Kouvaritakis and J.A. Rossiter. Stable generalized predictive con-


trol. IEE Proceedings, Part D, 139:349–362, 1992.

[KRSar] B. Kouvaritakis, J.A. Rossiter, and J. Schuurmans. Efficient robust


predictive control. IEEE Transactions on Automatic Control, To ap-
pear.

[Kun78] S.Y. Kung. A new low-order approximation algorithm via singu-


lar value decomposition. In Proc. 12th Asilomar Conf. on Cir-
cuits,Systems and Computers, 1978.

[LC96] J.H. Lee and B. Cooley. Recent advances in model predictive control
and other related areas. In Kantor et al. [KGC96].

[LD99] G.P. Liu and S. Daley. Output-model-based predictive control of un-


stable combustion systems using neural networks. Control Engineer-
ing Practice, 7:591–600, 1999.

[Lee00] J.H. Lee. Modeling and identification for nonlinear model predictive
control: requirements, current status and future research needs. In
Allgöwer and Zheng [AZ00], pages 269–293.

[LEL92] M.J. Liebman, T.F. Edgar, and L.S. Lasdon. Efficient data reconcili-
ation and estimation for dynamic processes using nonlinear program-
ming techniques. Computers in Chemical Engineering, 16:963–986,
1992.

[LGM92] J.H. Lee, M.S. Gelormino, and M. Morari. Model predictive control
of multi-rate sampled-data systems: a state-space approach. Interna-
tional Journal of Control, 55:153–191, 1992.

[Lju89] L. Ljung. System Identification: Theory for the User. Prentice Hall,
1989.
REFERENCES 327

[LKB98] G.P. Liu, V. Kadirkamanathan, and S.A. Billings. Predictive control


for non-linear systems using neural networks. International Journal
of Control, 71:1119–1132, 1998.
[LLF89] S. Li, K.Y. Lim, and D.G. Fisher. A state space formulation for
model predictive control. American Institute of Chemical Engineers’
Journal, 35:241–249, 1989.
[LLMS95] P. Lundström, J.H. Lee, M. Morari, and S. Skogestad. Limitations of
dynamic matrix control. Computers in Chemical Engineering, 19:409–
421, 1995.
[LMG94] J.H. Lee, M. Morari, and C.E. Garcia. State-space interpretation of
model predictive control. Automatica, 30:707–717, 1994.
[LP95] P. Lu and B.L. Pierson. Aircraft terrain following based on a non-
linear predictive control approach. Journal of Guidance, Control and
Dynamics, 18:817–823, 1995.
[LY94] J.H. Lee and Z.H. Yu. Tuning of model predictive controllers for
robust performance. Computers in Chemical Engineering, 18:15–37,
1994.
[LY97] J.H. Lee and Z.H. Yu. Worst-case formulations of model predictive
control for systems with bounded parameters. Automatica, 33:763–
781, 1997.
[Mac85] J.M. Maciejowski. Asymptotic recovery for discrete-time systems.
IEEE Transactions on Automatic Control, AC-30:602–605, 1985.
[Mac89] J.M. Maciejowski. Multivariable Feedback Design. Addison-Wesley,
Wokingham,UK, 1989.
[Mac97] J.M. Maciejowski. Reconfiguring control systems by optimization. In
Proc. 4’th European Control Conference, Brussels, 1997.
[Mac98] J.M. Maciejowski. The implicit daisy-chaining property of con-
strained predictive control. Applied Mathematics and Computer Sci-
ence, 8:695–711, 1998.
[Mat] The Mathworks. The LMI Toolbox for Matlab.
[May96] D.Q. Mayne. Nonlinear model predictive control: an assessment. In
Kantor et al. [KGC96].
[MHER95] E.S. Meadows, M.A. Henson, J.W. Eaton, and J.B. Rawlings. Re-
ceding horizon control and discontinuous state feedback stabilization.
International Journal of Control, 62:1217–1229, 1995.
[MKGW00] R.H. Miller, I. Kolmanovsky, E.G. Gilbert, and P.D. Washabaugh.
Control of constrained nonlinear systems: a case study. IEEE Control
Systems Magazine, 20(1):23–32, February 2000.
328 REFERENCES

[ML98] M. Mahfouf and D.A. Linkens. Generalised Predictive Control and


Bioengineering. Taylor and Francis, 1998.

[ML99] M. Morari and J.H. Lee. Model predictive control: past, present and
future. Computers and Chemical Engineering, 23:667–682, 1999.

[MM90] D.Q. Mayne and H. Michalska. Receding horizon control of nonlinear


systems. IEEE Transactions on Automatic Control, AC-35:814–824,
1990.

[MM93] H. Michalska and D.Q. Mayne. Robust receding horizon control of


constrained nonlinear systems. IEEE Transactions on Automatic
Control, 38:1623–1633, 1993.

[Mor94] M. Morari. Model predictive control: multivariable control technique


of choice in the 1990s? In Clarke [Cla94].

[Mos95] E. Mosca. Optimal, Predictive, and Adaptive Control. Prentice Hall,


1995.

[MR93a] K.R. Muske and J.B. Rawlings. Linear model predictive control of
unstable processes. Journal of Process Control, 3:85, 1993.

[MR93b] K.R. Muske and J.B. Rawlings. Model predictive control with linear
models. American Institute of Chemical Engineers’ Journal, 39:262–
287, 1993.

[MR95] M. Morari and N.L. Ricker. Model Predictive Control Toolbox: User’s
Guide. The Mathworks, 1995.

[MRRS00] D.Q. Mayne, J.B. Rawlings, C.V. Rao, and P.O.M. Scokaert. Con-
strained model predictive control: stability and optimality. Automat-
ica, 36:789–814, 2000.

[MS97a] L. Magni and R. Sepulchre. Stability margins of nonlinear receding-


horizon control via inverse optimality. Systems and Control Letters,
32:241–245, 1997.

[MS97b] D.Q. Mayne and W.R. Schroeder. Robust time-optimal control of


constrained linear systems. Automatica, 33:2103–2118, 1997.

[MZ88] M. Morari and E. Zafiriou. Robust Process Control. Prentice Hall,


1988.

[MZ89] E. Mosca and G. Zappa. ARX modeling of controlled ARMAX plants


and LQ adaptive controllers. IEEE Transactions on Automatic Con-
trol, 34:371–375, 1989.

[NL89] R.B. Newell and P.L. Lee. Applied Process Control — A Case Study.
Prentice Hall, New York, 1989.
REFERENCES 329

[NN94] J.E. Nesterov and A.S Nemirovsky. Interior Point Polynomial Meth-
ods in Convex Programming: Theory and Applications. SIAM,
Philadelphia, 1994.

[Nor86] J.P. Norton. An Introduction to Identification. Academic Press, New


York, 1986.

[NP97] V. Nevistic and J.A. Primbs. Finite receding horizon control: A gen-
eral framework for stability and performance analysis. Technical Re-
port AUT 97-06, Automatic Control Laboratory, ETH Zurich, 1997.

[NRPH00] M. Nørgaard, O. Ravn, N.K. Poulsen, and L.K. Hansen. Neural Net-
works for Modelling and Control of Dynamic Systems. Springer, Lon-
don, 2000.

[OB94] N.M.C.de Oliveira and L.T. Biegler. Constraint handling and stability
properties of model predictive control. American Institute of Chemical
Engineers’ Journal, 40:1138–1155, 1994.

[OC93] A.W. Ordys and D.W. Clarke. A state-space description for GPC
controllers. International Journal of Systems Science, 24:1727–1744,
1993.

[PG88] D.M. Prett and C.E. Garcia. Fundamental Process Control. Butter-
worths, Boston, 1988.

[PGR90] D.M. Prett, C.E. Garcia, and B.L. Ramaker, editors. The Second
Shell Process Control Workshop. Butterworths, Boston, 1990.

[PHGM97] G. Papageorgiou, M. Huzmezan, K. Glover, and J.M. Maciejowski.


Combined MBPC/H∞ autopilot for a civil aircraft. In American Con-
trol Conference, 1997.

[PLR+ 98] K. Preuß, M-V. LeLann, J. Richalet, M. Cabassud, and G. Casamatta.


Thermal control of chemical batch reactors with predictive functional
control. Journal A, 39:13–20, 1998.

[PM87] D.M. Prett and M. Morari, editors. The Shell Process Control Work-
shop. Process Control Research: Industrial and Academic Perspec-
tives. Butterworths, Boston, 1987.

[PRC82] D.M. Prett, B.L. Ramaker, and C.R. Cutler. Dynamic matrix control
method. United States Patent 4349869, 1982.

[Pro63] A.I. Propoi. Use of linear programming methods for synthesising


sampled-data automatic systems. Automation and Remote Control,
24:837–844, 1963.

[PSRJG00] S. Piché, B. Sayyar-Rodsari, D. Johnson, and M. Gerules. Nonlin-


ear model predictive control using neural networks. IEEE Control
Systems Magazine, 20(3):53–62, June 2000.
330 REFERENCES

[QB96] S.J. Qin and T.A. Badgwell. An overview of industrial model predic-
tive control technology. In Kantor et al. [KGC96], pages 232–256.

[QB99] S.J. Qin and T.A. Badgwell. An overview of nonlinear model pre-
dictive control applications. In Allgöwer and Zheng [AZ00], pages
369–392.

[Ray89] W. H. Ray. Advanced Process Control. Butterworths, Boston, 1989.

[ReADAK87] J. Richalet, S. Abu el Ata-Doss, C. Arber, and H.B. Kuntze. Predic-


tive functional control: application to fast and accurate robots. In
Proc. IFAC World Congress, Munich, 1987.

[Ric85] N.L. Ricker. Use of quadratic programming for constrained inter-


nal model control. Ind.Eng.Chem. Process Design and Development,
24:925–936, 1985.

[Ric90] N.L. Ricker. Model predictive control with state estimation.


Ind.Eng.Chem. Research, 29:374–382, 1990.

[Ric91] J. Richalet. Pratique de l’Identification. Editions Hermès, Paris, 1991.

[Ric93a] J. Richalet. Industrial applications of model based predictive control.


Automatica, 29, 1993.

[Ric93b] J. Richalet. Pratique de la Commande Prédictive. Editions Hermès,


Paris, 1993.

[RK93] J.A. Rossiter and B. Kouvaritakis. Constrained stable generalized


predictive control. Proc. Insitution of Electrical Engineers, Part D,
140:243–254, 1993.

[RM82] R. Rouhani and R.K. Mehra. Model algorithmic control (MAC): basic
theoretical properties. Automatica, 18:401–414, 1982.

[RM93] J.B. Rawlings and K.R. Muske. The stability of constrained receding
horizon control. IEEE Transactions on Automatic Control, 38:1512–
1516, 1993.

[RM00] C.A. Rowe and J.M. Maciejowski. Tuning MPC using H∞ loop shap-
ing. In Proceedings, American Control Conference, Chicago, 2000.

[Ros71] H.H. Rosenbrock. Good, bad or optimal? IEEE Transactions on


Automatic Control, 1971.

[Row97] C.A. Rowe. The fault-tolerant capabilities of constrained model pre-


dictive control. M.Phil. thesis, Cambridge Univeristy, 1997.

[RPG92] D.E. Rivera, J.F. Pollard, and C.E. Garcia. Control-relevant prefilter-
ing: a systematic design approach and case study. IEEE Transactions
on Automatic Control, 37:964–974, 1992.
REFERENCES 331

[RR99a] C.V. Rao and J.B. Rawlings. Nonlinear moving horizon estimation.
In Allgöwer and Zheng [AZ00].

[RR99b] C.V. Rao and J.B. Rawlings. Steady states and constraints in model
predictive control. American Institute of Chemical Engineers’ Jour-
nal, 45:1266–1278, 1999.

[RRK98] J.A. Rossiter, M.J. Rice, and B. Kouvaritakis. A numerically robust


state-space approach to stable predictive control strategies. Automat-
ica, 34:65–73, 1998.

[RRTP78] J. Richalet, A. Rault, J.L. Testud, and J. Papon. Model predictive


heuristic control: applications to industrial processes. Automatica,
14:413–428, 1978.

[RTV97] C. Roos, T. Terlaky, and J-Ph. Vial. Theory and Algorithms for Linear
Optimization — An Interior Point Approach. Wiley, Chichester, 1997.

[RWR98] C.V. Rao, S.J. Wright, and J.B. Rawlings. Application of interior-
point methods to model predictive control. Journal of Optimization
Theory and Applications, 99:723–757, 1998.

[Rya82] E.P. Ryan. Optimal Relay and Saturating Control System Synthesis.
Peter Peregrinus, Stevenage, UK, 1982.

[SA77] M.G. Safonov and M. Athans. Gain and phase margin for multi-
loop LQG regulators. IEEE Transactions on Automatic Control, AC-
22:173–179, 1977.

[SA87] G. Stein and M. Athans. The LQG/LTR procedure for multivariable


feedback control design. IEEE Transactions on Automatic Control,
32:105–113, 1987.

[San76] J.M. Martin Sanchez. Adaptive predictive control system. United


States Patent 4197576, 1976.

[San98] D.J. Sandoz. Perspectives on the industrial exploitation of model


predictive control. Measurement + Control, 31:113–117, 1998.

[SB98] G.J. Sutton and R.R. Bitmead. Experiences with model predictive
control applied to a nonlinear constrained submarine. In Proceedings,
37th IEEE Conference on Decisions and Control, Tampa, Florida,
December 1998.

[Sco97] P.O.M. Scokaert. Infinite horizon generalized predictive control. In-


ternational Journal of Control, 66:161–175, 1997.

[SCS93] A. Saberi, B.M. Chen, and P. Sannuti. Loop Transfer Recovery: Anal-
ysis and Design. Springer, 1993.
332 REFERENCES

[SD94] P.O.M. Scokaert and D.W.Clarke. Stability and feasibility in con-


strained predictive control. In Clarke [Cla94].

[SM98] P.O.M. Scokaert and D.Q. Mayne. Min-max feedback model predic-
tive control for constrained linear systems. IEEE Transactions on
Automatic Control, 43:1136–1142, 1998.

[Smi57] O.J.M. Smith. Close control of loops with deadtime. Chemical Engi-
neering Progress, 53:217–?, 1957.

[SMR99] P.O.M. Scokaert, D.Q. Mayne, and J.B. Rawlings. Suboptimal model
predictive control (feasibility implies stability). IEEE Transactions
on Automatic Control, 44:648–654, 1999.

[SMS92] D.S. Shook, C. Mohtadi, and S.L. Shah. A control-relevant identifi-


cation strategy for GPC. IEEE Transactions on Automatic Control,
37:975–980, 1992.

[Soe92] R. Soeterboek. Predictive Control: a Unified Approach. Prentice Hall,


New York, 1992.

[SR95] P.O. Scokaert and J.B. Rawlings. Receding horizon recursive state
estimation. In Proc. IFAC Symposium on Nonlinear Control Systems,
Tahoe City, USA, 1995.

[SR96a] J.M. Martin Sanchez and J. Rodellar. Adaptive Predictive Control.


Prentice Hall, London, 1996.

[SR96b] P.O. Scokaert and J.B. Rawlings. Infinite horizon linear quadratic
control with constraints. In Proceedings, IFAC World Congress, pages
109–114, San Francisco, July 1996.

[SR99] P.O.M. Scokaert and J.B. Rawlings. Feasibility issues in linear model
predictive control. American Institute of Chemical Engineers’ Jour-
nal, 45:1649–1659, 1999.

[SSD95] S.N. Singh, M. Steinberg, and R.D. DiGirolamo. Nonlinear predic-


tive control of feedback linearizable systems and flight control system
design. Journal of Guidance, Control and Dynamics, 18:1023–1028,
1995.

[SW97] H.J. Sussmann and J.C. Willems. 300 years of optimal control: from
the brachystochrone to the maximum principle. IEEE Control Sys-
tems Magazine, 17:32–44, 1997.

[TC88] T.T.C. Tsang and D.W. Clarke. Generalised predictive control with
input constraints. IEE Proceedings, Part D, 135:451–460, 1988.

[Ter96] T. Terlaky, editor. Interior Point Methods of Mathematical Program-


ming. Kluwer Academic, Dordrecht, 1996.
REFERENCES 333

[TM99] M.L. Tyler and M. Morari. Propositional logic in control and moni-
toring problems. Automatica, 35:565–582, 1999.

[vdBdV95] T.J.J. van den Boom and R.A.J. de Vries. Constrained predictive
control using a time-varying Youla parameter: a state space solution.
In Proceedings, European Control Conference, Rome, 1995.

[vOdM96] P. van Overschee and B. de Moor. Subspace Identification for Linear


Systems: Theory, Implementation, Applications. Kluwer Academic,
1996.

[VSJ99] J. Vada, O. Slupphaug, and T.A. Johansen. Efficient infeasibility han-


dling in linear MPC subject to prioritised constraints. In Proceedings,
European Control Conference, Karlsruhe, Germany, 1999.

[Won74] M. Wonham. Linear Multivariable Systems. Springer, Berlin, 1974.

[Wri96] S.J. Wright. Applying new optimization algorithms to model predic-


tive control. In Kantor et al. [KGC96].

[Wri97] S.J. Wright. Primal-Dual Interior-Point Methods. SIAM, Philadel-


phia, 1997.

[YP93] T.H. Yang and E. Polak. Moving horizon control of nonlinear systems
with input saturations, disturbances and plant uncertainties. Inter-
national Journal of Control, pages 875–903, 1993.

[Zaf90] E. Zafiriou. Robust model predictive control of processes with hard


constraints. Computers in Chemical Engineering, 14:359–371, 1990.

[ZAN73] V. Zakian and U. Al-Naib. Design of dynamical and control systems


by the method of inequalities. Proceedings, Institution of Electrical
Engineers, 120:1421–1427, 1973.

[ZB93] Y.C. Zhu and T. Backx. Identification of Multivariable Industrial


Processes for Simulation, Diagnosis and Control. Springer, London,
1993.

[ZC96] E. Zafiriou and H-W. Chiou. On the dynamic resiliency of constrained


processes. Computers in Chemical Engineering, 20:347–355, 1996.

[ZDG96] K. Zhou, J.C. Doyle, and K. Glover. Robust and Optimal Control.
Prentice Hall, New York, 1996.

[Zhu98] Y. Zhu. Multivariable process identification for MPC: the asymptotic


method and its applications. Journal of Process Control, 8:101–115,
1998.

[ZM74] H.P. Zeiger and A.J. McEwen. Approximate linear realization of given
dimension via Ho’s algorithm. IEEE Transactions on Automatic Con-
trol, AC-19:153, 1974.
334 REFERENCES

[ZM93] A. Zheng and M. Morari. Robust stability of constrained model pre-


dictive control. In Proceedings, American Control Conference, San
Francisco, pages 379–383, 1993.

[ZM95a] A. Zheng and M. Morari. On control of linear unstable systems with


constraints. In Proceedings, American Control Conference, Seattle,
1995.

[ZM95b] A. Zheng and M. Morari. Stability of model predictive control


with mixed constraints. IEEE Transactions on Automatic Control,
40:1818–1823, 1995.
Appendix A

Some Commercial MPC


Products

In this chapter we describe briefly some aspects of commercial predictive control


products available from several vendors: Aspentech’s DMCPlus, Honeywell’s RM-
PCT, Simulation Sciences Inc’s Connoisseur, Adersa’s PFC and HIECON, ABB’s
3DMPC. Most of these products are designed for the needs of the process indus-
tries, and they have been used predominantly in the petrochemical sector, whereas
Adersa’s products — particularly PFC — have been developed for a wider range of
applications, including servomechanisms with fast dynamics. We concentrate here
on relating these products to the theoretical material presented earlier in this book
— what cost functions are used, what constraints can be defined and how are they
treated, what are the tuning parameters. But it should be appreciated that much
of their value lies in aspects which are not emphasised here: how they interface
with other control software, particularly the real-time distributed control systems
used in the process industries, what kinds of modelling facilities they provide, what
support for commissioning and maintenance is provided by the vendors, what user
interfaces they provide, etc. In particular, most of these products are very strongly
influenced by the ‘culture’ of control practice in the process industries — this is pre-
dominantly a culture in which human operators are entrusted with running plants,
in which they are accustomed to having considerable authority over how their plants
are controlled, and in which they expect to remain ‘in the loop’ at some level. All
the products go to impressive lengths to support plant operators in their traditional
role, rather than trying to replace them.

Usually these predictive control products are implemented on top of a conventional


control layer. That is, the outputs of the predictive control algorithms are usually
set-points of conventional low-level controllers, such as flow controllers, tempera-
ture controllers, and pressure controllers. The objective of all the predictive control
products is to increase profitability of operation beyond that obtained by the exist-
ing conventional controllers. So if unusual conditions are encountered, in which a

335
336 A. Some Commercial MPC Products

predictive controller has trouble controlling the plant, then the operators have the
option of switching the controller off — which does not mean that the plant is left
uncontrolled, but that it is returned to the relative safety of conventional low-level
control. It will be appreciated that if operated in this way, some of the issues treated
earlier in the book, such as guarantees of closed-loop stability, are not of paramount
importance.

These products, like most commercial products, undergo continuous development.


The descriptions given here are believed to be accurate at the time of writing, and
reflect the author’s understanding of the products. Their inclusion here does not
imply any recommendation by the author or the publisher, and the descriptions are
not claimed to be complete, as regards either the technical or the commercial features
of the products. It is hoped to update the information from time to time, and perhaps
expand the range of products covered, on this book’s web site, which contains links
to the vendors of these and other predictive control products.

A.1 Aspentech: DMCPlus

DMCPlus is a derivative of the product DMC, which is an acronym for Dynamic Ma-
trix Control. DMC was originally developed and patented by Shell [CR80], then fur-
ther developed and marketed by the DMC Corporation, a company which was later
acquired by Aspentech. DMC and DMCPlus are the most widely known and used of
the commercially-available predictive control products, with particularly deep pen-
etration of the petrochemicals sector. A variant of DMC, known as Quadratic DMC
or QDMC, was also developed by Shell, and there are some references to it in the
literature [GM86], but the commercial rights to it have been retained by Shell.

DMCPlus uses multivariable finite step response models to represent plant models,
as described in Chapter 4. An extension to these models allows integrators to be
modelled as well as asymptotically stable plants. When making predictions, the
disturbance model referred to earlier as the DMC model is used, namely any error
between the prediction of a current output and its latest measurement is assumed
to be due to an output disturbance, and that disturbance is assumed to remain
unchanged in the future. For variables which are outputs of integrators, the operator
is also allowed to define a ‘rotation factor’. This is essentially the slope of a line
used to correct the predictions of integrated outputs, so it is a means of correcting
mis-modelled integrator gains.

The predictive control law is computed in DMCPlus in two steps. First a set of
steady-state ‘target’ levels or set-points is computed for the controlled variables
(outputs). These are chosen on economic grounds, the operators having the ability
to supply information on the current economic value of achieving product of a given
quality, and on the current economic costs of the input variables (typically flows of
expensive goods). The cost function is linear in this step (which is possible because of
A.1. Aspentech: DMCPlus 337

the use of a linear model). Input and output constraints are imposed and respected
in this step. These are in the form of linear inequality constraints, so that the target
levels are chosen by solving an LP problem. It should be emphasised that, although
a ‘steady-state’ problem is being solved in this first step, and so only the steady-state
gain information from the model is needed, this problem is re-solved at the same rate
as the dynamic control, and it is re-solved on the basis of the latest measurements.
In order to solve a meaningful optimization problem, the LP solver must know the
‘current’ steady-state. But at any particular time, the process is unlikely to be in
steady state, so the dynamic model is used to compute what the steady-state would
be, if the inputs all remained at their current levels, and this steady-state is taken
as the ‘current’ one.

In the second step, a future control trajectory is computed, over a control horizon,
which is predicted to bring the plant outputs to the target levels computed by the
LP optimization. This is computed as the solution of a least-squares problem, which
includes quadratic penalisation of control moves (referred to in DMCPlus as ‘move
suppression’). Constraints are not imposed explicitly, but the penalty weights are
increased as the predicted inputs and/or outputs approach constraints. So in effect
‘soft constraints’ are imposed, by means of a kind of ‘penalty function’ approach —
see Chapter 5. The time horizon for driving the plant to the new targets is taken to
be the same as the prediction horizon. However, the dimension of the optimization
problem is kept relatively small by using ‘blocking’, namely non-uniform spacing of
the ‘decision times’ during this horizon.

The operators are asked to define two kinds of equal concern errors, ‘steady-state’
and ‘dynamic’. Essentially, they are asked to specify how big a deviation of each
controlled output beyond its constraint boundary causes them significant concern.
The ‘steady-state’ equal concern errors are used in the target-setting step, if the
LP problem is found to be infeasible. In this case one of two strategies is adopted:
either a ‘minimum distance’ solution is found, which minimises a weighted sum of
distances of targets from their constraint boundaries, with the weights reflecting the
equal concern errors; or the equal concern errors are used to define priorities for the
constraints, and the constraints with lowest priority are allowed to be violated, until
feasibility of the LP is re-established.

The ‘dynamic’ equal concern errors are used to implement soft constraints in the sec-
ond step of computing the solution. If an output approaches its constraint boundary,
then the weight associated with its error from its target in the least-squares prob-
lem is increased. At what point the increase begins, and how much the weight is
increased, depends on the equal concern errors.

Some support for the control of nonlinear processes is provided, primarily by the
availbaility of a number of invertible transformations, such as square-root or loga-
rithmic transformations, and facilities to define others. These are useful when the
process is essentially (close to) linear, except for nonlinear transformations of input
and output variables, due to factors such as valve characteristics. Also a kind of
338 A. Some Commercial MPC Products

gain-scheduling is available for nonlinear processes, providing that a nonlinear model


is available. Such a model is used to estimate the steady-state gains at the current
operating point, and these are used in the LP step of the control calculation.

A.2 Honeywell: RMPCT

The name RMPCT is an acronym for Robust Multivariable Predictive Control Tech-
nology, a product which has been developed by Honeywell.

A distinctive feature of RMPCT is that it implements the ‘zone’ or ‘funnel’ concept,


in which the objective of control is to keep plant outputs within defined regions,
rather than at specific set-points, as discussed in section 5.5. Each controlled output
has an allowed range or zone, defined by a lower limit and a higher limit. So long
as its value is within this range, it is not penalised in any way. If an output is
outside the range, a straight-line trajectory is constructed from its current value to
the nearest edge of the allowed range; the output variable is supposed to follow this
trajectory to the target zone. The time taken by this trajectory to hit the allowed
range is pre-determined for each controlled output, and it varies between 0 and
twice the open-loop settling time of that output. Whenever the output is predicted
to lie outside the ‘funnel’ formed by the target zone and this trajectory, its distance
from the edge of the funnel is defined to be an error. A quadratic cost function is
formed as a weighted sum-of-squares of these errors. Future inputs are chosen so
as to minimise this cost function, subject to constraints on input levels and moves.
The optimization problem to be solved is a QP problem, and an active set solution
strategy is used.

It can be seen that the ‘agressiveness’ with which an output is returned to its target
zone is determined by the slope of the edge of the ‘funnel’ which is constructed to
bring it back into the allowed range. Thus this edge serves as a straight-line reference
trajectory, combining this concept with the funnel concept. Conventional set-point
control of a variable is obtained by making the low and high limits the same for that
variable.

Feedforward to combat the effects of measured disturbances is handled in a similar


way. The effects of such disturbances on the controlled outputs are predicted, and
any output driven outside its allowed range is again driven back by reference to a
‘funnel’. But typically the funnels for feedforward slope more steeply than those for
recovery from unmeasured disturbances — namely those for correction by feedback
action — because feedforward action, being outside any feedback loop, can be more
agressive without risk of becoming unstable.

Like DMCPlus, the RMPCT controller is also organised in two levels, one for op-
timization and one for control. A steady-state model is used to find the optimal
steady-state for the process, on the assumption that the ‘current steady-state’ is the
A.2. Honeywell: RMPCT 339

currently-predicted steady-state. The cost function used for this purpose is a combi-
nation of the traditional linear cost function which captures the economic benefits of
producing particular quantities of various products and the economic costs of using
control inputs, with a quadratic function which represents the costs of moving away
from the currently-predicted steady-state inputs and outputs. Process variables can
appear in this cost function which do not appear in the cost function used for dy-
namic control, and vice versa. The steady-state optimization can be performed for
several process units simultaneously, and the results passed down to the individual
dynamic controllers. The interaction between the steady-state and the dynamic op-
timization is not the conventional one, of simply passing steady-state objectives to
the dynamic controller. Rather, the new steady-state values are included in the dy-
namic optimization, but with a variable weighting which allows the ‘strength’ with
which the process is pushed to the new steady-state to be varied. If it is recalled
that RMPCT encourages most controlled outputs to have target zones rather than
set-points, it will be appreciated that putting a low weighting on the steady-state
solution will result in the controller concentrating on correcting any predicted excur-
sions outside the target zones, but pushing the process to the desirable steady-state
when no such excursions are predicted.

The net result of this combination of steady-state and dynamic optimization is soft
constraints on controlled variables, with an inexact penalty function — that is, in
some circumstances zone boundary violations may occur even if there is a feasible
trajectory which avoids them.

RMPCT allows ‘blocking’ of the predicted control moves, so that the moves com-
puted by the optimization are not assumed to be spaced at equal intervals in the
control horizon.

The dynamic model used by RMPCT is a multivariable ARX model.

RMPCT attempts to increase the robustness of its controller to modelling errors


by using a number of strateges. The first of these is to introduce scaling of the in-
put and output variables, in order to optimize the conditioning of the optimization
problem. The idea is to reduce the sensitivity of the output trajectories to model
errors. A second strategy is to approximate the prediction model by one with bet-
ter conditioning, if the original model is ill-conditioned with respect to inversion.
This is done by identifying the active constraint set involved in the optimization,
performing a singular value decomposition (SVD) of the corresponding matrix, and
approximating it by discarding any very small singular values.1 The third strategy is
adjusting the internal model used by the controller. The controller corresponding to
a particular internal model is assessed by using simulation to evaluate the ‘ISE’, or
‘Integrated Squared Error’, criterion for a range of plant model errors. The internal
model is then adjusted in a kind of extremum-seeking process until one is found for
which the worst-case ISE criterion is the smallest.

1
Actually RMPCT computes a ‘URV’ decomposition rather than an SVD, in which U and V
are orthogonal, as in SVD, but R is triangular rather than diagonal.
340 A. Some Commercial MPC Products

A.3 Simulation Sciences: Connoisseur

Connoisseur has three control modes:

1. ‘LR’ or ‘Long-Range’ mode,

2. ‘QP-LR’ mode, a mixture of LR mode with QP mode,

3. QP mode, in which a QP problem is solved, although one with soft constraints.

In LR mode, a quadratic cost function is optimised, ignoring constraints at first.


Since a linear model is used, as usual, this is a ‘linear-quadratic’ (‘LQ’) problem,
for which a closed-form solution exists. This can be obtained by solving a Riccati
equation, from which a fixed-gain state feedback matrix can be obtained — see
Mini-Tutorial 7. The finite-horizon Riccati equation is iterated to convergence, so
in effect an infinite-horizon feedback law is applied. This approach does not require
open-loop predictions to be computed, but closed-loop predictions, with the fixed-
gain feedback law in place, are computed, in order to see whether any constraints
are likely to be violated. If such violations are predicted, then the weights in the
cost function are modified until no constraint violations are predicted.

In QP-LR mode, a quadratic cost function is optimised, taking into account (hard)
input constraints, while output constraints are ignored. As in LR mode, weights
are adjusted to remove any predicted output constraint violations. In QP mode,
both input and output constraints are included in the optimization problem. All
constraints are ‘soft’, an exact penalty function being used, with weights used to
define constraint violation priorities.

The motivation for having these different modes is reducing computational effort.
For example, in LR mode, the feedback gains need to be found only once, although
the iterative adjustment of set-points (if necessary) of course requires additional
computation. In QP-LR mode, the number of constraints is smaller than in QP
mode, so the optimal solution is easier to compute.

The quadratic cost function can be defined to penalise both control moves, and
deviations of the control input values from their target values, if these are defined.

As is the case with the other products summarised here, the optimization algorithm
assumes uneven intervals between predicted control moves, or ‘blocking factors’, over
the control horizon.

Connoisseur uses internal models in the ARX form, similar to those used by RM-
PCT. Recursive least-squares is used to estimate the order and parameters of the
model. Adaptive control is possible, the recursive estimator being used to update
the model continuously.
A.4. Adersa: PFC and HIECON 341

The model is of the form


A(z)y(k) = B(z)∆u(k) + C(z)∆v(k) (A.1)
where A(z), B(z), and C(z) are matrices of z-transform polynomials (or, equiv-
alently, polynomials in the difference operator), and v(k) is a vector of measured
disturbance variables. Disturbances are not modelled explicitly, but when predic-
tions are made, the model is used to predict output changes relative to the latest
measured outputs:
A(z)[ŷ(k + i) − y(k)] = B(z)∆û(k + i) + C(z)∆v̂(k + i) (A.2)
This is the same procedure as used in DMCPlus, and is equivalent to adopting
the ‘DMC disturbance model’, namely assuming that all disturbances are output
disturbances which will remain unchanged in the future.

The actual model used is slightly modified from the form given above, because
different sampling intervals are permitted for the input and output variables (and
measured disturbances).

Optimization of set-points is done by solving an LP problem, at a greater interval


than the control update interval. Typically, if the control update interval is a few
seconds, the interval between re-computing optimal set-points would be a few min-
utes. As usual, the LP problem does not consider information about the dynamics
of the process, so it needs to be given a ‘current’ steady-state. This is assumed to be
equal to the current set-points, since it is assumed that the plant would eventually
converge to these if they remained unchanged. This set-point optimization can be
done for the set-points of several dynamic controllers simultaneously, which achieves
a degree of coordination between these controllers, and should give better economic
performance than optimising the set-points separately would.

A.4 Adersa: PFC and HIECON

PFC is primarily a methodology, a particular way of doing predictive control, as


described in section 5.6, but it is also a product of the French company Adersa, which
implements this methodology. It differs from the other products described here in
not being originally developed for, or particularly targetted at, the petrochemical
industry, or even at process industries at all. As a result, it has been applied in a
wider range of applications than the other products.

A basic form of PFC is implemented in the Quantum programmable logic controller


(PLC) available from Modicon. The implementation complies with the IEC 1131-3
standard for controller software.

HIECON is an alternative product, based on the same methodology, but aimed


at multivariable applications, and offering a wider range of solution algorithms,
including full constrained optimization.
342 A. Some Commercial MPC Products

Successful applications of the Adersa products range from process applications such
as batch reactors, rolling mills, and milk dryers, to ‘servo’ applications such as fuel
injection in car engines, gun turret control, and attitude control of launchers and
missiles.

A.5 ABB: 3dMPC

ABB’s product uses state-space models and quadratic cost functions, so of all the
products described here it is the one whose technical framework is the closest to
the standard one described in this book. Hard constraints can be defined for inputs
(manipulated variables) and their rates of change, and these can be supplemented
by soft constraints which indicate desriable rather than mandatory ranges for the
inputs. Soft constraints can be defined on outputs (controlled variables), and these
can be prioritised.

Considerable support is available for system identification from operating data, in-
cluding direct identification of the state-space model using subspace methods, as an
option.

Nonlinear transformations of input and output signals are available, as in most of


the other products.

A.6 Pavilion Technologies Inc: Process Perfecter

Pavilion Technologies Inc offer a predictive control product which is aimed primarily
at applications in which the use of nonlinear models brings large avantages, or is for
some reason unavoidable. It is based on ‘black-box’ neural net models, and relies on
the assumption that all the significant nonlinearities show up as changes in steady-
state gains. A more detailed account of the technical basis of this product is given
in section 10.3.3.
Appendix B

MATLAB Program basicmpc

This is the complete listing of MATLAB program basicmpc. It is also available from
the web site: http://www.booksites.net/maciejowski/

%BASICMPC Basic Predictive Control without constraints. (Script file)


%
% Implements unconstrained MPC for stable SISO discrete-time system
% defined as LTI object.
%
% The following are editable parameters (most have defaults):
% Tref: Time constant of exponential reference trajectory
% Ts: Sampling interval
% plant: Plant definition (discrete-time SISO LTI object)
% model: Model definition (discrete-time SISO LTI object)
% P: Vector of coincidence points
% M: Control horizon
% tend: Duration of simulation
% setpoint: Setpoint trajectory (column vector) - length must exceed
% no of steps in simulation by at least max(P).
% umpast, uppast, ympast, yppast: Initial conditions of plant & model.
%
% Assumes Matlab 5.3. Uses Control Toolbox LTI object class.
% No other toolboxes required.

%% J.M.Maciejowski, 8 March 1999. Revised 22.3.99, 15.12.99.


%% Copyright(C) 1999. All Rights Reserved.
%% Cambridge University Engineering Department.

%%%%%%%%%%%%%%%%% PROBLEM DEFINITION:

343
344 B. MATLAB Program basicmpc

% Define time-constant of reference trajectory Tref:


Tref = 6;

% Define sampling interval Ts (default Tref/10):


if Tref == 0,
Ts = 1;
else
Ts = Tref/10;
end

% Define plant as SISO discrete-time ’lti’ object ’plant’


%%%%% CHANGE FROM HERE TO DEFINE NEW PLANT %%%%%
nump=1;
denp=[1,-1.4,0.45];
plant = tf(nump,denp,Ts);
%%%%% CHANGE UP TO HERE TO DEFINE NEW PLANT %%%%%
plant = tf(plant); % Coerce to transfer function form
nump = get(plant,’num’); nump = nump{:}; % Get numerator polynomial
denp = get(plant,’den’); denp = denp{:}; % Get denominator polynomial
nnump = length(nump)-1; % Degree of plant numerator
ndenp = length(denp)-1; % Degree of plant denominator
if nump(1)~=0, error(’Plant must be strictly proper’), end;
if any(abs(roots(denp))>1), disp(’Warning: Unstable plant’), end

% Define model as SISO discrete-time ’lti’ object ’model’


% (default model=plant):
%%%%% CHANGE FROM HERE TO DEFINE NEW MODEL %%%%%
model = plant;
%%%%% CHANGE UP TO HERE TO DEFINE NEW MODEL %%%%%
model = tf(model); % Coerce to transfer function form
numm = get(model,’num’); numm = numm{:}; % Get numerator polynomial
denm = get(model,’den’); denm = denm{:}; % Get denominator polynomial
nnumm = length(numm)-1; % Degree of model numerator
ndenm = length(denm)-1; % Degree of model denominator
if numm(1)~=0, error(’Model must be strictly proper’), end;
if any(abs(roots(denm))>1), disp(’Warning: Unstable model’), end

nump=[zeros(1,ndenp-nnump-1),nump]; % Pad numerator with leading zeros


numm=[zeros(1,ndenm-nnumm-1),numm]; % Pad numerator with leading zeros

% Define prediction horizon P (steps)(default corresponds to 0.8*Tref):


if Tref == 0,
P = 5;
else
P = round(0.8*Tref/Ts);
end
345

% Define control horizon (default 1):


M = 1;

% Compute model step response values over coincidence horizon:


stepresp = step(model,[0:Ts:max(P)*Ts]);
theta = zeros(length(P),M);
for j=1:length(P),
theta(j,:) = [stepresp(P(j):-1:max(P(j)-M+1,1))’,zeros(1,M-P(j))];
end
S = stepresp(P);

% Compute reference error factor at coincidence points:


% (Exponential approach of reference trajectory to set-point)
if Tref == 0, % Immediate jump back to set-point trajectory
errfac = zeros(length(P),1);
else
errfac = exp(-P*Ts/Tref);
end

%%%%%%%%%%%%%%%% SIMULATION PARAMETERS:

if Tref == 0,
tend = 100*Ts;
else
tend = 10*Tref; % Duration of simulation (default 10*Tref)
end
nsteps = floor(tend/Ts); % (Number of steps in simulation).
tvec = (0:nsteps-1)’*Ts; % Column vector of time points (first one 0)

% Define set-point (column) vector (default constant 1):


setpoint = ones(nsteps+max(P),1);

% Define vectors to hold input and output signals, initialised to 0:


uu = zeros(nsteps,1); % Input
yp = zeros(nsteps,1); % Plant Output
ym = zeros(nsteps,1); % Model Output

% Initial conditions:
umpast = zeros(ndenm,1);
uppast = zeros(ndenp,1);
ympast = zeros(ndenm,1); % For model response
yppast = zeros(ndenp,1); % For plant response

%%%%%%%%%%%%%%%% SIMULATION:
346 B. MATLAB Program basicmpc

for k=1:nsteps,

% Define reference trajectory at coincidence points:


errornow = setpoint(k)-yp(k);
reftraj = setpoint(k+P) - errornow*errfac;

% Free response of model over prediction horizon:


yfpast = ympast;
ufpast = umpast;
for kk=1:max(P), % Prediction horizon
ymfree(kk) = numm(2:nnumm+1)*ufpast-denm(2:ndenm+1)*yfpast;
yfpast=[ymfree(kk);yfpast(1:length(yfpast)-1)];
ufpast=[ufpast(1);ufpast(1:length(ufpast)-1)];
end

% Compute input signal uu(k):


if k>1,
dutraj = theta\(reftraj-ymfree(P)’);
uu(k) = dutraj(1) + uu(k-1);
else
dutraj = theta\(reftraj-ymfree(P)’);
uu(k) = dutraj(1) + umpast(1);
end

% Simulate plant:
% Update past plant inputs
uppast = [uu(k);uppast(1:length(uppast)-1)];
yp(k+1) = -denp(2:ndenp+1)*yppast+nump(2:nnump+1)*uppast; % Simulation
% Update past plant outputs
yppast = [yp(k+1);yppast(1:length(yppast)-1)];

% Simulate model:
% Update past model inputs
umpast = [uu(k);umpast(1:length(umpast)-1)];
ym(k+1) = -denm(2:ndenm+1)*ympast+numm(2:nnumm+1)*umpast; % Simulation
% Update past model outputs
ympast = [ym(k+1);ympast(1:length(ympast)-1)];

end % of simulation

%%%%%%%%%%%%%%%% PRESENTATION OF RESULTS:

disp(’***** Results from script file BASICMPC :’)


disp([’Tref = ’,num2str(Tref),’, Ts = ’,num2str(Ts),...
’ P = ’,int2str(P’),’ (steps), M = ’,int2str(M)])
347

diffpm = get(plant-model,’num’);
if diffpm{:}==0,
disp(’Model = Plant’)
else
disp(’Plant-Model mismatch’)
end

figure
subplot(211)
% Plot output, solid line and set-point, dashed line:
plot(tvec,yp(1:nsteps),’-’,tvec,setpoint(1:nsteps),’--’);
grid; title(’Plant output (solid) and set-point (dashed)’)
xlabel(’Time’)

subplot(212)
% plot input signal as staircase graph:
stairs(tvec,uu,’-’);
grid; title(’Input’)
xlabel(’Time’)
348 B. MATLAB Program basicmpc
Appendix C

The MPC Toolbox

C.1 General remarks

Most of the examples which appear in this book, after Chapter 1, were worked out
with the help of the Model Predictive Control Toolbox for MATLAB. This same
software (or other software with similar functionality) is needed for many of the
Problems.

A comprehensive User’s Guide is available for the Model Predictive Control Toolbox.
It includes a Tutorial section, and it is not proposed to repeat that material here.
But it may be useful to relate some of the material in that documentation to the
material in this book. Historically, predictive control was first developed for step-
response models of plants, and the layout of the User’s Guide reflects this:

• Chapter 2 of the Tutorial deals with step-response models,

• Chapter 3 deals with state-space models. (And with transfer function models,
since the Toolbox includes functions for converting transfer functions to state-
space models.)

This is in contrast with this book, which places much more emphasis on state-space
models than on other forms. Fortunately Chapter 3 of the User’s Guide is written
in such a way that it can be read without reading Chapter 2 first.

The Model Predictive Control Toolbox uses its own format for representing state-
space models, which is called the MOD format. There is also a special format for
representing step-response models. The Toolbox includes functions for converting
models to and from these special formats. Before starting to use the Model Predictive
Control Toolbox it is recommended that the following sections of the User’s Guide
should be read:

349
350 C. The MPC Toolbox

• 3.1: State-space models


• 3.1.1: MOD format
• 3.1.5: Converting state-space to MOD format
• 3.1.8 Converting MOD format to other model formats

It will be seen from section 3.1 of the Guide that the model assumed in the MPC
Toolbox is more general than the one which appears in the basic formulation intro-
duced in Chapter 2 of this book, having additional elements such as disturbances
and noise which are introduced in later chapters.

Unfortunately the variable names are also different. The approximate correspon-
dences are given in Table C.1. The correspondences are only approximate because,
for example, we distinguish between measured outputs y and controlled outputs z,
whereas the Toolbox stacks both controlled and uncontrolled outputs in the same
vector y, with the convention that the controlled outputs appear at the top of the
vector.
Entity Name in Name in
book Toolbox
State transition matrix A Φ
Input distribution matrix B Γu
Disturbance distribution matrix Bd Γd
Output matrix Cy and/or Cz C
Inputs  u  u
y
Outputs y
z
Measured disturbance dm d
Unmeasured disturbance du w and/or z
Prediction horizon Hp P
Control horizon Hu M
Tracking error weight Q(i) ywt
Control penalty weight R(i) uwt

Table C.1: Approximate correspondence of variables and parameters in this book


and in the MPC Toolbox User’s Guide.

The core functions which will be needed by readers are:

• smpccon: Solves unconstrained predictive control problem. In this case the


solution is a constant matrix.
(Reference: User’s Guide pages 201–204).
• smpcsim: Simulates solution of unconstrained problem, using result from smpccon.
(Reference: User’s Guide pages 213–220).
C.1. General remarks 351

• scmpc: Solves constrained predictive control problem with linear plant, and
simulates solution.
(Reference: User’s Guide pages 186–193).
• scmpcnl: Solves constrained predictive control problem with nonlinear plant
in the form of a Simulink model, and simulates solution. (The internal model
used by the MPC controller is linear.)
(Not described in User’s Guide, but interface similar to scmpc).

There are many other functions, described in the User’s Guide. The Tutorial section
of the Guide shows how to use the functions, and the examples which appear in the
Tutorial are also available as on-line demos.

The functions smpccon, scmpc and scmpcnl take the input argument M, which is used
to specify which input moves the optimiser can make. If M is a scalar (integer) then
it is just the control horizon, namely the same as our Hu . But if it is a row vector
then it specifies that blocking should be used: each element specifies the number
of steps over which ∆u = 0, or over which the input u remains unchanged. So
M=[m1,m2,m3] means that û(k|k) = û(k+1|k) = . . . = û(k+m1−1|k), û(k+m1|k) =
û(k + m1 + 1|k) = . . . = û(k + m1 + m2 − 1|k), etc.

There is no parameter corresponding to our Hw . The parameter P specifies the


prediction horizon (our Hp ) and implicitly the Model Predictive Control Toolbox
always assumes Hw = 1. However, the parameter which defines weights on tracking
errors, ywt, can represent weights which vary over the prediction horizon, with each
row representing one step. So we can get the effect of Hw = 3, for example, by
making the first 2 rows of ywt zero. Note that you can have fewer than Hp rows in
ywt; the last row specifies the weights to be used from that value of i onwards.

One significant restriction is that only diagonal tracking error weight matrices Q(i)
and control move penalty weight matrices R(i) can be specified. This is done through
the arguments ywt and uwt, respectively. The diagonal elements of Q(i) (R(i)
respectively) are represented by the i’th row of ywt (uwt respectively). There is no
way of representing off-diagonal elements, so these are always assumed to be zero.
This can be a restriction, for example if one wants to represent a Q(i) obtained as
the solution of a Lyapunov equation, as in section 6.2.1. Problem 7 of Chapter 3
asks you to modify smpccon so as to remove this restriction. The other functions
could be modified similarly.

The way in which the Model Predictive Control Toolbox handles set-points is quite
restricted. There is no distinction between set-point and reference signals, of the
kind we made in section 1.2, and have implemented in the MATLAB functions
basicmpc, trackmpc and unstampc. Tracking errors are always defined as being
differences between the set-point and output vectors. Furthermore, although it
is possible to define a set-point trajectory over the duration of a simulation, the
functions scmpc and scmpcnl do not make any use of future values of the set-point
when computing the control signals. That is, the optimization algorithm is not
352 C. The MPC Toolbox

aware, at each step, of what the future of the set-point trajectory will be, and just
assumes that it will be constant at its current value. The function scmpcr allows
the optimiser to use such information about the future; this can be exploited to
perform limited simulations of the effects of defining specific reference trajectories,
for example by defining exponential set-point trajectories. But it is not possible to
simulate, say, the use of a reference trajectory in the presence of disturbances.

Most of the arguments can be omitted, and then take sensible default values. How-
ever, if P is omitted it defaults to 1, which is not usually a sensible prediction
horizon. With all possible arguments set to default values one obtains what is some-
times called a ‘perfect controller’ — see section 7.2.4. But in fact there are a lot of
problems with such a controller.

Constraints are represented in the functions scmpc and scmpcnl by the arguments
ulim (constraints on u and ∆u) and ylim (constraints on y). Like the weight
parameters, each row of these corresponds to one step in the prediction or control
horizon, so that the constraints can vary over the horizons. The bounds on ∆u are
always assumed to be symmetric (−Uj ≤ ∆uj ≤ Uj ), and they must be specified to
be finite, although they may be very large.

The MPC Toolbox allows arbitrary disturbance and noise models to be defined, and
disturbances can be specified to be measured or unmeasured, with feedforward action
being applied if measured disturbances are present. If no disturbance or noise model
is specified then by default the DMC disturbance model is assumed, namely a step
disturbance on each output, with no measurement noise. Observer gains can also
be specified, the default observer gain being taken to be the optimal observer for
the DMC disturbance model, namely [0, I]T — see section 2.6.3. If a more elaborate
model is needed, there is a simplified way of specifying the disturbance/noise model
of Lee and Yu — see section 8.2. For other disturbance and noise models the user
must specify the dynamics as state-space models, but there are facilities which help
with building up the augmented model which includes the plant, disturbance and
noise dynamics.

The Model Predictive Control Toolbox also contains functions for frequency-response
analysis of predictive controllers, under the assumption that constraints are not
active. For example, singular value plots of various closed-loop transfer functions,
such as the sensitivity and complementary sensitivity — see section 7.3 — can be
obtained by using the functions clmod, mod2frsp and svdfrsp.

The method used to solve the QP problem which arises in functions scmpc and
scmpcnl is described in [Ric85].
C.2. Functions scmpc2 and scmpcnl2 353

C.2 Functions scmpc2 and scmpcnl2

Modified versions of the functions scmpc and scmpcnl are available on this book’s
web site. These modified functions have the names scmpc2 and scmpcnl2, respec-
tively, and the modifications extend the functionality of the original functions in the
following ways.

1. Non-default observer gains can be used. Although this is also possible with
the standard functions scmpc and scmpcnl, those provide no facility for initial-
ising the observer state. When simulating a plant with non-zero initial state
(a common requirement particularly when using scmpcnl) and using a non-
default observer gain, it is important to be able to specify the initial observer
state. This possibility has been added.

2. It is possible to continue a previously-interrupted simulation. This is enabled


by providing additional input arguments for specifying the initial states of
the plant and observer, and the initial input values. Also the specification
of the initial time has been enabled — it does not always have to be 0. This
facility gives important additional functionality to the Model Predictive Control
Toolbox. It allows a simulation to be interrupted, some changes to be made,
and the simulation to be resumed. This allows, for example:

• Time-dependent weights and constraints. The standard functions allow


dependence on i, but not k. The modified functions allow dependence on
both.
• State-dependent weights and constraints.
• Modification of the linear internal model during a simulation run. With
a nonlinear plant this allows the linearised model used for prediction to
be updated from time to time. It could also be used to simulate adaptive
MPC.

It is anticipated that this feature will be mostly used to interrupt and resume
a simulation occasionally, but it is also possible to interrupt it at every step
— that is, to perform one step of the simulation, make suitable updates, then
perform one more step, etc.

3. Soft constraints on outputs have been implemented. It is possible to specify


a 1-norm, 2-norm, or ∞-norm penalty, or a mixture of 1-norm and 2-norm
penalties. It is also possible to specify different values of penalty coefficient (ρ
in the notation of section 3.4) for different outputs. A new function qpsoft
has been written to help implement this new functionality, and is used by the
modified functions.

Table C.2 lists the additional input arguments which have been made available in
functions scmpc2 and scmpcnl2.
354 C. The MPC Toolbox

Argument Purpose
xm0 Initial observer state
tvec Specification of start and end times of simulation
(replaces tend)
suwt, sywt Specified penalty coefficient on constraint violations
normtype Specifies 1-norm 2-norm, ∞-norm, or mixed-norm penalty for constraint violations

Table C.2: Additional or modified input arguments available in functions scmpc2


and scmpcnl2.

C.3 Functions scmpc3 and scmpc4

Function scmpc2 has been further modified to allow simulation with exponential
reference trajectories, as described in section 7.5. Function scmpc3 implements
reference trajectories without anticipation of future set-point changes (see Figure
7.17), while scmpc4 assumes that future set-point changes are known, and anticipates
them (see Figure 7.18).

Both functions have an additional argument, Tref, which is a vector of time con-
stants, one for the reference trajectory of each controlled output. Zero values are
allowed, which indicates that the reference trajectory coincides with the set-point
trajectory.
Author Index

Abu el Ata-Doss, S., 30, 177 de Oliveira, N.M.C., 111, 112


Al-Naib, U., 5 de Vries, R.A.J., 204
Anderson, B.D.O., 90, 247 Demircioglu, H., 181, 182
Arber, C., 30, 177 Diehl, M., 313
Åström, K.J., 45, 141, 146, 239 DiGirolamo, R.D., 319
Athans, M., 250–252 Dorea, C.E.T., 266
Doyle, F.J., 313
Backx, T., 45 Doyle, J.C., 131, 133, 168, 203, 204,
Badgwell, T.A., 88, 174, 312, 318 220, 242, 251, 252, 281, 289
Balakrishnan, V., 107, 243, 256–259, Dua, V., 99
261, 262, 267
Barratt, C., 94, 204 Edgar, T.F., 318
Bemporad, A., 99, 166, 235, 269, 270, El Ghaoui, L., 107, 256, 259
310, 311, 318 Emami-Naeini, A., 6, 44, 58
Bequette, B.W., 312
Berenguel, M., 30 Feron, E., 107, 256, 259
Biegler, L.T., 111, 112 Fletcher, R.R., 94, 100, 108, 112
Billings, S.A., 314 Franklin, G.F., 6, 44, 58
Bitmead, R.R., 90, 147, 190, 196, 198,
200–202, 247, 250, 252, 319 Garcia, C.E., 45, 56, 119, 121, 133,
Bock, H.G., 313 161, 222, 242–244, 246, 250,
Bordons, C., 30, 133, 147, 158, 188 273, 280, 336
Boskovic, J.D., 307 Gattu, G., 312
Boyd, S., 94, 107, 204, 256, 259 Gawthrop, P.J., 181, 182
Bryson, A.E., 32, 33, 90, 200, 247 Genceli, H., 266
Gerules, M., 314, 315
Camacho, E.F., 30, 133, 147, 158, 188 Gevers, M., 90, 147, 190, 196, 198,
Campo, P.J., 172, 243, 266 200–202, 247, 250, 252
Casavola, A., 235 Gilbert, E.G., 187, 190, 235, 264–266
Chang, T.S., 168 Gill, P.E., 94
Chen, B.M., 252 Glover, K., 131, 133, 168, 203, 204,
Chou, C.T., 157 220, 242, 281, 289, 319
Clarke, D.W., 25, 30, 121, 155, 212, Golub, G.H., 87, 103, 131
213, 226 Gopinathan, M., 307
Coales, J.F., 27
Cutler, C.R., 27, 64, 121, 336 Hansen, L.K., 314
Hennet, J.C., 266
Daley, S., 314 Ho, Y-C., 32, 33, 90, 200, 247
de Moor, B., 45, 135 Huzmezan, M., 234, 312, 319

355
356 AUTHOR INDEX

Johansen, T.A., 311 Morari, M., 99, 133, 166, 172, 191,
Johnson, D., 314, 315 222, 243, 244, 246, 250, 256–
258, 261, 262, 266, 267, 273,
Kadirkamanathan, V., 314 274, 289, 309–311, 318
Kailath, T., 58, 69, 129, 137 Morshedi, A.M., 336
Kalman, R.E., 250 Mosca, E., 45, 146, 147, 151, 158, 188,
Keerthi, S.S., 187, 190 198, 200, 235, 314
Kerrigan, E.C., 112, 270, 311 Murray, W., 94
Kleinman, D., 27 Muske, K.R., 165, 190, 193, 194, 308
Kolmanovsky, I., 235, 266
Kothare, M.V., 243, 256–258, 261, 262, Nemirovsky, A.S., 100, 107
267 Nesterov, J.E., 100, 107
Kouvaritakis, B., 115, 165, 166, 191, Newell, R.B., 295, 296
192, 204, 270 Nikolau, M., 266
Kung, S.Y., 132 Norton, J.P., 45, 135
Kuntze, H.B., 30, 177 Noton, A.R.M., 27
Kwakernaak, H., 33, 200, 247 Nørgaard, M., 314
Kwon, W.H., 27
Ogunaike, B.A., 313
Lasdon, L.S., 318 Ordys, A.W., 155
Lee, J.H., 133, 221, 243, 244, 246, 248,
250, 267, 314 Papageorgiou, G., 319
Lee, P.L., 295, 296 Papon, J., 27, 175, 177
Leineweber, D., 313 Pearson, A.E., 27
Liebman, M.J., 318 Pearson, R.K., 313
Linkens, D.A., 319 Piché, S., 314, 315
Liu, G.P., 314 Pierson, B.L., 319
Ljung, L., 45, 135 Pistikopoulos, E.N., 99
Lu, P., 319 Pollard, J.F., 45
Poulsen, N.K., 314
Maciejowski, J.M., 26, 87, 112, 131, Powell, J.D., 6, 44, 58
133, 157, 168, 197, 203, 204, Prett, D.M., 27, 56, 64, 119, 121, 161,
220, 234, 242, 251, 252, 256, 242, 273, 274, 280, 289
270, 281, 289, 305, 311, 312, Propoi, A.I., 27
319
Magni, L., 202 Qin, S.J., 88, 174, 312, 318
Mahfouf, M., 319
Martin Sanchez, J.M., 27, 45 Rago, C., 307
Mayne, D.Q., 190, 202, 264, 267, 269, Ramaker, B.L., 27, 64, 121, 336
315, 316 Rao, C.V., 2, 63, 107, 110, 190, 202,
McEwen, A.J., 132 318
Mehra, R.K., 27, 307 Rault, A., 27, 175, 177
Michalska, H., 190, 264, 269, 315 Ravn, O., 314
Mignone, D., 311, 318 Rawlings, J.B., 2, 63, 107, 110, 112,
Miller, R.H., 235 116, 165, 190, 191, 193, 194,
Mohtadi, C., 25, 45, 121, 212, 213 202, 250, 256, 264, 308, 315,
Moore, J.B., 90, 247 316, 318
AUTHOR INDEX 357

Redhead, S.N., 232 Vada, J., 311


Rice, M.J., 165, 166 van den Boom, T.J.J., 204
Richalet, J., 9, 18, 25, 27, 30, 45, 166, van Loan, C.F., 87, 103, 131
175, 177, 180, 231 van Overschee, P., 45, 135
Ricker, N.L., 56, 352 Vial, J-Ph., 2, 100, 107
Rivera, D.E., 45
Rodellar, J., 45 Washabaugh, P.D., 235
Roos, C., 2, 100, 107 Wertz, V., 90, 147, 190, 196, 198, 200–
Rosenbrock, H.H., 251 202, 247, 250, 252
Rossiter, J.A., 115, 165, 166, 191, 192, Willems, J.C., 33
204, 270 Wittenmark, B., 45, 141, 146
Rouhani, R., 27 Wonham, M., 222
Rowe, C.A., 256, 306 Wright, M.H., 94
Runkle, J.C., 307 Wright, S.J., 2, 63, 100, 103, 105, 107,
Ryan, E.P., 28 109, 110

Yu, Z.H., 221, 243, 244, 246, 248, 267


Saberi, A., 252
Safonov, M.G., 250 Zafiriou, E., 222, 312
Sandoz, D.J., 319 Zakian, V., 5
Sannuti, P., 252 Zeiger, H.P., 132
Sayyar-Rodsari, B., 314, 315 Zheng, A., 243, 266
Schlöder, J., 313 Zhou, K., 131, 133, 168, 203, 204, 220,
Schuurmans, J., 270 242, 281, 289
Scokaert, P.O.M., 112, 116, 165, 190, Zhu, Y.C., 45
191, 198, 202, 250, 256, 264,
267, 269, 315, 316, 318
Seborg, D.E., 168
Sepulchre, R., 202
Shah, S.L., 45
Shook, D.S., 45
Siller-Alcala, I., 181, 182
Singh, S.N., 319
Sivan, R., 33, 200, 247
Slupphaug, O., 311
Smith, O.J.M., 28
Soeterboek, R., 121, 141, 147, 207, 231
Stein, G., 251, 252
Steinberg, M., 319
Sussmann, H.J., 33
Sutton, G.J., 319

Tan, K.T., 235, 264, 265


Terlaky, T., 2, 100, 107
Testud, J.L., 27, 175, 177
Tuffs, P.S., 25, 121
Tyler, M.L., 309
Index

absolute value cost, 168, 171 clipping, 180, 184


active constraints, 95, 99, 101, 105, closed-loop transfer function, 204
106, 210, 219, 225, 235, 339 coincidence horizon, 176
active set method, 100, 101, 338 coincidence point, 9, 47, 173–175, 178,
actuator failure, 305 179, 280, 314
actuator saturation, 6 complementarity condition, 101, 109
adaptive control, 30, 45, 139, 185, 250, complementary sensitivity, 209, 219, 220,
305, 314, 340 225, 241, 248, 256, 271, 288,
additive uncertainty, 240, 290 352
alternative state variables, 133 compressor control, 3
analytic centre, 108 computational complexity, 107, 114, 279,
applications of MPC, 318 304, 309
ARX model, 137, 158, 339, 340 computational delay, 56, 59, 79
Åström’s robustness result, 239 Connoisseur, 340
augmented state vector, 54, 59, 64, 67, constrained optimization, 32, 34, 92
79, 150, 155, 199, 228 constraints, 1, 2, 4, 13, 34, 46, 49, 73,
auto-compensation, 177, 179 91, 94, 110, 180, 195, 197, 210,
277
backslash operator, 12, 14, 89
equality, 95, 100, 102, 104, 304
balanced realization, 280
management, 110, 308, 319, 337
balanced truncation, 133, 281
priorities, 311, 337, 340, 342
banded matrix, 103–105, 110
robust satisfaction, 256
bandwidth, 248, 254, 256
violation, 116, 311
barrier function, 107, 108
window, 308
basis function, 175
continuity of MPC controller, 99
Bezout identity, 141
continuous time, 15, 37
black-box model, 7, 45, 313
continuous-time predictive control, 181–
block-Hankel matrix, 128, 130, 133
182
blocking, 39, 118, 282, 301, 337, 339,
control hierarchy, 28
340, 351
control horizon, 47, 175, 179, 199, 248,
Bode plot, 220
280, 282
case study control invariant set, 269
evaporator, 295–300 control weight, 283, 292
Shell oil fractionator, 273–293 controllability matrix, 130, 132
Cauchy-Schwarz inequality, 262 controlled output, 41, 46, 122, 274, 296,
causality constraint, 267 350
central path, 108, 109 controller form, 129
certainty equivalence principle, 90, 147 convex hull, 243

358
INDEX 359

convex optimization, 2, 93, 94, 102, examples


204, 256, 259, 269, 314 buffer tank, 5, 6
convolution, 123, 124 Citation aircraft, 71–76, 79, 112,
coprime factor, 168, 183 115, 120
uncertainty, 241 helicopter, 26, 155, 183
coprime polynomial, 141 internal combustion engine, 4
correlated disturbances, 249 LNG plant, 306
cost function, 46, 47, 83, 119 paper machine headbox, 51–52, 214,
CRHPC, 188 219, 222, 236
current practice, 28 semi-batch reactor, 3
surge level control, 6
danger of feedback, 208 swimming pool, 117, 183, 184, 226–
data reconciliation, 318 231, 236
deadbeat, 25, 67, 71, 132, 155, 165, underwater vehicles, 4
192
fake
control, 212, 217
algebraic Riccati equation, 198–202
observer, 211, 215, 225, 235
Hamilton-Jacobi-Bellman equation,
decomposition of unstable plant, 166
202
decrescent function, 187, 189
fault-tolerant control, 305, 307
deterministic disturbance, 142, 145
feasibility, 166, 194, 257, 263
difference equation, 135, 137, 153
feasible problem, 187, 193
differential-algebraic equation, 313
feasible solution, 102, 106, 107
Diophantine equation, 140, 141, 143,
feasible SQP, 313
146
feed-through, 42
discrete time, 44
feedback, 22, 25
disturbance
feedback policy, 267
large, 102, 110, 115
feedforward, 35, 161–164, 183, 226, 273,
on state, 253
280, 284, 338, 352
sinusoidal, 118
finite impulse response, 129, 132, 138,
unmeasured, 285
165, 204, 243
disturbance model, 221, 223, 226, 243,
finite precision, 62, 165
249, 279, 352
finitely determined, 265
disturbance rejection, 276
first-principles model, 7, 45, 46, 133,
DMC, 27, 28, 64, 67, 68, 121, 123, 142, 305, 313
177, 215, 222, 223, 243, 246, fixed point, 189
305, 308, 336, 341, 352 flight control, 7, 30, 71
dual-mode predictive control, 190, 315 free response, 10, 84, 146
dynamic matrix, 123 frequency response, 210, 218, 220, 244,
249, 352
ellipsoid, 261, 270
Frobenius norm, 131
EPSAC, 28
funnel, 173, 179, 338
equal concern error, 337
equilibrium, 43, 187, 189, 296 gain scheduling, 338
Euclidean norm, 48 Gaussian elimination, 103
evaporator, 295–300 global optimum, 94, 102, 188, 193, 311,
exact penalty function, 112, 115, 286 316
360 INDEX

GPC, 25, 28, 35, 121, 148, 150, 152, Kalman filter, 65, 90, 151, 202, 226,
155, 160, 166, 188, 202, 222, 227, 245–247, 249, 250, 253,
226, 235, 248 317
extended, 317
H-infinity Karush-Kuhn-Tucker conditions, 100,
control, 166, 256 102, 109
norm, 240
Hankel matrix, 128, 130, 133 Lagrange multiplier, 95, 100–102, 106,
Hankel singular value, 280, 281 112, 115, 313
Hessian, 85, 94, 313 Lagrangian, 312
HIECON, 341 large disturbance, 115
high-bandwidth applications, 1, 99 least-squares, 10, 12, 14, 86, 115, 132,
historical data, 315 303, 317
hot starting, 106, 316 recursive, 340
hybrid system, 310 Lee and Yu tuning, 243, 352
lexicographic minimum, 311
ideal resting value, 49, 304
limits on feedback performance, 210
IEC 1131-3 standard, 341
linear controller, 89, 96, 171
IEEE Standard arithmetic, 62
linear inequality, 265
ill-conditioned problem, 88, 108
linear matrix inequality, 107, 256, 259,
impulse response, see pulse response
262, 270
independent model, 18, 24, 69, 155
induced norm, 131, 220 linear programming, 94, 106, 168, 169,
infeasibility, 93, 110, 113, 263, 286, 308 171, 173, 183, 265, 303, 311,
infinite horizon, 166, 190, 194, 195, 337
197, 200, 250, 255, 256 linear quadratic control, 166, 199, 200,
∞-norm 250, 318
cost, 172 linearised model, 43, 44, 46, 59
penalty, 111 local optimum, 94
information filter, 202 loop transfer recovery, 249–256
innovations representation, 151 dual procedure, 252
input constraints, 110 LQG design, 249
input disturbance, 80, 273 LTR, see loop transfer recovery
integral action, 22, 128, 148, 222, 223, LU factorisation, 103
254 Lyapunov
integrated white noise, 253 equation, 195, 198, 199, 351
integrator wind-up, 6, 180, 318 function, 187, 189, 191, 194, 263
interior point method, 100, 107 stability theorem, 189, 316
internal model, 7, 9, 34, 193, 203, 283,
297, 299, 312 manipulated variable, 273, 296
control, 222 Markov parameter, 125
principle, 222, 223 MATLAB file
internal stability, 203, 214 basicmpc.m, 15–18
invariant set, 261, 264 disturb2.m, 120
inverse response, 213 evaporator.mdl, 297, 302
makecita, 79
Jordan decomposition, 197 mismatch2.m, 120
INDEX 361

mkdelta.m, 290 multivariable system, 179, 207, 220,


noisympc.m, 22 248
oilfr20.mat, 281 MUSMAR, 314
scmpc.m, 228 myths, 122
scmpc2.m, 301, 353
scmpc3.m, 234, 354 neural net model, 313, 314
scmpc4.m, 234, 354 nominal stability, 193
scmpcnl.m, 297 non-diagonal weights, 119
scmpcnl2.m, 297, 353 non-Gaussian distribution, 4
simevap.m, 300, 302 non-minimum-phase, 213, 252
smpcest.m, 228, 246 non-quadratic cost, 168, 316
swimpool.m, 231, 237 nonlinear
trackmpc.m, 20 controller, 4, 53, 95, 170
matrix inversion lemma, 152 model, 7, 44, 202, 311, 338
matrix square-root, 86 plant, 42, 295, 299
maximal output admissible set, 264, predictive control, 311, 337
266 nonlinear predictive control, 312
mean-level control, 211, 214, 280 norm-bounded uncertainty, 240, 261
measured disturbances, 161–164, 273 null space, 278
measured output, 41, 274, 350 Nyquist
measured outputs, 122, 149 frequency, 221, 250, 256, 288
measurement noise, 208, 225, 243, 255, stability theorem, 241
279, 289 observability matrix, 130, 132
min-max problem, 172–173, 258, 266, observer, 25, 34, 64–69, 90, 92, 140,
269 149, 151, 154, 155, 194, 211,
minimal state-space model, 130, 280 216, 247, 257, 279, 317, 352,
minimum variance, 145–147, 149 353
mixed logical dynamic system, 310, 311 dynamics, 221, 224–231
mixed penalty function, 112 polynomial, 149, 226, 248
mixed weighted least-squares, 115 off-line computation of controller, 99
mixed-integer optimization, 309, 311 offset-free tracking, 18, 25, 38, 155,
MLD, see mixed logical dynamic sys- 176, 179, 222, 243, 253, 287,
tem 304
MOD format, 349 1-norm
Model Predictive Control Toolbox, 155, cost, 172
160, 216, 228, 246, 349 penalty, 111, 113, 120
model reduction, 133 operator interface, 63
monic polynomial, 142 output admissible set, 264, 270
monotonicity property, 201, 202 output constraints, 110
move supression factor, 47, 211, 292 output disturbance, 63, 64, 67, 128,
moving-horizon estimation, 317 140, 142, 152, 177, 204, 208,
multiobjective optimization, 304, 311 222, 243, 246
multiparametric programming, 99 output measurement, 9
multiple shooting, 313
multiplicative uncertainty, 241, 271 penalty function, 337
multivariable control, 6, 34 ‘perfect’ control, 213, 218, 236, 352
362 INDEX

performance specification, 276 quadratic programming, 13, 93, 94, 100,


persistent disturbance, 222, 269 168, 169, 182, 191, 196, 312,
PFC, see predictive functional control 313, 317, 338, 352
PI control, 319 as LMI problem, 259
piecewise-linear controller, 99 special structure, 100, 107
pioneers of predictive control, 27
plant operator, 170, 244, 319, 335 ramp disturbance, 159
plant testing, 45 random walk, 148
plant uncertainty, 240 re-aligned model, 24, 69, 70, 139, 145,
plant-model mismatch, 18, 46, 76, 112, 152
113, 210, 263, 292 re-linearised model, 299, 312
pole placement, 166, 227 receding horizon, 7, 10, 34
polynomial set-point, 177 reference governor, 235
polytope, 243, 257, 260, 265 reference trajectory, 7, 34, 37, 46, 84,
uncertainty, 242, 256 175, 179–180, 231–235, 237, 338,
positive definite, 48, 189 351, 354
positively invariant set, 264, 315 regulator problem, 193
prediction, 46, 60, 67, 90, 125, 126, return ratio, 251, 253, 254, 256
137, 138, 141, 145, 149, 163, Riccati equation, 33, 198–201, 246, 247,
247 340
prediction horizon, 9, 47, 191, 199, 240, RMPCT, 174, 180, 338
248, 280 robust
predictive functional control, 28, 166, constraint satisfaction, 256
175–181, 313, 341 control, 220, 239, 288, 339
predictor-corrector, 140 disturbance compensation, 229
primal-dual method, 109 feasibility, 263, 270
principle of optimality, 191 performance, 242
priority of objective, 304, 311 stability, 220, 241, 256, 257, 263,
Process Perfecter, 314, 342 289
profit maximisation, 6 rotation factor, 336
programmable logic controller, 341
propositional logic, 309, 310 sampling interval, 56, 279, 297
pseudo-inverse, 131 sampling time, 279
pulse response, 13, 121, 138, 141 scaling of variables, 282, 339
uncertainty, 243 semi-positive definite, 48
purpose of feedback, 208 sensitivity, 209, 219, 220, 225, 237, 240,
248, 256, 288, 352
QDMC, 28, 336 sensor failure, 305
QP, see quadratic programming separation principle, 90, 147
QR algorithm, 87, 89 sequential quadratic programming, 312
quadratic servomechanism, 30, 177, 335, 342
cost, 46 set-point, 7
form, 48 filtering, 234–235
inequality, 259 settling time, 240
model, 315 Shell oil fractionator, 273–293
penalty function, 111 simplex, 94
INDEX 363

Simulink, 295, 296, 351 set, 190, 269, 315


singular value, 130, 131, 133, 220, 241, terminal cost, 190, 196, 201, 202
288, 293, 352 3dMPC, 342
decomposition, 130, 131, 339 time delay, 136, 279, 282
structured, 242, 291, 293 time-invariant controller, 53, 54
SIORHC, 188 tracking error, 84, 88, 90, 164, 234
slack variable, 110, 112, 114, 311 transfer function, 35, 121, 135, 279,
small-gain theorem, 241 349
Smith predictor, 28 matrix, 136
soft constraints, 110–116, 120, 174, 263, tuning, 35, 207–237, 255
286, 292, 308, 311, 337, 339, tuning parameters, 49, 60, 68, 150, 207,
340, 353 221, 244, 297
spectral density, 142, 253 two degree of freedom system, 208
SQP, see sequential quadratic program-
ming unconstrained predictive control, 83–
stabilised predictions, 63, 164, 270 91, 208
stability, 35, 185–206, 316, 336 unstable closed loop, 186
asymptotic, 189 unstable mode, 194, 197, 198
margin, 210, 220, 250, 251 unstable plant, 23, 38, 67, 71, 148, 155,
164, 166, 185, 194, 197, 198,
of equilibrium, 189
204, 208, 211, 246, 249, 254
state estimate, 46, 68, 90, 92, 149, 151,
unstructured uncertainty, 242
163, 194, 225, 247, 249, 312
state feedback, 164, 200, 249, 256, 260, variable horizon, 264
261, 269 Volterra model, 313
state-space model, 34, 41, 124, 279,
349 web site, iv, 15, 234, 281, 290, 297,
steady state, 43, 314 301, 302, 336, 353
gain, 122, 278, 303, 304 weighted norm, 48
optimization, 29, 339 white noise, 137, 142
step response, 13, 35, 121, 208, 239,
275, 279, 336, 349 Youla parameter, 203, 204
stochastic disturbance, 142, 145, 151,
zone, 5, 50, 173, 277, 282, 285, 302,
243, 245
338
strictly proper model, 9, 13, 42, 136,
278
structured uncertainty, 242, 256, 275,
290
subspace methods, 135, 342
surge line, 3
SVD, see singular value decomposition
system identification, 45, 46, 135, 314,
315

Taylor series, 314


terminal constraint, 187, 190, 192, 196,
197, 202, 269, 316

You might also like