The time optimal control of a multibody system
is solved by an indirect method via the Pontryagin Maximium Principle.
When the equations are linear in the control variables
then the control is of bang-bang type.
The resulting problem is a two point boundary value
problem with switching functions.
This problem ist solved by a shooting method where the adjoint
equations are discretized by a magnus method.