Model Predictive Control
Toolbox
For Use with MATLAB®
Manfred Morari
N. Lawrence Ricker
Computation
Visualization
Programming
User’s Guide
Version 1
%PHONE
FAX)MAIL
INTERNET
@E-MAIL
How to Contact The MathWorks:
508-647-7000
508-647-7001
The MathWorks, Inc.
24 Prime Park Way
Natick, MA 01760-1500
Phone
Fax
Mail
http://www.mathworks.com Web
ftp.mathworks.com
comp.soft-sys.matlab
Anonymous FTP server
Newsgroup
support@mathworks.com
suggest@mathworks.com
bugs@mathworks.com
doc@mathworks.com
subscribe@mathworks.com
service@mathworks.com
info@mathworks.com
Technical support
Product enhancement suggestions
Bug reports
Documentation error reports
Subscribing user registration
Order status, license renewals, passcodes
Sales, pricing, and general information
Model Predictive Control Toolbox User’s Guide
COPYRIGHT 1984 - 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.
U.S. GOVERNMENT: If Licensee is acquiring the Programs on behalf of any unit or agency of the U.S.
Government, the following shall apply: (a) For units of the Department of Defense: the Government shall
have only the rights specified in the license under which the commercial computer software or commercial
software documentation was obtained, as set forth in subparagraph (a) of the Rights in Commercial
Computer Software or Commercial Software Documentation Clause at DFARS 227.7202-3, therefore the
rights set forth herein shall apply; and (b) For any other unit or agency: NOTICE: Notwithstanding any
other lease or license agreement that may pertain to, or accompany the delivery of, the computer software
and accompanying documentation, the rights of the Government regarding its use, reproduction, and disclo-
sure are as set forth in Clause 52.227-19 (c)(2) of the FAR.
MATLAB, Simulink, Handle Graphics, and Real-Time Workshop are registered trademarks and Stateflow
and Target Language Compiler are trademarks of The MathWorks, Inc.
Other product or brand names are trademarks or registered trademarks of their respective holders.
Printing History: January 1995
First printing
November 1995 Reprint
October 1998
October 1998
Revisions
Online
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