Solutions Manual to Accompany An Introduction to Numerical Methods and Analysis. James F. Epperson

Чтение книги онлайн.

Читать онлайн книгу Solutions Manual to Accompany An Introduction to Numerical Methods and Analysis - James F. Epperson страница 11

Solutions Manual to Accompany An Introduction to Numerical Methods and Analysis - James F. Epperson

Скачать книгу

style="font-size:15px;">      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.

      

      Exercises:

      1 Use the trapezoid rule with to approximate the integralYou should get that . How small does have to be to get that the error is less than ? ?

      2 Use the trapezoid rule and to approximate the integralHow small does have to be to get that the error is less than ? ?

      3 Repeat the above with .

      4 Apply the trapezoid rule with , to approximate the integralHow small does have to be to get that the error is less than ? ?Solution: It's a fairly direct (if tedious) computation to getNow, for the accuracy, we haveThe second derivative isand we can bound this (for all ) as follows:A better upper bound would come fromTherefore, to get accuracy requires (using the weaker upper bound)To get accuracy requires

      5 Apply the trapezoid rule with , to approximate the integralFeel free to use a computer program or a calculator, as you wish. How small does have to be to get that the error is less than ? ?Solution: The approximation is . The error bound gives usso we require for accuracy, and for accuracy.

      6 Apply the trapezoid rule with , to approximate the integralHow small does have to be to get that the error is less than ? ?Solution: The approximation is . The error bound yieldsso we need to get accuracy, and to get accuracy.

      7 Apply the trapezoid rule with , to approximate the integralHow small does have to be to get that the error is less than ? ?

      8 Apply the trapezoid rule with , to approximate the integralHow small does have to be to get that the error is less than ? ?Solution: We haveTo get the accuracy, we note thatso that, over the interval ,Therefore, to get an error less than we take to satisfyTo get an error less than we take to satisfy

      9 Let denote the value you obtained in the previous problem. Repeat the computation, this time using , and call this approximate value . Then computeand compare this to the given exact value of the integral.

      10 Repeat the above for the integralSolution: We getandThe exact value is , so we see that is much more accurate than either of the trapezoid rule values.

      11 For each integral below, write a program to do the trapezoid rule using the sequence of mesh sizes , where is the length of the given interval. Verify that the expected rate of decrease of the error is obtained:, , ;, , ;, , ;, , ;, , ;, , .

      12 For each integral in Problem 11, how small does have to be to get accuracy, according to the error theory, of at least ? ?Solution: For the single case of (d), since , we have , sofor all on . We therefore haveWe therefore get accuracy by imposing which implies For accuracy we have

      13 Apply the trapezoid rule to the integralusing a sequence of uniform grids with . Do we get the expected rate of convergence? Explain.

      14 The length of a curve , for between and , is given by the integralUse the trapezoid rule with and to find the length of one “arch” of the sine curve.Solution: We get(using ), and(using ).

      15 Use the trapezoid rule to find the length of the logarithm curve between and , using and .

      16 What should be to guarantee an accuracy of when using the trapezoid rule for each of the following integrals:Solution: The error bound gives usso we require .Solution: The error bound gives usso we require .Solution: The error bound gives usso we require .Solution: The error bound gives usso we require .

      17 Since the natural logarithm is defined as an integral,(2.3) it is possible to use the trapezoid rule (or any other numerical integration rule) to construct approximations to .Show that using the trapezoid rule on the integral (2.3) results in the series approximation (for )Hint: What are and in the integral defining the logarithm?How many terms are needed in this approximation to get an error of less than for all ? How many terms are needed for an error of less than over the same interval?Implement this series for a predicted accuracy of and compare it to the intrinsic natural logarithm function on your computer, over the interval . Is the expected accuracy achieved?If we were only interested in the interval , how many terms would be needed for the accuracy specified in (b)?Is it possible to reduce the computation of for all to the computation of for ? Explain.

      18 How small must be to compute the error function,using the trapezoid rule, to within accuracy for all ?Solution: The error estimate implies thatwhere and we have used a very crude upper bound on the second derivative. Since we want to achieve the specified accuracy for all , we use (since this maximizes the upper bound) and therefore solve the inequalityto get .

      19 Use

Скачать книгу