Standing Waves on a String
— Two identical waves travelling in opposite directions superpose into
a standing wave y(x,t) = 2A·sin(kx)·cos(ωt). The string is
fixed at both ends, so only wavelengths λₙ = 2L/n fit,
giving frequencies fₙ = n·v/2L. Nodes stay at zero;
antinodes swing between the dashed envelope. Toggle the two
underlying left- and right-moving travelling waves, or pluck the string
to superpose several harmonics at once.
🎻 Standing Waves on a String
About this simulation
A GLSL fragment shader on your GPU draws a string fixed at both ends. Two counter-propagating travelling waves, A·sin(kx−ωt) (right-moving) and A·sin(kx+ωt) (left-moving), superpose into the standing wave y(x,t)=2A·sin(kx)·cos(ωt). The string oscillates between a fixed envelope, with permanent nodes (always zero) and antinodes (maximum swing).
Controls
Harmonic n (1–8): selects the mode. Wavelength λₙ = 2L/n, frequency fₙ = n·v/2L.
Amplitude: peak displacement A of each travelling wave.
Tension / wave speed v: higher tension raises the wave speed and so the frequency fₙ.
Show component travelling waves: overlays the faint left- and right-moving waves that build the standing pattern.
Pluck: blends in higher harmonics so the string carries several modes at once.
Did you know?
A string of length L clamped at both ends has n−1 interior nodes (n+1 counting the fixed ends) and n antinodes in harmonic n. The fundamental (n=1) is the lowest note; every higher n is an exact integer multiple of it, which is why plucked strings sound musical.