正在加载图片...
Chapter 3. Interpolation and Extrapolation http://www.nr.com or call 3.0 Introduction 11-800-72 We sometimes know the value ofa function f()at a set of points 1,x2,...,N Cambridge (say,withz1<...<N),but we don't have an analytic expression for f(x)that lets NUMERICAL RECIPES IN us calculate its value at an arbitrary point.For example,the f(i)'s might result from server some physical measurement or from long numerical calculation that cannot be cast into a simple functional form.Often the zi's are equally spaced,but not necessarily. compu Press The task now is to estimate f(r)for arbitrary x by,in some sense,drawing a smooth curve through(and perhaps beyond)the z.If the desired r is in between the C:THE ART OF largest and smallest of the xi's,the problem is called interpolation;if is outside 马 that range,it is called extrapolation,which is considerably more hazardous (as many former stock-market analysts can attest). SCIENTIFIC Interpolation and extrapolation schemes must model the function,between or beyond the known points,by some plausible functional form.The form should 6 be sufficiently general so as to be able to approximate large classes of functions which might arise in practice.By far most common among the functional forms used are polynomials($3.1).Rational functions(quotients of polynomials)also turn out to be extremely useful(83.2).Trigonometric functions,sines and cosines,give r Numerical 92y rise to trigonometric interpolation and related Fourier methods,which we defer to Chapters 12 and 13 Recipes There is an extensive mathematical literature devoted to theorems about what sort of functions can be well approximated by which interpolating functions.These theorems are,alas,almost completely useless in day-to-day work:If we know ecipes enough about our function to apply a theorem of any power,we are usually not in the pitiful state of having to interpolate on a table of its values! Interpolation is related to,but distinct from,function approximation.That task North Software. consists of finding an approximate(but easily computable)function to use in place of a more complicated one.In the case of interpolation,you are given the function f America) at points not ofyour own choosing.For the case of function approximation,you are visit website machine allowed to compute the function f at any desired points for the purpose of developing your approximation.We deal with function approximation in Chapter 5. One can easily find pathological functions that make a mockery of any interpo- lation scheme.Consider,for example,the function f回=3x2+-9]+1 (3.0.1) 105Permission 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). Chapter 3. Interpolation and Extrapolation 3.0 Introduction We sometimes know the value of a function f(x) at a set of points x1, x2,...,xN (say, with x1 <...<xN ), but we don’t have an analytic expression for f(x)that lets us calculate its value at an arbitrary point. For example, the f(xi)’s might result from some physical measurement or from long numerical calculation that cannot be cast into a simple functional form. Often the xi’s are equally spaced, but not necessarily. The task now is to estimate f(x) for arbitrary x by, in some sense, drawing a smooth curve through (and perhaps beyond) the x i. If the desired x is in between the largest and smallest of the xi’s, the problem is called interpolation; if x is outside that range, it is called extrapolation, which is considerably more hazardous (as many former stock-market analysts can attest). Interpolation and extrapolation schemes must model the function, between or beyond the known points, by some plausible functional form. The form should be sufficiently general so as to be able to approximate large classes of functions which might arise in practice. By far most common among the functional forms used are polynomials (§3.1). Rational functions (quotients of polynomials) also turn out to be extremely useful (§3.2). Trigonometric functions, sines and cosines, give rise to trigonometric interpolation and related Fourier methods, which we defer to Chapters 12 and 13. There is an extensive mathematical literature devoted to theorems about what sort of functions can be well approximated by which interpolating functions. These theorems are, alas, almost completely useless in day-to-day work: If we know enough about our function to apply a theorem of any power, we are usually not in the pitiful state of having to interpolate on a table of its values! Interpolation is related to, but distinct from, function approximation. That task consists of finding an approximate (but easily computable) function to use in place of a more complicated one. In the case of interpolation, you are given the function f at points not of your own choosing. For the case of function approximation, you are allowed to compute the function f at any desired points for the purpose of developing your approximation. We deal with function approximation in Chapter 5. One can easily find pathological functions that make a mockery of any interpo￾lation scheme. Consider, for example, the function f(x)=3x2 + 1 π4 ln  (π − x) 2 +1 (3.0.1) 105
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有