# Learning for CasADi: Data-driven Models in Numerical Optimization

arXiv: https://arxiv.org/abs/2312.05873 · HTML: https://mlsanity.com/paper/2312.05873/

## Key facts

- Cited by 15 papers in the map (data through 14 Oct 2026).
- Builds on 9 of its 21 references that are in the map.
- First posted on arXiv 10 Dec 2023.

## Builds on (most cited first, 9 of 9)

- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [TensorFlow: Large-Scale Machine Learning on Heterogeneous Distributed Systems](https://mlsanity.com/paper/1603.04467/) (2016)
- [CVXPY: A Python-Embedded Modeling Language for Convex Optimization](https://mlsanity.com/paper/1603.00943/) (2016)
- [Differentiable MPC for End-to-end Planning and Control](https://mlsanity.com/paper/1810.13400/) (2018)
- [OSQP: An Operator Splitting Solver for Quadratic Programs](https://mlsanity.com/paper/1711.08013/) (2017)
- [acados: a modular open-source framework for fast embedded optimal control](https://mlsanity.com/paper/1910.13753/) (2019)
- [Real-time Neural-MPC: Deep Learning Model Predictive Control for Quadrotors and Agile Robotic Platforms](https://mlsanity.com/paper/2203.07747/) (2022)
- [Flexible development and evaluation of machine-learning-supported optimal control and estimation methods via HILO-MPC](https://mlsanity.com/paper/2203.13671/) (2022)
- [Zero-Order Optimization for Gaussian Process-based Model Predictive Control](https://mlsanity.com/paper/2211.15522/) (2022)

## Built on by (most cited first, 15 of 15)

- [Synthesis of Model Predictive Control and Reinforcement Learning: Survey and Classification](https://mlsanity.com/paper/2502.02133/) (2025)
- [A view on learning robust goal-conditioned value functions: Interplay between RL and MPC](https://mlsanity.com/paper/2502.06996/) (2025)
- [Safety Beyond the Training Data: Robust Out-of-Distribution MPC via Conformalized System Level Synthesis](https://mlsanity.com/paper/2602.12047/) (2026)
- [AC4MPC: Actor-Critic Reinforcement Learning for Nonlinear Model Predictive Control](https://mlsanity.com/paper/2406.03995/) (2024)
- [MPCritic: A plug-and-play MPC architecture for reinforcement learning](https://mlsanity.com/paper/2504.01086/) (2025)
- [Dynamic Tube MPC: Learning Tube Dynamics with Massively Parallel Simulation for Robust Safety in Practice](https://mlsanity.com/paper/2411.15350/) (2024)
- [Local-Global Learning of Interpretable Control Policies: The Interface between MPC and Reinforcement Learning](https://mlsanity.com/paper/2503.13289/) (2025)
- [Deep Reinforcement Learning Behavioral Mode Switching Using Optimal Control Based on a Latent Space Objective](https://mlsanity.com/paper/2406.01178/) (2024)
- [Autonomous Wheel Loader Navigation Using Goal-Conditioned Actor-Critic MPC](https://mlsanity.com/paper/2409.15717/) (2024)
- [Dynamic Neural Potential Field: Online Trajectory Optimization in the Presence of Moving Obstacles](https://mlsanity.com/paper/2410.06819/) (2024)
- [Model-free Reinforcement Learning for Model-based Control: Towards Safe, Interpretable and Sample-efficient Agents](https://mlsanity.com/paper/2507.13491/) (2025)
- [White-Box Neural Ensemble for Vehicular Plasticity: Quantifying the Efficiency Cost of Symbolic Auditability in Adaptive NMPC](https://mlsanity.com/paper/2602.01516/) (2026)
- [T2S-MPC: Time-Embedded Online Adaptive Model Predictive Control for Time-Varying Dynamics](https://mlsanity.com/paper/2605.24852/) (2026)
- [Language-Guided Terrain-Adaptive Neural MPC for Autonomous Traversal of Articulated Tracked Robots](https://mlsanity.com/paper/2609.13083/) (2026)
- [Scalable Identification of Physics-Based and Neural Dynamics from Partial Measurements](https://mlsanity.com/paper/2610.16559/) (2026)

## Abstract (arXiv)

While real-world problems are often challenging to analyze analytically, deep learning excels in modeling complex processes from data. Existing optimization frameworks like CasADi facilitate seamless usage of solvers but face challenges when integrating learned process models into numerical optimizations. To address this gap, we present the Learning for CasADi (L4CasADi) framework, enabling the seamless integration of PyTorch-learned models with CasADi for efficient and potentially hardware-accelerated numerical optimization. The applicability of L4CasADi is demonstrated with two tutorial examples: First, we optimize a fish's trajectory in a turbulent river for energy efficiency where the turbulent flow is represented by a PyTorch model. Second, we demonstrate how an implicit Neural Radiance Field environment representation can be easily leveraged for optimal control with L4CasADi. L4CasADi, along with examples and documentation, is available under MIT license at https://github.com/Tim-Salzmann/l4casadi
