Elastic pendulum solver

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 elastic pendulum

d2zdt2=(l0+z)θ˙2kzm+gsinθd2θdt2=gl0+zcosθ2z˙θ˙l0+z.\begin{aligned} \dfrac{d^{2}z}{dt^2} &= (l_0 + z) \dot{\theta}^2 - \dfrac{kz}{m} + g \sin{\theta} \\ \dfrac{d^{2} \theta}{dt^2} &= -\dfrac{g}{l_0 + z} \cos{\theta} - \dfrac{2\dot{z}\dot{\theta}}{l_0 + z}. \end{aligned}

Where:

  • zz is the extension of the pendulum beyond its rest length (in metres).

  • θ\theta is the angle of the pendulum relative to the positive xx-axis.

  • gg is the acceleration due to gravity (in metres per second squared).

  • l0l_0 is the rest length of the pendulum.

Simulation parameter form.
Parameter Value Explanation
Acceleration due to gravity in metres (m) per second (s) squared (ms2\mathrm{m}\cdot \mathrm{s}^{-2}).
Rest length (m) of pendulum rod.
Spring coefficient of pendulum.
Mass (kilograms or kg) of pendulum bob.
End time (s) for the simulation.
Initial value of zz (m).
Initial value of z˙\dot{z} (ms1\mathrm{m}\cdot \mathrm{s}^{-1}).
Initial value of θ\theta in radians (r).
Initial value of θ˙\dot{\theta} (rs1\mathrm{r}\cdot \mathrm{s}^{-1}).
Error tolerance.
Tolerance type, can be either absolute (0) or relative (1).
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. tScale=1.0t_{\mathrm{Scale}}=1.0 means animation and real time match. tScale<1.0t_{\mathrm{Scale}}<1.0 means the animation is going more slowly than real time. tScale>1.0t_{\mathrm{Scale}}>1.0 means it is going more rapidly.