  The Switch Point Algorithm is a new approach for solving optimal control
problems whose solutions are either singular or bang-bang or both singular and
bang-bang, and which possess a finite number of jump discontinuities in an
optimal control at the points in time where the solution structure changes.
Problems in this class can often be reduced to an optimization over the
switching points. Formulas are derived for the derivative of the objective with
respect to the switch points, the initial costate, and the terminal time. All
these derivatives can be computed simultaneously in just one integration of the
state and costate dynamics. Hence, gradient-based unconstrained optimization
techniques, including the conjugate gradient method or quasi-Newton methods,
can be used to compute an optimal control. The performance of the algorithm is
illustrated using test problems with known solutions and comparisons with other
algorithms from the literature.
