Skip to content

johnny-godoy/bocop-reader

Repository files navigation

BOCOP Reader

This project implements the BOCOPSolution Python class, which reads a BOCOP solution directory for ease of use in scientific and engineering applications.

For example, it implements:

  • Grouping states/adjoint states/control variables together in VariableBunch classes.
  • Representing variables in common types for scientific Python, such as NumPy ndarray and Pandas DataFrame.
  • Improved plotting with the matplotlib library, easily plotting variables over time as well as phase diagrams between states with full customization capabilities.
  • Variable interpolation with cubic splines, allowing for easy differentiation and integration.
  • Variable interpolation with piecewise constants, numerically detecting bang-bang controls and returning their LaTeX representation.

Installation and use

For local or Google Colab installation, just use the command:

pip install git+https://github.com/johnny-godoy/bocop-reader.git

The main object that stores all solution files is the BOCOPSolution class, which can be imported like such:

from bocop_solution import BOCOPSolution

We include a small guide in the notebooks/Introduction.ipynb notebook. It is also available as HTML here.

Contact

For bug reports and user help, I recommend you to use the GitHub Issues feature, but you may also contact the author at [email protected].

About

Python Library for reading and handling BOCOP solution files

Topics

Resources

License

Stars

Watchers

Forks

Languages