Solves the ODE of a pendulum
with damping (no damping if r is given as zero) through
a RK4 numerical integration. The equation, with angle φ vs. time,
t, is
m l φ" + r l φ' +
m g sin(φ) = 0 .
(Further on, it may be x ≡ φ .)
NB: it is always g = 9.8 m ⁄ s² .
A plot is shown for: angle, φ,
its derivative, φ'; and the small amplitude (φ*)
solution.
Other suggested values: r = 0 (no damping),
φ0 ≤ (⪅) 0.05 (i.e., "small"),
φ'0 = 0, giving coincident
φ* ≅ φ. |