Read this lesson as text

Adaptive Step Size

Numerical Analysis · Axiom Academy

LESSON Adaptive Step Size Control Automatically adjusting step sizes to balance accuracy and efficiency: the foundation of modern ODE solvers Most differential equations have solutions that vary in "difficulty" across the domain. Some regions have rapid changes requiring small steps for accuracy, while others are nearly linear and can be traversed with large steps. 2. Error Estimation via Step Doubling To adapt the step size, we need an estimate of the local error. One classical approach is step doubling : compare a single step of size h with two steps of size h/2. Compute y1 using one step of size h Compute y2 using two steps of size h/2 Error estimate: the difference |y1 - y2| approximates the local error For a method of order p, the local truncation error is O(h^(p+1)). The error estimate from step doubling is: 3. Step Size Adjustment Formula Once we have an error estimate, we need a formula to compute the new step size. The goal is to choose h so that the error matches a user-specified tolerance. For a method of order p with local error proportional to h^(p+1): If error < tol: ratio > 1, so h_new > h (can take larger steps) If error > tol: ratio < 1, so h_new < h (must take smaller steps) If error = tol: ratio = 1, step size stays the same A safety factor (typically 0.8-0.9) is often applied to avoid repeatedly rejecting steps that barely miss the tolerance: 4. Embedded Runge-Kutta Methods

This is the written version of the interactive lesson above. See the full Numerical Analysis course.