Code for reproducing results in (T. Lew, "Rough Stochastic Pontryagin Maximum Principle and an Indirect Shooting Method", available at https://arxiv.org/abs/2502.06726, 2025).
To reproduce results, move to the scripts folder cd scripts
and run:
- Example for open-loop optimal control:
python example_openloop.py
- Example for feedback optimal control:
python example_feedback.py
- Compare solutions to open-loop and feedback problems:
python compare_openloop_feedback.py --solve --plot
- Solve the open-loop for different hyperparameters via the direct and indirect methods:
python compare_hyperparameters.py --solve-comparison --sample-sizes-sweep
This code was tested with Python 3.10.12 on Ubuntu 22.04.5.
We recommend installing the package in a virtual environment. First, run
python -m venv ./venv
source venv/bin/activate
Upgrade pip:
python -m pip install --upgrade pip
Then, install all dependencies (numpy, scipy, jax, osqp, matplotlib, pytest, tqdm) by running
python -m pip install -r requirements.txt
and the package can be installed by running
python -m pip install -e .
The following command should run successfully:
python -m pytest