Behind the science
The nonlinear pendulum obeys θ̈ = −(g/L)sin(θ) − cθ̇. Longer pendulums swing more slowly; stronger gravity increases frequency; damping converts mechanical energy into heat. The angular equation is integrated using small timesteps, rather than playing a fixed animation.