A Python version of mesh refinement algorithm for optimal control problems. The code is illustrated by an example in GPOPS-II (Moon lander).
The control profile for the Moon lander problem is as follows.
An hp‐adaptive pseudospectral method for solving optimal control problems. Optimal Control Applications and Methods, 2011.