next up previous

2.2.3 Some Implementation Issues

A too small value of h means that we are doing unnecessary computation that could lead to roundoff error (error induced because the arithmetic is not exact); a too large value of h means that we are probably not meeting the desired accuracy requirements (errors induced by discretization). Although we will not develop the details here, something can be said about the qualitative behavior of global error as a function of h for a one-step method of order p. If the error in evaluating is with for all i and the error in forming is with for all i, then it can be shown that

where C and L are constants depending on y and its derivatives. A graph of (37) has the qualitative behavior shown in Figure 3.

Figure 4: Qualitative behavior of absolute error at a fixed point as a function of the step size h.

As we said earlier, most codes estimate local error at each step and attempt to adjust h accordingly. A widely used procedure for estimating local error follows. Suppose we have computed approximations of order p and p+1 at , and respectively. Then using (20), the local error in the pth order approximation can be written as

If h is sufficiently small, the term can be neglected and we can use the computed value as an estimate of the error in the pth order formula. This sort of approximation has been validated by extensive numerical experimentation over the years.