# TEMPO Spring School: Theory and Numerics of Nonlinear Model Predictive Control James B. Rawlings Department of Chemical and Biological Engineering University of Wisconsin Madison, Wisconsin Copyright (C) 2015 James B. Rawlings

## Course Overview

This course provides a modern overview of model predictive control (MPC), the leading advanced industrial process control technology in use today. The class is taught in a highly interactive manner, with participants running simulation examples to illustrate and reinforce the core concepts. Software for this purpose is provided as part of the course. The course is divided into the following sections: Review of linear regulation and state estimation; Tracking, disturbances and zero offset; Nonlinear MPC regulation; Nonlinear moving horizon state estimation.

## Who Should Take this Course

Students should have taken a first graduate level linear systems course. Students should be familiar with the Python, CasADi, and Octave/Matlab programming environments.

The course overheads are provided below. Clicking on the thumbnail figures displays the code that was used to create the figure. In addition, the complete collection of the CasADi/Python files and Matlab m-files in single zip files are available for download from the links below:

Octave/Matlab:

## Section 1: Introductory review: linear regulation and state estimation (LQR and LQE)

Control concepts: Linear quadratic regulation, stage cost, cost-to-go, linear quadratic estimation, Kalman filter, dynamic programming, recursive least squares, controllability and stabilizability, regulator convergence, infinite horizon regulator, observability and detectability, estimator convergence

Programming concepts: Representation with ss(A,B,C,D), c2d(sys, DT), and tf(num, den), anti-reset windup, minimal realization with minreal(sys) Figure 1 (slide 23):
Step response of a system with a right-half-plane zero. Figure 2 (slide 25):
Output response with an exponential input for a system with RHP zero. Figure 3 (slide 27):
Output response with input saturation for a system with RHP zero. Figure 4 (slide 32):
Closed-loop eigenvalues of A+BK_N(0) for different horizon lengths. Figure 5 (slide 33):
Stability dependence on horizon Figure 6 (slide 36):
The forecast versus the closed-loop behavior for N=5. Figure 7 (slide 37):
The forecast versus the closed-loop behavior for N=7. Figure 8 (slide 38):
The forecast versus the closed-loop behavior for N=20. Figure 9 (slide 55):
Optimal control law for constrained system. Figure 10 (slide 61):
A measurement with noise Figure 11 (slide 76):
Noisy measurement and state estimate versus time when estimating a scalar constant. Figure 12 (slide 77):
Taking the sample mean as the estimate Figure 13 (slide 78):
Estimate error variance goes to zero without process noise Figure 14 (slide 80): Figure 15 (slide 81):
With process noise, the state x is moving Figure 16 (slide 82):
The optimal estimate x is chasing after x Figure 17 (slide 83):
The sample mean is no longer a good estimator

## Section 2: Tracking, disturbances, and zero offset

Control concepts: Setpoint tracking, steady-state targets, dynamic regulation, state estimation, disturbance models, zero offset Figure 1 (slide 41):
Outputs following a step disturbance with steady-state offset Figure 2 (slide 42):
Inputs following a step disturbance with steady-state offset Figure 3 (slide 45):
Outputs following a step disturbance Figure 4 (slide 46):
Inputs following a step disturbance Figure 5 (slide 51):

## Section 3: Nonlinear model predictive control - Regulation

Control concepts: Equilibrium, positive invariance, K, K-infinty, KL functions, Lyapunov stability, asymptotic stability, exponential stability, Lyapunov function, converse theorems, stability of nonlinear MPC

Programming concepts: solving nonlinear OCPs with nmpc Figure 1 (slide 36):
Feasible region U_2, elliptical cost contours, and ellipse center, a(x), and constrained minimizers for different values of x. Figure 2 (slide 37):
Optimal control law for constrained system. Figure 3 (slide 42):
Feasibility sets X_N for N=1,2,3. Figure 4 (slide 51):
Trajectory using linearized system and linear MPC. Figure 5 (slide 54):
Trajectory using nonlinear MPC. Figure 6 (slide 56):
Comparison of linear and nonlinear MPC trajectories. Figure 7 (slide 57): Figure 8 (slide 61): Figure 1 (slide 67):