Professional Documents
Culture Documents
Adaptive Stepsize: 1 Example
Adaptive Stepsize: 1 Example
In numerical analysis, some methods for the numerical where c is some constant of proportionality.
solution of ordinary dierential equations (including the We have marked this solution and its error with a (0) .
special case of numerical integration) use an adaptive
stepsize in order to control the errors of the method The value of c is not known to us. Let us now apply Eu-
and to ensure stability properties such as A-stability. lers method again with a dierent step size to generate a
Rombergs method is an example of a numerical integra- second approximation to y(tn+1). We get a second solu-
tion method which uses an adaptive stepsize. tion, 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 Eulers method. This second solution is presumably
more accurate. Since we have to apply Eulers method
1 Example twice, the local error is (in the worst case) twice the orig-
inal error.
For simplicity, the following example uses the sim-
plest integration method, the Euler method; in practice,
higher-order methods such as RungeKutta methods are h
preferred due to their superior convergence and stability yn+ 21 = yn + 2 f (tn , yn )
properties.
(1) h
Consider the initial value problem yn+1 = yn+ 21 + f (tn+ 21 , yn+ 12 )
2
( )2 ( )2 ( )2
(1) h h h 1 1 (0)
n+1 = c +c = 2c = ch2 = n+1
y (t) = f (t, y(t)), y(a) = ya 2 2 2 2 2
(1) (1)
where y and f may denote vectors (in which case this yn+1 + n+1 = y(t + h)
equation represents a system of coupled ODEs in several Here, we assume error factor c is constant over the inter-
variables). val [t, t + h] . In reality its rate of change is proportional
We are given the function f(t,y) and the initial conditions to y (3) (t) . Subtracting solutions gives the error estimate:
(a, ya), and we are interested in nding 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 (1) y (0) = (1)
n+1 n+1 n+1
y(b) , where is the error in the numerical solution.
For a sequence (tn) of values of t, with tn = a + nh, the This local error estimate is third order accurate.
Euler method gives approximations to the corresponding The local error estimate can be used to decide how step-
values of y(tn) as size h should be modied to achieve the desired accu-
racy. For example, if a local tolerance of tol is allowed,
we could let h evolve like:
(0)
yn+1 = yn + hf (tn , yn )
( ( tol ) )
The local truncation error of this approximation is dened
h 0.9 h min max , 0.3 ,2
by (1)
|n+1 |
1
2 4 FURTHER READING
3 References
4 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