CasADi: a software framework for nonlinear optimization and optimal control

We present CasADi, an open-source software framework for numerical optimization. CasADi is a general-purpose tool that can be used to model and solve optimization problems with a large degree of flexibility, larger than what is associated with popular algebraic modeling languages such as AMPL, GAMS, JuMP or Pyomo. Of special interest are problems constrained by differential equations, i.e. optimal control problems. CasADi is written in self-contained C++, but is most conveniently used via full-featured interfaces to Python, MATLAB or Octave. Since its inception in late 2009, it has been used successfully for academic teaching as well as in applications from multiple fields, including process control, robotics and aerospace. This article gives an up-to-date and accessible introduction to the CasADi framework, which has undergone numerous design improvements over the last 7 years.

[1]  D. J. A. Welsh,et al.  An upper bound for the chromatic number of a graph and its application to timetabling problems , 1967, Comput. J..

[2]  L. L. Lynn,et al.  The use of orthogonal polynomials in the near-optimal control of distributed systems by trajectory approximation† , 1970 .

[3]  E. S. Parkin,et al.  Near-Optimal Control by Trajectory Approximation. Tubular Reactors with Axial Dispersion , 1970 .

[4]  L. Biegler Solution of dynamic optimization problems by successive quadratic programming and orthogonal collocation , 1984 .

[5]  H. Bock,et al.  A Multiple Shooting Algorithm for Direct Solution of Optimal Control Problems , 1984 .

[6]  Ed Anderson,et al.  LAPACK Users' Guide , 1995 .

[7]  J. E. Cuthrell,et al.  Simultaneous optimization and solution methods for batch reactor control profiles , 1989 .

[8]  A. Fiacco,et al.  Sensitivity and stability analysis for nonlinear programming , 1991 .

[9]  Brian W. Kernighan,et al.  AMPL: A Modeling Language for Mathematical Programming , 1993 .

[10]  Andreas Griewank,et al.  Algorithm 755: ADOL-C: a package for the automatic differentiation of algorithms written in C/C++ , 1996, TOMS.

[11]  Jack Dongarra,et al.  LAPACK Users' guide (third ed.) , 1999 .

[12]  James Demmel,et al.  LAPACK Users' Guide, Third Edition , 1999, Software, Environments and Tools.

[13]  Andreas Griewank,et al.  Evaluating derivatives - principles and techniques of algorithmic differentiation, Second Edition , 2000, Frontiers in applied mathematics.

[14]  Andrei Alexandrescu,et al.  Modern C++ Design , 2001 .

[15]  Andreas Griewank,et al.  Detecting Jacobian sparsity patterns by Bayesian probing , 2002, Math. Program..

[16]  Stephen J. Wright,et al.  Object-oriented software for quadratic programming , 2003, TOMS.

[17]  Vikram S. Adve,et al.  LLVM: a compilation framework for lifelong program analysis & transformation , 2004, International Symposium on Code Generation and Optimization, 2004. CGO 2004..

[18]  Carol S. Woodward,et al.  Enabling New Flexibility in the SUNDIALS Suite of Nonlinear and Differential/Algebraic Equation Solvers , 2020, ACM Trans. Math. Softw..

[19]  Michael A. Saunders,et al.  SNOPT: An SQP Algorithm for Large-Scale Constrained Optimization , 2005, SIAM Rev..

[20]  Alex Pothen,et al.  What Color Is Your Jacobian? Graph Coloring for Computing Derivatives , 2005, SIAM Rev..

[21]  Thomas Kaminski,et al.  Automatic Sparsity Detection Implemented as a Source-to-Source Transformation , 2006, International Conference on Computational Science.

[22]  Lorenz T. Biegler,et al.  On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming , 2006, Math. Program..

[23]  Stephen P. Boyd,et al.  Convex Optimization , 2004, Algorithms and Theory of Computation Handbook.

[24]  Jorge Nocedal,et al.  Knitro: An Integrated Package for Nonlinear Optimization , 2006 .

[25]  Timothy A. Davis,et al.  Direct methods for sparse linear systems , 2006, Fundamentals of algorithms.

[26]  M. Giles Collected Matrix Derivative Results for Forward and Reverse Mode Algorithmic Differentiation , 2008 .

[27]  Moritz Diehl,et al.  The Lifted Newton Method and Its Application in Optimization , 2009, SIAM J. Optim..

[28]  C. Kirches Fast Numerical Methods for Mixed-Integer Nonlinear Model-Predictive Control , 2011 .

[29]  Dirk Müller,et al.  Faster min–max resource sharing in theory and practice , 2011, Math. Program. Comput..

[30]  David L. Woodruff,et al.  Pyomo: modeling and solving mathematical programs in Python , 2011, Math. Program. Comput..

[31]  Uwe Naumann,et al.  The Art of Differentiating Computer Programs - An Introduction to Algorithmic Differentiation , 2012, Software, environments, tools.

[32]  V. V. Lopes,et al.  On the use of Markov chain models for the analysis of wind power time-series , 2012, 2012 11th International Conference on Environment and Electrical Engineering.

[33]  Janick V. Frasch,et al.  Mixed–-Level Iteration Schemes for Nonlinear Model Predictive Control , 2012 .

[34]  Manfred Morari,et al.  Efficient interior point methods for multistage problems arising in receding horizon control , 2012, 2012 IEEE 51st IEEE Conference on Decision and Control (CDC).

[35]  Lars Imsland,et al.  Multi-objective Predictive Control for non steady-state operation , 2013, 2013 European Control Conference (ECC).

[36]  Jan Swevers,et al.  Moving Horizon Estimation with a huber penalty function for robust pose estimation of tethered airplanes , 2013, 2013 American Control Conference.

[37]  Joel Andersson,et al.  A General-Purpose Software Framework for Dynamic Optimization (Een algemene softwareomgeving voor dynamische optimalisatie) , 2013 .

[38]  Moritz Diehl,et al.  Numerical Trajectory Optimization for Airborne Wind Energy Systems Described by High Fidelity Aircraft Models , 2013 .

[39]  Moritz Diehl,et al.  Modeling of Airborne Wind Energy Systems in Natural Coordinates , 2013 .

[40]  Francesco Casella,et al.  A framework for nonlinear model-predictive control using object-oriented modeling with a case study in power plant start-up , 2013, 2013 IEEE Conference on Computer Aided Control System Design (CACSD).

[41]  Francis J. Doyle,et al.  Estimating confidence intervals in predicted responses for oscillatory biological models , 2013, BMC Systems Biology.

[42]  Goele Pipeleers,et al.  Time-optimal path following for robots with object collision avoidance using lagrangian duality , 2013, 9th International Workshop on Robot Motion and Control.

[43]  Janick V. Frasch,et al.  A dual Newton strategy for the efficient solution of sparse quadratic programs arising in SQP-based nonlinear MPC , 2013 .

[44]  A. Holmqvist,et al.  Dynamic parameter estimation of atomic layer deposition kinetics applied to in situ quartz crystal microbalance diagnostics , 2014 .

[45]  Sebastian Engell,et al.  Efficient Robust Economic Nonlinear Model Predictive Control of an Industrial Batch Reactor , 2014 .

[46]  Sebastian Engell,et al.  Multi-stage Nonlinear Model Predictive Control with verified robust constraint satisfaction , 2014, 53rd IEEE Conference on Decision and Control.

[47]  Jan Poland,et al.  Stochastic optimal planning of solar thermal power , 2014, 2014 IEEE Conference on Control Applications (CCA).

[48]  Sebastien Gros,et al.  A distributed algorithm for NMPC-based wind farm control , 2014, 53rd IEEE Conference on Decision and Control.

[49]  Pieter Abbeel,et al.  Scaling up Gaussian Belief Space Planning Through Covariance-Free Trajectory Optimization and Automatic Differentiation , 2014, WAFR.

[50]  Goele Pipeleers,et al.  Model-based gearbox synthesis , 2014 .

[51]  Goele Pipeleers,et al.  Time-optimal tube following for robotic manipulators , 2014, 2014 IEEE 13th International Workshop on Advanced Motion Control (AMC).

[52]  John Bagterp Jørgensen,et al.  High-performance small-scale solvers for linear Model Predictive Control , 2014, 2014 European Control Conference (ECC).

[53]  Radoslav Paulen,et al.  Robust Nonlinear Model Predictive Control with Reduction of Uncertainty Via Robust Optimal Experiment Design , 2014 .

[54]  Lars Imsland,et al.  Optimal control strategies for oil production under gas coning conditions , 2014, 2014 IEEE Conference on Control Applications (CCA).

[55]  Nina F. Thornhill,et al.  Model Predictive Control for Power System Frequency Control Taking into Account Imbalance Uncertainty , 2014 .

[56]  D. Walraven,et al.  Optimum configuration of shell-and-tube heat exchangers for the use in low-temperature organic Rankine cycles , 2014 .

[57]  Didier Dumur,et al.  Hybrid dynamic optimization of power plants using sum-up rounding and adaptive mesh refinement , 2014, 2014 IEEE Conference on Control Applications (CCA).

[58]  Sebastian Engell,et al.  An environment for the efficient testing and implementation of robust NMPC , 2014, 2014 IEEE Conference on Control Applications (CCA).

[59]  Johan Åkesson,et al.  Toolbox for development and validation of grey-box building models for forecasting and control , 2014 .

[60]  Sebastian Engell,et al.  Control of towing kites under uncertainty using robust economic nonlinear model predictive control , 2014, 2014 European Control Conference (ECC).

[61]  Lars Imsland,et al.  On multi-objective economic predictive control for cyclic process operation , 2014 .

[62]  V. V. Lopes,et al.  Parameter-free resolution of the superposition of stochastic signals , 2015, 1510.07285.

[63]  Bjarne A. Foss,et al.  Scenario Based Implicit Dual Model Predictive Control , 2015 .

[64]  Sylvie Thiébaux,et al.  Distributed Multi-Period Optimal Power Flow for Demand Response in Microgrids , 2015, e-Energy.

[65]  Peter Nilsson,et al.  Real-Time NMPC for Semi-Automated Highway Driving of Long Heavy Vehicle Combinations , 2015 .

[66]  Fredrik Magnusson,et al.  A Framework for Nonlinear Model Predictive Control in JModelica.org , 2015 .

[67]  G. Pannocchia,et al.  Offset-free MPC explained: novelties, subtleties, and applications , 2015 .

[68]  Filip Logist,et al.  Interactive NBI and (E)NNC methods for the progressive exploration of the criteria space in multi-objective optimization and optimal control , 2015, Comput. Chem. Eng..

[69]  Gabriele Pannocchia,et al.  A Computational Framework for Environment-Aware Robotic Manipulation Planning , 2015, ISRR.

[70]  Marta Molinas,et al.  Management of harmonic propagation in a marine vessel by use of optimization , 2015, 2015 IEEE Transportation Electrification Conference and Expo (ITEC).

[71]  Joris Gillis Practical Methods for Approximate Robust Periodic Optimal Control ofNonlinear Mechanical Systems , 2015 .

[72]  Peyman Mohajerin Esfahani,et al.  Stochastic Nonlinear Model Predictive Control of an Uncertain Batch Polymerization Reactor , 2015 .

[73]  Georg Frey,et al.  Optimal Startup Control of a Steam Power Plant Using the JModelica Platform , 2015 .

[74]  Daniel Sarabia,et al.  An efficient distributed algorithm for multi-stage robust nonlinear predictive control , 2015, 2015 European Control Conference (ECC).

[75]  Karl Berntorp,et al.  Hierarchical predictive control for ground-vehicle maneuvering , 2015, 2015 American Control Conference (ACC).

[76]  Sebastian Engell,et al.  Towards dual robust nonlinear model predictive control: A multi-stage approach , 2015, 2015 American Control Conference (ACC).

[77]  J. Swevers,et al.  B-spline parameterized optimal motion trajectories for robotic systems with guaranteed constraint satisfaction , 2015 .

[78]  Lars Eriksson,et al.  A framework for modeling and optimal control of automatic transmission systems , 2015 .

[79]  Jan Tommy Gravdahl,et al.  Non-linear model predictive control for constrained robot navigation in row crops , 2015, 2015 IEEE International Conference on Industrial Technology (ICIT).

[80]  Johan Åkesson,et al.  Dynamic Optimization in JModelica.org , 2015 .

[81]  Moritz Diehl,et al.  A quaternion‐based model for optimal control of an airborne wind energy system , 2015, ArXiv.

[82]  Mario Zanon,et al.  Baumgarte stabilisation over the SO(3) rotation group for control , 2015, 2015 54th IEEE Conference on Decision and Control (CDC).

[83]  Boris Houska,et al.  Real-time Algorithm for Self-Reflective Model Predictive Control , 2016, 1611.02408.

[84]  Joost Venrooij,et al.  Comparison between filter- and optimization-based motion cueing in the Daimler Driving Simulator , 2016 .

[85]  Lieve Helsen,et al.  Quantification of flexibility in buildings by cost curves – Methodology and application , 2016 .

[86]  Helen Durand,et al.  Economic model predictive control designs for input rate-of-change constraint handling and guaranteed economic performance , 2016, Comput. Chem. Eng..

[87]  Bjarne Foss,et al.  A two-layer structure for stabilization and optimization of an oil gathering network , 2016 .

[88]  Lars Imsland,et al.  Numerical Optimal Control Mixing Collocation with Single Shooting: A Case Study , 2016 .

[89]  Lieve Helsen,et al.  Practical implementation and evaluation of model predictive control for an office building in Brussels , 2016 .

[90]  Moritz Diehl,et al.  Optimal control for minimizing power consumption during holding patterns for airborne wind energy pumping system , 2016, 2016 European Control Conference (ECC).

[91]  Vincent Padois,et al.  Generalized hierarchical control , 2015, Autonomous Robots.

[92]  Magnus Trägårdh,et al.  Input estimation for drug discovery using optimal control and Markov chain Monte Carlo approaches , 2016, Journal of Pharmacokinetics and Pharmacodynamics.

[93]  Erik Frisk,et al.  Path-dependent rollover prevention for critical truck maneuvers , 2016 .

[94]  Eric Bullinger,et al.  A Set-Based Optimal Control Approach for Pharmacokinetic/Pharmacodynamic Drug Dosage Design , 2016 .

[95]  Kjetil Uhlen,et al.  Model Predictive Load-Frequency Control , 2016, IEEE Transactions on Power Systems.

[96]  A. Holmqvist,et al.  Open-loop optimal control of batch chromatographic separation processes using direct collocation , 2016 .

[97]  Wolfgang Utschick,et al.  Availability and interpretability of optimal control for criticality estimation in vehicle active safety , 2016, 2016 Design, Automation & Test in Europe Conference & Exhibition (DATE).

[98]  Christian Kirches,et al.  An SR1/BFGS SQP algorithm for nonconvex nonlinear programs with block-diagonal Hessian matrix , 2016, Math. Program. Comput..

[99]  K. Sundmacher,et al.  CO2 Methanation: Optimal Start-Up Control of a Fixed-Bed Reactor for Power-To-Gas Applications , 2016 .

[100]  Moritz Diehl,et al.  Exploiting convexity in direct Optimal Control: a sequential convex quadratic programming method , 2016, 2016 IEEE 55th Conference on Decision and Control (CDC).

[101]  Andreas Müller,et al.  Inverse kinematics in minimum-time trajectory planning for kinematically redundant manipulators , 2016, IECON 2016 - 42nd Annual Conference of the IEEE Industrial Electronics Society.

[102]  Niels Kjølstad Poulsen,et al.  An ensemble nonlinear model predictive control algorithm in an artificial pancreas for people with type 1 diabetes , 2016, 2016 European Control Conference (ECC).

[103]  Dirk Abel,et al.  Nonlinear object-oriented modeling based optimal control of the heart: Performing precise preload manipulation maneuvers using a ventricular assist device , 2016, 2016 European Control Conference (ECC).

[104]  Tor Arne Johansen,et al.  Feasibility study of a circularly towed cable-body system for UAV applications , 2016, 2016 International Conference on Unmanned Aircraft Systems (ICUAS).

[105]  Nikolas Geroliminis,et al.  Model predictive control of large-scale urban networks via perimeter control and route guidance actuation , 2016, 2016 IEEE 55th Conference on Decision and Control (CDC).

[106]  Lars Eriksson,et al.  Optimal control of engine controlled gearshift for a diesel-electric powertrain with backlash , 2016 .

[107]  L. Imsland,et al.  An estimation-forecast set-up for iceberg drift prediction , 2016 .

[108]  Filip Logist,et al.  Dynamic optimization of biological networks under parametric uncertainty , 2016, BMC Systems Biology.

[109]  Jan Peters,et al.  Catching heuristics are optimal control policies , 2016, NIPS.

[110]  A. Verheyleweghen,et al.  HEALTH-AWARE OPERATION OF A SUBSEA GAS COMPRESSION SYSTEM UNDER UNCERTAINTY , 2016 .

[111]  Sigurd Skogestad,et al.  Real-Time Optimization under Uncertainty Applied to a Gas Lifted Well Network , 2016 .

[112]  Lars Imsland,et al.  Monitoring Moving Objects Using Aerial Mobile Sensors , 2016, IEEE Transactions on Control Systems Technology.

[113]  Filip Logist,et al.  Parametric uncertainty propagation for robust dynamic optimization of biological networks , 2016, 2016 American Control Conference (ACC).

[114]  Rafael Wisniewski,et al.  Non-linear model predictive supervisory controller for building, air handling unit with recuperator and refrigeration system with heat waste recovery , 2016, 2016 IEEE Conference on Control Applications (CCA).

[115]  Joris De Schutter,et al.  Generalizing demonstrated motions and adaptive motion generation using an invariant rigid body trajectory representation , 2016, 2016 IEEE International Conference on Robotics and Automation (ICRA).

[116]  Jan Swevers,et al.  Time-optimal motion planning for n-DOF robot manipulators using a path-parametric system reformulation , 2016, 2016 American Control Conference (ACC).

[117]  Sebastian Sager,et al.  Synthesis of optimal controls and numerical optimization for the vibration-based energy harvesters , 2016 .

[118]  Viktor Leek An Optimal Control Toolbox for MATLAB Based on CasADi , 2016 .

[119]  Goele Pipeleers,et al.  Online distributed motion planning for multi-vehicle systems , 2016, 2016 European Control Conference (ECC).

[120]  Panagiotis D. Christofides,et al.  On closed-loop economic performance under Lyapunov-based economic model predictive control , 2016, 2016 American Control Conference (ACC).

[121]  Iain Dunning,et al.  JuMP: A Modeling Language for Mathematical Optimization , 2015, SIAM Rev..

[122]  Sebastian Engell,et al.  Rapid development of modular and sustainable nonlinear model predictive control solutions , 2017 .

[123]  Anwesh Reddy Gottu Mukkula,et al.  Model-based design of optimal experiments for nonlinear systems in the context of guaranteed parameter estimation , 2017, Comput. Chem. Eng..

[124]  Lars Eriksson,et al.  Optimal stationary control of diesel engines using periodic control , 2017 .

[125]  Alessio Artoni,et al.  A Two-Stage Trajectory Optimization Strategy for Articulated Bodies With Unscheduled Contact Sequences , 2017, IEEE Robotics and Automation Letters.

[126]  Adriaen Verheyleweghen,et al.  Health-Aware Operation of a Subsea Compression System Subject to Degradation , 2018 .