  In this work, we propose an adaptive spectral element algorithm for solving
nonlinear optimal control problems. The method employs orthogonal collocation
at the shifted Gegenbauer-Gauss points combined with very accurate and stable
numerical quadratures to fully discretize the multiple-phase integral form of
the optimal control problem. The proposed algorithm relies on exploiting the
underlying smoothness properties of the solutions for computing approximate
solutions efficiently. In particular, the method brackets discontinuities and
"points of nonsmoothness" through a novel local adaptive algorithm, which
achieves a desired accuracy on the discrete dynamical system equations by
adjusting both the mesh size and the degree of the approximating polynomials. A
rigorous error analysis of the developed numerical quadratures is presented.
Finally, the efficiency of the proposed method is demonstrated on three test
examples from the open literature.
