Model Predictive Control
Toolbox
For Use with MATLAB®
Manfred Morari
N. Lawrence Ricker
Computation
Visualization
Programming
User’s Guide
Version 1
How to Contact The MathWorks:
www.mathworks.com
comp.soft-sys.matlab
Web
Newsgroup
support@mathworks.com
suggest@mathworks.com
bugs@mathworks.com
doc@mathworks.com
service@mathworks.com
info@mathworks.com
Technical support
Product enhancement suggestions
Bug reports
Documentation error reports
Order status, license renewals, passcodes
Sales, pricing, and general information
508-647-7000
508-647-7001
The MathWorks, Inc.
3 Apple Hill Drive
Natick, MA 01760-2098
Phone
Fax
Mail
For contact information about worldwide offices, see the MathWorks Web site.
Model Predictive Control Toolbox User’s Guide
COPYRIGHT 1995 - 1998 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used
or copied only under the terms of the license agreement. No part of this manual may be photocopied or repro-
duced in any form without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by
or for the federal government of the United States. By accepting delivery of the Program, the government
hereby agrees that this software qualifies as "commercial" computer software within the meaning of FAR
Part 12.212, DFARS Part 227.7202-1, DFARS Part 227.7202-3, DFARS Part 252.227-7013, and DFARS Part
252.227-7014. The terms and conditions of The MathWorks, Inc. Software License Agreement shall pertain
to the government’s use and disclosure of the Program and Documentation, and shall supersede any
conflicting contractual terms or conditions. If this license fails to meet the government’s minimum needs or
is inconsistent in any respect with federal procurement law, the government agrees to return the Program
and Documentation, unused, to MathWorks.
MATLAB, Simulink, Stateflow, Handle Graphics, and Real-Time Workshop are registered trademarks, and
Target Language Compiler is a trademark of The MathWorks, Inc.
Other product or brand names are trademarks or registered trademarks of their respective holders.
Printing History: January 1995
October 1998
First printing
(Online only)
1
2
Contents
Preface
Tutorial
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Target Audience for the MPC Toolbox . . . . . . . . . . . . . . . . . . . . 1-3
System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-3
MPC Based on Step Response Models
Step Response Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Model Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-6
Unconstrained Model Predictive Control
. . . . . . . . . . . . . . 2-11
Closed-Loop Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-18
Constrained Model Predictive Control . . . . . . . . . . . . . . . . . 2-20
Application: Idle Speed Control . . . . . . . . . . . . . . . . . . . . . . . 2-22
Process Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Control Problem Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-24
Application: Control of a Fluid Catalytic Cracking Unit . 2-31
Process Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-31
Control Problem Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . 2-33
i
Simulations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34
Step Response Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-34
Associated Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
Unconstrained Control Law . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
Constrained Control Law . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-36
3
4
MPC Based on State-Space Models
State-Space Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-2
Mod Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-3
SISO Continuous-Time Transfer Function to Mod Format . . . . 3-3
SISO Discrete-Time Transfer Function to Mod Format . . . . . . 3-6
MIMO Transfer Function Description to Mod Format . . . . . . . 3-7
Continuous or Discrete State-Space to Mod Format . . . . . . . . . 3-9
Identification Toolbox (“Theta”) Format to Mod Format . . . . . . 3-9
Combination of Models in Mod Format
. . . . . . . . . . . . . . . . . . 3-10
Converting Mod Format to Other Model Formats . . . . . . . . . . 3-10
Unconstrained MPC Using State-Space Models . . . . . . . . . 3-12
State-Space MPC with Constraints . . . . . . . . . . . . . . . . . . . . 3-20
Application: Paper Machine Headbox Control . . . . . . . . . . 3-26
MPC Design Based on Nominal Linear Model . . . . . . . . . . . . . 3-27
MPC of Nonlinear Plant
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-38
Command Reference
Commands Grouped by Function . . . . . . . . . . . . . . . . . . . . . . . 4-2
Index
ii
Contents
Preface
Preface
Acknowledgments
The toolbox was developed in cooperation with: Douglas B. Raven and Alex
Zheng
The contributions of the following people are acknowledged: Yaman Arkun,
Nikolaos Bekiaris, Richard D. Braatz, Marc S. Gelormino, Evelio Hernandez,
Tyler R. Holcomb, Iftikhar Huq, Sameer M. Jalnapurkar, Jay H. Lee, Yusha
Liu, Simone L. Oliveira, Argimiro R. Secchi, and Shwu-Yien Yang
We would like to thank Liz Callanan, Jim Tung and Wes Wang from the
MathWorks for assisting us with the project, and Patricia New who did such
an excellent job putting the manuscript into LATEX.
iv
About the Authors
About the Authors
Manfred Morari
Manfred Morari received his diploma from ETH Zurich in 1974 and his Ph.D.
from the University of Minnesota in 1977, both in chemical engineering.
Currently he is the McCollum-Corcoran Professor and Executive Officer for
Control and Dynamical Systems at the California Institute of Technology.
Morari’s research interests are in the areas of process control and design. In
recognition of his numerous contributions, he has received the Donald P.
Eckman Award of the Automatic Control Council, the Allan P. Colburn Award
of the AIChE, the Curtis W. McGraw Research Award of the ASEE, was a Case
Visiting Scholar, the Gulf Visiting Professor at Carnegie Mellon University
and was recently elected to the National Academy of Engineering. Dr. Morari
has held appointments with Exxon R&E and ICI and has consulted
internationally for a number of major corporations. He has coauthored one
book on Robust Process Control with another on Model Predictive Control in
preparation.
N. Lawrence Ricker
Larry Ricker received his B.S. degree from the University of Michigan in 1970,
and his M.S. and Ph.D. degrees from the University of California, Berkeley, in
1972/78. All are in Chemical Engineering. He is currently Professor of
Chemical Engineering at the University of Washington, Seattle. Dr. Ricker has
over 80 publications in the general area of chemical plant design and operation.
He has been active in Model Predictive Control research and teaching for more
than a decade. For example, he published one of the first nonproprietary
studies of the application of MPC to an industrial process, and is currently
involved in a large-scale MPC application involving more than 40 decision
variables.
v
Preface
vi