Читать книгу Solutions Manual to Accompany An Introduction to Numerical Methods and Analysis - James F. Epperson - Страница 14
2.4 LINEAR INTERPOLATION Exercises:
Оглавление1 Use linear interpolation to find approximations to the following values of the error function, using the table in the text. For each case, give an upper bound on the error in the approximation:;;;;.Solution For Part (a), we have and , sothusThe upper bound on the error comes straight from Theorem 2.1. We havewhere the maximum of the second derivative is computed over the interval . We haveso thatHence the error satisfies
2 The gamma function, denoted by , occurs in a number of applications, most notably probability theory and the solution of certain differential equations. It is basically the generalization of the factorial function to non‐integer values, in that . Table 2.5 (Table 2.8 in the text) gives values of for between 1 and 2. Use linear interpolation to approximate values of as given below:;;;.Table 2.5 (Table 2.8 in the text) Table of values.1.001.00000000001.100.95135076991.200.91816874241.300.89747069631.400.88726381751.500.88622692551.600.89351534931.700.90863873291.800.93138377101.900.96176583192.001.0000000000
3 Theorem 2.1 requires an upper bound on the second derivative of the function being interpolated, and this is not always available as a practical matter. However, if a table of values is available, we can use a difference approximation to the second derivative to estimate the upper bound on the derivative and hence the error. Recall, from Problem 12 of §2.2,Assume the function values are given at the equally spaced grid points for some grid spacing, . Using the estimateto approximate the derivative upper bound, estimate the error made in using linear interpolation to approximate each of the following values of , based on the same table as in the previous problem:;;;;.Solution We do Part (d), only. This is a “two‐stage” problem. First, we compute an approximate value for using linear interpolation. Then we estimate the error using the suggested device for approximating the second derivative.The interpolation is straight‐forward:so thatNow, the error is bounded according towhere the maximum is taken over the interval . We don't have a formula for , so we can't get one for the second derivative. But we do have the approximation (for any function)so we use this to estimate the second derivative of :Therefore the estimate on the error isAccording to MATLAB, the exact value (to 15 places) isthus the interpolation error is , so our estimate is a tad high, but certainly it is within the range of acceptable estimation.
4 Construct a linear interpolating polynomial to the function using and as the nodes. What is the upper bound on the error over the interval , according to the error estimate?
5 Repeat the above for , using the interval .Solution: The polynomial isThe error bound is given byThis is again a conservative estimate, since a simple plot of the difference shows that the maximum absolute error is about 0.04.
6 Repeat the above for , using the interval .
7 If we want to use linear interpolation to the sine function and obtain an accuracy of , how close together do the entries in the table have to be? What if we change the error criterion to ?Solution: This amounts to asking how small does have to be to make the upper bound in the error estimate less than the specified tolerance. For convenience set . We have, then, for ,so that making the error less than requires taking . For an error less than we need .
8 Repeat the above for , for .
9 If we try to approximate the logarithm by using a table of logarithm entries, together with linear interpolation, to construct the approximation to over the interval , how many points are required to get an approximation that is accurate to within ?Solution: The error estimate isSo we require for accuracy; this means we need points. (Which is a lot of points!)
10 Construct a piecewise linear approximation to over the interval using the nodes . What is the maximum error in this approximation?
11 Repeat the above for over the interval , using the nodes .Solution: The polynomials areThe maximum errors are given byandso the overall error bound is about 0.078.