9.3 Solving the Heat Equation: Separation of Variables and 9.4 The Wave Equation & Vibrating Strings solved the bare equations, and 9.5 d'Alembert's Solution & Characteristics added a source on an infinite line. Real sources oscillate, boundaries move, and heat has no characteristics to follow. One idea handles all of it, the one you used in 7.6 Nonhomogeneous Linear Systems: change to the coordinates in which the operator is diagonal. A PDE with a source then becomes a list of independent ODEs with sources, and it also explains resonance, the reason a bridge, an organ pipe or a wing panel can be shaken apart by a small force at the wrong frequency.
Transcript
- Along the eigenvectors of a symmetric matrix, a forced system falls apart into scalar equations. On a rod with zero ends, minus d x x plays the matrix, with eigenvectors sine of k pi x. So expand the temperature and the source in sines, with coefficients that depend on time. Each sine is multiplied by minus lambda k, so matching coefficients gives one ODE per mode: for heat, a k prime plus lambda k a k equals f k; for the wave equation, a k double prime plus omega k squared a k equals f k.
- Heat a rod on the middle part, from 0.4 to 0.6, at unit rate, with the ends held at zero and the rod cold. The box is symmetric about the middle, so the even modes vanish. The first coefficient is 0.3935, then f 3 is minus 0.3434, and f 5 is 0.2546. They alternate in sign and fall off slowly.
- Each mode is solved by Duhamel's principle. For a source held on, a k is f k over lambda k times one minus e to the minus lambda k t. The sum splits into a steady state, where conduction balances the source, minus a transient of decaying modes. Mode one alone gives 0.02501 at time 0.1. At the midpoint the temperature is 0.02062, 0.03014, 0.03946 and 0.04294 at times 0.05, 0.1, 0.2 and 0.3, and reaches 0.04500 at time 1.
- How many modes do we need? At time 1, one mode gives 0.03986, 11 percent low. Three modes give 0.04373, off by 2.8 percent. Five give 0.04476, within 0.5 percent of 0.04500. The solution's coefficients carry an extra one over lambda k, so they fall like one over k cubed, and a few modes are enough.
- The source itself is another matter. The box has jumps, so its sine series overshoots, the Gibbs effect. The largest value is 1.124 with 20 modes, 1.101 with 50, 1.092 with 200: the overshoot does not shrink, it only narrows. A point source is worse, its coefficients do not decay at all. Yet the solution is a tent with a corner of height 0.21, and the error there falls only like one over N. At x equals 0.3, N of 1, 5, 20 and 200 gives 0.1326, 0.1931, 0.2049 and 0.2095. Heat has a decay factor to help; the wave equation does not.
- You can skip the eigenfunctions: put 50 grid points on the rod, replace u x x by a central difference, and march with Runge Kutta. This is the method of lines, and it agrees with the modal sum to 8 times 10 to the minus 6. The reason is that the grid operator's eigenvectors are exactly sines, with slightly wrong eigenvalues: 9.8664 against pi squared, 9.8696. The largest is 9990, about 1000 times the smallest, so the system is stiff.
- Now the wave equation, forced by sine pi x times cosine omega t. Each mode obeys a double prime plus omega k squared a equals f cosine omega t. Away from a natural frequency the response stays bounded. At omega equal to pi the limit is t sine pi t over 2 pi: the amplitude grows linearly, each push arriving at the right moment, like a child on a swing. The midpoint reaches 1.512 at time 9.5, under the envelope t over 2 pi, which is 1.592 at time 10.
- Detune to 0.9 pi and the amplitude stays finite, 1.067, reached at half a beat period, time 10. Drive at 2 pi, the second mode, and the peak is only 0.0675: the force sine pi x is symmetric, mode 2 is antisymmetric, so its coefficient is zero. Resonance needs both the frequency and the shape. With damping, gamma 0.5, the growth saturates: the largest midpoint value is 0.316, against the limit 0.318. Damping caps the amplitude but does not remove the danger.
- Now let the right end move. Sines vanish at x equals 1, so subtract a moving line: u equals v plus x g of t. The curvature of x g is zero, but its time derivative is left over as a source, minus x g prime for heat, minus x g double prime for the wave. For heat at omega 10 pi, the source is large but the effect is small: the midpoint only ranges between 0.360 and 0.640, and at x equals 0.1 between 0.079 and 0.121. Conduction cannot follow a fast wiggle. Shake a string's end at its fundamental, and the extra force has frequency omega one: at time 9.5 the middle has swung to 10.
- To recap. Each mode obeys its own ODE with the projected source, and Duhamel gives a steady state plus a transient. A force that meets a mode in frequency and shape grows linearly, and damping caps it. A moving end is an extra source. Next: membranes and drums, where the eigenfunctions stop being plain sines.
Diagonalize the spatial operator
For a symmetric matrix , the eigenvectors are perpendicular directions along which only stretches. Write a vector in those directions and falls apart into scalar equations. On with at both ends, plays the part of the matrix: its eigenvectors are with eigenvalues (8.2 Eigenvalue Problems & Sturm–Liouville Theory), perpendicular in the sense for . “Writing in those directions” is the sine series of 8.3 Fourier Series.
Take the forced heat equation, with (time in units of ):
Expand both the unknown and the source in the sines, with coefficients that depend on time:
Every term satisfies the end conditions. Substitute into the PDE. Since , matching the coefficient of each sine gives
The wave equation (with ) goes the same way and yields
This is the whole eigenfunction expansion method: project the source onto the modes, solve one ODE per mode, add up.
One ODE per mode: Duhamel
The mode equations are the linear ODEs of 3.4 Linear First-Order Equations & Integrating Factors and 5.5 Variation of Parameters. Treat the force as a train of small kicks. A kick at time decays as for heat and rings as for the wave (5.6 Forced Oscillations & Resonance), so
This is Duhamel’s principle again, now one mode at a time on a bounded rod. The payoff for a source that is switched on at and then held, :
The first sum solves , the balance between conduction and the source: a steady state. The second is a sum of decaying modes, exactly the object of 9.3 Solving the Heat Equation: Separation of Variables, and each mode returns to rest at its own rate . The slowest mode, with time constant , sets the settling time.
Example: a heated rod with a localized source
Let a heater warm the part of the rod at unit rate, there and elsewhere, with the ends held at zero and the rod cold at . The sim’s midpoint rule gives the first coefficient . The box is symmetric about and even modes are odd about the middle, so they vanish; , , and the first mode alone has
At the midpoint the temperature climbs as at (the sine sum with 200 modes), and has reached at , the steady state. By hand, the steady state is , where for and for is the response at to a unit point source at , the Green’s function of the rod. Its sine series, , is what the formula above gives for a point source. At :
| modes kept | error | |
|---|---|---|
| 1 | 0.03986 | 11% |
| 3 | 0.04373 | 2.8% |
| 5 | 0.04476 | 0.5% |
What to try. Heat with the box source: move the time index, lower to and , then switch to the point source and watch the kink. Wave with the mode-1 shape: press the button.
Convergence: honest limits of the expansion
Two different series are in play and they converge at very different speeds.
The source. The box has jumps, so its sine coefficients fall only like and its series shows the Gibbs overshoot of 8.5 Convergence & the Gibbs Phenomenon. The sim sums the series for the unit box and records its largest value: with modes, with and with . The overshoot does not shrink, it only narrows; the limit is about of the jump (from memory). A point source is worse: its coefficients do not decay, so its series is not a function.
The solution. Nobody sums the source series. The solution’s coefficients are , and dividing by buys two powers of . For the box they fall like and the sums above converge quickly with no overshoot. For the point source they fall like , like the plucked string of 9.4 The Wave Equation & Vibrating Strings: the steady state is the tent , with a corner of height , and the error of the -mode sum at the corner shrinks like :
| 1 | 5 | 20 | 200 | |
|---|---|---|---|---|
| 0.1326 | 0.1931 | 0.2049 | 0.2095 |
Even modes miss the corner by . Heat gets extra help from the factor , which kills high modes after any positive time; the wave equation has no such factor, and a corner stays a corner.
The same problem by the method of lines
You can also put grid points on the rod, replace by the central difference and march the ODE system with RK4 (4.3 Runge–Kutta Methods & Butcher Tableaux): the method of lines. The sim does this with and beside the modal sum. At both give at the midpoint, and over the whole run they never differ by more than .
The agreement has a reason. The discrete operator is a symmetric matrix whose eigenvectors are exactly , with eigenvalues (from memory, a standard fact that I checked numerically). For that is against : the method of lines is the eigenfunction method with a slightly wrong list of eigenvalues. The largest eigenvalue is , about times the smallest, so the system is stiff (4.5 Stability Regions & Stiffness): RK4 needs , set by the finest grid mode. The modal method has no such limit, but you must know the eigenfunctions. For the resonant string below, the two differ by at most over the run (peaks near ), because the grid’s lowest frequency is rather than and the phase drifts slowly: numerical dispersion, the subject of 10.5 Wave Equation Numerics & the CFL Condition.
Forced vibrations and resonance
Now the wave equation, on a string of length with fixed ends and , so that . A source with this time dependence gives the mode equation , where is the sine coefficient of . For the solution with is
It is bounded: a response at the driving frequency plus a free oscillation at the natural one. When is close to the denominator is small and the amplitude large, a fast oscillation inside a slow envelope (beats). At the limit (Problem 2) is
an oscillation whose amplitude grows linearly without bound. That is resonance: each push arrives at the right moment in the cycle, like a child on a swing.
Numbers from the sim (force shape , , response at the midpoint, run to ):
| what happens | largest | |
|---|---|---|
| resonance, | 1.512 at | |
| beats, bound | 1.067 | |
| not a resonance here | 0.0675 |
At resonance the envelope is at , and the sampled peak at is . At the amplitude is finite but is already large, and it is reached at half a beat period, , the end of this run. At the mode-2 frequency is hit, yet nothing resonates: is symmetric about the middle, mode 2 is antisymmetric, so . Resonance needs both the frequency and the shape. A unit point force at has and gives at , while the box on gives because its is only .
Damping. With loss, , resonance grows for a while and saturates at . For and the force the sim’s largest midpoint value is against the limit . Damping caps the amplitude but does not remove the danger.
Why it matters. Bridge decks, organ pipes and wing panels are elastic or acoustic systems with a list of and light damping (from memory). The Tacoma Narrows collapse is usually attributed to aeroelastic flutter, where the wind’s force depends on the motion, not to simple resonance with an outside force (from memory). The practice is the same: compute the , keep known forcing frequencies away from them, add damping. An organ pipe is the useful case, an air column driven at its mode.
Time-dependent boundary data
Now let the right end move: , . Every vanishes at , so a sum of them cannot hit . 9.3 Solving the Heat Equation: Separation of Variables subtracted a steady straight line for constant ends. The same move works when varies, if you remember that the subtracted function now depends on time:
Since , obeys the same spatial operator, but the time derivative of is left over and becomes a new source:
(Constant adds nothing: the old trick.) Project onto the sines: , so mode is driven by or . Choose so that starts at rest; the sim uses .
Heat, oscillating end. Take : the right end swings between and five times per unit of time. The source is large ( has size ) but its effect is small: over , ranges between and , a swing of about the mean , and at only between and . The oscillation does not penetrate: heat conduction cannot follow a fast wiggle, so the signal dies out as it enters, roughly like at the distance from the moving end (the thermal skin depth, from memory; an exact frequency-domain calculation gives the amplitudes at and at ). Viscous flow over an oscillating plate behaves the same way.
Wave, shaken end. Shake the right end of a string at its fundamental, . The extra force has frequency , so mode 1 is driven at resonance and . Adding at the midpoint, at the sim gives : the middle of the string, driven by an end that moves only between and , has swung units. A moving boundary is a resonant force like any other.
Check your understanding
Problems
The rod () has zero end temperatures and . Find and the steady state, and state the relaxation time.
Show worked solution
The source is exactly mode 2, so and all other . The mode equation is , with , so and . The steady state is , reached with time constant . All other modes stay at zero.
Start from , the solution of with zero initial data. Take to derive . Then, for and , find the amplitude envelope at .
Show worked solution
Use and . Then
As , the first factor tends to and, since , the second to . So . For the envelope is , which is at .
The rod has , and . (a) Write and find the equation, end conditions and initial data of . (b) Find the coefficient of the first mode of . (c) Find the exact long-time profile of and compare its midpoint value with the first mode alone.
Show worked solution
(a) (since has no curvature), with and . The source is , a time-independent source, with .
(b) The coefficient of is , so and , giving , with limit .
(c) The steady state satisfies , so , and gives : . At it is . The first mode alone gives , too large in magnitude: one mode already captures the profile. So .
Computation
A smooth source on the cold rod, solved twice: by the modal formula and by the method of lines.
Now implement the mode machinery yourself.
Try the point-source error by hand: replace the source by the coefficients and see how the error at falls with .
Key Takeaways
- Expanding in the eigenfunctions of the spatial operator turns into independent ODEs , and into , with the projection of the source.
- Each mode is solved by Duhamel; a held source gives the steady state minus a transient. For the box source the rod’s midpoint reaches , with , and from , and modes.
- The box source’s own series overshoots by about (peak , , at ), but the solution’s coefficients carry an extra and converge fast. A point source leaves a corner with error about ( against at ).
- Resonance: forcing at gives , growing linearly (peak at for ); detuning to gives beats of size ; a force orthogonal to a mode cannot excite it; damping saturates the growth at .
- A moving end is handled by , which adds the source (heat) or (wave). A fast heat wiggle stays near the wall ( at for ); a string shaken at its fundamental reaches at the midpoint by .
- The method of lines is the same expansion with grid eigenvalues: it matched the modal answer to for the rod and for the resonant string, at the price of a stiffness ratio near .
What comes next
Everything here lived on a line, where the eigenfunctions are sines and the frequencies are . A drum is a two-dimensional region, and 9.8 Higher Dimensions: Membranes & Drums carries this lesson over to rectangles and disks. The eigenfunctions stop being plain sines: on a rectangle they are products of sines, and on a disk they involve the Bessel functions of 8.6 Orthogonal Polynomials & Special Functions, whose zeros are not evenly spaced, so a drum has no clear pitch. The method of this lesson (project the source, one ODE per mode, resonance when a force meets a mode in frequency and shape) then goes through unchanged. Closed-form eigenfunctions exist only for special shapes such as these; for an arbitrary region they must be computed numerically.