Adaptive Euler step doubling for exponential decay Created 2026-10-14 Updated 2026-10-14
Consider the nonstiff scalar initial value problem , , on . Its exact solution is the exponential decay . Use step-doubling error estimation with the explicit Euler method: from the same numerical starting value , form one coarse step and two half steps giving :Accept when the absolute and relative error tolerances test passes, with . There is no Richardson extrapolation in the accepted value. Both approximations have order of a numerical method one, while this local error estimator has step exponent . Consequently the adaptive step-size controller uses a square root, not a cube root:Start with . A rejected trial retains both and , caps at one, and retries. A zero estimate uses . Before every trial, cap at . Stop with a failure if floating-point arithmetic gives , or after 100000 trials. These rules specify the example completely; they are not a prescription for every ordinary differential equation solver.
Adaptive two-half-step Euler decay: exact and numerical trajectories, accepted step sizes and rejected trials
. Details. The first two trials, and , have and and are rejected. The next trial has and and is accepted. For positive decreasing numerical values, , so the local error estimator givesWhen the relative term dominates, this suggests nearly constant accepted steps, approximately . When falls below the crossover size , the absolute term increasingly permits longer steps. The sharp final decrease in only lands on ; it does not indicate a sudden loss of smoothness.
The actual signed local defect from the same numerical input isHere is Big O notation, obtained from Taylor's theorem for the exponential function. Thus agrees with the leading term as , but is not identical to . At , , the estimate is while the actual local defect is . Their closeness improves for the smaller accepted steps. Had we added using Richardson extrapolation, the accepted formula would instead be , of order of a numerical method two; the same raw difference would still scale as and would not estimate that improved value's leading defect.
Estimated versus actual local Euler defects, rejected trials, and actual accumulated global error scaled by the local tolerance
. Details. The global error obeys an exact recurrence relation involving the actual local defects:Each previous global error contracts, yet the local defects keep adding. In the plotted run, 101 steps are accepted and two trials are rejected. Every accepted is at most approximately , while the largest is approximately . At , the numerical value is approximately , compared with the exact , giving absolute error approximately . The right-hand plot deliberately scales actual global error by the same used for local acceptance; it is not a new global error tolerance test.
Tightening both absolute and relative error tolerances by a factor ten gives 315 accepted steps and endpoint absolute error approximately ; tightening both by a factor one hundred gives 991 accepted steps and endpoint absolute error approximately . This is a convergence comparison for this particular initial value problem. The endpoint error decreases by about a factor three per tenfold tightening, rather than by ten: a first-order Euler method accumulates defects across many steps, while its local error estimator varies quadratically with . A variable-step global ODE error bound needs propagation information as well as accepted local tests.
The absolute stability boundary remains a separate constraint. On the Dahlquist test equation with , the accepted two-half-step formula has stability function . It strictly damps perturbations only for . Its local error estimator is , which can pass an absolute-tolerance test at tiny even outside this damping interval. In a stiff two-mode linear system, a fast mode can therefore constrain the step long after its visible amplitude has become small. An adaptive step-size controller does not turn an explicit Euler method into an A-stable method. Official solver documentation likewise distinguishes explicit Runge-Kutta methods for nonstiff problems from implicit Runge-Kutta methods and backward differentiation formulas for stiff equations.[ref]
scipy.integrate.solve_ivp. solve_ivp, method parameter: explicit versus implicit methods and stiffness
Adaptive step-size controller 2026-10-14
If a scaled local error estimator behaves as with approximately unchanged error scale, the displayed update targets a fixed local level. A safety factor aims below the acceptance boundary. For an embedded Runge-Kutta pair with order of a numerical method for the accepted output and for the companion formula, the difference generally has ; for the actual unscaled local truncation error of an order- formula, . The exponent belongs to the quantity being controlled. Dividing the defect by changes that exponent. This follows by solving for the next step.[ref]
Rejecting a trial means retrying from the same accepted time and state, with a smaller step. Advancing time or retaining the rejected output would change the initial value problem being approximated. Minimum and maximum change factors prevent extreme updates; a zero estimate requires finite capped growth. After acceptance, cap the next step at the remaining interval length. Detect a step that cannot advance time in floating-point arithmetic, and report failure rather than an endless retry. An adaptive step-size controller can use earlier estimates to smooth step sequences, but the memoryless rule here is sufficient to explain acceptance and rejection.[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.
Local error estimator 2026-10-14
A local error estimator approximates a numerical step's defect from the exact solution starting at the same input. Differences between formulas estimate error only after their asymptotic orders and constants are accounted for. Step-doubling error estimation, an embedded Runge-Kutta pair and predictor-corrector error estimation are common constructions. They do not by themselves bound accumulated global error.
Let be the exact endpoint of the ordinary differential equation started at the numerical value , and let be the candidate numerical endpoint. The signed local defect being estimated is . In contrast, actual global error compares with the solution of the original initial value problem, including all previous steps. The local truncation error convention inserts original exact data instead. These starting-value distinctions matter even when the same formula is used for every step. A practical local error estimator also relies on a smooth Taylor expansion; a small difference can reflect accidental cancellation rather than a rigorous upper bound.
Runge-Kutta method Created 2026-09-24 Updated 2026-10-14
A Runge-Kutta method advances an initial value problem , , by sampling its vector field at several trial states within one time step. These samples are Runge-Kutta stages; a weighted combination of their slopes produces the next state. The construction improves on the single tangent line used by the Euler method while requiring evaluations of , rather than explicit higher derivatives of the solution. It applies to scalar equations and systems of ordinary differential equations alike. The coefficient choices distinguish methods such as Heun's method, the classical fourth-order Runge-Kutta method and implicit Runge-Kutta methods.
For stages, write for the stage matrix, for relative time nodes and for output weights. A time step of length computesHere is a slope, with units of state per time; is a state increment. Another common convention writes , so its stage states are and its output is . These are equivalent conventions: including both inside and again in the output would count the time step twice. The textbook formulation uses the increment convention.[ref]
6.4 Runge-Kutta methods. Fundamentals of Numerical Computation, §6.4.3, equations 6.4.10–6.4.11: multistage recipe and tableau
Usually the Butcher tableau obeys , called internal consistency. Stage then combines slopes over an effective time . The second-order conditions with independent Runge-Kutta abscissae explain what changes when time nodes are specified independently. A Runge-Kutta stage is generally an auxiliary approximation, not a separate accepted solution value at its node. Several stages can even have the same time node but different state arguments, as in the classical fourth-order Runge-Kutta method.
The useful idea is to approximate the integral without knowing the intermediate exact trajectory. Trial states provide places to sample , and Butcher order conditions make the resulting combination agree with the exact Taylor expansion. More stages alone do not guarantee a higher order of a numerical method: their coefficients must satisfy the appropriate conditions. Embedded Runge-Kutta pairs reuse these same samples for a second output and a practical local error estimator.

