loading...
running...
How to use
Pick a preset or use Pluck or Send pulse; drag to orbit. Watch how a pulse reflects at a fixed, free or absorbing end and at the density junction (blue part is the heavier string). Turn on the driver and tune it to mode n to see standing waves; the x-t diagram shows reflections as diagonal bands. The probe dot feeds the probe graph. Space pauses, R clears.
Models and baked PBR textures made in Blender; Three.js r160 animates the string from the same solver module as the 2D page. The vertical exaggeration slider is large because real displacements are millimetres.
The science
A transverse displacement y(x,t) on a stretched string of linear density μ and tension T obeys the wave equation (small slopes, no stiffness):
μ(x) ∂²y/∂t² = T ∂²y/∂x² - b ∂y/∂t, wave speed c = sqrt(T/μ), impedance Z = sqrt(T μ)
The solver is the standard leapfrog scheme on 401 points with a time step 0.9 dx/c_max, below the Courant limit dx/c. The fastest wave in the string sets the step, so a time step of tens of microseconds is simulated and shown in slow motion.
Reflection at a junction. Where the density changes from μ1 to μ2 the displacement and the slope (force balance) must be continuous. For a pulse arriving from the left this gives
R = (Z1 - Z2)/(Z1 + Z2), T_c = 2 Z1/(Z1 + Z2), 1 + R = T_c
A heavier second string (Z2 > Z1) reflects with inverted sign; a fixed end is the limit Z2 → infinity (R = -1) and a free end Z2 → 0 (R = +1). The energy reflection fraction is R², transmitted (Z2/Z1) T_c², and they add to 1.
Standing waves. A uniform fixed-fixed string supports modes f_n = n c/(2L) with shapes sin(nπx/L). With a junction the modes follow from matching the two sections, Z1 cos(a) sin(b) + Z2 sin(a) cos(b) = 0 with a = 2πf L1/c1, b = 2πf L2/c2; the readout and the spectrum graph use this exact condition. The bars show the plain sine-series coefficients of the current shape, which are exact modes only for a uniform string.
Simplifications. Small slopes (the picture is exaggerated vertically by the slider), no stiffness or dispersion (real piano strings are inharmonic), a perfectly absorbing end is a first-order boundary condition that reflects a few percent at oblique incidence (here only normal incidence exists), and the damping is simple viscous drag. Pulse and wave speeds are real SI values; time is slowed by the slow-motion slider, otherwise a pulse would cross a metre in about 15 ms.