  Though switched dynamical systems have shown great utility in modeling a
variety of physical phenomena, the construction of an optimal control of such
systems has proven difficult since it demands some type of optimal mode
scheduling. In this paper, we devise an algorithm for the computation of an
optimal control of constrained nonlinear switched dynamical systems. The
control parameter for such systems include a continuous-valued input and
discrete-valued input, where the latter corresponds to the mode of the switched
system that is active at a particular instance in time. Our approach, which we
prove converges to local minimizers of the constrained optimal control problem,
first relaxes the discrete-valued input, then performs traditional optimal
control, and then projects the constructed relaxed discrete-valued input back
to a pure discrete-valued input by employing an extension to the classical
Chattering Lemma that we prove. We extend this algorithm by formulating a
computationally implementable algorithm which works by discretizing the time
interval over which the switched dynamical system is defined. Importantly, we
prove that this implementable algorithm constructs a sequence of points by
recursive application that converge to the local minimizers of the original
constrained optimal control problem. Four simulation experiments are included
to validate the theoretical developments.
