The Wave Equation

Understanding the mathematics and physics of vibrating strings

Visualize standing waves with optional mode overlay

Drag the string to pull it into position, then release to pluck.

1The 1D Wave Equation and Its Physical Meaning

When you pluck a guitar string, you create a disturbance that travels along the string. The one-dimensional wave equation describes how this disturbance propagates:

∂²y/∂t² = c² · ∂²y/∂x²

Let's break down what each term means:

  • y(x,t)The vertical displacement of the string at position x and time t. This is what we see when the string vibrates.
  • ∂²y/∂t²The acceleration of the string at each point. This represents how quickly the velocity is changing. This is Newton's F = ma in disguise.
  • ∂²y/∂x²The curvature of the string. A more curved section experiences a greater restoring force pulling it back toward equilibrium.
  • cThe wave velocity, determined by the string's physical properties: c = √(T/μ), where T is tension and μ is linear mass density.

Physical intuition: The wave equation says that the acceleration at any point is proportional to how curved the string is there. More curvature → more force → more acceleration. This is why waves propagate: a displaced region pulls its neighbors, which pull their neighbors, and so on.

2Forming the General Solution

We solve the wave equation using separation of variables. We assume the solution can be written as a product of a function of space and a function of time:

y(x,t) = X(x) · T(t)

Substituting this into the wave equation and dividing both sides by X·T:

(1/T) · d²T/dt² = c² · (1/X) · d²X/dx² = -ω²

Since the left side depends only on t and the right side only on x, both must equal the same constant (which we call -ω² for reasons that will become clear). This gives us two ordinary differential equations:

d²X/dx² + k²X = 0

where k = ω/c

d²T/dt² + ω²T = 0

Note the similarity to spatial equation

These are both simple harmonic oscillator equations with solutions:

  • Spatial part: X(x) = A·sin(kx) + B·cos(kx)
  • Temporal part: T(t) = C·sin(ωt) + D·cos(ωt)

3Boundary Conditions

A guitar string is fixed at both ends, at the nut (x = 0) and at the bridge (x = L). This gives us our boundary conditions:

y(0, t) = 0 for all t
y(L, t) = 0 for all t

Applying the first boundary condition y(0, t) = 0:

X(0) = A·sin(0) + B·cos(0) = B = 0

So B must be zero, leaving only the sine term.

Applying the second boundary condition y(L, t) = 0:

X(L) = A·sin(kL) = 0

This requires kL = nπ, where n = 1, 2, 3, ...

We refer to k as the wave number, related to wavelength λ by k = 2π/λ. The boundary conditions mean that only certain wavelengths are allowed. The wave number must satisfy:

k_n = nπ/L → λ_n = 2L/n

The longest allowed wavelength is λ₁ = 2L (the fundamental), then λ₂ = L, λ₃ = 2L/3, and so on. Each corresponds to a standing wave pattern with n antinodes.

Finally, looknig at the relationship k = ω/c, we see the allowed angular frequencies:

ω_n = k_n · c = nπc/L

4Initial Conditions

To fully specify the string's motion after a pluck, we need two initial conditions, the initial displacement and initial velocity at t = 0:

y(x, 0) = f(x) : initial shape
∂y/∂t(x, 0) = g(x) : initial velocity

For a plucked string:

  • Initial shape f(x): Can be approximated as a triangle shape, zero at both ends, peaked where you pluck. If you pluck at position x₀ with height h, the shape is two line segments meeting at (x₀, h).
  • Initial velocity g(x): Zero everywhere. When you first release the string, it's initially stationary before it starts moving.

Why does pluck position matter? Plucking at different positions creates different triangular shapes, which decompose into different mixtures of harmonics. Plucking near the bridge emphasizes higher harmonics (brighter tone), while plucking near the middle emphasizes the fundamental (mellower tone).

5Normal Modes & Superposition

The solutions that satisfy the boundary conditions are the normal modes, the natural vibration patterns of the string:

y_n(x,t) = sin(nπx/L) · [A_n cos(ω_n t) + B_n sin(ω_n t)]

The frequencies of these modes are:

f_n = n · √(T/μ) / (2L) = n · f₁

Notice that the frequencies form a harmonic series: f₂ = 2f₁, f₃ = 3f₁, etc.

The general solution is a superposition of all modes:

y(x,t) = Σ A_n · sin(nπx/L) · cos(ω_n t)

The values of the specific coefficients A_n are determined by decomposing the specific initial shape f(x) using Fourier analysis:

A_n = (2/L) ∫₀ᴸ f(x) · sin(nπx/L) dx

And this is exactly what the simulation above does! It takes your pluck shape, computes the Fourier coefficients for each mode, and then sums up all the modes oscillating at their natural frequencies.

Try it: In the simulation, enable "Show first 5 modes" to see how the individual harmonics combine. Pluck at different positions and watch how the mode amplitudes change. Pluck exactly at the center (L/2) and notice that all even harmonics vanish!

Summary: From Pluck to Sound

  1. You pluck the string, creating an initial triangular displacement.
  2. The wave equation governs how this shape evolves. Curvature creates restoring forces.
  3. Boundary conditions (fixed ends) quantize the allowed wavelengths.
  4. The initial shape decomposes into a sum of normal modes via Fourier analysis.
  5. Each mode oscillates at its natural frequency f_n = n·f₁, creating the harmonic series.
  6. The resulting vibration is detected by pickups (next section) and becomes the sound you hear.