c16-0 (779592), страница 2
Текст из файла (страница 2)
In recent yearsBulirsch-Stoer has been replacing predictor-corrector in many applications, but itis too soon to say that predictor-corrector is dominated in all cases. However, itappears that only rather sophisticated predictor-corrector routines are competitive.Accordingly, we have chosen not to give an implementation of predictor-correctorin this book. We discuss predictor-corrector further in §16.7, so that you can usea canned routine should you encounter a suitable problem.
In our experience, therelatively simple Runge-Kutta and Bulirsch-Stoer routines we give are adequatefor most problems.Each of the three types of methods can be organized to monitor internalconsistency. This allows numerical errors which are inevitably introduced intothe solution to be controlled by automatic, (adaptive) changing of the fundamentalstepsize. We always recommend that adaptive stepsize control be implemented,and we will do so below.In general, all three types of methods can be applied to any initial valueproblem. Each comes with its own set of debits and credits that must be understoodbefore it is used.710Chapter 16.Integration of Ordinary Differential EquationsCITED REFERENCES AND FURTHER READING:Gear, C.W. 1971, Numerical Initial Value Problems in Ordinary Differential Equations (EnglewoodCliffs, NJ: Prentice-Hall).Acton, F.S. 1970, Numerical Methods That Work; 1990, corrected edition (Washington: Mathematical Association of America), Chapter 5.Lambert, J.
1973, Computational Methods in Ordinary Differential Equations (New York: Wiley).Lapidus, L., and Seinfeld, J. 1971, Numerical Solution of Ordinary Differential Equations (NewYork: Academic Press).16.1 Runge-Kutta MethodThe formula for the Euler method isyn+1 = yn + hf(xn , yn )(16.1.1)which advances a solution from xn to xn+1 ≡ xn +h.
The formula is unsymmetrical:It advances the solution through an interval h, but uses derivative information onlyat the beginning of that interval (see Figure 16.1.1). That means (and you can verifyby expansion in power series) that the step’s error is only one power of h smallerthan the correction, i.e O(h2 ) added to (16.1.1).There are several reasons that Euler’s method is not recommended for practicaluse, among them, (i) the method is not very accurate when compared to other,fancier, methods run at the equivalent stepsize, and (ii) neither is it very stable(see §16.6 below).Consider, however, the use of a step like (16.1.1) to take a “trial” step to themidpoint of the interval.
Then use the value of both x and y at that midpointto compute the “real” step across the whole interval. Figure 16.1.2 illustrates theidea. In equations,k1 = hf(xn , yn )k2 = hf xn + 12 h, yn + 12 k1(16.1.2)yn+1 = yn + k2 + O(h3 )As indicated in the error term, this symmetrization cancels out the first-order errorterm, making the method second order.
[A method is conventionally called nthorder if its error term is O(hn+1 ).] In fact, (16.1.2) is called the second-orderRunge-Kutta or midpoint method.We needn’t stop there. There are many ways to evaluate the right-hand sidef(x, y) that all agree to first order, but that have different coefficients of higher-ordererror terms. Adding up the right combination of these, we can eliminate the errorterms order by order. That is the basic idea of the Runge-Kutta method.
Abramowitzand Stegun [1], and Gear [2], give various specific formulas that derive from this basicSample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).Stoer, J., and Bulirsch, R.
1980, Introduction to Numerical Analysis (New York: Springer-Verlag),Chapter 7..















