Solution of dynamic optimization problems by successive quadratic programming and orthogonal collocation