Skip to main content

5.2 Extrapolated difference

Source: Ideas from Computational Physics (Landau, Páez, Bordeianu), §5.2. Rewritten in original wording. Continues 5.1 Differentiation. Labs: 5.2b Extrapolated-difference labs.

Extrapolating the error away​

A differentiation rule that keeps a finite Taylor chunk also predicts the leading leftover. Combine two central approximations so those leftovers cancel — Richardson extrapolation. Walk D(h)D(h), D(h/2)D(h/2), and DedD_{\mathrm{ed}} — pick the matching equation at each step.

Caveat: high-order stencils on noisy data amplify noise. Smooth or fit first (Chapter 6), then differentiate.

Second derivatives (force from y(t)y(t))​

Newton: F=ma=m d2y/dt2F=ma=m\,d^{2}y/dt^{2}. From a measured y(t)y(t), approximate y′′y'' by nesting central differences (the guide after the reference one-liners walks that stencil).

The compact form is neat but may worsen cancellation by forming the large sum y(t+h)+y(t−h)y(t+h)+y(t-h) before subtracting 2y(t)2y(t). Second derivatives need larger optimal hh than first derivatives: round-off scales roughly like εm/h2\varepsilon_m/h^{2}.

Truncation vs round-off (recap with numbers)​

From Chapter 3, the sweet spot is where εapp≃εro\varepsilon_{\mathrm{app}}\simeq\varepsilon_{\mathrm{ro}}. Rough models:

εappfd∼∣y′′∣h2,εappcd∼∣y′′′∣h224,εro∼εmh.\varepsilon_{\mathrm{app}}^{\mathrm{fd}}\sim\frac{|y''|h}{2},\qquad \varepsilon_{\mathrm{app}}^{\mathrm{cd}}\sim\frac{|y'''|h^{2}}{24},\qquad \varepsilon_{\mathrm{ro}}\sim\frac{\varepsilon_m}{h}.

Equating and taking ∣y′′∣∼∣y′′′∣∼1|y''|\sim|y'''|\sim 1 with εm∼10−15\varepsilon_m\sim 10^{-15} suggests hfd∼10−8h_{\mathrm{fd}}\sim 10^{-8} and hcd∼10−5h_{\mathrm{cd}}\sim 10^{-5}, with central error orders of magnitude smaller — the “better” method optimally uses a larger hh.

On a log⁡10∣E∣\log_{10}|\mathcal{E}| vs log⁡10h\log_{10}h plot: large hh → algorithmic slope (∼1\sim 1 for fd, ∼2\sim 2 for cd, ∼4\sim 4 for ed); tiny hh → round-off rising as hh falls.

Reference one-liners

FD = (y(t+h) − y(t)) / h
CD = (y(t+h/2) − y(t−h/2)) / h
ED = (8(y(t+h/4)−y(t−h/4)) − (y(t+h/2)−y(t−h/2))) / (3h)
D2 = (y(t+h) − 2y(t) + y(t−h)) / h²

Quick check of DedD_{\mathrm{ed}} and the y′′y'' stencil — pick the matching equation at each step.

Quiz

Extrapolation and y″

1 / 3

D_ed = (4 D_cd(h/2) − D_cd(h))/3 is built to…

Pick an answer to see if you are right.

Next: 5.2b Extrapolated-difference labs. Then 5.3 Integration.