What is CasADi?
CasADi initially focused on using a syntax akin to Computer Algebra Systems (CAS) and has now encapsulated this expertise in a general-purpose tool for gradient-based numerical optimization. The user can set up, solve, and perform forward and adjoint sensitivity analysis for systems of Ordinary Differential Equations (ODE) or Differential-Algebraic Equations (DAE) as well as formulate and solve Non-Linear Programs (NLP, MINLP) and Optimal Control Problems (OCP) using the derivative information generated by AD.
It facilitates rapid and efficient implementation of various methods for numerical optimal control, both in an offline context and for Non-linear Model Predictive Control (NMPC).
CasADi’s backbone is a symbolic framework implementing forward and reverse mode of ADon expression graphs to construct gradients, large-and-sparse Jacobians and Hessians.
Interface with Artelys Knitro
For each problem mentioned above, CasADi is able to call relevant solvers, such as Artelys Knitro, a high-performance tool dedicated to NLP/MINLP. This is especially useful to solve high-dimensional nonlinear problems that occur in robotics, for example when performing trajectory planning.
For instance, in a previous news we mentioned an article from the Biomimetic Robotics Lab of the Massachusetts Institute of Technology (MIT) where the authors use CasADi and Knitro for real-time control of their legged robots: the MIT Mini Cheetah and the MIT Humanoid.
Version 13.2 of Artelys Knitro offers many improvements compared to the last version supported in CasADi, some of which are especially relevant in this context:
- Many NLP/MINLP improvements
- New parallelism features on Branch-and-Bound and linear solvers
- Improved presolve including bound tightening and detection of redundant constraints
- New MIP cuts and improved cut generation and selection strategies
- Improved multi-start heuristics
The applications of CasADi in science and engineering involve system design, parameter estimation, Model Predictive Control (MPC) or Moving Horizon Estimation (MHE) in many fields, either directly or embedded in software packages.
In The MIT Mini Cheetah use case mentioned earlier, the authors implemented a NMPC to find optimal landing postures, requiring nonlinear trajectory optimization with contact complementary constraints. Because real-time performance is so important in the short duration of a fall, Knitro was used for its speed, reliable convergence and ability to handle complementarity constraints.
In this article, the authors tackle the topical problem of trajectory generation for autonomous Micro-Aerial-Vehicles. A new formulation is proposed for multirotors trajectory generation that, unlike previous formulations, takes into account gravity, aerodynamic drag as well as obstacles and path constraints. The result is an NLP modeled in CasADi and solved with Knitro. Thanks to their approach and to Knitro, the authors are now able to cold start their optimization and converge to an optimal solution.
This use case also resorts to CasADi to plan multi-contact motions for legged robots to traverse uneven surfaces. Due to perturbations that may arise in real world (e.g. environment changes), online motion planning becomes essential. To this end, the authors use Receding Horizon Planning (RHP) which aims at constantly updating the motion plan. RHP requires the resolution of trajectory optimization problems, which are high-dimensional nonlinear problems, hence why Knitro was chosen as solver.
In this thesis, the race strategy of FIA Formula E is optimized. In this series, energy management is crucial. Defining the best trajectory using only GPS data of the track boundaries is a highly nonlinear problem. Therefore, CasADi and Knitro have been used to compute the optimal energy distribution in a single lap first, and then over the entire race.
— As part of Le Havre Seine Métropole’s energy master plan, Artelys has worked with metropolitan services to set up a web platform for monitoring territorial energy data.
Artelys participation to studies assessing potential contribution of African H2 to EU decarbonization objectives
— As part of the Clean Hydrogen Partnership funding programme, Artelys will participate in the JUST-GREEN AFRH2ICA project along with ten other African and European partners ready to share their know-how on hydrogen economics and technologies.
Artelys demonstrated how to perform cost-benefit analysis of new transmission assets in a smart grid during a webinar hosted by the Linux Foundation Energy and the Global Power System Transformation Consortium showing the strength of the prominent open-source grid computation tool PowSyBl-Metrix.
— We propose building blocks for a common Penta power sector vision and showcase the key enabling role of power system flexibility.
subscribe to our newsletters