File Exchange

image thumbnail

OpenOCL - Open Optimal Control Library

version 6.01 (237 KB) by Jonas
Optimal Control toolbox for Matlab, Octave. Model-predictive control (MPC) and Trajectory optimization software.


Updated 07 Aug 2019

GitHub view license on GitHub

OpenOCL v6 now with acados interface!

Optimal Control allows you to formulate control problems (control theory) as mathematical optimization problems. OpenOCL provides a modeling language that makes it particularly easy to implement optimal control problems in a natural way. The toolbox assures that the optimal control problems can be solved in an efficient way, and is able to directly call the fast (C/C++) implementations of the underlying numerical optimization solvers that calculate the control inputs for your system.

Optimal control:
- Model dynamical systems: robot, car, aircraft, spacecraft, wind turbine, mechanical system, chemical system
- Specify cost functions or rewards: balancing of a robot, grasping, reaching goal in minimum time, tracking problems
- Specify constraints: joint limits, obstacles, velocity limits, torque limits, flight envelop, starting state, end state

Trajectory optimization:
- Solve the optimal control problem with Ipopt, a powerful non-linear programming solver (non-linear cost, constraints, dynamics)
- Analyze the the behavior of your system for different conditions
- Monte Carlo simulation

Model Predictive Control:
- Solve the optimal control problem in real-time with specialized solvers that take advantage of the problem structure (linear, quadratic, polytopic, non-linear constraints/costs/dynamics)
- Real-time iteration to minimize feedback times in a real-time loop

- Automatic differentiation through CasADi
- Multi-stage problems
- Matrix-valued variables
- Access all variables by their name (no indexing required)
- Easy plotting of initial guess, intermediate steps, and solution
- Get started within minutes (dependencies will be resolved automatically on first startup)
- Get the .mltbx package from the website and install as an Add-on

Applications (non-exhaustive list):
- Robotics
- Aerospace engineering
- Wind power
- Mechanical systems
- Chemical systems

Copyright 2019 Jonas Koenemann, Moritz Diehl, University of Freiburg
Redistribution is permitted under the 3-Clause BSD License terms. Please
ensure the above copyright notice is visible in any derived work.

The project is at the time of the release being developed at University of
Freiburg, Germany, under the supervision of Prof. Moritz Diehl.

Main developer:
Jonas Koenemann,,

Systems Control and Optimization Laboratory,
Department of Microsystems Engineering (IMTEK) and Department of Mathematics,
University of Freiburg, Georges-Koehler-Allee 102, 79110 Freiburg, Germany

OpenOCL: Copyright 2019 Jonas Koenemann, Moritz Diehl, University of Freiburg

Comments and Ratings (6)


Hi Jan, thanks a lot for the feedback! I updated the description, let me know (here or by mail) if there is anything missing that you would expect to be in the description. Best, Jonas


@Moritz and Jonas: It would be useful to explain here, what this tool does, because this is the information users need to decide, if this is a useful submission for them or not. The link to clarifies this exhaustively, if you are familiar with this topic already. But the average visitor on the FileExchange pages won't get any clue. Who needs this tool to solve which problem? Kind regards from Heidelberg!


Easy to use, nice!



acados interface
API updates


feature automatic differentiation


reformulation of description


introduction description




- allow use of custom CasADi installation
- resolved warning
- added description


- multi-stage problems (bouncing ball)
- GettingStarted.mlx
- Package documenation (doc ocl)
- Increased compatibility (R2014+)


Connected to github


Fixing issues with adding from Matlab Add-on manager

MATLAB Release Compatibility
Created with R2016a
Compatible with R2014b to any release
Platform Compatibility
Windows macOS Linux