In this paper, we solve an optimal control problem using the
calculus of variation. The system under consideration is a
switched autonomous delay system that undergoes jumps at the
switching times. The control variables are the instants when the
switches occur, and a set of scalars which determine the jump
amplitudes. Optimality conditions involving analytic expressions
for the partial derivatives of a given cost function with respect
to the control variables are derived using the calculus of
variation. A locally optimal impulsive control strategy can then
be found using a numerical gradient descent algorithm.