Professional Documents
Culture Documents
Model Predictive Control Theory Computation and Design 2Nd Edition Rawlings James B Full Chapter
Model Predictive Control Theory Computation and Design 2Nd Edition Rawlings James B Full Chapter
Model Predictive Control Theory Computation and Design 2Nd Edition Rawlings James B Full Chapter
ISBN 9780975937730
9 780975 937730
Model Predictive Control:
Theory, Computation, and Design
2nd Edition
James B. Rawlings
Department of Chemical Engineering
University of California
Santa Barbara, California, USA
David Q. Mayne
Department of Electrical and Electronic Engineering
Imperial College London
London, England
Moritz M. Diehl
Department of Microsystems Engineering and
D
Department of Mathematics
University of Freiburg
Freiburg, Germany
b Hi
No ll Publishing
First Edition
First Printing August 2009
Electronic Download November 2013
Electronic Download (2nd) April 2014
Electronic Download (3rd) July 2014
Electronic Download (4th) October 2014
Electronic Download (5th) February 2015
Second Edition
First Printing October 2017
Electronic Download October 2018
Electronic Download (2nd) February 2019
To Cheryl, Josephine, and Stephanie,
In the eight years since the publication of the first edition, the field
of model predictive control (MPC) has seen tremendous progress. First
and foremost, the algorithms and high-level software available for solv-
ing challenging nonlinear optimal control problems have advanced sig-
nificantly. For this reason, we have added a new chapter, Chapter 8,
“Numerical Optimal Control,” and coauthor, Professor Moritz M. Diehl.
This chapter gives an introduction into methods for the numerical so-
lution of the MPC optimization problem. Numerical optimal control
builds on two fields: simulation of differential equations, and numeri-
cal optimization. Simulation is often covered in undergraduate courses
and is therefore only briefly reviewed. Optimization is treated in much
more detail, covering topics such as derivative computations, Hessian
approximations, and handling inequalities. Most importantly, the chap-
ter presents some of the many ways that the specific structure of opti-
mal control problems arising in MPC can be exploited algorithmically.
We have also added a software release with the second edition of
the text. The software enables the solution of all of the examples and
exercises in the text requiring numerical calculation. The software is
based on the freely available CasADi language, and a high-level set of
Octave/MATLAB functions, MPCTools, to serve as an interface to CasADi.
These tools have been tested in several MPC short courses to audiences
composed of researchers and practitioners. The software can be down-
loaded from www.chemengr.ucsb.edu/~jbraw/mpc.
In Chapter 2, we have added sections covering the following topics:
• economic MPC
• MPC with discrete actuators
We also present a more recent form of suboptimal MPC that is prov-
ably robust as well as computationally tractable for online solution of
nonconvex MPC problems.
In Chapter 3, we have added a discussion of stochastic MPC, which
has received considerable recent research attention.
In Chapter 4, we have added a new treatment of state estimation
with persistent, bounded process and measurement disturbances. We
have also removed the discussion of particle filtering. There are two
vi
vii
viii
ix
JBR DQM
Madison, Wisconsin, USA London, England
Acknowledgments
Both authors would like to thank the Department of Chemical and Bio-
logical Engineering of the University of Wisconsin for hosting DQM’s
visits to Madison during the preparation of this monograph. Funding
from the Paul A. Elfers Professorship provided generous financial sup-
port.
JBR would like to acknowledge the graduate students with whom
he has had the privilege to work on model predictive control topics:
Rishi Amrit, Dennis Bonné, John Campbell, John Eaton, Peter Findeisen,
Rolf Findeisen, Eric Haseltine, John Jørgensen, Nabil Laachi, Scott Mead-
ows, Scott Middlebrooks, Steve Miller, Ken Muske, Brian Odelson, Mu-
rali Rajamani, Chris Rao, Brett Stewart, Kaushik Subramanian, Aswin
Venkat, and Jenny Wang. He would also like to thank many colleagues
with whom he has collaborated on this subject: Frank Allgöwer, Tom
Badgwell, Bhavik Bakshi, Don Bartusiak, Larry Biegler, Moritz Diehl,
Jim Downs, Tom Edgar, Brian Froisy, Ravi Gudi, Sten Bay Jørgensen,
Jay Lee, Fernando Lima, Wolfgang Marquardt, Gabriele Pannocchia, Joe
Qin, Harmon Ray, Pierre Scokaert, Sigurd Skogestad, Tyler Soderstrom,
Steve Wright, and Robert Young.
DQM would like to thank his colleagues at Imperial College, espe-
cially Richard Vinter and Martin Clark, for providing a stimulating and
congenial research environment. He is very grateful to Lucien Polak
and Graham Goodwin with whom he has collaborated extensively and
fruitfully over many years; he would also like to thank many other col-
leagues, especially Karl Åström, Roger Brockett, Larry Ho, Petar Koko-
tovic, and Art Krener, from whom he has learned much. He is grateful
to past students who have worked with him on model predictive con-
trol: Ioannis Chrysochoos, Wilbur Langson, Hannah Michalska, Sasa
Raković, and Warren Schroeder; Hannah Michalska and Sasa Raković,
in particular, contributed very substantially. He owes much to these
past students, now colleagues, as well as to Frank Allgöwer, Rolf Find-
eisen Eric Kerrigan, Konstantinos Kouramus, Chris Rao, Pierre Scokaert,
and Maria Seron for their collaborative research in MPC.
Both authors would especially like to thank Tom Badgwell, Bob Bird,
Eric Kerrigan, Ken Muske, Gabriele Pannocchia, and Maria Seron for
their careful and helpful reading of parts of the manuscript. John Eaton
x
xi
again deserves special mention for his invaluable technical support dur-
ing the entire preparation of the manuscript.
Added for the second edition. JBR would like to acknowledge the
most recent generation of graduate students with whom he has had the
privilege to work on model predictive control research topics: Doug Al-
lan, Travis Arnold, Cuyler Bates, Luo Ji, Nishith Patel, Michael Risbeck,
and Megan Zagrobelny.
In preparing the second edition, and, in particular, the software re-
lease, the current group of graduate students far exceeded expectations
to help finish the project. Quite simply, the project could not have been
completed in a timely fashion without their generosity, enthusiasm,
professionalism, and selfless contribution. Michael Risbeck deserves
special mention for creating the MPCTools interface to CasADi, and
updating and revising the tools used to create the website to distribute
the text- and software-supporting materials. He also wrote code to cal-
culate explicit MPC control laws in Chapter 7. Nishith Patel made a
major contribution to the subject index, and Doug Allan contributed
generously to the presentation of moving horizon estimation in Chap-
ter 4.
A research leave for JBR in Fall 2016, again funded by the Paul A.
Elfers Professorship, was instrumental in freeing up time to complete
the revision of the text and further develop computational exercises.
MMD wants to especially thank Jesus Lago Garcia, Jochem De Schut-
ter, Andrea Zanelli, Dimitris Kouzoupis, Joris Gillis, Joel Andersson,
and Robin Verschueren for help with the preparation of exercises and
examples in Chapter 8; and also wants to acknowledge the following
current and former team members that contributed to research and
teaching on optimal and model predictive control at the Universities of
Leuven and Freiburg: Adrian Bürger, Hans Joachim Ferreau, Jörg Fis-
cher, Janick Frasch, Gianluca Frison, Niels Haverbeke, Greg Horn, Boris
Houska, Jonas Koenemann, Attila Kozma, Vyacheslav Kungurtsev, Gio-
vanni Licitra, Rien Quirynen, Carlo Savorgnan, Quoc Tran-Dinh, Milan
Vukov, and Mario Zanon. MMD also wants to thank Frank Allgöwer, Al-
berto Bemporad, Rolf Findeisen, Larry Biegler, Hans Georg Bock, Stephen
Boyd, Sébastien Gros, Lars Grüne, Colin Jones, John Bagterp Jørgensen,
Christian Kirches, Daniel Leineweber, Katja Mombaur, Yurii Nesterov,
Toshiyuki Ohtsuka, Goele Pipeleers, Andreas Potschka, Sebastian Sager,
Johannes P. Schlöder, Volker Schulz, Marc Steinbach, Jan Swevers, Phil-
ippe Toint, Andrea Walther, Stephen Wright, Joos Vandewalle, and Ste-
fan Vandewalle for inspiring discussions on numerical optimal control
xii
xiii
xiv Contents
C Optimization 729
C.1 Dynamic Programming . . . . . . . . . . . . . . . . . . . . . 729
C.1.1 Optimal Control Problem . . . . . . . . . . . . . . . 731
C.1.2 Dynamic Programming . . . . . . . . . . . . . . . . . 733
C.2 Optimality Conditions . . . . . . . . . . . . . . . . . . . . . 737
C.2.1 Tangent and Normal Cones . . . . . . . . . . . . . . 737
C.2.2 Convex Optimization Problems . . . . . . . . . . . . 741
C.2.3 Convex Problems: Polyhedral Constraint Set . . . 743
C.2.4 Nonconvex Problems . . . . . . . . . . . . . . . . . . 745
C.2.5 Tangent and Normal Cones . . . . . . . . . . . . . . 746
C.2.6 Constraint Set Defined by Inequalities . . . . . . . 750
C.2.7 Constraint Set; Equalities and Inequalities . . . . . 753
C.3 Set-Valued Functions and Continuity of Value Function . 755
C.3.1 Outer and Inner Semicontinuity . . . . . . . . . . . 757
C.3.2 Continuity of the Value Function . . . . . . . . . . . 759
C.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
List of Figures
xxi
xxii List of Figures
5.1 State estimator tube. The solid line x̂(t) is the center of
the tube, and the dashed line is a sample trajectory of x(t). 342
5.2 The system with disturbance. The state estimate lies in
the inner tube, and the state lies in the outer tube. . . . . . 343
xxiv List of Figures
p p p+1 p+1
6.1 Convex step from (u1 , u2 ) to (u1 , u2 ). . . . . . . . . . 386
6.2 Ten iterations of noncooperative steady-state calculation. . 403
6.3 Ten iterations of cooperative steady-state calculation. . . . 403
6.4 Ten iterations of noncooperative steady-state calculation;
reversed pairing. . . . . . . . . . . . . . . . . . . . . . . . . . . 404
6.5 Ten iterations of cooperative steady-state calculation; re-
versed pairing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
6.6 Cooperative control stuck on the boundary of U under
coupled constraints . . . . . . . . . . . . . . . . . . . . . . . . 412
6.7 Cost contours for a two-player, nonconvex game. . . . . . . 422
6.8 Nonconvex function optimized with the distributed gra-
dient algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
6.9 Closed-loop state and control evolution with (x1 (0), x2 (0)) =
(3, −3). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
6.10 Contours of V (x(0), u1 , u2 ) for N = 1. . . . . . . . . . . . . . 432
6.11 Optimizing a quadratic function in one set of variables at
a time. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
6.12 Constrained optimality conditions and the normal cone. . 445
8.8 Direct single shooting solution for (8.63) without path con-
straints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
8.9 Open-loop simulation for (8.63) using collocation. . . . . . . 592
8.10 Gauss-Newton iterations for the direct multiple-shooting
method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594
xxvii
xxviii List of Examples and Statements
Mathematical notation
∃ there exists
∈ is an element of
∀ for all
=⇒ ⇐= implies; is implied by
=6 ⇒ ⇐=
6 does not imply; is not implied by
a := b a is defined to be equal to b.
a =: b b is defined to be equal to a.
≈ approximately equal
V (·) function V
V :A→B V is a function mapping set A into set B
x , V (x) function V maps variable x to value V (x)
x+ value of x at next sample time (discrete time system)
ẋ time derivative of x (continuous time system)
fx partial derivative of f (x) with respect to x
∇ nabla or del operator
δ unit impulse or delta function
|x| absolute value of scalar; norm of vector (two-norm unless
stated otherwise); induced norm of matrix
x sequence of vector-valued variable x, (x(0), x(1), . . .)
kxk sup norm over a sequence, supi≥0 |x(i)|
kxka:b max a≤i≤b |x(i)|
tr(A) trace of matrix A
det(A) determinant of matrix A
eig(A) set of eigenvalues of matrix A
ρ(A) spectral radius of matrix A, max i |λi | for λi ∈ eig(A)
A−1 inverse of matrix A
A †
pseudo-inverse of matrix A
A0 transpose of matrix A
inf infimum or greatest lower bound
min minimum
sup supremum or least upper bound
max maximum
xxxix
xl Notation
Symbols
A, B, C system matrices, discrete time, x + = Ax + Bu, y = Cx
Ac , Bc system matrices, continuous time, ẋ = Ac x + Bc u
Aij state transition matrix for player i to player j
Ai state transition matrix for player i
ALi estimate error transition matrix Ai − Li Ci
Bd input disturbance matrix
Bij input matrix of player i for player j’s inputs
Bi input matrix of player i
Cij output matrix of player i for player j’s interaction states
Ci output matrix of player i
Cd output disturbance matrix
C controllability matrix
C∗ polar cone of cone C
d integrating disturbance
E, F constraint matrices, F x + Eu ≤ e
f,h system functions, discrete time, x + = f (x, u), y = h(x)
fc (x, u) system function, continuous time, ẋ = fc (x, u)
F (x, u) difference inclusion, x + ∈ F (x, u), F is set valued
G input noise-shaping matrix
Gij steady-state gain of player i to player j
H controlled variable matrix
I(x, u) index set of constraints active at (x, u)
0
I (x) index set of constraints active at (x, u0 (x))
k sample time
K optimal controller gain
`(x, u) stage cost
`N (x, u) final stage cost
L optimal estimator gain
m input dimension
M cross-term penalty matrix x 0 Mu
M number of players, Chapter 6
M class of admissible input policies, µ ∈ M
n state dimension
N horizon length
O observability matrix, Chapters 1 and 4
O compact robust control invariant set containing the origin,
Chapter 3
p output dimension
xlii Notation
Greek letters
xlv
Another random document with
no related content on Scribd:
Bartlett—[Gruffly.] I’ve naught to forget—leastways naught that’s in
your mind. But they’s things about the stubborn will o’ woman I’d like to
forget. [They look at each other across the table. There is a pause. Finally
he cannot stand her accusing glance. He looks away, gets to his feet, walks
about, then sits down again, his face set determinedly—with a grim smile.]
Well, here we be, Sarah—alone together for the first time since—
Mrs. Bartlett—[Quickly.] Since that night, Isaiah.
Bartlett—[As if he hadn’t heard.] Since I come back to you, almost.
Did ye ever stop to think o’ how strange it be we’d ever come to this? I
never dreamed a day’d come when ye’d force me to sleep away from ye,
alone in a shed like a mangy dog!
Mrs. Bartlett—[Gently.] I didn’t drive you away, Isaiah. You came o’
your own will.
Bartlett—Because o’ your naggin’ tongue, woman—and the wrong ye
thought o’ me.
Mrs. Bartlett—[Shaking her head, slowly.]
It wasn’t me you ran from, Isaiah. You ran away from your own self—
the conscience God put in you that you think you can fool with lies.
Bartlett—[Starting to his feet—angrily.] Lies?
Mrs. Bartlett—It’s the truth, Isaiah, only you be too weak to face it.
Bartlett—[With defiant bravado.] Ye’ll find I be strong enough to face
anything, true or lie! [Then protestingly.] What call have ye to think evil o’
me, Sarah? It’s mad o’ ye to hold me to account for things I said in my
sleep—for the damned nightmares that set me talkin’ wild when I’d just
come home and my head was still cracked with the thirst and the sun I’d
borne on that island. Is that right, woman, to be blamin’ me for mad
dreams?
Mrs. Bartlett—You confessed the rest of what you said was true—of
the gold you’d found and buried there.
Bartlett—[With a sudden fierce exultation.] Aye—that be true as
Bible, Sarah. When I’ve sailed back in the schooner, ye’ll see for yourself.
There be a big chest o’ it, yellow and heavy, and fixed up with diamonds,
emeralds and sech, that be worth more, even, nor the gold. We’ll be rich,
Sarah—rich like I’ve always dreamed we’d be! There’ll be silks and
carriages for ye—all the woman’s truck in the world ye’ve a mind to want
—and all that Nat and Sue’ll want, too.
Mrs. Bartlett—[With a shudder.] Are you tryin’ to bribe me, Isaiah—
with a treasure that’s been cursed by God?
Bartlett—[As if he hadn’t heard.] D’ye remember long ago, back East,
just after we was married, and I was skipper o’ my first whalin’ ship, how
that foreigner come to me with the map o’ the pirates’ gold and asked me to
charter the ship? D’ye remember o’ how I’d talk to ye o’ findin’ ambergris,
a pile o’ it on one vige that’d make us rich? Ye used to take interest then,
and all th’ voyage with me ye’d be hopin’ I’d find it, too.
Mrs. Bartlett—That was my sin o’ greed that I’m bein’ punished for
now.
Bartlett—[Again as if he hadn’t heard.] And now when it’s come to us
at last—bigger nor I ever dreamed on—ye drive me away from ye and say
it’s cursed.
Mrs. Bartlett—[Inexorably.] Cursed with the blood o’ the man and
boy ye murdered!
Bartlett—[In a mad rage.] Ye lie, woman! I spoke no word!
Mrs. Bartlett—That’s what you kept repeatin’ in your sleep, night
after night that first week you was home, till I knew the truth, and could
bear no more. “I spoke no word!” you kept sayin’, as if ’twas your own soul
had you at the bar of judgment. And “That cook, he didn’t believe ’twas
gold,” you’d say, and curse him.
Bartlett—[Wildly.] He was lyin’, the thief! Lyin’ so’s he and the boy
could steal th’ gold. I made him own up he was lyin’. What if it’s all true,
what ye heard? Hadn’t we the right to do away with two thieves? And we
was all mad with thirst and sun. Can ye hold madmen to account for the
things they do?
Mrs. Bartlett—You wasn’t so crazed but you remember.
Bartlett—I remember I spoke no word, Sarah—as God’s my judge!
Mrs. Bartlett—But you could have prevented it with a word, couldn’t
you, Isaiah? That heathen savage lives in the fear of you. He’d not have
done it if——
Bartlett—[Gloomily.] That’s woman’s talk. There be three o’ us can
swear in any court I spoke no word.
Mrs. Bartlett—What are courts? Can you swear it to yourself? You
can’t, and it’s that’s drivin’ you mad, Isaiah. Oh, I’d never have believed it
of you for all you said in sleep, if it wasn’t for the way you looked and
acted out of sleep. I watched you that first week, Isaiah, till the fear of it had
me down sick. I had to watch you, you was so strange and fearful to me. At
first I kept sayin’, ’twas only you wasn’t rid o’ the thirst and the sun yet.
But then, all to once, God gave me sight, and I saw ’twas guilt written on
your face, on the queer stricken way you acted, and guilt in your eyes. [She
stares into them.] I see it now, as I always see it when you look at me. [She
covers her face with her hands with a sob.]
Bartlett—[His face haggard and drawn—hopelessly, as if he were too
beaten to oppose her further—in a hoarse whisper.] What would ye have
me do, Sarah?
Mrs. Bartlett—[Taking her hands from her face—her eyes lighting up
with religious fervor.] Confess your sin, Isaiah! Confess to God and men,
and make your peace and take your punishment. Forget that gold that’s
cursed and the voyage you be settin’ out on, and make your peace.
[Passionately.] I ask you to do this for my sake and the children’s, and your
own most of all! I’ll get down on my knees, Isaiah, and pray you to do it, as
I’ve prayed to God to send you his grace! Confess and wash your soul of
the stain o’ blood that’s on it. I ask you that, Isaiah—and God asks you—to
make your peace with Him.
Bartlett—[His face tortured by the inward struggle—as if the word
strangled him.] Confess and let someone steal the gold! [This thought
destroys her influence over him in a second. His obsession regains
possession of him instantly, filling him with rebellious strength. He laughs
harshly.] Ye’d make an old woman o’ me, would ye, Sarah?—an old,
Sunday go-to-meetin’ woman snivvelin’ and prayin’ to God for pardon!
Pardon for what? Because two sneakin’ thieves are dead and done for? I
spoke no word, I tell ye—but if I had, I’d not repent it. What I’ve done I’ve
done, and I’ve never asked pardon o’ God or men for ought I’ve done, and
never will. Confess, and give up the gold I’ve dreamed of all my life that
I’ve found at last! By thunder, ye must think I’m crazed!
Mrs. Bartlett—[Seeming to shrivel up on her chair as she sees she has
lost—weakly.] You be lost, Isaiah—no one can stop you.
Bartlett—[Triumphantly.] Aye, none’ll stop me. I’ll go my course
alone. I’m glad ye see that, Sarah.
Mrs. Bartlett—[Feebly trying to get to her feet.] I’ll go to home.
Bartlett—Ye’ll stay, Sarah. Ye’ve had your say, and I’ve listened to
ye; now I’ll have mine and ye listen to me. [Mrs. Bartlett sinks back in
her chair exhaustedly. Bartlett continues slowly.] The schooner sails at
dawn on the full tide. I ask ye again and for the last time, will ye christen
her with your name afore she sails?
Mrs. Bartlett—[Firmly.] No.
Bartlett—[Menacingly.] Take heed, Sarah, o’ what ye’re sayin’! I’m
your husband ye’ve sworn to obey. By right I kin order ye, not ask.
Mrs. Bartlett—I’ve never refused in anything that’s right—but this be
wicked wrong.
Bartlett—It’s only your stubborn woman’s spite makes ye refuse.
Ye’ve christened every ship I’ve ever been skipper on, and it’s brought me
luck o’ a kind, though not the luck I wanted. And we’ll christen this one
with your own name to bring me the luck I’ve always been seekin’.
Mrs. Bartlett—[Resolutely.] I won’t, Isaiah.
Bartlett—Ye will, Sarah, for I’ll make ye. Ye force me to it.
Mrs. Bartlett—[Again trying to get up.] Is this the way you talk to me
who’ve been a good wife to you for more than thirty years?
Bartlett—[Commandingly.] Wait! [Threateningly.] If ye don’t christen
her afore she sails, I’ll take Nat on the vige along with me. [Mrs. Bartlett
sinks back in her chair, stunned.] He wants to go, ye know it. He’s asked me
a hundred times. He s’spects—’bout the gold—but he don’t know for sartin.
But I’ll tell him the truth o’ it, and he’ll come with me, unless—
Mrs. Bartlett—[Looking at him with terror-stricken eyes—
imploringly.] You won’t do that, Isaiah? You won’t take Nat away from me
and drag him into sin? I know he’ll go if you give him the word, in spite of
what I say. [Pitifully.] You be only frightenin’ me! You can’t be so wicked
cruel as that.
Bartlett—I’ll do it, I take my oath—unless—
Mrs. Bartlett—[With hysterical anger.] Then I’ll tell him myself—of
the murders you did, and—
Bartlett—[Grimly.] And I’ll say ’twas done in fair fight to keep them
from stealin’ the gold! I’ll tell him your’s is a woman’s notion, and he’ll
believe me, not you. He’s his father’s son, and he’s set to go. Ye know it,
Sarah. [She falls back in the chair hopelessly staring at him with horrified
eyes. He turns away and adds after a pause.] So ye’ll christen the Sarah
Allen in the mornin’ afore she sails, won’t ye, Sarah?
Mrs. Bartlett—[In a terrified tone.] Yes—if it’s needful to save Nat—
and God’ll forgive me when He sees my reason. But you—Oh, Isaiah! [She
shudders and then breaks down, sobbing.]
Bartlett—[After a pause, turns to her humbly as if asking her
forgiveness.] Ye mustn’t think hard o’ me that I want your name. It’s
because it’s a good woman’s name, and I know it’ll bring luck to our vige.
I’d find it hard to sail without it—the way things be.
Mrs. Bartlett—[Getting to her feet—in a state of feverish fear of him.]
I’m goin’ to home.
Bartlett—[Going to her.] I’ll help ye to the top o’ the hill, Sarah.
Mrs. Bartlett—[Shrinking from him in terror.] No. Don’t you touch
me! Don’t you touch me! [She hobbles quickly out of the door in the rear,
looking back frightenedly over her shoulder to see if he is following as