正在加载图片...
134 Chapter 4.Integration of Functions by taking twice as many steps(in this case,it is by a factor of 4).In subsequent equations we will show only the scaling of the error term with the number of steps. For reasons that will not become clear until $4.2,equation(4.1.11)is in fact the most important equation in this section,the basis for most practical quadrature schemes The extended formula of order 1/N3 is: f(x)dr=h 品+ 2龙+f后+方4+ (4.1.12) …+fN-2+ 2w-1+w 13 +0 (a) (We will see in a moment where this comes from.) If we apply equation (4.1.4)to successive,nonoverlapping pairs of intervals, we get the extended Simpson's rule: f(x)dx =h 3+ 4 2 + +3+ 3 2 (4.1.13) .4 3fN-2+3N-1+3fN +0 1 、享a出明的 Press. Notice that the 2/3,4/3 alternation continues throughout the interior of the evalu- 9 ation.Many people believe that the wobbling alternation somehow contains deep information about the integral of their function that is not apparent to mortal eyes. In fact,the alternation is an artifact of using the building block(4.1.4).Another 三 extended formula with the same order as Simpson's rule is f()dz=h +五+ 4B+fa+6+ OF SCIENTIFIC COMPUTING (ISBN 1988-19920 23 ·+fN-4+fN-3+ 24JN-2+ 6JN-1+ 3 (4.1.14) +o Numerical Recipes 10-6211 43106 This equation is constructed by fitting cubic polynomials through successive groups (outside of four points;we defer details to $18.3,where a similar technique is used in the Software. solution of integral equations.We can,however,tell you where equation(4.1.12) North came from.It is Simpson's extended rule,averaged with a modified version of itself in which the first and last step are done with the trapezoidal rule(4.1.3).The trapezoidal step is two orders lower than Simpson's rule;however,its contribution to the integral goes down as an additional power of N(since it is used only twice,not N times).This makes the resulting formula of degree one less than Simpson.134 Chapter 4. Integration 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). by taking twice as many steps (in this case, it is by a factor of 4). In subsequent equations we will show only the scaling of the error term with the number of steps. For reasons that will not become clear until §4.2, equation (4.1.11) is in fact the most important equation in this section, the basis for most practical quadrature schemes. The extended formula of order 1/N 3 is:  xN x1 f(x)dx = h 5 12f1 + 13 12f2 + f3 + f4+ ··· + fN−2 + 13 12fN−1 + 5 12fN + O  1 N3  (4.1.12) (We will see in a moment where this comes from.) If we apply equation (4.1.4) to successive, nonoverlapping pairs of intervals, we get the extended Simpson’s rule:  xN x1 f(x)dx = h 1 3 f1 + 4 3 f2 + 2 3 f3 + 4 3 f4+ ··· + 2 3 fN−2 + 4 3 fN−1 + 1 3 fN + O  1 N4  (4.1.13) Notice that the 2/3, 4/3 alternation continues throughout the interior of the evalu￾ation. Many people believe that the wobbling alternation somehow contains deep information about the integral of their function that is not apparent to mortal eyes. In fact, the alternation is an artifact of using the building block (4.1.4). Another extended formula with the same order as Simpson’s rule is  xN x1 f(x)dx = h 3 8 f1 + 7 6 f2 + 23 24f3 + f4 + f5+ ··· + fN−4 + fN−3 + 23 24fN−2 + 7 6 fN−1 + 3 8 fN + O  1 N4  (4.1.14) This equation is constructed by fitting cubic polynomials through successive groups of four points; we defer details to §18.3, where a similar technique is used in the solution of integral equations. We can, however, tell you where equation (4.1.12) came from. It is Simpson’s extended rule, averaged with a modified version of itself in which the first and last step are done with the trapezoidal rule (4.1.3). The trapezoidal step is two orders lower than Simpson’s rule; however, its contribution to the integral goes down as an additional power of N (since it is used only twice, not N times). This makes the resulting formula of degree one less than Simpson.
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有