Pull the brass mass down, release it, and time the oscillation. Does the period depend on gravity? On the mass of the spring itself?
Each preset changes a single idea. Compare Earth and Moon: the stopwatch period stays the same.
Changing any parameter restarts the run from the pulled-down position. Spring mass uses the lumped correction m + ms/3.
Blue: RK4 integration. Orange dashed: closed-form solution. They overlap when the numerics are correct.
Times the oscillation for 7 different masses at your k and spring mass, then fits T² = (4π²/k) m + (4π²/k)(mₛ/3). The slope gives k; the intercept reveals the spring's own mass.
A bob of mass m hangs on a spring of stiffness k. Measured from the stretched equilibrium, the motion is a harmonic oscillation. Gravity only shifts the equilibrium, e_eq = (m + mₛ/2) g / k; it cancels from the equation for x = e − e_eq:
(m + mₛ/3) x'' + c x' + k x = 0
So ω₀ = √(k / (m + mₛ/3)) and T = 2π √((m + mₛ/3)/k), identical on the Moon and on Jupiter. Only the equilibrium length changes. With damping ratio ζ = c / (2√(k m_eff)), the damped period is T / √(1 − ζ²) for ζ < 1; at ζ ≥ 1 there is no oscillation.
The one-third comes from integrating the kinetic energy of a uniform spring whose displacement grows linearly from the top: ∫ ½ (mₛ/L)(v s/L)² ds = ⅙ mₛ v². The mean extension of the coils at rest gives the mₛ/2 in the gravity term.
Simplifications: the spring is assumed to stretch uniformly and to stay within Hooke's law; coil-to-coil waves and transverse swinging are ignored; damping is linear (viscous). The 3D coil is a visual only: its length follows the computed extension. The integrator is RK4 with a fixed 0.5 ms step; the check above compares it to the closed-form solution and does not reuse the renderer.
Pitfall: using only the bob mass underestimates the period by about mₛ/(6m) in relative terms for a light spring.