# MPOPT : Optimal control problem solver#

Simple to use, optimal control problem solver library in Python: GitHub.

*MPOPT* is an open-source, extensible, customizable and easy to use
Python package that includes a collection of modules to solve
multi-stage non-linear optimal control problems(OCP) in the standard Bolza form using
pseudo-spectral collocation methods.

## Resources#

Detailed implementation aspects of MPOPT are part of the master thesis.

Quick introduction presentation.

List of solved examples

Features of MPOPT in Jupyter Notebooks

A pdf version of this documentation can be downloaded from PDF document

A must read Jupyter notebook on MPOPT features Getting Started

## Case studies#

Quick demo of the solver using simple moon-lander fuel minimization OCP (bang-bang type control), refer Quick features demo notebook for more details. The image below shows the optimal altitude and the velocity profile (states) along with the optimal throttle (controls) to get minimum fuel trajectory to land on the Moon.

A complex real-world example of The SpaceX falcon9 rocket orbital launch with the booster recovery results are shown below. OCP is defined to find the optimal trajectory and the thrust profile for booster return, refer SpaceX Falcon9 booster recovery notebook for more details. The first image below is the MPOPT solution using adaptive mesh and the second one is the real-time data of the SpaceX Falcon9 launch of NROL76 mission. The ballistic altitude profile of the booster is evident in both MPOPT solution and the real-time telemetry. Further, the MPOPT velocity solution compares well with the real-time data even though the formulation is only a first order representation of the actual booster recovery problem.

## Features and Limitations#

While MPOPT is able to solve any Optimal control formulation in the Bolza form, the present limitations of MPOPT are,

Only continuous functions and derivatives are supported

Dynamics and constraints are to be written in CasADi variables (Familiarity with casadi variables and expressions is expected)

The adaptive grid though successful in generating robust solutions for simple problems, doesnt have a concrete proof on convergence.

## License#

This project is licensed under the GNU LGPL v3 - see the LICENSE file for details

## Acknowledgments#

**Petr Listov**

## Cite#

Thammisetty, “Development of a multi-phase optimal control software for aerospace applications (mpopt),” Master’s thesis, Lausanne, EPFL, 2020.

**BibTex entry**:

- @mastersthesis{thammisetty2020development,
title={Development of a multi-phase optimal control software for aerospace applications (mpopt)}, author={Thammisetty, Devakumar}, year={2020}, school={Master’s thesis, Lausanne, EPFL}}