Continue the initial value problem , , to using the Euler-Heun embedded pair. Choose absolute and relative error tolerances and , so the scalar scale is throughout. This intentionally absolute-only test makes the local and accumulated errors directly comparable. Start with , accept the Heun's method endpoint precisely when , and after every trial use the capped adaptive step-size controller
For use the growth factor two. Cap every trial at ; on rejection retain the old time and state. These choices specify an original computation, rather than a claim about the defaults of a particular software solver.
The initial trial has and is rejected. Retrying from with gives and is accepted. The run takes 315 accepted steps and one rejected trial. Increasing exponential growth makes the local error estimator grow at a fixed , so subsequent steps shrink roughly like . The final step is additionally shortened to land at .
Figure 1.
Computed Euler-Heun step sizes and errors: every accepted local estimate passes, but accumulated global error exceeds the absolute tolerance
. Details.
The right panel plots errors against the accepted-step number, all divided by the same . The actual Heun local defect uses the restarted exact endpoint , while actual global error uses . All accepted are at most one, and the actual Heun local defects here are even smaller, at most about . Nevertheless the endpoint is , versus , with absolute error about . Passing local tests therefore does not certify the original trajectory's global error.
This failure of a global guarantee has an exact explanation for this example. Put and . Then
Each new local defect is added to the previous error amplified by . Iterating this identity, rather than merely inspecting , accounts for accumulation. The variable-step global ODE error bound describes the corresponding mechanism for more general ordinary differential equations.
Repeating with gives 98 accepted steps, one rejection and endpoint absolute error about ; with it gives 1001 accepted steps, two rejections and endpoint absolute error about . Accuracy improves on this smooth problem, but the endpoint error remains about fifteen times the requested local scale. A different initial value problem can amplify or damp defects differently.
Embedded Runge-Kutta pair Created 2026-10-14 Updated 2026-10-14
Two Runge-Kutta methods share a stage matrix and nodes but use different output weights. An order- and order- pair with gives an output difference generally of order , estimating the lower-order defect. Shared stage evaluations reduce the cost. The adaptive step-size controller exponent must reflect this estimator order, rather than blindly the higher reported solution order.
Using the slope convention for Runge-Kutta stages, an embedded Runge-Kutta pair computes
Its Butcher tableau has two output rows, and . Evaluating is often the expensive part of solving an ordinary differential equation; after the shared slopes have been computed, the extra row needs only another linear combination.[ref]
Write for the exact endpoint from the current numerical state, and define signed local defects and . Then . If and , with , the difference reproduces the leading lower-order defect. It does not reproduce the leading higher-order defect. Here the powers use big O notation and a smooth Taylor expansion; a vanishing leading coefficient or accidental cancellation can make the estimate misleading.
A common choice accepts after testing with absolute and relative error tolerances. With the scale approximately unchanged on a retry, the adaptive step-size controller uses exponent . Accepting a better endpoint does not change the power in the quantity being tested. The Euler-Heun embedded pair makes this visible without a large coefficient table.[ref]
Error control for ODE solvers Created 2026-10-14 Updated 2026-10-14
Error control selects discretization parameters and checks approximations against requested accuracy. Local error estimators, absolute and relative error tolerances and an adaptive step-size controller provide practical local control. Propagation of defects determines the global error, while stiffness, roundoff error and algebraic-solve accuracy impose additional limits.
For an ordinary differential equation, the practical loop is to propose a step, form a local error estimator, scale it by absolute and relative error tolerances, and accept or retry before choosing the next step. An embedded Runge-Kutta pair supplies two endpoints from shared Runge-Kutta stages, making this extra accuracy check inexpensive. The Euler-Heun embedded pair below exposes the distinction between the accepted formula's order of a numerical method and the estimator's step exponent; its Adaptive Euler-Heun integration of exponential growth shows accepted local tests alongside accumulated global error.
Heun's method 2026-10-14
Here Heun's method means the explicit endpoint-averaging Runge-Kutta method: take an Euler predictor , sample there, and average it with for the output. The second Runge-Kutta stage is evaluated at the predictor, not at the corrected endpoint. In particular it requires no implicit solve as the ODE trapezoidal rule does. Naming conventions vary between books; the formulas specify the method unambiguously.[ref]
For smooth , a Taylor expansion about gives , where is the state Jacobian matrix. Consequently the output is , matching the exact solution through degree two by the chain rule. This gives local truncation error and, with the usual bounded smoothness and Lipschitz continuity hypotheses on a fixed finite interval, global error . The Euler-Heun embedded pair compares this output with its Euler predictor.
Figure 1.
Euler-Heun stage geometry for y prime equals y: sample at the Euler predictor, then average slopes for the corrected endpoint
. Details.
For , and , the sampled slopes are and . Transporting the second slope to the starting point would end at ; the average slope instead ends at . The exact exponential function reaches . The magnified endpoint comparison separates the pair difference from the actual Heun local defect .