Constrained Optimization, Lagrangians, and Duality
The Lagrangian and its dual underlie MPC, reconstruction, and scenario design; they turn constrained problems into solvable stationarity conditions.
The Lagrangian
Nearly every optimization in the stack is constrained - by physics, actuator limits, or the safe envelope. The Lagrangian folds constraints into the objective with multipliers, converting a constrained problem into a stationarity problem. It is the shared mathematical spine of MPC, equilibrium reconstruction, and scenario optimization.
Primal: min f(x) s.t. g_i(x)<=0, h_j(x)=0
Lagrangian:
L(x, mu, nu) = f(x) + sum_i mu_i g_i(x) + sum_j nu_j h_j(x)
Stationarity: grad_x L = 0
Dual function: d(mu,nu) = min_x L(x,mu,nu)
Dual problem: max_{mu>=0, nu} d(mu, nu)
Weak and strong duality
The dual function is always a lower bound on the primal optimum (weak duality); for convex problems satisfying a constraint qualification the bound is tight (strong duality), so primal and dual optima coincide. Convex problems - the QPs in MPC, Tikhonov-regularized reconstruction - enjoy strong duality, which is why they solve reliably and their multipliers are meaningful.
# multipliers reveal constraint sensitivities (shadow prices)
sol = solve_constrained(f, g, h)
# dL*/db_i = -mu_i : how the optimum changes as limit i moves
for i, mu in enumerate(sol.mu):
sensitivity[i] = -mu # marginal effect of relaxing limit i
Multipliers as sensitivities
The optimal multipliers measure how much the objective would improve if a constraint were relaxed - the sensitivity of the solution to each limit. In control terms this tells the stack which physical limit is most costly to the objective right now, guiding scenario redesign and informing operators which envelope boundary is the true bottleneck. The KKT conditions are exactly the Lagrangian stationarity plus feasibility and complementarity.
- Lagrangian: constraints absorbed via multipliers.
- Strong duality (convex): dual optimum equals primal optimum.
- Multipliers = shadow prices: sensitivity to each constraint.
- Foundation shared by MPC, reconstruction, scenario design.
Duality is not abstract here: it is how the stack solves constrained problems efficiently and how it explains, in physical terms, which constraint is governing a given operating point.