Sudden change in a second-order nonlinear system with a slowly varying parameter