9.4 The Wave Equation & Vibrating Strings used d’Alembert’s formula and the method of images as tools: it split a pulse in two, bounced the halves off the ends, and warned that a leapfrog scheme with blows up. This lesson earns those claims. The result is an exact picture of the one-dimensional wave equation: every value is built from initial values found by following two straight lines backward in time, the template for how compressible-flow codes treat information.
Transcript
- The wave operator factors just like a squared minus b squared, into d t minus c d x times d t plus c d x. Change variables to xi equals x minus c t and eta equals x plus c t, and the equation becomes u xi eta equals zero. So every solution is one shape moving right plus one moving left, F of x minus c t plus G of x plus c t, running along two families of straight characteristics.
- Now match the data at time zero. F plus G must equal the starting shape f, and the slope condition fixes G minus F by the integral of the velocity g. Solving gives d'Alembert's formula: walk back from the point along both characteristics to the two feet, average the shape there, and add the velocity accumulated between them.
- Release a bump from rest, and at x equals 0.2, time 0.3, the feet are at minus 0.1 and 0.5, so u is 0.5. At the old centre, x equals 0.5, both feet miss the bump and u is 0. Choose the velocity as minus c times f prime, and you get a one-way pulse that keeps its full height: u is 1 at x equals 1.3, time 0.8. Strike the string with a hammer instead, and the point lifts and stays lifted, on a plateau of 0.2.
- Each point depends only on the interval between its two feet, and nothing outside it: its domain of dependence. Turn the picture over, and an interval of data influences a wedge, bounded by the two outer characteristics, with u exactly zero outside. That is the light cone, and it is why waves have a finite speed c, while heat does not.
- A wall has no characteristic coming from the left, so extend the data past it. A fixed end uses an odd extension, with a mirror bump upside down, and a free end uses an even one. For the bump at 0.5, at x equals 0.2 and time 0.7, the answer is minus 0.5 with a fixed end and plus 0.5 with a free end. At the wall at time 0.5, the fixed end reads 0, and the free end reads 1, twice the height of each half.
- On an interval with both ends fixed, the extension must be odd about both ends, which makes it odd and periodic with period 2 L. Characteristics fold back at the walls like a billiard ball. For length 1.5, after one period the shape returns exactly: u at 0.5, time 3 is 1, and again at time 6.
- Add a source and treat it as a sequence of kicks. Each kick spreads by d'Alembert's formula, and summing them gives Duhamel's principle: integrate the source over the dependence triangle. A uniform load S 0 gives S 0 t squared over 2. A Gaussian source gives 0.41186 at x equals 1, time 2, just under the bound of 0.4431. On a half-line at x equals 0.5, the images give 0.2215 with a fixed end and 0.4431 with a free end.
- Now the numerics. After n steps a grid scheme sees only data within n cells, so its numerical dependence has half-width c t over nu. If nu exceeds 1, the physical dependence is larger, and the scheme never sees data the true answer needs. At x equals 1.4, time 0.8, the exact value is 0.25. Leapfrog gives 0.2474 at nu 0.5, 0.2488 at 0.8, exactly 0.25 at 1, about minus 2.4 times 10 to the 4 at 1.05, and exactly 0 at 1.25, where it misses the bump entirely.
- Fluid codes use first-order systems. For sound, p plus Z u moves right at speed c, and p minus Z u moves left: two Riemann invariants, with Z equal to rho c. For air, Z is 408. A 100 Pa pulse at rest splits into two 50 Pa halves, with air speed plus or minus 0.1225 metres per second. At a rigid wall the images are even, and the pressure there reaches 100 Pa with u equal to 0.
- To recap. Factoring the operator gives two families of characteristics and d'Alembert's formula. Dependence and influence give the light cone, images handle walls, Duhamel handles forcing, and CFL says the scheme must see what the physics sees. Next: forced and nonhomogeneous problems, where sources oscillate and boundaries move.
Factoring the operator
The wave operator factors exactly like :
Let . The equation says , which is the transport equation of 9.10 First-Order PDEs: Advection & Characteristics with speed : is constant along the lines , so for some function . Then is transport with a known source along , and it is solved by plus an arbitrary function of . The result is
The same answer comes from a change of variables. Put and . By the chain rule and , so
The equation is : does not depend on , so . The lines and are the characteristics of the equation, two families of straight lines of slopes and in the - plane.
Unlike the nonlinear case of 9.11 Nonlinear Waves: Burgers' Equation & Shocks, the speed here is the constant : the lines of a family are parallel and never meet.
d’Alembert’s formula
Now impose initial data and on the whole line. At :
Integrate the second equation from to and write , so . Solve the pair for and :
The constant cancels in , and what remains is d’Alembert’s formula:
Read it as a recipe: walk back from along the two characteristics to the feet on the -axis, average the shape there, and add the velocity accumulated between them.
Example 1: released from rest. Take , , and the cosine-squared bump for (zero elsewhere), the same shape as in the previous lesson. At the feet are and , so . At , the centre of the original bump, the feet are and , both outside the bump, so : the bump has left its starting point and the string there is flat.
Example 2: a one-way pulse. Choose . Then (the bump vanishes at ), and the formula collapses to : a pulse that only moves right. At the feet are and , so : the bump has simply travelled to the right and kept its full height. At the answer is . The two-halves split of the last lesson () has both halves present.
Example 3: a struck string. Take and on (a hammer). At the middle the integral covers , so for , giving , and then for all later times: the point is lifted by the hammer and stays lifted. On an infinite line a velocity impulse leaves a permanent plateau of height . (From memory: in three dimensions there is no such wake, Huygens’ principle.)
Where information comes from and where it goes
Every point with has a domain of dependence: the interval of the initial line. The value uses at the two endpoints and on the whole interval, and nothing outside. Turn the picture upside down: an interval of initial data affects the points whose dependence interval overlaps , namely . This is its domain of influence, a wedge of the plane bounded by the two outer characteristics. Outside the wedge is exactly zero. Together they form the light cone, with the signal speed.
Unlike the heat equation of 9.3 Solving the Heat Equation: Separation of Variables, where a point source warms the whole rod at once, waves have a finite propagation speed . In the sim the dashed lines are the edges of the bump’s influence wedge.
Inside the dependence interval, for only the two endpoints matter: the interior can change and will not notice, which is why the centre of the bump is quiet at in Example 1.
What to try. Drag the dot; switch the data to one-way and struck; change the domain; tick the Duhamel and CFL boxes.
Walls: the method of images
A half-line with a fixed end has no characteristic coming from the left of the wall, so d’Alembert’s formula has nothing to evaluate. The trick is to extend the data to the whole line so that the wall condition holds automatically. Put in the formula:
This vanishes for every if is odd and is odd (an odd integrates to zero over a symmetric interval). So for a fixed end extend and as odd functions. For a free end , the same computation says that the extensions should be even. A shape at then has a mirror image at with the sign flipped (fixed) or kept (free), and the image’s wave running in from the left is what the reflection looks like. This is the method of images, the trick behind the series of 8.4 Even & Odd Extensions: Sine and Cosine Series.
Numbers from the sim (bump at , released from rest, ). At the feet are and . The bump itself sits at , and its mirror at is the one the foot hits: for a fixed end (inverted reflection) and for a free end. At the wall itself at , the two halves meet: for a fixed end and for a free end, twice the height of each half.
An interval with both ends fixed has two walls, so the extension must be odd about both: odd about and odd about , which makes it odd and periodic with period . The - picture is a strip, and a characteristic that reaches a wall is folded back, like a billiard ball. The formula is unchanged: with the periodic extension. After one period the shape returns exactly: for the bump has , and again at . The sine modes of 9.4 The Wave Equation & Vibrating Strings are exactly such odd periodic functions, each carried by two characteristics.
Forcing: Duhamel’s principle
Add a source: with at . Here is an idea you have met for ODEs in 5.5 Variation of Parameters: treat the source as a sequence of kicks. During the source gives the string an extra velocity and then lets it go. By d’Alembert’s formula (zero shape, velocity , starting at time ) that kick evolves into
and by linearity the solution is the sum of all the kicks, Duhamel’s principle:
The region of integration is exactly the dependence triangle of : apex at , base . Check: since , and .
Example 4: uniform load. If everywhere, the triangle has area , so : every point simply falls under the constant force, independent of .
A smooth source in the sim. Take and the steady Gaussian source , switched on at , on the whole line. The sim’s double midpoint integral gives and . As a bound, at , and the result sits below it because early triangles do not yet cover the whole Gaussian. With the same source on a half-line the images matter: at the sim gives for a fixed end and for a free end. The next lesson, 9.7 Nonhomogeneous Problems & Eigenfunction Expansions, treats time-dependent sources and boundary values by modes.
The numerical link: CFL as dependence
A grid scheme advances from a few nearby values at the previous steps. After steps depends only on initial data within of : the numerical domain of dependence is the interval . With its half-width is where is the Courant number. The physical dependence interval has half-width . If , the physical interval is larger, so a datum the true solution needs is never seen by the scheme. Changing that datum changes the exact answer but not the numerical one, so the scheme cannot converge. This is the Courant-Friedrichs-Lewy (CFL) condition:
It is necessary, not sufficient (from memory; 10.3 Von Neumann Stability Analysis gives the sufficiency tool).
Use the leapfrog scheme of the previous lesson on with , the bump at , and watch the value at , where the exact value is :
| steps | scheme’s dependence reach | at | |
|---|---|---|---|
| 0.5 | 160 | 1.60 | 0.2474 |
| 0.8 | 100 | 1.00 | 0.2488 |
| 1.0 | 80 | 0.80 | 0.2500 (exact) |
| 1.05 | 76 | 0.76 | about |
| 1.25 | 64 | 0.64 | exactly 0 |
At the numerical and physical characteristics coincide and the scheme is exact. At the scheme looks only to on either side of , so it sees , which misses the bump (support ) entirely: the value is exactly zero where the true value is . At the scheme does see part of the bump, but an instability destroys the answer. For the scheme sees more than it needs, and the small deficit ( against ) is numerical dispersion: short waves lag behind (from memory; the deficit does shrink with the grid, to at with ), made quantitative in 10.5 Wave Equation Numerics & the CFL Condition.
First-order systems: acoustics and Riemann invariants
Fluid solvers do not use but first-order systems for several unknowns. Linearize 1D compressible flow about still air of density and sound speed (11.12 Compressible Flow & Shocks). For the pressure disturbance and the velocity :
Eliminating gives back , but there is a more useful move. Let (the acoustic impedance), and look at the two combinations . Add times the second equation to the first:
and subtracting gives . Each combination is a Riemann invariant, transported by a plain advection equation, to the right at speed and to the left. These are the two combinations that do not mix: the eigenvectors of the coefficient matrix, with eigenvalues (1.6 Change of Basis & Diagonalization). A pressure pulse released at rest has , so : half of it goes each way.
Numbers. Take sea-level air, kg/m, m/s, so Pa s/m. A Pa pulse at rest splits into two Pa halves. The right-moving half has m/s (the air moves with the wave), and the left-moving half has m/s. Next to a rigid wall () the images are even: pressure reflects upright, and at the pressure at the wall is Pa, the sum of the halves, with . A closed end acts like the free end of the string.
Check your understanding
Problems
Let , , on the whole line. (a) Find . (b) Evaluate and give the domain of dependence of the point .
Show worked solution
(a) , a standing wave: a pair of traveling waves. (b) . The feet are , so the domain of dependence is .
For , and on the whole line, find by d’Alembert’s formula and check that it satisfies and the initial conditions.
Show worked solution
. Then , and . It is a standing wave with a shape and a time factor .
A half-line string with starts at rest and feels the constant force . Using Duhamel and the odd extension, show for and for .
Show worked solution
For the dependence triangle stays in and . For the part of the triangle with meets the odd source . Let , the time at which the left side of the triangle crosses the wall. For the inner integral is with ; for it is . Then
At both formulas give .
In air with Pa s/m a probe reads Pa and m/s at one instant. Find the invariants and the pressure carried by the right-moving and left-moving parts.
Show worked solution
Pa and Pa. Each part carries half of its invariant: Pa moving right (with m/s) and Pa moving left (with m/s). Their sum gives Pa and m/s as measured.
Computation
A bump on the interval with fixed ends, evolved with nothing but the odd periodic extension and d’Alembert’s formula.
Now implement the two formulas of this lesson yourself.
Try the Gaussian source with and and see how quickly the midpoint rule converges.
Key Takeaways
- Factoring the wave operator and using , gives , so along two families of straight characteristics.
- d’Alembert’s formula comes from matching and ; the released bump has and .
- A struck string leaves a plateau on the infinite line ( for the unit hammer of width ).
- The domain of dependence of is , the domain of influence of an interval is a wedge, and is exactly zero outside it.
- Fixed ends mean odd images, free ends even images ( or for the bump at ); an interval of length has period .
- Duhamel: over the dependence triangle, for a uniform load and at for the sim’s Gaussian source.
- CFL means the numerical dependence (half-width ) must contain the physical one: at leapfrog gives at , exactly at and about at .
- In acoustics move at (Riemann invariants); a Pa pulse splits into Pa halves with m/s, the idea behind upwind fluxes.
What comes next
The forced problems here were easy: an infinite string or one wall, and a steady source. Real sources oscillate, boundaries move, and heat has no characteristics to draw. 9.7 Nonhomogeneous Problems & Eigenfunction Expansions expands the solution in the eigenfunctions of the earlier lessons, handles time-dependent boundary values, and meets resonance: forcing a bounded string at one of its normal frequencies makes the amplitude grow without limit, the bounded cousin of the linear growth under a steady source here. Leapfrog dispersion and absorbing boundaries wait in 10.5 Wave Equation Numerics & the CFL Condition.