8.6 Orthogonal Polynomials & Special Functions ended with a promise: a string’s modes are sines with frequencies , the integer multiples that make a guitar sound like a note, while a drum’s modes use Bessel zeros and come out at times the lowest. This lesson cashes in the first half of that promise. The wave equation is also the first equation of this module that does not smooth things out. A heat profile forgets its shape; a wave remembers it forever. For a simulator that difference is everything: sound, pressure waves in a duct and the information carried by a supersonic flow all run on this equation, and its numerical scheme has a stability limit of a different kind from the heat equation’s.
Transcript
- Take a small piece of a stretched string, with tension T and density rho. The tension pulls on both ends, and where the string curves the two pulls do not cancel. For small slopes the net force is T u x x times the length, and mass times acceleration gives u t t equals c squared u x x, with c the square root of T over rho. For a string at 70 newtons, 0.4 grams per metre and 0.65 metres long, c is 418.3 metres per second and the lowest note is 321.8 hertz.
- The operator factors into two transport operators, so every solution is a right-moving shape plus a left-moving one. Release a bump at rest, and it splits into two copies at half the height, running apart at speed c. At time 0.3 the string is exactly zero outside 0.1 to 0.9: information has a finite speed, which heat does not have.
- The ends are mirrors. A fixed end is an odd extension: the pulse comes back upside down. A free end is an even extension: it comes back upright. At time 0.7, at x equal 0.2, the displacement is minus 0.5 with fixed ends and plus 0.5 with free ends.
- Now separate variables. The space problem gives sine of k pi x over L, and the time equation gives cosine of omega k t, an oscillation instead of heat's decay. The frequencies are k times c over 2 L, the harmonic series, so the motion repeats and the ear hears a pitch. A standing wave is just two equal traveling waves, and a pulse is a sum of standing waves.
- Pluck the string at a quarter of its length, to height 1. The coefficients fall like 1 over k squared: 0.76421, 0.27019, 0.08491, then exactly zero, because sine of 4 pi over 4 is zero. Every fourth harmonic is missing. The energy shares are 0.542, 0.271, 0.060, 0, 0.022 and 0.030, so over half the energy sits in the fundamental.
- Because the triangle is continuous, with only a corner in its slope, the sums converge with no Gibbs overshoot. The biggest gap between the K term sum and the triangle is 0.13 at K equal 3, 0.049 at 10, 0.011 at 50 and 0.0027 at 200. It falls roughly like 1 over K, and it all sits at the corner.
- Energy is kinetic plus potential, and it is exactly conserved. For the quarter pluck all 2.667 starts as potential. At time 0.25 the kinetic energy is 1.778 and the potential energy is 0.889, and the total is still 2.667. Summing 200 modes gives 2.659, and the missing 0.3 percent is the tail. Unlike heat, nothing decays, and the motion is reversible.
- To simulate it, use leapfrog on 100 cells, with Courant number nu equal c delta t over delta x. At nu equal 1 each step shifts the data by exactly one cell, and the error is round-off, about 10 to the minus 15. At 0.8 the corner disperses, and the error is 0.022. At 1.05, just 5 percent over the limit, the solution grows to about 10 to the 48 in 190 steps. That is the CFL condition: information may not cross more than one cell per step.
- Strike the string instead of plucking it. A hammer on 0.45 to 0.55 gives velocity, not displacement. The sine coefficients now come from the velocity: g 1 is 0.199, g 3 is minus 0.193, and the even ones vanish because the hammer sits at the midpoint. The exact energy is 0.050 and the 200 mode sum gives 0.0495.
- To recap. Newton's law gives u t t equals c squared u x x. Solutions are two traveling waves, mirrored at the ends, or a sum of standing modes at harmonic frequencies. The plucked string has no Gibbs overshoot, its energy is conserved, and leapfrog needs nu at most 1. Next, d'Alembert's solution and characteristics: the formula on an infinite line, and what each point can influence.
From Newton’s law to
Stretch a string of linear density (mass per length) to tension and let be its small sideways displacement. Take a piece between and . The tension pulls along the string at both ends. At the right end the string makes an angle with the horizontal, so the vertical pull is , and for small slopes . The net vertical force is
The mass is , so Newton’s law reads . Cancel :
The law is second order in time because forces change acceleration, not displacement. Two things are assumed: slopes are small (the horizontal tension stays and ), and the string is perfectly flexible. For large slopes the equation turns nonlinear (from memory, not derived here).
A heavier string is slower, a tighter one faster, and quadrupling the tension doubles .
An example (illustrative numbers, not a measured string). Take N, g/m kg/m and length m. Then m/s, and the lowest note is the one that fits one half-wave in the string, Hz. The sim’s sliders compute the same numbers.
Being second order in time, the equation needs two initial conditions, the shape and the velocity , plus an end condition: fixed () or free ().
Two traveling waves: characteristics again
The operator factors, exactly as does:
Each factor is the transport operator of 9.10 First-Order PDEs: Advection & Characteristics, and the one from 9.11 Nonlinear Waves: Burgers' Equation & Shocks with held constant. Introduce the characteristic coordinates and . By the chain rule , so the equation says . Integrate in and then in :
Any right-moving shape and left-moving solve the equation, and so does their sum (linearity). With zero initial velocity, : the initial shape splits into two half-size copies that run apart. With one adds the term , which is d’Alembert’s formula; the next lesson is devoted to it, so here I use it as a tool.
Information has a speed. If outside an interval, then for every farther than from that interval. Heat has no such limit: warmth anywhere is felt everywhere, however faintly, at once.
Ends are mirrors. A fixed end forces , which we get by extending the initial shape to the whole line as an odd function: the part of the wave that has crossed the end is replaced by an upside-down copy. A free end forces , which an even extension supplies. The pulse comes back inverted at a fixed end and upright at a free end. In the sim below: a cosine-squared bump of width centred at , released at rest, at is two separate bumps of height exactly and the string is exactly zero outside (finite speed). At the left half has hit the end at and is coming back; at the displacement is for fixed ends and for free ends.
What to try. Play the pulse with the halves visible and flip the ends between fixed and free; switch to the pluck and drag ; tick the leapfrog box.
Standing waves: separation of variables
Look for solutions that are a product , as in 9.3 Solving the Heat Equation: Separation of Variables. Substituting, is a function of on one side and of on the other, so both equal a constant :
The space problem is the Sturm-Liouville problem of 8.2 Eigenvalue Problems & Sturm–Liouville Theory. With fixed ends on it has and ; with free ends, cosines. For heat, the time equation gave a decaying exponential; here gives oscillation at angular frequency . The normal modes are
and the general solution is their sum, . The constants are fixed by the initial data: is the sine coefficient of , and the same for , exactly the formulas of 8.3 Fourier Series.
The harmonic series. The frequencies in hertz are : the lowest one (the fundamental) and its integer multiples, the harmonics. Every frequency is a whole multiple of the lowest, so the motion repeats with period and the ear hears a definite pitch. Mode has interior nodes; touch a guitar string lightly at its midpoint and you kill the odd modes, leaving the octave. The drum of the previous lesson has frequency ratios (quoted from that lesson, not recomputed here), which are not whole numbers, so a drumhead does not ring with a clear pitch. The Bessel-function modes get their own lesson, 9.8 Higher Dimensions: Membranes & Drums.
Two pictures, one solution. A sine times a cosine is a pair of waves:
A standing wave is two equal traveling waves, and a pulse is a sum of standing waves. The sim confirms that d’Alembert’s formula and the 200-mode sum of the quarter pluck differ by at most (at and ; at ): the truncated tail.
The plucked string
Pull the string to a triangle with its peak, height , at , and let go. The initial velocity is , so . The sine coefficients of the triangle are
(Integrate by parts twice, as in 8.3 Fourier Series: the only contribution comes from the corner at .) For the sim’s midpoint rule gives
The fourth is zero because : pluck at a quarter of the length and every fourth harmonic is missing, and pluck at the midpoint and every even harmonic is missing.
No Gibbs. The coefficients fall like , not the of the square wave in 8.5 Convergence & the Gibbs Phenomenon. The reason is that the triangle is continuous with a corner; only its slope jumps. The partial sums converge uniformly, and the overshoot of order of the jump never appears. The biggest gap between the -term sum and the triangle at sample points (the corner is one):
| 3 | 10 | 50 | 200 | |
|---|---|---|---|---|
| max error | 0.13 | 0.049 | 0.011 | 0.0027 |
The error falls roughly like , concentrated at the corner.
A half period later. The string is exactly turned over and reversed. By d’Alembert, : at the value is for . The 200-mode sum gives .
A struck string. A hammer gives the string a velocity on a small interval instead of a displacement. Then and supplies the sine coefficients, and the displacement amplitude of mode is . With on the sim gets and ; the even ones vanish because the hammer sits at the midpoint.
Energy: the wave equation does not forget
Define the energy of the string as kinetic plus potential:
Differentiate in time, use , and integrate the second term by parts:
The bracket vanishes at fixed ends () and at free ends (). Energy is exactly conserved. Kinetic and potential energy trade places, but the total is constant.
Worked example. Take and the quarter pluck. At all energy is potential: on and on , so . At , use and with on and elsewhere. For : , . For both equal , so , . Then
and the total is again. The sim’s quadrature agrees at , and (kinetic , potential ), and at and it shows kinetic , potential .
In modes. Each mode carries its own energy (density ), and the total is (a Parseval statement). For the quarter pluck, the shares of modes through are , so over half the energy is in the fundamental. Summing 200 modes gives against : the tail holds about . For the hammer the exact energy is and the 200-mode sum gives .
Wave versus heat
| heat equation | wave equation | |
|---|---|---|
| time derivative | first | second |
| mode in time | decays, | oscillates, , forever |
| energy | dissipated | conserved (with no damping) |
| reversible in time? | no: backward runs blow up | yes: leaves the equation unchanged |
| signal speed | infinite (tiny but nonzero) | exactly |
| corners | smoothed out at once | stay as corners, carried along |
The numerical link: leapfrog and
Replace and by central differences on a grid with spacing and time step :
This is the leapfrog scheme, with the Courant number (the first step is ). The value depends on only three grid points of the previous step, so the scheme’s numerical domain of dependence has speed . If , the true solution at a point depends on data from outside that interval, and no scheme that ignores it can converge: this is the CFL condition (name and argument from memory; 10.5 Wave Equation Numerics & the CFL Condition does it properly). Compare 10.2 Explicit Methods for the Heat Equation: heat needs , the wave only .
The sim runs it on 100 cells for the quarter pluck, against the exact d’Alembert solution, up to (the half period):
| steps | max error | max | |
|---|---|---|---|
| 1.0 | 100 | (round-off) | 1.00 |
| 0.8 | 125 | 0.022 | 0.986 |
| 0.5 | 200 | 0.029 | 0.981 |
| 1.05 | 190 (at ) |
At leapfrog is exact on this grid, because the numerical and true characteristics coincide: each step shifts the data by one cell. Reduce and the error is larger, not smaller, as the scheme starts to disperse the corner (short waves travel slower than ); the is round-off, and at the short-wave content of the corner grows at every step without bound. That short waves lag behind is a standard fact quoted from memory; the error column is the measurement. Just over the limit gives in 190 steps.
Check your understanding
Problems
A string of length m, linear density g/m, has tension N. Find the wave speed and the frequencies of the first three harmonics. By what factor must the tension change to raise the fundamental by a factor of ?
Show worked solution
m/s. The fundamental is Hz, and the harmonics are Hz and Hz. Since , doubling the pitch needs to be multiplied by , that is N.
A string on with is plucked at its midpoint to height . (a) Find . (b) What fraction of the energy is in the fundamental? (You may use .)
Show worked solution
(a) With the formula gives : zero for even , and , , and so on.
(b) for odd . The total is , which equals the exact potential energy . The fundamental has , which is of the total.
The cosine-squared bump of width centered at (height ) is released from rest. Using with , find for fixed ends and for free ends.
Show worked solution
The bump is nonzero only for . At , : the arguments are and . Here (outside the bump). For we need the extension: odd for fixed ends, ; even for free ends, . So for fixed ends and for free ends, as in the sim.
Computation
First look at the plucked string as a mode sum.
Now implement the leapfrog scheme itself.
Try and in your solution and compare the error at the same final time: the error does not shrink as drops, only the stability margin grows.
Key Takeaways
- Newton’s law for a piece of string, with small slopes, gives with ; for N and kg/m over m, m/s and the fundamental is Hz.
- Factoring the operator gives : with no initial velocity a pulse splits into two half-height copies, with a finite speed (outside the string is exactly still at ).
- Fixed ends reflect inverted (odd extension), free ends reflect upright (even extension): at , the displacement is or .
- Separation of variables gives the normal modes with frequencies , the harmonic series; a standing wave is a pair of traveling waves.
- A plucked string has : no Gibbs overshoot, with max error at and at ; plucked at , every fourth harmonic is missing.
- Energy is exactly conserved: the quarter pluck holds , kinetic and potential at .
- Unlike heat, the wave equation has no decay, is reversible, keeps corners and has a finite signal speed.
- Leapfrog needs ; it is exact at , disperses at (error ) and blows up at (about in 190 steps).
What comes next
This lesson used d’Alembert’s formula as a tool: to split a pulse, to reflect it, and to check the mode sum. It did not prove the pieces in the generality they deserve. 9.5 d'Alembert's Solution & Characteristics does that: the formula on an infinite line, the domain of dependence and of influence, the method of images for the end conditions (which I used here without deriving it), and the proper link from characteristics to the CFL condition. After that come forced problems, then the drum, the first place where the integer harmonics of this lesson break down. The leapfrog scheme and its dispersion get a full treatment in 10.5 Wave Equation Numerics & the CFL Condition.