  We propose an efficient algorithm for the optimal control problems (OCPs) of
nonlinear switched systems that optimizes the control input and switching
instants simultaneously for a given switching sequence. We consider the
switching instants as the optimization variables and formulate the OCP based on
the direct multiple shooting method. We derive a linear equation to be solved
in Newton's method and propose a Riccati recursion algorithm to solve the
linear equation efficiently. The computational time of the proposed method
scales linearly with respect to the number of time stages of the horizon as the
standard Riccati recursion. Numerical experiments show that the proposed method
converges with a significantly shorter computational time than the conventional
methods.
