Critical oscillations of mass–spring systems due to nonsmooth friction