Analytical and Numerical Methods for Optimal Control Problems on Manifolds and Lie Groups.