Checks (measured vs predicted)
The science
Each ball is a pendulum, θ″ = −(g/L) sinθ, with period T ≈ 2π√(L/g)(1 + θ²/16 + 11θ⁴/3072) for amplitude θ. Adjacent balls collide when their horizontal positions meet; for equal masses the impulse is j = (1+e)/2 · (vi − vj), which for e = 1 exchanges velocities, so k balls in give k balls out. The solver sweeps the collision chain several times per step so the impulse propagates through touching balls.
Total energy is Σ ½(Lω)² + m g L (1 − cosθ); with e < 1 each collision loses a fraction (1−e²)/2 of the relative kinetic energy and the swing decays. Simplifications: pairwise instantaneous collisions (no Hertz contact time), point contact on the horizontal line, no air drag. Educational model.