fbpx
Wikipedia

Adaptive step size

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

 

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  , 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

 

The local truncation error of this approximation is defined by

 

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:

 

where c is some constant of proportionality.

We have marked this solution and its error with a  .

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  . 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.

 
 
 
 

Here, we assume error factor   is constant over the interval  . In reality its rate of change is proportional to  . Subtracting solutions gives the error estimate:

 

This local error estimate is third order accurate.

The local error estimate can be used to decide how stepsize   should be modified to achieve the desired accuracy. For example, if a local tolerance of   is allowed, we could let h evolve like:

 

The   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   in the next try. If  , we consider the step successful, and the error estimate is used to improve the solution:

 

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  , this theory facilitates our controllable integration of the ODE from point   to  , 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  :

 
 

The next step   is predicted from the previous information  .

For embedded RK method, computation of   includes a lower order RK method  . The error then can be simply written as

 

  is the unnormalized error. To normalize it, we compare it against a user-defined tolerance, which consists of the absolute tolerance and relative tolerance:

 
 

Then we compare the normalized error   against 1 to get the predicted  :

 

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 a simplified procedures used in the stepsize control for explicit RK solvers. A more detailed treatment can be found in Hairer's textbook.[1] 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

References

  1. ^ E. Hairer, S. P. Norsett G. Wanner, “Solving Ordinary Differential Equations I: Nonstiff Problems”, Sec. II.

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

adaptive, step, size, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sources, unsourced, material, challenged, removed, find, sources, news, newspapers, books, scholar, jstor, octob. This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Adaptive step size news newspapers books scholar JSTOR October 2012 Learn how and when to remove this template message 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 Contents 1 Example 2 Embedded error estimates 3 See also 4 References 5 Further readingExample EditFor 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 y a displaystyle y t f t y t qquad y a y a 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 y b e y b displaystyle y b varepsilon y b where e displaystyle varepsilon 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 y n 1 0 y n h f t n y n displaystyle y n 1 0 y n hf t n y n The local truncation error of this approximation is defined by t n 1 0 y t n 1 y n 1 0 displaystyle tau n 1 0 y t n 1 y n 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 t n 1 0 c h 2 displaystyle tau n 1 0 ch 2 where c is some constant of proportionality We have marked this solution and its error with a 0 displaystyle 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 displaystyle 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 y n 1 2 y n h 2 f t n y n displaystyle y n frac 1 2 y n frac h 2 f t n y n y n 1 1 y n 1 2 h 2 f t n 1 2 y n 1 2 displaystyle y n 1 1 y n frac 1 2 frac h 2 f t n frac 1 2 y n frac 1 2 t n 1 1 c h 2 2 c h 2 2 2 c h 2 2 1 2 c h 2 1 2 t n 1 0 displaystyle tau n 1 1 c left frac h 2 right 2 c left frac h 2 right 2 2c left frac h 2 right 2 frac 1 2 ch 2 frac 1 2 tau n 1 0 y n 1 1 t n 1 1 y t h displaystyle y n 1 1 tau n 1 1 y t h Here we assume error factor c displaystyle c is constant over the interval t t h displaystyle t t h In reality its rate of change is proportional to y 3 t displaystyle y 3 t Subtracting solutions gives the error estimate y n 1 1 y n 1 0 t n 1 1 displaystyle y n 1 1 y n 1 0 tau n 1 1 This local error estimate is third order accurate The local error estimate can be used to decide how stepsize h displaystyle h should be modified to achieve the desired accuracy For example if a local tolerance of tol displaystyle text tol is allowed we could let h evolve like h 0 9 h min max tol 2 t n 1 1 1 2 0 3 2 displaystyle h rightarrow 0 9 times h times min left max left left frac text tol 2 left tau n 1 1 right right 1 2 0 3 right 2 right The 0 9 displaystyle 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 displaystyle 0 9 times text tol in the next try If t n 1 1 lt tol displaystyle tau n 1 1 lt text tol we consider the step successful and the error estimate is used to improve the solution y n 1 2 y n 1 1 t n 1 1 displaystyle y n 1 2 y n 1 1 tau 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 displaystyle h b a this theory facilitates our controllable integration of the ODE from point a displaystyle a to b displaystyle 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 EditAdaptive 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 y n displaystyle y n y n 1 y n h n ps t n y n h n displaystyle y n 1 y n h n psi t n y n h n t n 1 t n h n displaystyle t n 1 t n h n The next step h n displaystyle h n is predicted from the previous information h n g t n y n h n 1 displaystyle h n g t n y n h n 1 For embedded RK method computation of ps displaystyle psi includes a lower order RK method ps displaystyle tilde psi The error then can be simply written as err n h y n 1 y n 1 h ps t n y n h n ps t n y n h n displaystyle textrm err n h tilde y n 1 y n 1 h tilde psi t n y n h n psi t n y n h n err n displaystyle textrm err n is the unnormalized error To normalize it we compare it against a user defined tolerance which consists of the absolute tolerance and relative tolerance tol n Atol Rtol max y n y n 1 displaystyle textrm tol n textrm Atol textrm Rtol cdot max y n y n 1 E n norm err n tol n displaystyle E n textrm norm textrm err n textrm tol n Then we compare the normalized error E n displaystyle E n against 1 to get the predicted h n displaystyle h n h n h n 1 1 E n 1 q 1 displaystyle h n h n 1 1 E n 1 q 1 The parameter q is the order corresponding to the RK method ps displaystyle tilde psi 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 a simplified procedures used in the stepsize control for explicit RK solvers A more detailed treatment can be found in Hairer s textbook 1 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 EditAdaptive quadrature Adaptive numerical differentiationReferences Edit E Hairer S P Norsett G Wanner Solving Ordinary Differential Equations I Nonstiff Problems Sec II Further reading EditWilliam 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 amp Sons 1989 ISBN 0 471 62489 6 Retrieved from https en wikipedia org w index php title Adaptive step size amp oldid 1100389276, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.