Model Predictive Control's Real-Time Structure, from Chapter to Cockpit

A chemical-engineering-rooted MPC textbook, read for its real-time engineering constraints: Riccati recursion and condensing, the 2005 real-time iteration scheme, moving horizon estimation, and why particle filtering got cut past five state dimensions.

πŸ“• Rawlings, Mayne, Diehl β€” MPC (2nd ed.) ⬑ Full interactive viz

The re-solve-from-scratch loop

No training, no reward signal. Every control cycle, MPC measures the current state, solves an optimization problem against a known dynamics model over a horizon, applies only the first control, then throws the rest away and re-solves next cycle.

Cycle-time budgets across domains

The same re-solve loop has to fit inside wildly different deadlines depending on the plant β€” this is the range the book's real-time machinery has to cover, log-scaled.

cycle time (ms), log scale

Why structure exploitation matters

A naive dense Newton factorization over an N-step horizon costs O(NΒ³). Because each stage only couples to its immediate neighbor β€” block-banded, not dense β€” a Riccati-style recursion solves the exact same problem in O(N).

naive dense O(NΒ³) Riccati-structured O(N)
On a linear axis the Riccati bars nearly vanish β€” that's the point. The gap isn't a constant-factor win, it grows without bound with horizon length.

The block-banded KKT matrix

Hover a cell. Each stage k only couples to kβˆ’1 and k+1 β€” everything off that band is exactly zero and never needs to be materialized.

zero block nonzero (in-band) block

Riccati recursion vs condensing

Riccati recursion is dynamic programming in a numerical-optimization costume: one backward sweep computing feedback gains, two cheap sweeps recovering the trajectory β€” linear in horizon length N. Condensing eliminates the states up front and collapses everything into one dense QP over the controls β€” cheaper for short horizons, especially when state dimension n dwarfs control dimension m.

Riccati recursion, O(N) classical condensing, O(NΒ³) Cholesky-folded condensing, O(NΒ²)

Moving horizon estimation vs the Kalman filter

MHE is the optimization-based counterpart to the Kalman filter: a sliding window of recent measurements, re-solved every step, which is why it can enforce constraints a closed-form recursive filter can't (e.g. "this concentration can't go negative").

Why particle filtering got cut past 5 dimensions

The book drops particle filtering from its main text once state dimensionality climbs past five β€” sampling can't keep up. MHE's optimization-based approach sidesteps that specific failure mode.

tractable breaks down

Cited works