ArticleslgStudy

mathematics

Adaptive step size

Adaptive step size is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Adaptive step size rather than just read about it. In short: In mathematics and numerical analysis, an adaptive step size is used in some methods for the numerical solution of ordinary differential equations (including the special case of numerical integration) in order to control the errors of the method and to ensure stability properties such as A-stability. Using an adaptive stepsize is of particular importance when there is a large variation in the size of the derivative.

Adaptive step size — main illustration
Adaptive step size — illustration

Key takeaways

  • Adaptive step size belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Adaptive step size to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Adaptive step size from memory before moving on to harder problems.

Reference excerpt

In mathematics and numerical analysis, an adaptive step size is used in some methods for the numerical solution of ordinary differential equations (including the special case of numerical integration) in order to control the errors of the method and to ensure stability properties such as A-stability. Using an adaptive stepsize is of particular importance when there is a large variation in the size of the derivative. For example, when modeling the motion of a satellite about the earth as a standard Kepler orbit, a fixed time-stepping method such as the Euler method may be sufficient. However things are more difficult if one wishes to model the motion of a spacecraft taking into account both the Earth and the Moon as in the Three-body problem. There, scenarios emerge where one can take large time steps when the spacecraft is far from the Earth and Moon, but if the spacecraft gets close to colliding with one of the planetary bodies, then small time steps are needed. Romberg's method and Runge–Kutta–Fehlberg are examples of a numerical integration methods which use an adaptive stepsize.

Example For simplicity, the following example uses the simplest integration method, the Euler method; in practice, higher-order methods such as Runge–Kutta methods are preferred due to their superior convergence and stability properties. Consider the initial value problem y′(t)=f(t,y(t)),y(a)=ya where y and f may denote vectors (in which case this equation represents a system of coupled ODEs in several variables). We are given the function f(t,y) and the initial conditions (a, ya), and we are interested in finding the solution at t = b. Let y(b) denote the exact solution at b, and let yb denote the solution that we compute. We write yb+ε=y(b), where ε is the error in the numerical solution. For a sequence (tn) of values of t, with tn = a + nh, the Euler method gives approximations to the corresponding values of y(tn) as yn+1(0)=yn+hf(tn,yn) The local truncation error of this approximation is defined by τn+1(0)=y(tn+1)−yn+1(0) and by Taylor's theorem, it can be shown that (provided f is sufficiently smooth) the local truncation error is proportional to the square of the step size: τn+1(0)=ch2 where c is some constant of proportionality. We have marked this solution and its error with a (0). The value of c is not known to us. Let us now apply Euler's method again with a different step size to generate a second approximation to y(tn+1). We get a second solution, which we label with a (1). Take the new step size to be one half of the original step size, and apply two steps of Euler's method. This second solution is presumably more accurate. Since we have to apply Euler's method twice, the local error is (in the worst case) twice the original error. yn+12=yn+h2f(tn,yn)yn+1(1)=yn+12+h2f(tn+12,yn+12)τn+1(1)=c(h2)2+c(h2)2=2c(h2)2=12ch2=12τn+1(0)yn+1(1)+τn+1(1)=y(t+h) Here, we assume error factor c is constant over the interval [t,t+h]. In reality its rate of change is proportional to y(3)(t). Subtracting solutions gives the error estimate: yn+1(1)−yn+1(0)=τn+1(1) This local error estimate is third order accurate. The local error estimate can be used to decide how stepsize h should be modified to achieve the desired accuracy. For example, if a local tolerance of tol is allowed, we could let h evolve like: h→0.9×h×min⁡(max⁡((tol2|τn+1(1)|)1/2,0.3),2) The 0.9 is a safety factor to ensure success on the next try. The minimum and maximum are to prevent extreme changes from the previous stepsize. This should, in principle give an error of about 0.9×tol in the next try. If |τn+1(1)|<tol, we consider the step successful, and the error estimate is used to improve the solution: yn+1(2)=yn+1(1)+τn+1(1) This solution is actually third order accurate in the local scope (second order in the global scope), but since there is no error estimate for it, this doesn't help in reducing the number of steps. This technique is called Richardson extrapolation. Beginning with an initial stepsize of h=b−a, this theory facilitates our controllable integration of the ODE from point a to b, using an optimal number of steps given a local error tolerance. A drawback is that the step size may become prohibitively small, especially when using the low-order Euler method. Similar methods can be developed for higher order methods, such as the 4th-order Runge–Kutta method. Also, a global error tolerance can be achieved by scaling the local error to global scope.

Embedded error estimates Adaptive stepsize methods that use a so-called 'embedded' error estimate include the Bogacki–Shampine, Runge–Kutta–Fehlberg, Cash–Karp and Dormand–Prince methods. These methods are considered to be more computationally efficient, but have lower accuracy in their error estimates. To illustrate the ideas of embedded method, consider the following scheme which update yn: yn+1=yn+hnψ(tn,yn,hn)tn+1=tn+hn The next step hn is predicted from the previous information hn=g(tn,yn,hn−1). For embedded RK method, computation of ψ includes a lower order RK method ψ~. The error then can be simply written as errn(h)=y~n+1−yn+1=h(ψ~(tn,yn,hn)−ψ(tn,yn,hn)) errn is the unnormalized error. To normalize it, we compare it against a user-defined tolerance, which consists of the absolute tolerance and relative tolerance: toln=Atol+Rtol⋅max⁡(|yn|,|yn−1|) En=norm(errn/toln) Then we compare the normalized error En against 1 to get the predicted hn: hn=hn−1(1/En)1/(q+1) The parameter q is the order corresponding to the RK method ψ~, which has lower order. The above prediction formula is plausible in a sense that it enlarges the step if the estimated local error is smaller than the tolerance and it shrinks the step otherwise. The description given above is simplified compared to the procedures used in the stepsize control for explicit RK solvers. A more detailed treatment can be found in Hairer's textbook. The ODE solver in many programming languages uses this procedure as the default strategy for adaptive stepsize control, which adds other engineering parameters to make the system more stable.

See also Adaptive quadrature Adaptive numerical differentiation

References

Further reading William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian P. Flannery, Numerical Recipes in C, Second Edition, CAMBRIDGE UNIVERSITY PRESS, 1992. ISBN 0-521-43108-5 Kendall E. Atkinson, Numerical Analysis, Second Edition, John Wiley & Sons, 1989. ISBN 0-471-62489-6

Illustrations

Adaptive step size: This shows the computational time in real time used during a 3-body simulation evolved with the Runge-Kutta-Fehlberg method. Most of the computer time is spent when the bodies pass close by and are susceptible to numerical error.
This shows the computational time in real time used during a 3-body simulation evolved with the Runge-Kutta-Fehlberg method. Most of the computer time is spent when the bodies pass close by and are susceptible to numerical error.

Worked examples

Example 1 — a first encounter with Adaptive step size

Start with the simplest possible case. Write down what Adaptive step size claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Adaptive step size before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Adaptive step size ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Adaptive step size

In research
Adaptive step size appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Adaptive step size in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Adaptive step size is common in secondary-school and first-year university syllabi. It links to neighbouring topics Numerical analysis, Numerical differential equations, so understanding it makes those chapters shorter.
In everyday life
Look for Adaptive step size outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Adaptive step size” →

How to study Adaptive step size in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Adaptive step size means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Adaptive step size out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Adaptive step size in simple terms?

In mathematics and numerical analysis, an adaptive step size is used in some methods for the numerical solution of ordinary differential equations (including the special case of numerical integration) in order to control the errors of the method and to ensure stability properties such as A-stabilit…

Why does Adaptive step size matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Adaptive step size?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Adaptive step size.

Tags

  • Numerical analysis
  • Numerical differential equations

Keep exploring