  We consider the optimization of a dynamical system by switching at discrete
time points between abstract evolution equations composed by nonlinearly
perturbed strongly continuous semigroups, nonlinear state reset maps at mode
transition times and Lagrange-type cost functions including switching costs. In
particular, for a fixed sequence of modes, we derive necessary optimality
conditions using an adjoint equation based representation for the gradient of
the costs with respect to the switching times. For optimization with respect to
the mode sequence, we discuss a mode-insertion gradient. The theory unifies and
generalizes similar approaches for evolutions governed by ordinary and delay
differential equations. More importantly, it also applies to systems governed
by semilinear partial differential equations including switching the principle
part. Examples from each of these system classes are discussed.
