Numerical computation of optimal control sequences and trajectories