---
tag: F7H4H711MY
kind: definition
name: Adaptive step size
msc: [65L50, 65L05, 65L06]
defines: 6MREWBZR7R
uses: [558XADG64M, T220HF0562]
sources:
  - url: https://en.wikipedia.org/wiki/Adaptive_step_size
---

## Definition

Let a [[one-step method|558XADG64M]] for $y' = f(t, y)$ come with an error estimator.
From $t_n$, $y_n$ and a trial step $h$ it computes $y_{n+1}$ and a number $\mathrm{err}_n \ge 0$.
This number estimates the norm of the [[local truncation error|T220HF0562]] of the step, which behaves like $C h^{q+1}$ for some integer $q \ge 1$.
Let $\mathrm{tol} > 0$ be a tolerance, $0 < \rho < 1$ a safety factor, and $0 < \alpha_{\min} < 1 < \alpha_{\max}$ bounds.
*Adaptive step size control* runs the method with steps chosen as follows.

1. If $\mathrm{err}_n \le \mathrm{tol}$, the step is accepted: $t_{n+1} = t_n + h$, and $y_{n+1}$ is kept.
2. If $\mathrm{err}_n > \mathrm{tol}$, the step is rejected and repeated from $t_n$.
3. In both cases the next trial step is
$$h_{\mathrm{new}} = h \cdot \min\Big(\alpha_{\max}, \max\Big(\alpha_{\min}, \; \rho \, \Big(\frac{\mathrm{tol}}{\mathrm{err}_n}\Big)^{1/(q+1)}\Big)\Big).$$

## Remarks

The formula of clause 3 comes from $\mathrm{err} \approx C h^{q+1}$: the step $h'$ with $C h'^{q+1} = \mathrm{tol}$ is $h (\mathrm{tol}/\mathrm{err})^{1/(q+1)}$, and $\rho$, $\alpha_{\min}$, $\alpha_{\max}$ protect against a poor estimate.
Example: with an embedded pair of orders $4$ and $5$ such as the [[Runge–Kutta–Fehlberg method|6D73FFD9DC]], $\mathrm{err}_n = \norm{\hat y_{n+1} - y_{n+1}}$ and $q = 4$; if $\mathrm{err}_n = 32\,\mathrm{tol}$ the step is rejected and, with $\rho = 0.9$, retried with $h_{\mathrm{new}} = 0.9 \cdot 32^{-1/5} h = 0.45 h$.
Other estimators use step doubling: compare one step of size $h$ with two steps of size $h/2$, as in [[Richardson extrapolation|WMTZG71K2Y]].
Non-example: a schedule fixed in advance, such as $h_n = 2^{-n}$, varies the step but is not adaptive, since it ignores the error estimate.
The tolerance controls the local error per step; the global error is usually of a similar size but is not guaranteed to be below $\mathrm{tol}$.

## Explanations

### L1 human

After each step, the solver estimates how much error it just made.
If the error is too big, it throws the step away and tries again with a smaller one.
If it is small, it accepts the step and tries a larger one next time.
