The wave equation: oscillations acquire space
The puzzle: something crosses, and nothing makes the trip¶
At a football match, a wave goes round the stadium. You can watch it travel: a band of standing, arms-up fans sweeping along the stands, once round the ground in half a minute. And yet nobody in the stadium has moved from their seat. Each person stood up and sat down again, a little after their neighbour did.
Tie a 20 m rope to a wall, pull it taut, and flick the end. Something runs along the rope and slaps the wall a fraction of a second later — you can feel it arrive through the wall if you put your other hand on it. No piece of rope made that trip.
Predict before you calculate¶
Commit to an answer for each before running anything.
Two pulses on the same rope, one twice as tall as the other. Which reaches the far end first — the taller one, the shorter one, or neither?
A speck of dust rests halfway along the rope. A pulse runs through it and on. Where is the speck afterwards?
You double the tension in the rope. Does the time a pulse takes to cross it halve, fall by some other factor, or stay the same?
You pull the middle of the rope aside into a triangle, hold it still, and let go. Does one pulse leave, or two?
Explore the model¶
Three animations, all generated from the same wavelab.waves solver the laboratory runs.
Every displacement is drawn in millimetres on a string several metres long, so every pulse
on screen is hundreds of times steeper than the string it depicts. The axis units say so;
the physics assumes the true, gentle slopes.
A pulse runs 2.6 m along a string at 20 m/s. One point of the string, 2 m along, is marked in orange, with a faint trail of everywhere it has been. The trail is a vertical line. The lower panel records the point’s height against time: it rises 10 mm as the front of the pulse arrives, falls as the back leaves, and finishes within mm of where it started. Whatever crossed the string, none of the string went with it.
A string pulled into a 10 mm triangle and released from rest. It splits into two triangles of half the height, running apart. The translucent fills beneath are d’Alembert’s two halves, in blue and in orange: at the first frame they lie on top of each other and the string is their sum; as they slide apart the string follows. The solver matches the formula to of the height over the whole run — it is at the special time step derived below, where a pluck is carried exactly.
The same pluck computed twice, with the time step 1% under the stability limit (blue) and 1% over it (orange). For a hundred steps the two strings look identical. The bottom panel shows why that is misleading: on a logarithmic axis it tracks the shortest wave the grid can hold, and in the orange run it climbs a straight line from rounding error, multiplying by 1.33 every step. At step 137 it reaches the pulse’s own size, and within a dozen steps the string panel is overwhelmed. Nothing physical happened.
Run the laboratory now, then come back. Four things are worth doing before you read on:
Watch a chain of 5, 20 and 100 beads turn into a string, and notice how slowly the corners of a triangular pluck get there.
Time a pulse between two photogates as the tension changes, then race pulses of different heights and widths on the same string.
Follow the dust speck, and compare how fast it moves with how fast the pulse moves.
Set the time step 1% too long and count the steps the string survives.
Derive the result¶
Route (a): module 07’s chain, one step further¶
Put beads of mass on a thread, a distance apart, and pull the thread to tension . Displace bead sideways by . The stretch of thread to its right is tilted by an angle whose sine is , and it pulls the bead with a transverse force times that sine. For small tilts the square root is just , and the two stretches together give
This is module 07’s chain exactly, with springs of stiffness — the dictionary that module 07 ended on, now with a reason behind it.
Now let the beads crowd together. Treat the displacements as samples of a smooth function, , and expand the neighbours about :
In the sum every odd term cancels, so the second difference is
Keep the leading term, divide by , and write for the mass per unit length:
Module 07 already knew the answer to the speed. Its dispersion relation is a straight line at small , with slope . The discarded is exactly what bends that line over at larger : expanding the sine to the next order gives , the same twelve.
Route (b): Newton for a piece of string¶
Forget beads. Take a short piece of a continuous string, between and , and list the forces on it. At each end the rest of the string pulls along its own direction with tension . If the string is tilted at angle at the left end and at the right, the vertical parts of the two pulls are and , and they cancel only if the string is straight.
For small slopes, . The net vertical force is then , the piece has mass , and Newton’s second law reads
Two routes meeting at one equation is the lesson. The wave equation is not about beads and it is not about strings: it is about any medium whose pieces are pulled back toward the line by their neighbours, in proportion to how far out of line they are. Write the speed as
and the equation takes the form every later part of the course will recognise:
D’Alembert’s solution: every solution is two travelling shapes¶
Try for any twice-differentiable function . By the chain rule, each time derivative brings down a factor and each space derivative a factor 1:
so , whatever is. The graph of is the graph of shifted right by : a shape moving toward at speed , unchanged. By the same argument is a shape moving toward . The remarkable thing is that there is nothing else.
Read what the theorem leaves out. The speed is in the equation; the shapes and are not. The medium chooses the speed, and the hand chooses only the shape. A taller pulse is the same solution multiplied by a constant; a sharper one is a different ; both travel at . That is prediction 1 — neither arrives first — and prediction 3: doubling the tension multiplies by , so the crossing time falls to , about 71%, and not to half.
The initial-value problem: plucks and strikes¶
A real string starts with some shape and some velocity . Which and do those select? At ,
Integrate the second equation, up to a constant that cancels, and solve the pair:
A pluck has a shape and no velocity. The integral vanishes, and the string becomes two copies of the starting shape, each half the height, running apart. It must split — a single copy moving one way would need a velocity from the start, and a string held still has none, so neither direction is preferred and each gets half. That is prediction 4.
A strike has a velocity and no shape: a hammer hitting a piano string, a rectangle of speed over a width . Now only the integral survives. At a given point it counts how much struck string lies within a distance , so the string rises into a plateau that grows at speed until and then holds at height , its edges running outward at . The string is left permanently displaced — nothing pulls it back, because moving a whole straight stretch sideways stretches nothing.
Sinusoidal waves, and ¶
The course’s travelling wave is
Factor out : , so this is with . It solves the wave equation exactly when
the straight-line dispersion relation module 07 found at the bottom of the chain’s band. Every wavelength travels at the same speed: that is what it means for the ideal string to be non-dispersive, and it is why a pulse — a superposition of many wavelengths — keeps its shape. In everyday units, .
What travels, and what does not¶
Stand at one point, , and watch a right-moving pulse go by. The displacement there is : as runs, the point reads off the pulse’s shape backwards in time, rising as the front arrives and falling as the back leaves. When the pulse has gone, has returned to zero, and so has the point. That is prediction 2: the speck ends exactly where it started.
What travelled was the pattern — the fact of being displaced, handed from each piece of string to the next — and, as module 09 shows, the energy that goes with it. The pieces themselves move only sideways, and at a speed with nothing to do with :
The transverse velocity is times the slope, and since the slope is small, the string moves far more slowly than the wave. In the laboratory’s pulse, the speck’s fastest is 1.14 m/s while the pulse travels at 20 m/s.
Two honesty notes. The ideal string has no motion along its own length at all, by assumption, so the vertical trail in the animation is partly built in. A real string’s pieces do move slightly along it, by an amount second order in the slope — and they return too. The claim that survives is the one that matters: after the pulse, nothing is anywhere else.
How the computer solves it: the chain, rebuilt¶
To integrate the wave equation numerically, sample the string at points and times , and replace each second derivative by its centred difference:
Solved for the future, this is the leapfrog scheme,
where is the Courant number. Now look at the right-hand side of the difference equation before dividing: it is . That is Newton’s law for a mass on springs of stiffness — route (a)'s chain, with the beads a grid spacing apart. The computer solves the continuum equation by quietly rebuilding the chain it came from. Discretisation runs the continuum limit backwards.
One condition makes the scheme trustworthy. In one time step the update at point consults only points , and , so information on the grid moves at most one spacing per step. The true solution at depends on everything within of it. If , the solution depends on points the scheme never looked at, and no arrangement of numbers can get it right. The Courant–Friedrichs–Lewy condition is
and violating it is not a small inaccuracy. The next section shows what it is.
Verify computationally¶
Each check below is also a test in the project’s suite, so these claims cannot silently rot.
1. The solver against d’Alembert. A Gaussian pluck on a 4 m string is integrated at a fixed Courant number and compared, at every point, with the exact solution. Halving the grid spacing — and with it the step — reduces the error by factors of 3.996, 4.002, 4.001 and 4.000, and the fitted exponent is -2.000: the scheme is second order, as the centred differences promise. This convergence test is run before any animation on this page is rendered.
2. The stencil is the chain. simulate_string is handed a 201-point string, and
coupled.simulate_coupled — module 07’s integrator, which knows nothing about grids — is
handed the chain of masses on springs . Started identically, they
agree for 2000 steps to about of the largest displacement. The closing claim of the
derivation is not an analogy.
3. The magic step. At exactly, the stencil simplifies to , which moves any travelling shape by exactly one grid spacing per step.
4. Past the limit. The pluck is run at .
5. Photogates, and what they measure. Two detectors record the string where they sit, and the pulse’s arrival at each is timed by the centroid of its record. With the time step fixed for the fastest string, tension is swept over a decade: the fitted exponent of against is 0.5000000, and against it is -0.5000000, every speed within of . Nine pulses of three heights and three widths on one string arrive at the same speed to 10-7 — the falsifier for “shaking harder makes it faster”, run nine times.
Timing the peak of each record instead reads slow, by the relative amount for a Gaussian of width — measured to within 0.4% of that formula at , 0.5 and 0.75, and exactly at . This is grid dispersion: on the grid, short wavelengths travel slightly slower than long ones, and the peak of a pulse drifts back. The centroid is immune, because it responds only to the dispersion relation’s slope at , where the grid is exact. The laboratory’s measurement part turns the same distinction into an error bar.
6. Energy. Over sixteen transits between two fixed ends, the solver’s total energy wobbles by of itself at and does not drift; halve the step and the wobble falls fourfold. What that energy is, and where on the string it lives, is module 09.
Transfer the idea¶
Standing waves. Put walls at both ends and the travelling halves come back.
11-standing-wavesbuilds a string’s modes from d’Alembert’s two directions, and recovers module 07’s as the limit of the chain’s mode shapes.Dispersion. The ideal string is non-dispersive by construction: is a straight line.
13-dispersionasks what happens when it is not, where a pulse spreads as it travels — and you have already seen it happen, on the grid, in the photogate check above.Back to module 07. The chain’s band edge was a ceiling the string does not have. The string’s equation is what remains of the chain when every wavelength of interest is much longer than the spacing, and route (a) says precisely how much longer.
Longitudinal waves. Module 07’s chain was drawn sideways but modelled lengthways: masses sliding along their own line. Read that way, route (a) is exact without any small-slope assumption, and gives sound in a solid rod, with playing the part of the rod’s stiffness rather than a tension.
Check your understanding¶
Two pulses are sent along the same stretched rope, one after the other. The second is made by flicking the end twice as hard, so it is twice as tall, and twice as fast, so it is half as wide. How does its speed along the rope compare with the first pulse’s?
A. The same. The rope’s tension and mass per length set the speed; the flick sets only the shape. B. Faster. The taller, sharper pulse carries more energy and so outruns the first. C. Slower. A sharper pulse stretches the rope more, and the extra stretch has to be pulled back. D. Faster, by a factor of two, since the hand moved twice as fast.
Check your answer
Correct answer: A — The same. The rope’s tension and mass per length set the speed; the flick sets only the shape.
A. Right. The wave equation mu y_tt = T y_xx contains T and mu and nothing else, so every solution travels at v = sqrt(T/mu) whatever shape it has. Height cannot matter because the equation is linear: a taller pulse is the same motion scaled. Width cannot matter because d’Alembert’s solution f(x - vt) moves any f at all, sharp or broad. Measured on the simulated string, nine pulses of three heights and three widths arrive at the same speed to one part in ten million.
B. It does carry more energy, and that energy arrives sooner only because more of it is sent, not because it travels faster. Energy and speed are separate questions here: the speed is fixed by the medium, and module 09 shows that the energy then rides along at exactly that same speed. Harder flicks change what arrives, never when.
C. The extra stretch is real, but it is second order in the slope, and the model that gives v = sqrt(T/mu) has already thrown it away by assuming the slope is small. Within that model the tension is the same everywhere and so is the speed. A pulse steep enough for the stretch to matter is one the ideal string no longer describes.
D. The hand’s speed sets how fast each piece of rope moves up and down — the transverse velocity — not how fast the disturbance moves along. The two are independent: a simulated pulse on a 20 m/s string moved its pieces at 1.1 m/s. Speed up the hand and the pieces move faster sideways while the pulse travels at exactly the same 20 m/s.
A small speck of dust rests on a long horizontal string. A single hump-shaped pulse travels along the string, passes the speck, and continues on. Where is the speck once the pulse has gone?
A. Exactly where it started. It rose and fell as the pulse passed, and nothing carried it along. B. A little way along, in the direction the pulse was travelling. C. Raised slightly, since the pulse lifted it and nothing pushed it back down. D. Carried along with the pulse all the way to the end of the string.
Check your answer
Correct answer: A — Exactly where it started. It rose and fell as the pulse passed, and nothing carried it along.
A. Right. At the speck’s position the displacement is y = f(x0 - vt): it follows the shape of the pulse in time, rising and falling, and returns to f = 0 once the pulse has gone. The pulse is a pattern handed from each piece of string to the next, and the pieces stay home. In the simulation the speck rose 10 mm and finished within a millionth of that of zero.
B. This is the picture to give up: that a wave is stuff moving. The speck is attached to one piece of string, and that piece is pulled up by its neighbour on one side and back down by its neighbour on the other. Nothing in either pull points along the string, and the ideal string has no along-the-string motion at all. What travels is the shape — the same way a stadium wave travels round the stadium while every fan keeps their seat.
C. Something did push it back down: the back half of the pulse. As the trailing edge passes, the string’s slope reverses and its neighbours pull it toward the line. A string left permanently displaced does exist — a strike leaves a plateau — but that needs a starting velocity, and a pulse that simply passes by delivers none net.
D. If the pulse carried the string with it, a pulse sent down a rope would pile rope up at the far wall, and the rope would be shorter after every flick. What reaches the wall is a disturbance and its energy. The rope stays where it is.
A long taut string is pulled into a triangle 12 mm tall at its middle, held still, and released. Once the motion has had time to separate, what does the string look like?
A. Two triangles, each 6 mm tall, travelling away from each other at the wave speed. B. One 12 mm triangle, travelling in one direction at the wave speed. C. A 12 mm triangle that stays in the middle and oscillates up and down in place. D. Two 12 mm triangles, travelling away from each other.
Check your answer
Correct answer: A — Two triangles, each 6 mm tall, travelling away from each other at the wave speed.
A. Right. d’Alembert’s solution for a shape released from rest is y = [y0(x - vt) + y0(x + vt)]/2: half the shape running right, half running left. At t = 0 the two halves lie on top of each other and add up to the original. It must split, because a string released from rest has no velocity to prefer either direction, and it must split evenly for the same reason.
B. A single right-moving triangle needs y_t = -v y_x from the very first instant: the front of the triangle already rising, the back already falling. A string held still and let go has y_t = 0 everywhere, so it cannot be a single travelling shape. Starting velocity picks the direction; with none, both directions get half.
C. That is what a single mass on a spring would do, and it is the right picture for the whole string only when both ends are close enough to reflect the halves straight back — standing waves, module 11. On a long string the two halves simply leave.
D. The direction is right and the height is not. Two full-height triangles would contain twice the displacement the string started with, and the equation is linear: at t = 0 the two travelling pieces must add up to exactly the original shape, so each is half.
A rope 12 m long with a total mass of 0.60 kg is held under a tension of 80 N. How long does a pulse take to travel from one end to the other, in seconds?
Check your answer
Correct answer: 0.3 (± 0.01)
The mass per unit length is mu = 0.60 kg / 12 m = 0.050 kg/m, so v = sqrt(T/mu) = sqrt(80 / 0.050) = sqrt(1600) = 40 m/s, and the crossing takes 12 m / 40 m/s = 0.30 s. The total mass enters only through mu: double the rope’s length at the same mu and the speed is unchanged while the trip takes twice as long. Check the units as you go — N/(kg/m) is (kg m/s^2)(m/kg) = m^2/s^2, whose square root is a speed.
A string with tension 50 N and linear density 5.0 g/m is simulated with the leapfrog scheme on a grid of spacing 2.0 mm. What is the largest time step, in microseconds, for which the scheme is stable?
Check your answer
Correct answer: 20.0 (± 0.5)
First the wave speed, in SI units: mu = 5.0 g/m = 0.0050 kg/m, so v = sqrt(50 / 0.0050) = 100 m/s. The Courant condition S = v dt / dx <= 1 then gives dt <= dx / v = 0.0020 m / 100 m/s = 2.0e-5 s = 20 microseconds. Physically: in one step, nothing may travel further than one grid spacing, because each point is updated only from its immediate neighbours. Run at 1% over this and the shortest wave the grid holds grows by a factor of 1.33 every step, from rounding error, until it swamps everything.
Two snapshots of a string taken 0.10 s apart show the same hump, unchanged in shape, whose peak has moved from x = 3.0 m to x = 2.4 m. Which description fits?
A. y = g(x + vt) with v = 6.0 m/s — a left-mover. B. y = f(x - vt) with v = 6.0 m/s — a right-mover. C. y = f(x - vt) with v = -6.0 m/s. D. y = g(x + vt) with v = 0.6 m/s.
Check your answer
Correct answer: A — y = g(x + vt) with v = 6.0 m/s — a left-mover.
A. Right. The peak moved 0.6 m toward -x in 0.10 s, so the pattern travels at 6.0 m/s in the -x direction. A function of x + vt keeps its value when x decreases as t increases, which is exactly that motion: the peak sits where x + vt is constant. With v positive, the sign inside the argument carries the direction and v carries only the speed.
B. A function of x - vt keeps its value where x - vt is constant, so its peak moves to larger x as t grows. This peak moved to smaller x. The sign inside the argument is the direction; get it backwards and every reflection problem in module 10 comes out upside down.
C. Algebraically that is the same function as g(x + vt) with v = 6.0 m/s, so this is not wrong so much as a bookkeeping hazard. The course keeps v = sqrt(T/mu) positive, as a property of the medium, and writes the direction into the argument. A negative “speed” means a quantity that is sometimes a speed and sometimes not.
D. The direction is right and the speed is off by the time interval. Speed is distance over time: 0.6 m in 0.10 s is 6.0 m/s. A distance of 0.6 m would have taken a whole second at 0.6 m/s.
The wave equation d^2y/dt^2 = v^2 d^2y/dx^2 can be reached from module 07’s chain of masses and from Newton’s law for a small piece of string. Describe both routes in words, say where they meet, and name the approximation both of them need.
Check your answer
The chain route starts from N beads of mass m, spacing a, on a thread under tension T. Each bead is pulled toward its neighbours, and for small slopes the transverse pull of each stretch of thread is T times the height difference over a: a spring of stiffness T/a. That gives module 07’s equation m y_n’’ = (T/a)(y_{n+1} - 2 y_n + y_{n-1}). Now let the beads crowd together: write y_n = y(na, t) and Taylor-expand the neighbours about x = na. The combination y_{n+1} - 2 y_n + y_{n-1} becomes a^2 times the second derivative in x, so y_tt = (T a/m) y_xx, and with mu = m/a that is y_tt = (T/mu) y_xx. The chain’s dispersion relation says the same thing independently: at small ka its slope is a sqrt(k_s/m), which is sqrt(T/mu).
The string route never mentions beads. Take a piece of string between x and x + dx. The tension pulls along the string at each end, and if the string is tilted differently at the two ends the vertical parts of those pulls do not cancel. For small slopes the sine of the tilt angle is the slope itself, so the net vertical force is T times the change in slope across the piece, T y_xx dx. Newton’s law for its mass mu dx gives mu y_tt = T y_xx. They meet at the same equation with the same speed, v = sqrt(T/mu). That agreement is the point: the wave equation is not about beads or about strings, but about any medium whose pieces are pulled back toward the line by their neighbours in proportion to how far out of line they are. Both routes need small slopes, |dy/dx| << 1. In the chain route it hides in the bead’s pull, where sin(theta) was replaced by the height difference over a; in the string route it replaces sin(theta) by the slope, lets the length of the piece be dx, and keeps the tension the same at both ends. A steep pulse breaks the model, not the mathematics.
Exam-style problems for this module — the ones worth doing with a pen — are collected in the problem set.
Explain it in your own words¶
Answer in a few sentences each. No number will save you.
Explain what moves in a stadium wave, and what does not. Then explain what moves along a flicked rope, using the same words, and say what plays the part of each fan.
Why can “how hard you flick” not appear in the speed of the pulse? Give an answer that uses the wave equation, and a second answer that does not use any equation at all.
A string released from rest in a triangle splits into two triangles. A friend says one triangle travelling to the right would conserve energy just as well. Explain what is wrong with that, without mentioning energy.
A simulation of a vibrating string blows up after 140 steps. Explain why this is a statement about the numerical method and not about the string, and say what single change would fix it.
Advanced: stability, the magic step, images, and what a first PDE is¶
Von Neumann’s argument. Where exactly does come from? Try a single Fourier mode on the grid, , and ask how its amplitude changes per step. Substituting into the leapfrog stencil gives
The two roots multiply to 1. While the bracket lies between -1 and 1 they are a complex conjugate pair on the unit circle, , and the mode neither grows nor decays. Once the bracket falls below -1 they are real, one of them has , and the mode grows exponentially. The bracket stays in range for every if and only if . The worst mode is the shortest the grid can hold, , where for
1.3266 at . That is the number the blow-up in the verification section matched — and since rounding error contains every in small amounts, there is always a seed for it to grow from.
Why S = 1 is exact. With , write and the same equation becomes the grid’s dispersion relation,
At the two sines are equal, so and exactly — every wavelength the grid can hold travels at exactly , and there is no grid dispersion at all. For , expanding both sines gives : short waves lag, which is the photogate bias measured above. The step that is exact and the step that is unstable are apart.
The half-line, by images. d’Alembert’s solution lives on an infinite line. Put a fixed end at , where for all time, and it still works, by a trick. Extend the starting shape to negative as an odd function, , and solve on the whole line. At the two halves are then always equal and opposite, so the displacement there is zero for ever — the boundary condition, satisfied by symmetry rather than imposed. A pulse approaching the wall meets its own upside-down image coming the other way, and after they pass through each other the image is the one that emerges: a fixed end returns a pulse inverted. Extend evenly instead and the slope at vanishes — a free end — which returns the pulse upright. Module 10 derives both results properly, as the two limits of one formula.
What makes a PDE “first”. The wave equation is the simplest hyperbolic equation, and its character is in d’Alembert’s variables: and are constant along lines in the plane called characteristics, and information moves only along them. The solution at depends on the starting data only in the interval — its domain of dependence — and on nothing outside it. The CFL condition is the discrete echo of that fact: the grid’s own domain of dependence, one spacing per step, must contain the true one. The heat equation, , looks almost identical and behaves completely differently: it has no characteristics, a disturbance is felt everywhere instantly, and shapes smear instead of travelling. One derivative in time rather than two is the whole difference.