Stabilizing system behavior

A simulation that exhibits an oscillating behavior that increases rapidly in amplitude points to unstable integration settings. When this occurs, decrease the integration step size or switch to an integration algorithm that yields more accurate results and produces less accumulated errors over the course of the simulation, such as the adaptive Runge Kutta 5th order or adaptive Bulirsh-Stoer integration algorithm.

For highly nonlinear systems or stiff systems, you should use backward Euler.