Abstract
Optimization Engine (OpEn) is an open-source code generation tool for real-time embedded nonconvex optimization. It implements the proximal averaged Newton-type method for optimal control (PANOC) combined with penalty and augmented Lagrangian methods to compute approximate stationary points. OpEn's core solver is written in Rust, ensuring memory safety and high performance, while providing high-level interfaces for Python and MATLAB.
Introduction: The Embedded Optimization Challenge
Embedded systems like autonomous drones and industrial robots frequently encounter complex, nonconvex optimization problems that must be solved in real-time. These systems face a significant trade-off between first-order methods, which are memory-efficient but slow to converge, and second-order methods, which converge rapidly but are computationally intensive due to the need for solving expensive linear systems. Furthermore, traditional solvers written in C/C++ often lack modern memory-safety guarantees, posing risks for safety-critical applications.
Methodology: The OpEn Framework
OpEn addresses these challenges by utilizing the Proximal Averaged Newton-type method for Optimal Control (PANOC). This hybrid algorithm leverages the simplicity of gradient-based "oracles" while accelerating convergence through L-BFGS, a quasi-Newton method. To maintain stability in nonconvex regions, it employs the Forward-Backward Envelope (FBE) as a merit function to switch between fast Newton-like steps and robust gradient steps.
Complex nonlinear constraints are managed through a combination of the Penalty Method and the Augmented Lagrangian Method (ALM), transforming constrained problems into a sequence of unconstrained sub-problems.
The core solver is implemented in Rust, providing thread safety and deterministic memory management without a garbage collector. This architecture allows users to define problems in high-level languages like Python (using CasADi) and generate optimized Rust binaries or TCP socket servers for deployment.
Evaluation and Results
The performance of OpEn was evaluated against industry-standard solvers, including IPOPT (interior-point) and SLSQP (sequential least squares programming), across two primary benchmarks: nonlinear Model Predictive Control (MPC) for obstacle avoidance and Moving Horizon Estimation (MHE) for a chaotic Lorenz system.
In the obstacle avoidance task, OpEn demonstrated superior speed and reliability. While competing solvers often approached or exceeded the 50ms real-time sampling limit, OpEn consistently solved the optimization problem in significantly less time.
In the Lorenz system estimation benchmark, OpEn exhibited better scalability. As the estimation horizon increased from $N=50$ to $N=150$, OpEn's runtime remained lower and more predictable compared to the distribution seen in IPOPT.
Conclusion
OpEn bridges the gap between high-level mathematical modeling and high-performance embedded execution. By combining the speed of second-order methods with the low overhead of first-order methods, and leveraging the safety of the Rust programming language, it provides a robust solution for real-time nonconvex optimization. Future work aims to further explore the theoretical convergence properties under broader nonlinear constraint assumptions.
Summary updated