The efficient computation of parametric solution sensitivities is a key challenge in the integration of learning-enhanced methods with nonlinear model predictive control (MPC), as their availability is crucial for many learning algorithms. This paper discusses the computation of solution sensitivities of general nonlinear programs (NLPs) using the implicit function theorem (IFT) and smoothed optimality conditions treated in interior-point methods (IPM). We detail sensitivity computation within a sequential quadratic programming (SQP) method which employs an IPM for the quadratic subproblems. Previous works presented in the machine learning community 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.
@article{arxiv.2505.01353,
title = {Differentiable Nonlinear Model Predictive Control},
author = {Jonathan Frey and Katrin Baumgärtner and Gianluca Frison and Dirk Reinhardt and Jasper Hoffmann and Leonard Fichtner and Sebastien Gros and Moritz Diehl},
journal= {arXiv preprint arXiv:2505.01353},
year = {2025}
}