  This paper studies the design of feedback controllers to steer a switching
linear time-invariant dynamical system towards the solution trajectory of a
time-varying convex optimization problem. We propose two types of controllers:
(i) a continuous controller inspired by the online gradient descent method, and
(ii) a hybrid controller that can be interpreted as an online version of
Nesterov's accelerated gradient method with restarts of the state variables. By
design, the controllers continuously steer the system towards the time-varying
optimizer without requiring knowledge of exogenous disturbances affecting the
system. For cost functions that are smooth and satisfy the Polyak-\L ojasiewicz
inequality, we demonstrate that the online gradient-flow controller ensures
uniform global exponential stability when the time scales of the system and
controller are sufficiently separated and the switching signal of the system
varies slowly on average. For cost functions that are strongly convex, we show
that the hybrid accelerated controller outperforms the continuous gradient
descent method. When the cost function is not strongly convex, we show that the
the hybrid accelerated method guarantees global practical asymptotic stability.
