The 3D sim evaluates the standard mass-perturbation formula for a tensioned string directly and animates a matching sine curve. This 2D companion instead discretizes the beam into masses connected by tension and numerically integrates Newton's second law forward in time (velocity-Verlet leapfrog) with the particle's mass genuinely added to the mesh at its landing node:
mu(x) y_tt = T y_xx (string wave equation, mu(x) = mu0 everywhere,
plus dm/dx smeared over one cell at x₀)
y_i'' = (T / mu(x_i)) (y_{i+1} - 2y_i + y_{i-1}) / dx²
Every rendered frame, the raw mesh displacement is projected onto the sin(nπx/L) basis — a discrete sine transform, exactly what a lock-in amplifier extracts from a real resonator's readout — giving each mode's own time-domain signal. Counting the time between that signal's zero-crossings gives the period, and hence the frequency, with no formula involved. A second, undisturbed copy of the same mesh runs alongside as the reference clock, so the fractional shift Δf₀/f₀ comes from two independently measured numbers, not from evaluating an equation.
R = (Δf₂/f₂) / (Δf₁/f₁) = 4cos²(πx₀/L)
x₀ = (L/π)·arccos(√(R/4))
δm = −M · (Δf₁/f₁) / sin²(πx₀/L)
A discrepancy worth flagging: deriving the shift from Rayleigh's method (a point mass dm raises mode n's effective modal mass by dm·sin²(nπx₀/L), and the modal mass of a string mode is M/2) gives Δf_n/f_n ≈ −(δm/M)·sin²(nπx₀/L). The time-domain measurement here reproduces exactly that relationship to within a few percent across every tested landing point and mass. The 3D version's theory panel states the shift as −(2δm/M)·sin²(...) — twice too large — which would recover a mass estimate exactly half the true value. This simulator uses the δm/M form, verified independently by the time-stepped mesh rather than assumed from either formula.
- Tension — the engine's own internal clock is fixed for a watchable on-screen oscillation rate; tension instead scales how tall the visible string deflection sits and (through the standard unperturbed-string formula) the real MHz frequencies reported once a measurement locks.
- Length — longer beams have lower real resonant frequencies for the same tension, exactly as in the 3D sim; the fractional shifts themselves depend only on x₀/L and δm/M, so they are unaffected.
- Particle mass — the true δm applied to the mesh the next time you drop a particle.
- Drop particle — restarts the loaded mesh from rest with the particle's mass on it and begins timing; watch the "measuring" status until enough oscillation cycles have been clocked to lock a frequency estimate, just as a real spectrum sweep needs integration time.