正在加载图片...
166 Chapter 5.Evaluation of Functions How do you know when you have summed enough terms?In practice,the terms had better be getting small fast,otherwise the series is not a good technique to use in the first place.While not mathematically rigorous in all cases,standard practice is to quit when the term you have just added is smaller in magnitude than some small e times the magnitude of the sum thus far accumulated.(But watch out if isolated instances of ak=0 are possible!). A weakness of a power series representation is that it is guaranteed not to converge farther than that distance from xo at which a singularity is encountered in the complex plane.This catastrophe is not usually unexpected:When you find 三 a power series in a book(or when you work one out yourself),you will generally also know the radius of convergence.An insidious problem occurs with series that converge everywhere(in the mathematical sense),but almost nowhere fast enough to be useful in a numerical method.Two familiar examples are the sine function and the Bessel function of the first kind, 茶 sin (-1) +可 2k+1 (5.1.2) k=0 (-z2)* 9 =()”】 (5.1.3) Both of these series converge for all x.But both don't even start to converge until;before this,their terms are increasing.This makes these series useless for large x. IENTIFIC Accelerating the Convergence of Series 6 There are several tricks for accelerating the rate of convergence of a series(or, equivalently,of a sequence of partial sums).These tricks will not generally help in cases like (5.1.2)or(5.1.3)while the size of the terms is still increasing.For series with terms of decreasing magnitude,however,some accelerating methods can be startlingly good.Aitken's 62-process is simply a formula for extrapolating the partial 10.621 sums of a series whose convergence is approximately geometric.If Sn1,Sn,Sn+1 % are three successive partial sums,then an improved estimate is Numerical Recipes 43106 (outside S%三Sn+1- (Sn+1-Sn)2 Sn+1-2Sn Sn-1 (5.1.4) North You can also use (5.1.4)with n +1 and n-1 replaced by n+p and n-p respectively,for any integer p.If you form the sequence of Ss,you can apply (5.1.4)a second time to that sequence,and so on.(In practice,this iteration will only rarely do much for you after the first stage.)Note that equation(5.1.4)should be computed as written;there exist algebraically equivalent forms that are much more susceptible to roundoff error. For alternating series (where the terms in the sum alternate in sign),Euler's transformation can be a powerful tool.Generally it is advisable to do a small166 Chapter 5. Evaluation of Functions Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). How do you know when you have summed enough terms? In practice, the terms had better be getting small fast, otherwise the series is not a good technique to use in the first place. While not mathematically rigorous in all cases, standard practice is to quit when the term you have just added is smaller in magnitude than some small  times the magnitude of the sum thus far accumulated. (But watch out if isolated instances of ak = 0 are possible!). A weakness of a power series representation is that it is guaranteed not to converge farther than that distance from x0 at which a singularity is encountered in the complex plane. This catastrophe is not usually unexpected: When you find a power series in a book (or when you work one out yourself), you will generally also know the radius of convergence. An insidious problem occurs with series that converge everywhere (in the mathematical sense), but almost nowhere fast enough to be useful in a numerical method. Two familiar examples are the sine function and the Bessel function of the first kind, sin x = ∞ k=0 (−1)k (2k + 1)!x2k+1 (5.1.2) Jn(x) = x 2 n∞ k=0 (−1 4x2)k k!(k + n)! (5.1.3) Both of these series converge for all x. But both don’t even start to converge until k |x|; before this, their terms are increasing. This makes these series useless for large x. Accelerating the Convergence of Series There are several tricks for accelerating the rate of convergence of a series (or, equivalently, of a sequence of partial sums). These tricks will not generally help in cases like (5.1.2) or (5.1.3) while the size of the terms is still increasing. For series with terms of decreasing magnitude, however, some accelerating methods can be startlingly good. Aitken’s δ2-process is simply a formula for extrapolating the partial sums of a series whose convergence is approximately geometric. If S n−1, Sn, Sn+1 are three successive partial sums, then an improved estimate is S n ≡ Sn+1 − (Sn+1 − Sn)2 Sn+1 − 2Sn + Sn−1 (5.1.4) You can also use (5.1.4) with n + 1 and n − 1 replaced by n + p and n − p respectively, for any integer p. If you form the sequence of S i’s, you can apply (5.1.4) a second time to that sequence, and so on. (In practice, this iteration will only rarely do much for you after the first stage.) Note that equation (5.1.4) should be computed as written; there exist algebraically equivalent forms that are much more susceptible to roundoff error. For alternating series (where the terms in the sum alternate in sign), Euler’s transformation can be a powerful tool. Generally it is advisable to do a small
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有