Flow Lab

Syllabus / Module 9: Classical PDEs: Heat, Waves & Potentials

Lesson 9.9

Infinite Domains & the Fourier Transform

From series to integrals: the Fourier transform, heat kernel, solving PDEs on the whole line, dispersion relations.

Written byClaude Sonnet

🌊
Why this matters for simulation: Dispersion relations explain why water waves of different lengths travel at different speeds.

By the end of this lesson you can…

  • Take the period $2L$ of a Fourier series to infinity and arrive at the transform pair, stating the convention and where each $2\pi$ sits.
  • Transform a Gaussian, and explain the tradeoff between the width of a signal and the width of its spectrum.
  • Use the derivative rule and the convolution theorem to turn a constant-coefficient PDE into an ODE in $t$ for each wavenumber.
  • Solve the heat equation on the whole line with the Gaussian heat kernel, and say why its width grows like $\sqrt t$ while a wave has a finite front.
  • Read a dispersion relation $\omega(k)$, and compute phase and group velocity for a packet.
  • Differentiate a periodic grid function with the FFT, and compare its error with finite differences.
On this page
·
  1. From a sum to an integral
  2. The Gaussian and the uncertainty tradeoff
  3. Derivatives become multiplication
  4. Heat on the whole line
  5. The contrast with waves
  6. Waves by transform
  7. Energy: Plancherel
  8. Spectral differentiation on a periodic box
  9. Check your understanding
  10. Problems
  11. Computation
  12. Key Takeaways
  13. What comes next

9.8 Higher Dimensions: Membranes & Drums ended on a limitation. Every region there was bounded, so the modes formed a discrete list and the solution was a sum. A wake behind a wing, a pulse on a very long wire, or a puff of heat in open air has no wall to fix the modes. A flight simulator spends most of its time in exactly this situation: the domain is large compared with anything of interest. This lesson takes the Fourier series of 8.3 Fourier Series to its limit, where the list of modes becomes a continuum and the sum becomes an integral. Two payoffs follow: the heat equation gets a closed-form answer for any initial data, and waves get a vocabulary (dispersion, group velocity) that no bounded problem could teach.

▶ Video Series becoming an integral, the Gaussian pair, the heat kernel spreading, a dispersive packet whose envelope outruns its crests, and the FFT as a derivativecaptions only
Transcript
  1. Bounded regions gave a list of modes and a sum. With no walls, take a function of period two L and let L grow. The wavenumbers sit pi over L apart, so they crowd together, and the series, a Riemann sum, becomes an integral. That is the transform pair: F of k is the integral of f times e to the minus i k x, and f is one over two pi times the integral of F times e to the i k x. The two pi sits in the inverse.
  2. The Gaussian is the pair worth memorising. A Gaussian of width s transforms to a Gaussian of width one over s: narrow in space means wide in wavenumber. Measuring both spreads, the product is 0.5000 for every Gaussian. For the hyperbolic secant it is 0.5236, which is pi over 6, a little above the bound. You cannot localise a signal in both space and wavenumber.
  3. Two rules do the heavy lifting. Differentiating in x multiplies by i k, and a second derivative multiplies by minus k squared, so a constant coefficient PDE becomes an ODE in time for each wavenumber, with no coupling. And convolution in space is plain multiplication in wavenumber. A kink such as e to the minus absolute x transforms to two over one plus k squared, falling slowly because of the corner. Energy is preserved too: both sides of Plancherel give 1.772454 for the unit Gaussian.
  4. Now heat on the whole line. Transform, and each wavenumber decays at its own rate: U equals F times e to the minus alpha k squared t. That factor is itself a Gaussian pair, so the answer is the initial data convolved with the heat kernel, a Gaussian of variance two alpha t. The width grows like the square root of t. For a box of heat, the centre reads 0.9747, 0.8427, 0.5205 and 0.2763 at times 0.1, 0.25, 1 and 4, while the total stays 2.0000.
  5. The variance of the box gains 0.2000, 0.5000, 2.0000 and 8.0000: exactly two alpha t each time. At the centre the box obeys the error function of one over two root t, which falls to one half at t about 1.10. And there is no finite front: at t equals 1, five units beyond the edge, the temperature is 2.0 times ten to the minus 4. Heat multiplies by a real decay, whose kernel has infinite tails; a wave only rotates a phase.
  6. Waves by transform: u t t equals c squared u x x gives U equals F times cosine of c k t, which is two travelling copies of the initial shape. That is d'Alembert's formula, and the spectral solution of a Gaussian pulse matches it to below ten to the minus twelve. The reason is the dispersion relation, omega equals c k: every wavenumber travels at the same speed. Other equations give other omega of k.
  7. A plane wave's crests move at the phase velocity, omega over k. But a packet of nearby wavenumbers has an envelope, and the envelope moves at the group velocity, d omega d k. For u t plus u x x x equals zero, omega is minus k cubed. At k equals 3 the crests move at minus 9 and the envelope at minus 27: three times faster. For deep water the crests go at 0.5774 and the energy at 0.2887, half as fast. Measured on the grid, the packet centroid moves at minus 27.094 and 0.2891.
  8. When omega is not linear, the envelope also spreads. The packet of width 2.8284 keeps it when omega equals k, even at time 10. Under minus k cubed it grows to 4.2594 by time 1 and 6.9692 by time 2: more than double. Deep water spreads slowly, 2.8297 at time 10. That is dispersion: a splash sorts itself by wavelength, and a ship's wake is the pattern.
  9. On a periodic box the same rule gives spectral differentiation: take the FFT, multiply by i k, transform back. For e to the sine x, second order differences lose a factor four per doubling, and fourth order a factor sixteen. The FFT error is 0.00432 at 8 points, 1.8 times ten to the minus 7 at 16, and rounding by 32. Sixteen points beat 128 points of fourth order. But it needs smoothness: for absolute sine cubed the FFT error also drops only by a factor 4.
  10. To recap. Letting the period go to infinity turns the series into the transform pair. Gaussians trade width for spectrum, derivatives become multiplication, and heat is a Gaussian blur of variance two alpha t. Waves only rotate phases, and dispersion separates the crests from the envelope. The FFT turns this into a derivative that beats finite differences on smooth data. Next: wave equation numerics and the CFL condition, where the grid's own dispersion decides what is stable.

From a sum to an integral

Take a function of period 2L2L and write the series in the complex form of 8.3 Fourier Series, with kn=nπ/Lk_n = n\pi/L and spacing Δk=π/L\Delta k = \pi/L:

f(x)=∑ncneiknx,cn=12L∫−LLf(x) e−iknx dx.f(x) = \sum_n c_n e^{ik_nx},\qquad c_n = \frac{1}{2L}\int_{-L}^{L} f(x)\,e^{-ik_nx}\,dx.

Put FL(k)=∫−LLfe−ikxdxF_L(k) = \int_{-L}^{L}f e^{-ikx}dx. Then cn=FL(kn)/2L=FL(kn) Δk/2πc_n = F_L(k_n)/2L = F_L(k_n)\,\Delta k/2\pi, so the series reads f(x)=12π∑nFL(kn)eiknxΔkf(x) = \frac{1}{2\pi}\sum_n F_L(k_n)e^{ik_nx}\Delta k. This is a Riemann sum. Let L→∞L\to\infty: the spacing Δk→0\Delta k\to0, and if ff decays fast enough the sum becomes an integral. That is the Fourier transform pair:

F(k)=∫−∞∞f(x) e−ikx dx,f(x)=12π∫−∞∞F(k) eikx dk.F(k) = \int_{-\infty}^{\infty} f(x)\,e^{-ikx}\,dx,\qquad f(x) = \frac{1}{2\pi}\int_{-\infty}^{\infty}F(k)\,e^{ikx}\,dk.

This lesson uses this convention throughout: kk is the angular wavenumber (radians per unit length), the forward transform carries no factor, and the inverse carries 1/2π1/2\pi. Other books put 1/2π1/\sqrt{2\pi} on both, or use e−2πiξxe^{-2\pi i\xi x} and no factors at all, so the formulas below change by factors of 2π2\pi if you swap conventions. The orientation matches np.fft.fft, which is the unnormalized sum with e−i⋅e^{-i\cdot}. F(k)F(k) is the amplitude of the wave eikxe^{ikx} needed to build ff; F(0)=∫f dxF(0) = \int f\,dx is the total.

The Gaussian and the uncertainty tradeoff

The one transform worth knowing by heart is the Gaussian. For f=e−x2/2s2f = e^{-x^2/2s^2},

F(k)=s2π e−s2k2/2.F(k) = s\sqrt{2\pi}\,e^{-s^2k^2/2}.

(Complete the square in ∫e−x2/2s2−ikxdx\int e^{-x^2/2s^2 - ikx}dx and use ∫e−u2/2s2du=s2π\int e^{-u^2/2s^2}du = s\sqrt{2\pi}; the shift into the complex plane is justified in a complex analysis course.) A Gaussian transforms to a Gaussian, and the widths are inverse: narrow in xx means wide in kk. Scaling says why. Squeezing f(x)→f(x/a)f(x)\to f(x/a) with a<1a\lt1 gives F(k)→aF(ak)F(k)\to aF(ak), which is wider in kk by the same factor. A sharp spike needs every wavenumber to build it.

Measure width by the standard deviation of the energy density, σx2=∫x2∣f∣2dx/∫∣f∣2dx\sigma_x^2 = \int x^2|f|^2dx/\int|f|^2dx, and likewise σk\sigma_k from ∣F∣2|F|^2. The sim computes both by FFT on a grid. For the Gaussian with s=1s = 1 it gives σx=0.7071\sigma_x = 0.7071 and σk=0.7071\sigma_k = 0.7071, product 0.50000.5000; at s=2s = 2 the widths are 1.41421.4142 and 0.35360.3536, still 0.50000.5000. For sech⁡(x/s)\operatorname{sech}(x/s) the product is 0.52360.5236 at every ss (it equals π/6\pi/6; the sim’s F(0)=3.1416F(0) = 3.1416 is the integral). I recall that σxσk≥12\sigma_x\sigma_k\ge\tfrac12 for every signal, with equality only for Gaussians (from memory), which is the mathematical core of the Heisenberg principle. For a simulation it has a plain meaning: a grid that resolves features of width ℓ\ell must carry wavenumbers up to about 1/ℓ1/\ell, and you cannot localize in both xx and kk.

Derivatives become multiplication

Integrate by parts, with the boundary terms vanishing because ff decays:

f′^(k)=∫f′e−ikxdx=ik F(k),f′′^=−k2F.\widehat{f'}(k) = \int f'e^{-ikx}dx = ik\,F(k),\qquad \widehat{f''} = -k^2F.

Differentiation in xx is multiplication by ikik. This is why Fourier methods exist: a constant-coefficient PDE becomes an ODE in tt for each kk, with no coupling between wavenumbers. It also reads smoothness off the spectrum: f=e−∣x∣f = e^{-|x|} has transform 2/(1+k2)2/(1+k^2) (Problem 1), falling only like k−2k^{-2}, because the kink in ff means f′f' jumps and f′^\widehat{f'} cannot decay faster than 1/k1/k. The Laplace transform of 6.1 The Laplace Transform did the same to ODEs in time; a Fourier transform in time is a Laplace transform along s=iωs = i\omega, so the two are one idea.

Convolution theorem. The convolution (f∗g)(x)=∫f(y)g(x−y) dy(f*g)(x) = \int f(y)g(x-y)\,dy has transform F(k)G(k)F(k)G(k) (substitute x=y+zx = y + z and the double integral factors). A product of spectra is a blend in space, exactly as in 6.5 Convolution & Transfer Functions. We use it next.

Heat on the whole line

Solve ut=αuxxu_t = \alpha u_{xx} on −∞<x<∞-\infty\lt x\lt\infty with u(x,0)=f(x)u(x,0) = f(x). Transform in xx: Ut=−αk2UU_t = -\alpha k^2U, so

U(k,t)=F(k) e−αk2t.U(k,t) = F(k)\,e^{-\alpha k^2t}.

Each wavenumber decays at its own rate, as the modes of 9.3 Solving the Heat Equation: Separation of Variables did, except that now every kk is present. The factor e−αk2te^{-\alpha k^2t} is the Gaussian pair with s2=2αts^2 = 2\alpha t, whose inverse transform is the heat kernel

K(x,t)=14παt e−x2/4αt,u(x,t)=(K∗f)(x)=∫K(x−y,t) f(y) dy.K(x,t) = \frac{1}{\sqrt{4\pi\alpha t}}\,e^{-x^2/4\alpha t},\qquad u(x,t) = (K*f)(x) = \int K(x-y,t)\,f(y)\,dy.

The solution is the initial data blurred by a Gaussian of variance 2αt2\alpha t: the width grows like t\sqrt t, not like tt. A point of heat at yy spreads into a bell centred at yy, and the answer is the sum of the bells.

Worked example. Start from f=e−x2/2f = e^{-x^2/2} with α=1\alpha = 1. Convolving two Gaussians adds variances, 1→1+2t1\to1+2t, and the area is conserved, so

u=11+2t e−x2/2(1+2t).u = \frac{1}{\sqrt{1+2t}}\,e^{-x^2/2(1+2t)}.

At t=4t = 4 the peak is 1/31/3 and the width σ=3\sigma = 3; the area 13⋅32π\tfrac13\cdot3\sqrt{2\pi} is unchanged. The area is the k=0k = 0 mode, which does not decay.

A box. For f=1f = 1 on ∣x∣<1\lvert x\rvert\lt1, the integral of the kernel over [−1,1][-1,1] gives u=12[erf⁡1−x2αt+erf⁡1+x2αt]u = \tfrac12\left[\operatorname{erf}\frac{1-x}{2\sqrt{\alpha t}} + \operatorname{erf}\frac{1+x}{2\sqrt{\alpha t}}\right]. The sim solves this by FFT instead, with α=1\alpha = 1 (all quoted to four digits):

tt0.10.2514
u(0,t)u(0,t)0.97470.84270.52050.2763

The variance of u/∫uu/\int u grows by 0.2000, 0.5000, 2.0000, 8.00000.2000,\ 0.5000,\ 2.0000,\ 8.0000, which is 2αt2\alpha t each time, and ∫u dx=2.0000\int u\,dx = 2.0000 throughout. Multiplying by e−αk2te^{-\alpha k^2t} and convolving with the sampled kernel agree to rounding error, below 10−1310^{-13}: the convolution theorem, checked.

◆ Interactive Transform pairs, the heat kernel, dispersion and FFT derivatives

Loading simulation…

What to try. In the heat view slide tt from 00 and watch the right panel: high wavenumbers die first, which is the smoothing. Then open the other views as you read on.

The contrast with waves

Heat has no finite speed. At t=1t = 1 the box solution at x=6x = 6, five units from the edge, is 2.0×10−42.0\times10^{-4}, small but positive; at t=4t = 4 it is 0.03190.0319. Every point feels every other instantly, because each Gaussian has infinite tails. The wave equation behaves differently, as 9.5 d'Alembert's Solution & Characteristics showed: data with compact support gives exactly zero outside the cone ∣x∣≤a+ct\lvert x\rvert\le a+ct. The multiplier is the difference. Heat multiplies each kk by a real e−αk2te^{-\alpha k^2t}, which shrinks it; waves multiply by a phase, which only rotates it.

Waves by transform

Transform utt=c2uxxu_{tt} = c^2u_{xx} in xx: Utt=−c2k2UU_{tt} = -c^2k^2U. With ut(x,0)=0u_t(x,0) = 0, U=F(k)cos⁡(ckt)=12F(eickt+e−ickt)U = F(k)\cos(ckt) = \tfrac12F\left(e^{ickt} + e^{-ickt}\right). A factor eikx0F(k)e^{ikx_0}F(k) is the transform of f(x+x0)f(x + x_0) (shift theorem), so u=12[f(x+ct)+f(x−ct)]u = \tfrac12[f(x+ct) + f(x-ct)]: d’Alembert’s formula, recovered. The sim agrees: for the pulse e−x2/2e^{-x^2/2} at c=1c = 1 the FFT solution and d’Alembert differ by less than 10−1210^{-12} (rounding).

The reason it works for every kk at the same speed is that the relation between frequency and wavenumber is linear, ω=ck\omega = ck. In general, substitute a plane wave ei(kx−ωt)e^{i(kx-\omega t)} into a linear PDE with constant coefficients. The result is the dispersion relation ω(k)\omega(k):

equationω(k)\omega(k)
ut+cux=0u_t + cu_x = 0ckck
ut+uxxx=0u_t + u_{xxx} = 0−k3-k^3
ut=αuxxu_t = \alpha u_{xx}−iαk2-i\alpha k^2 (imaginary: decay)
utt+βuxxxx=0u_{tt} + \beta u_{xxxx} = 0 (a beam)±β k2\pm\sqrt\beta\,k^2

A real ω\omega means oscillation, an imaginary part means growth or decay. Each plane wave has phase velocity vp=ω/kv_p = \omega/k. Now take a packet of wavenumbers near k0k_0 and expand ω≈ω0+ω′(k0)(k−k0)\omega\approx\omega_0 + \omega'(k_0)(k-k_0). The exponent splits,

ei(kx−ωt)≈ei(k0x−ω0t)  ei(k−k0)(x−ω′t).e^{i(kx-\omega t)} \approx e^{i(k_0x-\omega_0t)}\;e^{i(k-k_0)(x-\omega't)}.

The first factor is the carrier, moving at vpv_p. The second depends only on x−ω′tx-\omega't, so the envelope moves at the group velocity vg=dω/dkv_g = d\omega/dk. The energy travels at vgv_g. When ω′′≠0\omega''\ne0 the linear approximation fails at the next order, and the envelope also spreads. That is dispersion.

The sim tests this on the packet e−x2/32cos⁡(k0x)e^{-x^2/32}\cos(k_0x) with k0=3k_0 = 3.

modelvpv_pvgv_gmeasured centroid speedenvelope width at t=0t=0, later
ω=k\omega = k111.00002.8284 at t=10t=10: 2.8284
ω=−k3\omega = -k^3−9-9−27-27−27.094-27.0942.8284, then 4.2594 at t=1t=1 and 6.9692 at t=2t=2
deep water0.57740.28870.28912.8284 at t=10t=10: 2.8297

For ω=−k3\omega = -k^3 the envelope runs at three times the speed of the crests and more than doubles its width in two time units; for ω=k\omega = k nothing changes shape. The small excess −27.094-27.094 over −27-27 is not an error: the packet has a spread of wavenumbers, and the centroid moves at the energy-weighted average of ω′\omega', which here is −3(k02+132)=−27.0938-3\left(k_0^2 + \tfrac1{32}\right) = -27.0938 (the average formula is from memory; the sim reproduces its number).

Energy: Plancherel

The transform preserves energy. The same Riemann-sum argument that took Parseval’s identity of 8.3 Fourier Series to infinity gives

∫−∞∞∣f∣2dx=12π∫−∞∞∣F∣2dk.\int_{-\infty}^{\infty}|f|^2dx = \frac{1}{2\pi}\int_{-\infty}^{\infty}|F|^2dk.

The sim prints both sides for the Gaussian with s=1s = 1: 1.7724541.772454 and 1.7724541.772454, which is π\sqrt\pi. Apply it in time. Waves multiply each mode by a phase, so ∣U∣|U| never changes and the energy is constant. Heat multiplies by e−αk2te^{-\alpha k^2t}, so ∣U∣|U| shrinks and the energy decays, fastest where kk is large. The same measure that separated waves from heat above is the energy.

Spectral differentiation on a periodic box

A computer has a finite box, so replace the line by a periodic domain of length 2π2\pi with NN samples xj=2πj/Nx_j = 2\pi j/N. The discrete transform is the DFT and the FFT computes it in Nlog⁡2NN\log_2N operations (8.5 Convergence & the Gibbs Phenomenon, which also explains aliasing). The recipe for f′f' is the derivative rule applied to samples: FFT, multiply by ikik, inverse FFT. The one care is the Nyquist mode k=N/2k = N/2, whose derivative would be a complex number; set that multiplier to 00.

The sim compares this with the central difference of 10.1 Finite Differences: Discretizing Derivatives (second order) and a five-point central difference (fourth order), on f=esin⁡xf = e^{\sin x}, with maximum error over the nodes:

NN8163264128
2nd-order FD0.3400.09360.02580.006510.00163
4th-order FD0.1380.01580.001137.6×10−57.6\times10^{-5}4.8×10−64.8\times10^{-6}
FFT0.004321.8×10−71.8\times10^{-7}roundingroundingrounding

The finite differences lose a fixed factor (44, then 1616) per doubling of NN; the FFT error falls faster than any power, and by N=32N = 32 it has reached rounding error near 10−1410^{-14}, which is why no digits are quoted. Sixteen points with the FFT beat 128128 points of fourth-order differences by a factor above 2020. This is spectral accuracy, and it needs a smooth periodic function. For ∣sin⁡x∣3\lvert\sin x\rvert^3, whose third derivative jumps, the FFT error at N=8,16,32,64,128N = 8, 16, 32, 64, 128 is 0.0607, 0.0171, 0.00436, 0.00109, 2.7×10−40.0607,\ 0.0171,\ 0.00436,\ 0.00109,\ 2.7\times10^{-4}: a fixed factor 44 again. Accuracy is set by smoothness, as in the convergence table of 8.5 Convergence & the Gibbs Phenomenon.

Check your understanding

✅ Concept check

With $F(k) = \int f(x)e^{-ikx}dx$, what factor multiplies the inverse integral $\int F(k)e^{ikx}dk$?

✅ Concept check

Why does heat spread instantly (positive everywhere for $t\\gt0$) while a wave pulse with compact support does not?

✅ Concept check

For $u_t + u_{xxx} = 0$ the group velocity at $k = 2$ is

✅ Concept check

You differentiate a smooth periodic function with the FFT and double $N$. The error

Problems

✏️ Pen & paperTransform of a two-sided exponential●○○

Find F(k)F(k) for f=e−a∣x∣f = e^{-a|x|} with a>0a\gt0, and say how fast FF decays at large kk and why.

Show worked solution

Split at 00. ∫0∞e−axe−ikxdx=1a+ik\int_0^\infty e^{-ax}e^{-ikx}dx = \dfrac{1}{a+ik}, and the half on x<0x\lt0 is the complex conjugate. Sum: 1a+ik+1a−ik=2aa2+k2\dfrac{1}{a+ik} + \dfrac{1}{a-ik} = \dfrac{2a}{a^2+k^2}. It falls like k−2k^{-2}: ff has a corner at 00, f′f' jumps, and f′^=ikF\widehat{f'} = ikF can fall no faster than 1/k1/k, so F∼k−2F\sim k^{-2}.

✏️ Pen & paperA box of heat●●○

With α=1\alpha = 1 and f=1f = 1 on ∣x∣<1\lvert x\rvert\lt1, show u(0,t)=erf⁡ ⁣(12t)u(0,t) = \operatorname{erf}\!\left(\dfrac{1}{2\sqrt t}\right) and find when it falls to 12\tfrac12.

Show worked solution

u(0,t)=∫−11K(y,t) dy=14πt∫−11e−y2/4tdyu(0,t) = \int_{-1}^{1}K(y,t)\,dy = \dfrac{1}{\sqrt{4\pi t}}\int_{-1}^{1}e^{-y^2/4t}dy. Put y=2t zy = 2\sqrt t\,z: 1π∫−1/2t1/2te−z2dz=erf⁡ ⁣(12t)\dfrac{1}{\sqrt\pi}\int_{-1/2\sqrt t}^{1/2\sqrt t}e^{-z^2}dz = \operatorname{erf}\!\left(\dfrac{1}{2\sqrt t}\right). The inverse error function satisfies erf⁡−1(0.5)≈0.4769\operatorname{erf}^{-1}(0.5)\approx0.4769, so 12t=0.4769\dfrac{1}{2\sqrt t} = 0.4769, giving t≈1.10t\approx1.10.

✏️ Pen & paperBeam waves●●○

For utt+βuxxxx=0u_{tt} + \beta u_{xxxx} = 0 find ω(k)\omega(k), vpv_p and vgv_g. For β=1\beta = 1 and a packet at k0=2k_0 = 2, which is faster, the crests or the envelope, and by how much?

Show worked solution

Substituting ei(kx−ωt)e^{i(kx-\omega t)}: −ω2+βk4=0-\omega^2 + \beta k^4 = 0, so ω=±β k2\omega = \pm\sqrt\beta\,k^2. On the ++ branch vp=β kv_p = \sqrt\beta\,k and vg=2β kv_g = 2\sqrt\beta\,k. At k0=2k_0 = 2: vp=2v_p = 2, vg=4v_g = 4. The envelope is twice as fast as the crests, and shorter waves travel faster still, so a beam hit by an impulse rings with the high frequencies arriving first (from memory).

Computation

The exercise is the whole spectral method in a few lines: the wavenumbers, the derivative, and one exact heat step.

🧪 Coding exerciseExercise: FFT differentiation and an exact heat step
⌘/Ctrl + Enter

Second, a playground: a packet under three dispersion relations. The envelope’s centre moves at the group velocity.

🐍 PythonLab: a dispersive packet by FFT
⌘/Ctrl + Enter

Change tt and k0k_0 and compare the centroid with vgtv_gt.

Key Takeaways

  • Letting the period 2L→∞2L\to\infty turns the Fourier sum into the pair F(k)=∫fe−ikxdxF(k) = \int fe^{-ikx}dx, f=12π∫Feikxdkf = \frac1{2\pi}\int Fe^{ikx}dk. The convention (no factor forward, 1/2π1/2\pi back) matters: other books move the 2π2\pi.
  • A Gaussian transforms to a Gaussian with inverse width, so σxσk=0.5000\sigma_x\sigma_k = 0.5000 (and 0.52360.5236 for sech⁡\operatorname{sech}). Narrow in space means wide in wavenumber.
  • f′^=ikF\widehat{f'} = ikF turns constant-coefficient PDEs into one ODE per wavenumber; convolution in xx is multiplication in kk.
  • Heat on the line: U=Fe−αk2tU = Fe^{-\alpha k^2t}, so u=K∗fu = K*f with the Gaussian kernel of variance 2αt2\alpha t. Width grows like t\sqrt t, the area is conserved, and the tails are positive instantly (u(6,1)=2.0×10−4u(6,1) = 2.0\times10^{-4} for a box). Waves have a finite front.
  • The dispersion relation ω(k)\omega(k) gives phase velocity ω/k\omega/k and group velocity ω′\omega'; for ω=−k3\omega = -k^3 at k0=3k_0 = 3 they are −9-9 and −27-27. A nonlinear ω\omega also spreads the envelope. Deep water has vg=vp/2v_g = v_p/2 (from memory).
  • Plancherel: ∫∣f∣2dx=12π∫∣F∣2dk\int|f|^2dx = \frac1{2\pi}\int|F|^2dk. Phases conserve energy; the real exponential of heat dissipates it.
  • On a periodic grid, FFT differentiation is spectrally accurate for smooth data (1.8×10−71.8\times10^{-7} at N=16N = 16 for esin⁡xe^{\sin x}, against 0.01580.0158 for fourth-order differences) and falls back to second order when the third derivative jumps.

What comes next

The dispersion relation just derived assumed the continuum. A computer replaces uxxu_{xx} by a difference and uttu_{tt} by another, so the scheme has its own ω(k)\omega(k), and the same plane-wave test shows which wavelengths it moves at the wrong speed and when it blows up. That is the content of 10.5 Wave Equation Numerics & the CFL Condition: the stability limit of the leapfrog wave scheme, the CFL condition, and the numerical dispersion that spreads a grid-scale pulse into ripples (from memory; I have not computed it here). The same wavenumber bookkeeping will carry through, only with the discrete ω(k)\omega(k) in place of ckck.

Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.