Switched pendulum dynamics.