  We present necessary and sufficient optimality conditions for finite time
optimal control problems for a class of hybrid systems described by linear
complementarity models. Although these optimal control problems are difficult
in general due to the presence of complementarity constraints, we provide a set
of structural assumptions ensuring that the tangent cone of the constraints
possesses geometric regularity properties. These imply that the classical
Karush-Kuhn-Tucker conditions of nonlinear programming theory are both
necessary and sufficient for local optimality, which is not the case for
general mathematical programs with complementarity constraints. We also present
sufficient conditions for global optimality.
  We proceed to show that the dynamics of every continuous piecewise affine
system can be written as the optimizer of a mathematical program which results
in a linear complementarity model satisfying our structural assumptions. Hence,
our stationarity results apply to a large class of hybrid systems with
piecewise affine dynamics. We present simulation results showing the
substantial benefits possible from using a nonlinear programming approach to
the optimal control problem with complementarity constraints instead of a more
traditional mixed-integer formulation.
