Differentiable Nonlinear Model Predictive Control

Jonathan Frey, Katrin Baumgärtner, Gianluca Frison, Dirk Reinhardt, Jasper Hoffmann +3 more
5/2/2025
19 citations
math.OCcs.AIcs.LG

Official code: FreyJo/differentiable_nmpc (53 stars, Python, last commit 2026-01-29).

Abstract

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).

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

An efficient implementation of differentiable NMPC based on acados. Code to reproduce the results in our paper.

533PythonMay 2, 202510 months ago

Similar Papers

Cite this paper

@article{frey2025differentiable,
  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},
  year   = {2025},
  eprint = {2505.01353},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.01353v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.01353.svg)](https://codeofpaper.com/paper/2505.01353)

Discussion