Python software for Strategies and Heuristics Regarding Lifting of Optimal Control problems (PySHeRLOC)
This software implements the benchmarks and algorithms described in [1].
To use blockSQP2, you have to follow the installation instructions from [2]. Afterwards, change the path inside the file blocksqp_path.txt to your local installation:
# path to your local installation of blockSQP2:
{PATH_TO_LOCAL_INSTALLATION}/blockSQP2/Python
To use the CasADi version of blockSQP, you have to configure the ma27 solver.
First, create a new virtual python environment, e.g.,
python -m venv .venv
Then activate the virtual environment and install the necessary packages via:
source .venv/bin/activate
python -m pip install -r requirements.txt
Now you can start the solver with user interface by running
python GUI.py # for the normal optimal control problems
python OED_GUI.py # for OED problems
from the same folder as the file itself.
To benchmark all problems listed in benchmark_problems.txt, run:
bash run_all_alg_benchmarks.sh # to benchmark all algorithms
bash run_all_def_benchmarks.sh # to benchmark all shooting discretizations
Alternatively, you can run the corresponding benchmark with the desire arguments, e.g.,
# benchmarks the Bioreactor problem using the exact Hessian variant of blockSQP2
python benchmark_def.py -n "Bioreactor" -hess y -solver blockSQP2
# benchmarks the automatic condensing algorithm for Lotka OED using the Quasi-Newton variant of blockSQP2
python benchmark_algs.py -n "Lotka OED" -hess n -fs n -cond y
The problem titles refer to the description on mintOC. They can be solved using IPOPT, blockSQP, blockSQP2, or fatrop.
Benchmark problems can be found inside the Apps folder. Those include, among many others:
| Bioreactor | Bioreactor Mayer | Bryson Denham | Bryson Denham Mayer |
| Cart Pendulum | Cart Pendulum Mayer | Catalyst Mixing | Cushioned Oscillation Mayer |
| Dielectrophoretic Particle Mayer | Double Oscillator | Double Oscillator Mayer | Ducted Fan |
| Egerstedt | Egerstedt Mayer | Electric Car | Electric Car Mayer |
| Fuller | Fuller Mayer | Hang Glider | Hanging Chain |
| Lotka Competitive | Lotka Competitive Mayer | Lotka Shared | Lotka Shared Mayer |
| Lotka Volterra | Lotka Volterra Mayer | LQR | Moon Landing |
| Mountain Car Mayer | Ocean | Quadrotor | Rao Mease |
| Three Tank | Three Tank Mayer | Van der Pol | Van der Pol Mayer |
| Lotka OED | Dielectr Particle OED | Jackson OED | Van der Pol OED |
[1]: Lampel, R., Sager, S.: "On lifting strategies for optimal control problems"
