Model Predictive Control (Advanced)

Research Depth 117 in the knowledge graph I know this Set as goal
mpc predictive-control constrained-optimization receding-horizon nonlinear-mpc

Core Idea

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.

How It's Best Learned

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.

Common Misconceptions

Explainer

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.

Practice Questions 5 questions

Prerequisite Chain

Counting to 10Counting to 20Understanding ZeroThe Number ZeroCounting to FiveOne-to-One CorrespondenceCombining Small Groups Within 5Addition Within 10Addition Within 20Two-Digit Addition Without RegroupingTwo-Digit Addition with RegroupingAddition Within 100Repeated Addition as MultiplicationMultiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Two-Digit by One-Digit DivisionDivision with RemaindersRemainders and Quotients in DivisionDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueReading and Writing DecimalsComparing and Ordering DecimalsAdding and Subtracting DecimalsMultiplying DecimalsDividing DecimalsDividing FractionsMixed Number ArithmeticOrder of OperationsInteger Order of OperationsVariable ExpressionsCombining Like TermsOne-Step EquationsTwo-Step EquationsSolving Multi-Step EquationsEquations with Variables on Both SidesAngle Pairs: Complementary, Supplementary, and VerticalParallel Lines and TransversalsCorresponding AnglesAlternate Interior AnglesTriangle Angle Sum TheoremExterior Angle TheoremTriangle Inequality TheoremSimilar Triangles: AA SimilaritySimilar Triangles: SSS and SAS SimilarityProportions in Similar TrianglesRight Triangle Trigonometry IntroductionTrigonometric Ratios ReviewRadian MeasureConverting Between Degrees and RadiansThe Unit CircleGraphing Sine and CosineGraphing Tangent and Reciprocal Trigonometric FunctionsDerivatives of Trigonometric FunctionsAntiderivativesIterated Integrals and Fubini's TheoremDouble Integrals in Cartesian CoordinatesDouble Integrals over Rectangular RegionsDouble Integrals in Polar CoordinatesDouble Integrals: Definition and SetupIterated Integrals and Fubini's TheoremDouble Integrals over Rectangular RegionsDouble Integrals over General RegionsApplications of Double Integrals: Area, Mass, and MomentsTriple Integrals in Cartesian CoordinatesTriple Integrals in Cylindrical and Spherical CoordinatesChange of Variables and the Jacobian DeterminantApplications of Triple Integrals: Volume and MassVector Fields and Their RepresentationsLine Integrals of Vector FieldsGreen's TheoremSurface Integrals and Flux of Vector FieldsSurface Integrals and Flux of Vector FieldsDivergence Theorem: Flux and OutflowDivergence TheoremElectric FluxGauss's LawConductors in Electrostatic EquilibriumCapacitance and CapacitorsDielectricsDielectric Constant and Relative PermittivityElectric Field Inside Dielectric MaterialsDielectric Materials and PolarizationDielectric Susceptibility and PermittivityEnergy Density in Electric FieldsElectric Current and Current DensityElectrical Resistance and ResistivityOhm's Law and Circuit ElementsElectromotive Force (EMF) and BatteriesKirchhoff's Circuit Laws: Voltage and CurrentDC Circuit Network Analysis MethodsTransient Response in RC CircuitsRC CircuitsLC and RLC CircuitsSecond-Order Transient Circuit ResponseFeedback Control FundamentalsLaplace Transform Methods for ControlTransfer Functions and System ModelingFirst-Order System Time ResponseSecond-Order System Time ResponseRouth-Hurwitz Stability CriterionRoot Locus MethodRoot Locus Construction RulesRoot Locus Gain DesignRoot Locus Method and Pole Placement DesignState Feedback Control and Pole PlacementModel Predictive Control (Advanced)

Longest path: 118 steps · 661 total prerequisite topics

Prerequisites (3)

Leads To (0)

No topics depend on this one yet.