Numerical methods for optimal control problems : algorithms , analysis and applications