1Today's goals
- Derive the heat equation from conservation of energy and Fourier's law
- Solve it by separation of variables with fixed-temperature ends
- Compute Fourier sine and cosine coefficients
- Explain why sharp features smooth out first (decay ∝ n²)
- Estimate thermal time scales from L²/α
2From energy balance to a PDE
Take a thin slice of a rod between x and x + dx. Heat flux q (W/m²) flows in at x and out at x + dx. Fourier's law: heat flows down the temperature gradient, q = −k·∂u/∂x. Energy balance on the slice:
Read it: the temperature at a point rises if it is below the average of its neighbours (uxx > 0, a valley) and falls if it is above (a peak). Diffusion fills valleys and flattens peaks. The same equation governs ink spreading in water, a pollutant in groundwater, and — after a change of variables — the Black–Scholes model of option prices.
A PDE needs boundary conditions as well as an initial shape: fixed temperature (Dirichlet), insulated ends (Neumann, ux = 0), or convection to the air (Robin).
3Separation of variables
Rod of length L, both ends held at 0, initial shape f(x). Guess u = X(x)·T(t):
X″ + λX = 0 with X(0) = X(L) = 0 → Xn = sin(nπx/L), λn = (nπ/L)²
T′ = −αλnT → Tn = e−α(nπ/L)²t
u(x, t) = Σ bn·sin(nπx/L)·e−α(nπ/L)²t
Each sine shape (a mode, just like Day 8) keeps its shape and simply decays. Mode n decays n² times faster than mode 1, so fine detail disappears first and every profile ends up looking like the single hump sin(πx/L).
4Fourier series
To fit the initial shape, choose the bn so that Σ bn·sin(nπx/L) = f(x). Because the sines are orthogonal (∫ sin(mπx/L)·sin(nπx/L) dx = 0 for m ≠ n), each coefficient can be picked out alone:
Full series on (−π, π): f(x) = a₀/2 + Σ (an·cos nx + bn·sin nx), an = (1/π)∫ f·cos nx dx, bn = (1/π)∫ f·sin nx dx
| Wave (amplitude 1, period 2π) | Coefficients | Decay of coefficients |
|---|---|---|
| Square | bn = 4/(nπ), odd n only | 1/n — it has jumps |
| Sawtooth | bn = 2(−1)n+1/(nπ) | 1/n — one jump per period |
| Triangle | bn = ±8/(n²π²), odd n | 1/n² — continuous, kinked |
The smoother the function, the faster its coefficients fall. Near a jump, any partial sum overshoots by about 9 % of the jump — the Gibbs phenomenon — and adding terms only squeezes the overshoot closer to the jump.
Fourier, eigenfunctions and the FFT you already use
The sines are the eigenfunctions of d²/dx² with the boundary conditions — exactly as eigenvectors were for a matrix on Day 8. Expanding in eigenfunctions decouples the PDE into independent ODEs, one per mode. The same idea with complex exponentials over a finite record is the discrete Fourier transform; the FFT computes it fast. When your vibration analyser shows a spectrum, it is printing the an, bn of a measured signal.
5Worked example
6Lab: Fourier builder
Build a wave from sines. With "separate harmonics" on, the thin orange curves are the first few terms; the blue curve is their sum. Press P to add terms one by one and watch the Gibbs overshoot sit stubbornly at the jumps. Compare the spectra of the square and the triangle.
The heated rod
Press P. Left: the profile flattening. Middle: the space–time map building upwards. Right: the sine coefficients decaying — the outlines are their starting sizes. With "both held at 0" watch mode 5 vanish long before mode 1. Try insulated ends: the average never changes.
7Pro tips and common mistakes
- Match the series to the boundary conditions: sines for fixed-zero ends, cosines for insulated ends.
- Non-zero end temperatures: subtract the steady straight-line solution first, solve for the remainder with zero ends, then add it back.
- Heat "travels" infinitely fast in this model (any change is felt everywhere at once, though tiny far away). For most engineering it does not matter.
8Practice
- Compute b₁ and b₂ for f(x) = x on (0, π) with a sine series.
- For the steel bar above, how long until mode 1 falls to 5 %?
- In the heat lab, start with "sin πx + 0.5 sin 5πx". After what fraction of the run is the wiggle invisible?
- Show that u = e−αk²t·sin kx satisfies ut = α·uxx.
9Quick quiz
5 questions. Click an answer — you get the explanation straight away.