Differentiable Nonlinear Model Predictive Control
Organizations: University Freiburg · NTNU Trondheim
Abstract
The efficient computation of parametric solution sensitivities is a key challenge in the integration of learning-enhanced methods with nonlinear model predictive control, as their availability is crucial for many learning algorithms. This paper discusses the computation of solution sensitivities of general nonlinear programs using the implicit function theorem and smoothed optimality conditions treated in interior-point methods (IPM). We introduce sequential barrier quadratic programming (SBQP), which generalizes SQP with an IPM quadratic programming (QP) solver by allowing the barrier parameter to approach a prescribed nonnegative target value, recovering classical SQP when this target is zero. Previous works are limited to convex or unconstrained formulations, or lack an implementation for efficient sensitivity evaluation. The publication is accompanied by an efficient open-source implementation within the acados framework, providing both forward and adjoint sensitivities for general optimal control problems, achieving speedups exceeding 3x over the state-of-the-art solvers mpc.pytorch and cvxpygen.
Figures & tables
| Nominal solution | Solution + adjoint sens. | |||||
|---|---|---|---|---|---|---|
| config | acados | mpc.pytorch | cvxpygen | acados | mpc.pytorch | cvxpygen |
| default | 8.6 | ( ) | ( ) | 21.0 | ( ) | ( ) |
| 15.7 | ( ) | ( ) | 23.4 | ( ) | ( ) | |
| 29.3 | ( ) | ( ) | 68.2 | ( ) | ( ) | |
| , | 19.7 | ( ) | ( ) | 40.7 | ( ) | ( ) |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Software | OCP | ad- | ineq. | Nonlinearity in | exact | parallel- | permissive | |||
|---|---|---|---|---|---|---|---|---|---|---|
| / publication | tailored | joint | support | cost | eq. | ineq. | results | ization | license | |
| acados this paper | OpenMP | BSD-2 | ||||||||
| mpc.pytorch Amos et al. (2018) | a | PyTorch | MIT | |||||||
| cvxpygen + cvxpylayers Schaller et al. (2022) Schaller & Boyd (2026) | b | b | Python multi- threading | Apache 2.0 | ||||||
| diffmpc (Toyota) Adabag et al. (2026) | JAX | CC BY- NC-ND 4.0 | ||||||||
| trajax (Google) no paper | c | JAX | Apache 2.0 | |||||||
| Nominal solution | Solution + adjoint sens. | |||||
|---|---|---|---|---|---|---|
| problem config | acados | mpc.pytorch | speedup | acados | mpc.pytorch | speedup |
| 0.007 | 0.05 | 7.18 | 0.029 | 0.07 | 2.59 | |
| 0.008 | 15.12 | 1929.75 | 0.033 | 14.64 | 450.01 | |
Nonlinear MPC
Nonlinear model predictive control (NMPC) repeatedly optimizes future actions using nonlinear system models and constraints.
See all 87 papers