Every figure here runs live. The lab above uses the same equations on a grid of a few hundred points, 44,100 times a simulated second.
The wave equation
A small piece of string feels the tension pull on both of its ends. When the string is straight the two pulls cancel. When it is curved they do not, and the net force points toward the inside of the curve. Divide that force by the mass of the piece and you get its acceleration:
Here u is the sideways displacement, T the tension and μ the mass per metre. So the acceleration is the curvature times c². This is what the magma colour in the lab shows: bright where the string bends hard, dark where it is straight. A plucked string is a set of straight lines joined at sharp corners, so all the force sits in those corners.
d'Alembert saw in 1747 that any solution is two shapes moving in opposite directions at speed c:
A pluck starts as two equal half-height copies of the triangle, one running each way. At a fixed end each copy comes back upside down. The figure shows the two copies (blue and orange) and their sum (white). The corners are where the force is.
Two travelling waves add to the plucked shape. Each reflects upside down at a fixed end.
Standing waves
The waves bounce between the ends, so only shapes that fit a whole number of half wavelengths survive. These are the modes. Mode n has n loops, n − 1 still points inside (nodes) and moves as a whole at one frequency:
The first five modes. Dots are nodes. Mode n vibrates n times as fast as mode 1.
Any motion of the string is a sum of these modes. The bars under the lab string show how much of each mode is on the string now.
What sets the pitch
The fundamental takes one round trip, 2L, at speed c:
This is Mersenne's law (1636). Halve the length and the pitch goes up an octave: that is the 12th fret. Four times the tension also gives an octave. A heavier string (larger μ) is lower, which is why the bass strings are wound with wire: more mass without more stiffness.
Change length, tension and mass. The string slows down 200 times so you can see it.
The harmonic series and its ratios
The modes of an ideal string are exact whole-number multiples of f₁. Two notes sound smooth together when their harmonics line up, which happens when their frequencies are in a ratio of small whole numbers:
Harmonics 1 to 12 of a low E on a log frequency axis, with the ratio between neighbours. The intervals get smaller as you go up.
Play a chord in the lab and watch the bars: each string adds its own series, and in a major chord many of those lines fall on top of each other.
Why the pluck position changes the tone
A pluck at fraction p of the length gives mode n the amplitude
A mode with a node at the pluck point gets nothing. Pluck at the middle (p = 1/2) and every even harmonic is gone: the tone is round and hollow. Pluck near the bridge and many high modes stay: the tone is bright and thin. Guitarists play near the sound hole, about p = 1/5, so the 5th, 10th and 15th harmonics are missing.
The pluck point moves along the string. Red bars are harmonics with a node at the pluck point.
Inharmonicity: real strings are stiff
A steel string also resists bending. That adds a fourth-derivative term, and high modes go a little sharp:
For guitar strings B is about 10⁻⁵ to 10⁻⁴, so the 8th harmonic is a few cents sharp. A piano's short bass strings are much worse, which is why tuners stretch the octaves. Turn up Stiffness in the lab and watch the spectrum lines move right of the grid.
How sharp each harmonic is, in cents, for a plain steel B string, a wound low E, and a string with 30 times the B value of the plain B string.
Frets and twelve equal steps
Each fret shortens the string by the same factor, 2−1/12, so each step is the same ratio, 100 cents:
This makes every key sound the same, but only the octave is a pure ratio. The equal fifth (27/12 = 1.4983) is 2 cents flat of 3/2. The equal major third (1.2599) is 14 cents sharp of 5/4, and you can hear it as a slow beat.
Fret positions on a 648 mm scale. The spacing shrinks by 5.6 % at each fret.
How the body makes it loud
A string is too thin to push much air. It pushes the bridge instead, with the force
The bridge drives the top plate, and the top and the air inside the box have resonances of their own. Near a resonance the body radiates much more. The guitar's air mode near 100 Hz gives the bass its boom. A violin's main body modes sit near 280, 470 and 550 Hz, and its bridge adds a broad lift near 2.5 kHz.
Gain of the body filters used for the lab's sound, for the three instruments.
Bowing: stick and slip
A bow does not pluck. Rosin makes the hair grip the string, which moves with the bow (stick) until the string's pull is larger than friction. Then it snaps back (slip), and grips again. Helmholtz found in the 1860s that the string takes a simple shape: two straight lines joined at one sharp corner. The corner runs around a lens-shaped path once per period, and each time it passes the bow, the string slips.
Here β is the bow position as a fraction of the length. Choose the violin and the Bow tool in the lab and hold the bow on a string to watch the corner travel.
Helmholtz motion. Top: the string with its travelling corner. Bottom: the string velocity under the bow.
The mathematics of a string
Twelve steps from Newton's law to the colours in the lab. Each figure runs the page's own engine, and each "See it in the lab" button sets the views above to show the same thing.
1. The wave equation from one piece of string
Take a short piece of string between x and x + dx, with tension T and mass per length μ. The tension pulls along the string at each end. If the slopes are small, the angle of the string is θ ≈ ∂u/∂x, and the vertical pulls are T sin θ ≈ T ∂u/∂x. The net vertical force is the difference of the two ends:
Newton's second law for the piece, mass μ dx, gives:
A straight piece feels no net force, whatever its slope. Only a bend, the curvature ∂²u/∂x², accelerates the string.
The two tension forces (orange) and their sum (yellow). Move the slider through zero: a straight piece has no net force.
2. d'Alembert's solution and the fixed ends
Any function of x − ct or x + ct solves the wave equation, so the general solution is two shapes moving apart at speed c:
The ends are fixed, u(0, t) = u(L, t) = 0. To keep them at zero, continue the start shape u₀ as an odd function about both ends, so it repeats every 2L. Each wave that reaches an end meets its upside-down image, and the two cancel at the end:
The real string is the bright window. The faint copies are its odd images. A wave leaves the window as its image comes in upside down: that is the reflection.
3. Separation of variables and the modes
Try a solution that is a shape times a time function, u = X(x) T(t). The wave equation splits into two ordinary equations with one constant, −k²:
X(0) = X(L) = 0 allows only sin(kx) with kL = nπ. So the string has a ladder of modes, each a standing sine that swings at its own frequency:
Because the equation is linear, any motion of the string is a sum of these modes.
X(x) is the dashed envelope, T(t) the phasor on the right. Their product is the moving string. Green dots are the nodes.
4. Fourier coefficients of a pluck
A pluck at x₀ = pL pulls the string into a triangle of height h and lets go with zero velocity. Project the triangle onto each mode with the orthogonality of the sines:
Two facts follow. The amplitudes fall as 1/n², so a pluck is mellow compared with a strike (1/n). And if p = 1/k, then sin(nπp) = 0 for n = k, 2k, …: a mode with a node at the pluck point cannot be excited. Plucking at a fifth of the string removes the 5th, 10th and 15th harmonics.
Bars: the formula. Dots: the same numbers measured from the lab's StringSim, by projecting its plucked shape onto the modes. Red: harmonics that the pluck point removes.
5. Energy in each mode
The energy of the string is kinetic plus the stretch of the tension:
Put in the mode sum. The cross terms integrate to zero, because the sines are orthogonal, so the energy is a sum over modes, and each mode keeps its own energy:
For the pluck, the sum equals the work done to pull the string aside, Th²/(2L p(1 − p)). With damping each mode loses energy as e^(−2σₙt), and the high modes go first.
Bars: energy of modes 1 to 12 now (yellow) and at the start (grey). Right: the total over 4 s.
6. Stiffness, dispersion and inharmonicity
A real string also resists bending, like a thin beam with Young's modulus E and second moment I = πd⁴/64. That adds a fourth-derivative term:
Put in u = sin(kx) cos(ωt). Waves of different length now travel at different speeds, which is dispersion, and the modes are no longer whole multiples:
Thick, stiff, short strings have the largest B. That is why a wound string uses a thin core: the winding adds mass but almost no stiffness.
Left: frequency against wave number for a flexible string (dashed) and for this stiff string. Right: how many cents each partial is sharp of n f₁.
7. Damping and decay times
The lab adds two loss terms (Bilbao's model): σ₀ removes energy at the same rate for every mode (air), and σ₁ removes more from short waves (losses inside the string):
For mode n, u_txx = −(nπ/L)² u_t, so each mode decays as e^(−σₙt) with its own rate. The time to fall by 60 dB, a factor of 1000 in amplitude, follows:
Left: T60 of modes 1 to 20. Right: modes 1, 4 and 8 dying away (oscillation drawn slow). The defaults are the steel A2 string of the lab.
8. The acceleration field: what the colours show
The right side of the equation of motion is the total force per unit mass on each point of the string. That is the acceleration the lab colours:
The tension term is by far the largest, so a ≈ c²u_xx: the colour is the curvature times c². A plucked string is straight lines and corners. The straight parts are dark, because nothing pulls them, and the corners glow, because all the force is there. Watch the corners run to the ends and back: that is d'Alembert's two waves. The field menu in the lab shows each term on its own.
A StringSim of the classical E string, in slow motion. Top: the shape. Middle: the curvature. Bottom: |a| in magma, as the lab draws it.
9. Impedance and the bridge
A string resists being moved sideways with its wave impedance, the force needed per unit of transverse velocity:
When a wave on string 1 meets a second medium with impedance Z₂, part reflects and part goes on. Matching the force and the velocity at the joint gives:
A guitar bridge has an impedance of order 10²–10³ kg/s; a string about 1 kg/s. So the displacement wave reflects almost fully and upside down (r_u ≈ −1), and only a few parts in a thousand go into the top plate per bounce. That small leak is all the sound you hear from the body, and it is why the note can sustain for seconds. The amplitude decay from the bridge alone is σ = f₁ (−ln|r|).
A pulse on string 1 (blue) meets string 2 (orange). At Z₂ = Z₁ it passes through with no reflection; at large Z₂ the joint acts like a fixed end.
10. Helmholtz motion of a bowed string
A bow does not pluck once; it sticks and slips every period. Helmholtz saw in 1863 that the result is a single corner running round the string along two parabolas. In modes, every harmonic is present with amplitude 1/n² and the same phase:
The sum is two straight lines meeting at a corner at x = c t (and back). Under the bow the string velocity has only two values: it moves with the bow (stick), then flies back (slip) when the corner passes. The spectrum, 1/n² in displacement and 1/n in velocity, is the bright sawtooth sound of a violin.
With few modes the corner is round; with many it is sharp. The dashed parabolas are the envelope.
11. Beats and coupled strings
Two tones close in frequency add to a tone at the mean frequency whose loudness swells and fades:
So you hear Δf beats per second; tuning two strings means slowing the beats to zero. Strings on the same bridge are also coupled: the bridge moves a little and drives the other strings. Two equal strings with coupling k have two normal modes, and energy swaps between the strings at their difference frequency. That is sympathetic resonance: an untouched string sings when its partner is played.
Top: beats of two tones. Bottom: the energy of two coupled strings; only string 1 was plucked.
12. Equal temperament against just ratios
The harmonic series gives the pure intervals: 2:1, 3:2, 5:4 and so on. Frets divide the octave into twelve equal steps instead, so every key works the same. The size of an interval in cents is:
The equal fifth is 2 cents flat of 3:2, almost pure. The equal major third is 14 cents sharp of 5:4, so a fretted major chord always beats a little. When the upper note of an interval p:q has its qth harmonic near the pth harmonic of the lower note, they beat at |q f_upper − p f_lower|.
Top: the equal steps (blue, up) and the just ratios (orange, down). Bottom: how fast each equal-tempered interval beats on A3.