Duffing JavaScript integrator

This webpage uses the Runge-Kutta-Fehlberg fourth-order method with fifth-order error checking (RKF45) to approximate the solution to the problem of the Duffing oscillator:

x¨+δx˙+αx+βx3=γcos(ωt)\begin{aligned} \ddot{x} + \delta \dot{x} + \alpha x + \beta x^3 = \gamma \cos{(\omega t)} \end{aligned}

Below you can specify these various parameters, as well as the initial conditions and starting and end times. The default values give chaotic behaviour.

Simulation parameter form.
Parameter Value Explanation
Linear stiffness parameter.
Nonlinearity in restoring force parameter.
Amplitude of periodic driving force.
Damping parameter.
Angular frequency of periodic driving force.
Starting time for the simulation in seconds (s).
End time for the simulation in seconds..
x coordinate in metres (m) at time t0t_0.
First derivative of xx with respect to tt at t0t_0 (in ms1\mathrm{m}\cdot \mathrm{s}^{-1}).
Absolute error tolerance.
Initial step size.
Minimum allowed step size.
Time increment for skipping ahead in animation.
Time you want to skip ahead to in animation when you press the skip button.
Width (in px) of Plotly windows used for plotting and animation below.
Height (in px) of Plotly windows used for plotting and animation below.
Proportion of animation time passed per real time. Delay=1.0 means animation and real time match. Delay<1 means the animation is going more slowly than real time. Delay>1.0 means it is going more rapidly.