is accurate to 0(ω-2). However, the integral itself ordinarily goes to zero like ω- 1, so the relative error is ordinarily only 0(ω-1). The situation is typical of classical asymptotic approximation of integrals. The bigger w is, the better the asymptotic ap- proximation and the more difficult the integral is for conventional numerical methods. On the other hand, for a given w, the asymptotic approximation may not be sufficiently accurate and there is no easy way to improve it. When w is “small,” finite Fourier inte- grals are easy for conventional numerical methods, and when w is “large,” asymptotic approximations are satisfactory. Filon’s method provides a way to compute accurate integrals when w is of moderate size.
Filon divides the interval [a,b] into 2N subintervals of equal length h. Let us define xj = a + jh for j = 0, . . . ,2N. The function f(x) is approximated by a continuous spline S(x) that is a quadratic polynomial on each [x2 m, xm + 2] defined there by interpolation
to f(xj) for j = 2m, 2m + 1,2m + 2. Each of the integrals in the approximation
can be evaluated analytically by integration by parts. A lengthy calculation results in Filon’s method:
Here θ = ωh and
Also,
There is a similar approximation when cosine is replaced by sine. The formula is
The coefficients α, β, γ are the same, and Se and So are like Ce and Co with the cosines replaced by sines.
Using the results developed in this chapter for the error of interpolation, it is easy to bound the error of Filon’s method. On each subinterval [x2 m, x2 m + 2], S(x) is a
quadratic interpolant to f(x). If M3 is a bound on the third derivative of f(x) on
uniformly for a < x < b. Then
This is a bound on the absolute error that depends on f(x) and the sampling interval h, but not on ω. If we want a meaningful result for “large” ω, we have to take into account that the integral is 0(ω-l). This leads to a bound on the relative error that is
0 ( θ- 1h4) .
In a subsection of Chapter 5 about applying a general-purpose code to problems with oscillatory integrands, the example
is discussed. The function f(x) = l/(1 + x2) ought to be approximated well by a quadratic interpolatory spline with a relatively crude mesh, so Filon’s method ought to be quite effective. A matter not usually discussed with Filon’s method is how to estimate the accuracy of the result. One way to proceed is to compute a result that we believe to be more accurate and estimate the error of the less accurate result by com- parison. If the accuracy is acceptable, often the more accurate result is the one taken as the answer. Inspection of the formulas shows that if h, or equivalently θ, is halved, we can reuse all the evaluations of f, sin(x), and cos(x) made in the first approximation to keep down the cost. According to the bounds, the error should be reduced enough by halving h to get a good estimate of the error by comparison. Using Filon’s method with θ = 0.4, we obtained an approximate integral of 0.04566373122996. Halving θ resulted in the approximation 0.04566373690838. Estimating the accuracy by com- parison suggests that we have an answer with an error smaller than 6 × 10-9. Reuse of the function evaluations by virtue of halving θ holds the cost to 315 evaluations of the integrand. The quadrature code Adapt developed in Chapter 5 asks the user to specify the accuracy desired. Using the code in the manner outlined in that chap- ter and experimenting some with the error tolerances, we obtained an approximation 0.04566373866324 with an estimated error of about -1.6 × 10-9. This cost 1022 evaluations of the integrand.
Let us now change the subject from applying a continuous spline to applying a smooth spline. In this chapter we have been looking at the approximation of functions y = f(x), but sometimes we want to approximate curves. This will be discussed in the plane for it will then be clear how to deal with a curve in three dimensions. The basic idea is to use a parametric representation (x(s),y(s)) for the curve and approx- imate independently the coordinate functions x(s) and y(s). The parameter s can be anything, but often in the theory it is taken to be arc length. Having chosen somehow nodes si, i = l, . . . , N, we can interpolate the data xi = x(si) by a spline Sx(s) and like-
wise the data yi = y(si) by a spline Sy(s). The curve (x(s),y(s)) is then approximated by (Sx(s),Sy(s)). This yields a curve in the plane that passes through all the points
(x(si),y(si)) in order. It is natural to use the smooth cubic spline of SPCOEF because
it leads to a curve with continuous curvature, but if the data are sparse, we might have to resort to the shape-preserving spline to get a curve of the expected shape. All these computations are familiar except for the selection of the nodes si. One way to proceed
REFERENCES 131
Figure 3.21 Curve fit for a sewing machine pattern.
is to choose them so that the parameter s approximates the arc length of the curve. This is done by taking s1 = 0 and defining the difference between si and si+1 as the distance between the points (xi,yi) and (xi + 1,yi + l), namely
Exercise 3.39 suggests an alternative. See Farin [6] for many other approaches. An interesting example of the technique is furnished by a need to approximate curves for automatic control of sewing machines. Arc length is the natural parameter because a constant increment in arc length corresponds to a constant stitch length. An example taken from [18] fits the data (2.5, -2.5), (3.5, -0.5), (5, 2), (7.5, 4), (9.5, 4.5), (11.8, 3.5), (13, 0.5), (11.5, -2), (9, -3), (6, -3.3), (2.5, -2.5), (0, 0), (-1.5, 2), (-3, 5), (-3.5, 9), (-2, 11), (0, 11.5), (2, 11), (3.5, 9), (3, 5), (1.5, 2), (0, 0), (-2.5, -2.5), (-6, -3.3), (-9, -3), (-11.5, -2), (-13, 0.5), (-11.8, 3.5), (-9.5, 4.5), (-7.5, 4), (-5, 2), (-3.5, -0.5), (-2.5, -2.5). The resulting spline curve
is seen in Figure 3.21. n
REFERENCES
1. E. Becker, G. Carey and J. T. Oden, Finite Elements: An Introduction, Vol. I, Prentice Hall, Englewood Cliffs, N.J., 1981.
2. G. Birkhoff and A. Priver, “Hermite interpolation errors for derivatives,” J. Math. and Physics, 46 (1967), pp. 440-447.