Step-size stability of a reference perturbation (source code)

= Step-size stability of a reference perturbation

<Step-size stability of a reference perturbation> checks whether a numerical reference-response estimate behaves consistently as the applied step changes. For a final comparison $F(R)$, a central slope is
$$
C_h=\frac{F(R_0+h)-F(R_0-h)}{2h}.
$$
For sufficiently smooth $F$, its leading truncation error is proportional to $h^2$. Comparing several steps tests that numerical behavior, while choosing steps near the physical reference uncertainty also probes whether a local derivative adequately represents the measurement model.<Guide to the expression of uncertainty in measurement by JCGM>[§§5.1.2–5.1.4, nonlinear propagation and sensitivity coefficients]{ref}

For an original model, let $x=R-R_0$ and $F(R)=D_0+0.2x+\kappa x^3$, with $\kappa=100\,\mathrm{mm^{-2}}$. For $h=0.010,0.005,0.0025\,\mathrm{mm}$, the central slopes are0.210,0.2025 and0.200625. Their successive departures from0.2 shrink by four as $h$ halves. <Richardson extrapolation> removes the cubic contribution exactly in this model:
$$
\frac{4C_{h/2}-C_h}{3}=0.2.
$$
For a general smooth response, it removes the leading $h^2$ term rather than proving exact cancellation of every nonlinear contribution.

Small steps also amplify output error. If each evaluation has absolute error at most $q$, the error in the central slope is at most $q/h$. With $q=0.1\,\mathrm{nm}=10^{-7}\,\mathrm{mm}$, this bound is $10^{-5}$ at $h=0.01\,\mathrm{mm}$ but0.1 at $h=10^{-6}\,\mathrm{mm}$. The cubic truncation term decreases with $h$, whereas this evaluation-error bound increases. Equating their orders, $|\kappa|h^2\sim q/h$, suggests the scale $h\sim(q/|\kappa|)^{1/3}$, here0.001mm. This scale follows from the stipulated error model, not a universal finite-difference setting.

An unchanging central value is also insufficient to establish differentiability. For $F(R)=|R-R_0|$, every $C_h$ is zero, while the forward and backward slopes are $+1$ and $-1$. Inspecting both one-sided changes reveals the cusp. Likewise, a stable local slope does not rule out a quadratic finite-range response, as <finite-perturbation reference sensitivity> shows.

A meaningful test changes one assigned shared reference consistently in every dependent calculation, holds the other inputs and computational settings fixed, and records the steps, units, slopes and one-sided changes. Shared reference uncertainty and comparison-process variability are distinct physical contributions in the NIST uncertainty budget.<The Gauge Block Handbook by Ted Doiron and John S. Beers>[§4.4.3]{ref} If evaluation includes simulation noise, separate its repeatability from the response to the changed reference.