Model Predictive Control (MPC) optimizes control input over a finite future horizon by solving a constrained optimization problem at each time step, then implementing only the first control move (receding-horizon principle). MPC naturally handles multi-variable coupling, input/state constraints, and performance objectives beyond simple pole placement. Practical MPC formulations use explicit quadratic programming (QP), interior-point solvers, or specialized algorithms for real-time execution. Nonlinear MPC (NMPC) extends the framework to nonlinear plant models via sequential convex approximation or direct discretization methods, enabling control of systems where linearization is inadequate.
Implement a basic MPC regulator for a 2–3 state system with constraints: minimize ||y−r||² + ||u||² subject to |u| ≤ 1 and |x| ≤ 5 over a 10–15 step horizon. Compare closed-loop responses with PID and LQR (unconstrained). Observe how constraint activation changes the optimal trajectory and why the receding-horizon approach achieves stability despite the finite horizon.
You've studied state feedback and system identification: how to place poles and estimate unknown system dynamics. MPC takes a radically different approach — instead of designing a fixed linear feedback law, MPC solves an optimization problem at every time step to compute the best control inputs over the next N steps, then implements only the first move and repeats (receding horizon).
Why this matters: in the real world, actuators saturate (can only push so hard), outputs must respect safety bounds, and you often care about multiple objectives simultaneously — minimize energy use while keeping temperature in a band and avoiding overshoot. State feedback control cannot directly handle these constraints. A pole-placed LQR controller can be implemented and will stabilize, but once the actuator saturates, the closed-loop behaves unpredictably (the linear controller assumes unlimited actuation). MPC bakes constraints directly into the optimization. The solver respects them by construction: it will not recommend a control action that violates constraints, and if constraints are mutually impossible (can't satisfy all of them simultaneously), the solver will explicitly report this rather than silently failing.
The MPC formulation is a constrained quadratic program:
minimize: ∑(||y(k+i)−r||²_Q + ||u(k+i)||²_R) over i=0 to N-1
subject to: x(k+i+1) = Ax(k+i) + Bu(k+i), y(k+i) = Cx(k+i), and bounds |u|≤u_max, |x|≤x_max, etc.
At each time step k, you solve this optimization, extract u(k) (the first optimal input), apply it to the plant, measure the new state, and resolve at time k+1. This receding-horizon structure is key: by re-optimizing at each step, MPC adapts to disturbances and modeling errors without requiring a perfect model — you only commit to the immediate control move, not a pre-planned trajectory.
Nonlinear MPC (NMPC) replaces the linear dynamics x(k+1) = Ax(k) + Bu(k) with a nonlinear model x(k+1) = f(x(k), u(k)). This is vastly more complex: the optimization becomes nonconvex, and a global optimum is generally intractable. Practical NMPC uses Sequential Quadratic Programming (SQP): at each time step, linearize the nonlinear dynamics around the current trajectory, solve the linearized QP, use that solution as an improved starting point, linearize again, repeat until convergence. SQP warm-started from the previous time step's solution converges in a few iterations, making real-time NMPC feasible. Alternatively, Convex-Concave Procedure (CCP) approximates the nonlinear dynamics by a sequence of convex problems. The tradeoff: NMPC is more expressive and handles true nonlinearities, but the solver is not guaranteed to find the global optimum and can fail to converge (especially if the warm-start guess is poor or the nonlinearity is severe). Stability guarantees are weaker: NMPC with a finite horizon only guarantees local stability near the origin unless special terminal conditions are imposed.
The terminal cost or terminal constraint is subtle but essential. Since you optimize over a finite horizon, the optimizer might choose a control sequence that is locally optimal over the window but globally unstable — deferred cost is out of the window, so it doesn't get penalized. The solution: either impose a terminal constraint (force the state at step k+N into a small region, typically near the origin) or a terminal cost (add a term that penalizes the state at the horizon end as if the infinite future cost could be approximated by a quadratic function of the state at that point). With either, the finite-horizon MPC is provably asymptotically stable. Without them, MPC can destabilize, especially for short horizons.
Computational cost is the major tradeoff. Solving a QP or NLP at millisecond timescales requires specialized hardware or algorithms. Explicit MPC precomputes the control law offline as a piecewise-affine (for linear MPC) or polynomial function of the state, reducing real-time computation to table lookups — eliminating the online optimization entirely but requiring extensive offline precomputation for systems with more than about 6 states. For most systems, online MPC is practical: modern solvers (CVXPY, Casadi, FORCES Pro) can solve moderate-sized problems in milliseconds, and warm-starting from the previous solution accelerates convergence. MPC is the industrial standard for constrained control in refining, petrochemicals, and aerospace, where the computational cost is justified by the complexity of managing dozens of process variables under operating and safety constraints simultaneously.
No topics depend on this one yet.