0% found this document useful (0 votes)
7 views2 pages

Problem

The document presents a series of interpolation problems, including linear, Newton's, and Lagrange polynomial methods, to estimate logarithmic values and other functions. It also involves fitting polynomials to given data sets, calculating percent relative errors, and developing programs for numerical methods. The problems require various techniques such as inverse interpolation and spline fitting, emphasizing accuracy and convergence in the results.

Uploaded by

24ms32
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Problem

The document presents a series of interpolation problems, including linear, Newton's, and Lagrange polynomial methods, to estimate logarithmic values and other functions. It also involves fitting polynomials to given data sets, calculating percent relative errors, and developing programs for numerical methods. The problems require various techniques such as inverse interpolation and spline fitting, emphasizing accuracy and convergence in the results.

Uploaded by

24ms32
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

522 INTERPOLATION

PROBLEMS
18.1 Estimate the common logarithm of 10 using linear interpolation. differences as in Fig. 18.5 and order your points to attain optimal
(a) Interpolate between log 8  0.9030900 and log 12  1.0791812. accuracy and convergence.
(b) Interpolate between log 9  0.9542425 and log 11 
1.0413927. For each of the interpolations, compute the percent x 0 1 2 5.5 11 13 16 18
relative error based on the true value. y 0.5 3.134 5.3 9.9 10.2 9.35 7.2 6.2
18.2 Fit a second-order Newton’s interpolating polynomial to
18.11 Employ inverse interpolation using a cubic interpolating
estimate log 10 using the data from Prob. 18.1 at x  8, 9, and 11.
polynomial and bisection to determine the value of x that corre-
Compute the true percent relative error.
sponds to f (x)  0.23 for the following tabulated data:
18.3 Fit a third-order Newton’s interpolating polynomial to esti-
mate log 10 using the data from Prob. 18.1. x 2 3 4 5 6 7
18.4 Repeat Probs. 18.1 through 18.3 using the Lagrange
y 0.5 0.3333 0.25 0.2 0.1667 0.1429
polynomial.
18.5 Given the data 18.12 Employ inverse interpolation to determine the value of x that
corresponds to f (x)  0.85 for the following tabulated data:
x 1.6 2 2.5 3.2 4 4.5
f (x) 2 8 14 15 8 2 x 0 1 2 3 4 5

(a) Calculate f (2.8) using Newton’s interpolating polynomials of f (x) 0 0.5 0.8 0.9 0.941176 0.961538
order 1 through 3. Choose the sequence of the points for your Note that the values in the table were generated with the function
estimates to attain the best possible accuracy. f (x)  x2(1  x2).
(b) Utilize Eq. (18.18) to estimate the error for each prediction. (a) Determine the correct value analytically.
18.6 Given the data (b) Use cubic interpolation of x versus y.
x 1 2 3 5 7 8
(c) Use inverse interpolation with quadratic interpolation and the
quadratic formula.
f (x) 3 6 19 99 291 444 (d) Use inverse interpolation with cubic interpolation and bisec-
Calculate f (4) using Newton’s interpolating polynomials of order 1 tion. For parts (b) through (d) compute the true percent relative
through 4. Choose your base points to attain good accuracy. What error.
do your results indicate regarding the order of the polynomial used 18.13 Develop quadratic splines for the first 5 data points in
to generate the data in the table? Prob. 18.5 and predict f (3.4) and f(2.2).
18.7 Repeat Prob. 18.6 using Lagrange polynomials of order 1 18.14 Develop cubic splines for the data in Prob. 18.6 and
through 3. (a) predict f (4) and f (2.5) and (b) verify that f 2(3) and f 3(3)  19.
18.8 The following data come from a table that was measured with 18.15 Determine the coefficients of the parabola that passes
high precision. Use the best numerical method (for this type of prob- through the last three points in Prob. 18.5.
lem) to determine y at x  3.5. Note that a polynomial will yield an 18.16 Determine the coefficients of the cubic equation that passes
exact value. Your solution should prove that your result is exact. through the first four points in Prob. 18.6.
18.17 Develop, debug, and test a program in either a high-level
x 0 1.8 5 6 8.2 9.2 12 language or macro language of your choice to implement Newton’s
y 26 16.415 5.375 3.5 2.015 2.54 8 interpolating polynomial based on Fig. 18.7.
18.18 Test the program you developed in Prob. 18.17 by duplicat-
18.9 Use Newton’s interpolating polynomial to determine y at x  ing the computation from Example 18.5.
3.5 to the best possible accuracy. Compute the finite divided differ- 18.19 Use the program you developed in Prob. 18.17 to solve
ences as in Fig. 18.5 and order your points to attain optimal accu- Probs. 18.1 through 18.3.
racy and convergence. 18.20 Use the program you developed in Prob. 18.17 to solve
x 0 1 2.5 3 4.5 5 6 Probs. 18.5 and 18.6. Utilize all the data to develop first- through
fifth-order polynomials. For both problems, plot the estimated error
y 2 5.4375 7.3516 7.5625 8.4453 9.1875 12
versus order.
18.10 Use Newton’s interpolating polynomial to determine y at 18.21 Develop, debug, and test a program in either a high-level
x  8 to the best possible accuracy. Compute the finite divided language or macro language of your choice to implement Lagrange
cha01064_ch18.qxd 3/20/09 12:48 PM Page 523

PROBLEMS 523

interpolation. Base it on the pseudocode from Fig. 18.11. Test it by (c) Use the five points from (b) to estimate f(0.8) with first- through
duplicating Example 18.7. fourth-order Newton interpolating polynomials.
18.22 A useful application of Lagrange interpolation is called a (d) Generate and plot a cubic spline using the five points from (b).
table look-up. As the name implies, this involves “looking-up” an (e) Discuss your results.
intermediate value from a table. To develop such an algorithm, 18.27 The following is the built-in humps function that MATLAB
the table of x and f (x) values are first stored in a pair of one- uses to demonstrate some of its numerical capabilities:
dimensional arrays. These values are then passed to a function
along with the x value you wish to evaluate. The function then per- 1 1
f(x) = + −6
forms two tasks. First, it loops down through the table until it finds (x − 0.3) + 0.01 (x − 0.9)2 + 0.04
2

the interval within which the unknown lies. Then it applies a tech-
The humps function exhibits both flat and steep regions over a
nique like Lagrange interpolation to determine the proper f (x)
relatively short x range. Generate values of this function at inter-
value. Develop such a function using a cubic Lagrange polynomial
vals of 0.1 over the range from x  0 to 1. Fit this data with a cubic
to perform the interpolation. For intermediate intervals, this is a
spline and create a plot comparing the fit with the exact humps
nice choice because the unknown will be located in the interval in
function.
the middle of the four points necessary to generate the cubic. For
18.28 The following data defines the sea-level concentration of
the first and last intervals, use a quadratic Lagrange polynomial.
dissolved oxygen for fresh water as a function of temperature:
Also have your code detect when the user requests a value outside
the range of x’s. For such cases, the function should display an T, oC 0 8 16 24 32 40
error message. Test your program for f (x)  ln x using data from
o, mg/L 14.621 11.843 9.870 8.418 7.305 6.413
x  1, 2, ... , 10.
18.23 Develop, debug, and test a program in either a high-level Estimate o(27) using (a) linear interpolation, (b) Newton’s interpo-
language or macro language of your choice to implement cubic lating polynomial, and (c) cubic splines. Note that the exact result
spline interpolation based on Fig. 18.18. Test the program by dupli- is 7.986 mg/L.
cating Example 18.10. 18.29 Generate eight equally-spaced points from the function
18.24 Use the software developed in Prob. 18.23 to fit cubic
f (t) = sin2 t
splines through the data in Probs. 18.5 and 18.6. For both cases,
predict f(2.25). from t  0 to 2π . Fit this data with (a) a seventh-order interpolat-
18.25 Use the portion of the given steam table for superheated ing polynomial and (b) a cubic spline.
H2O at 200 MPa to (a) find the corresponding entropy s for a spe- 18.30 Temperatures are measured at various points on a heated
cific volume v of 0.108 m3/kg with linear interpolation, (b) find the plate (Table P18.30). Estimate the temperature at (a) x  4, y  3.2,
same corresponding entropy using quadratic interpolation, and and (b) x  4.3, y  2.7.
(c) find the volume corresponding to an entropy of 6.6 using in-
verse interpolation. TABLE P18.30 Temperature (°C) at various points on a
3
square heated plate.
v (m /kg) 0.10377 0.11144 0.1254
s (kJ/kg· K) 6.4147 6.5453 6.7664 x0 x2 x4 x6 x8

18.26 Runge’s function is written as y  0 100.00 90.00 80.00 70.00 60.00


y  2 85.00 64.49 53.50 48.15 50.00
1 y  4 70.00 48.90 38.43 35.03 40.00
f(x) =
1 + 25x 2 y  6 55.00 38.78 30.39 27.07 30.00
y  8 40.00 35.00 30.00 25.00 20.00
(a) Develop a plot of this function for the interval from x  1 to 1.
(b) Generate and plot the fourth-order Lagrange interpolating
polynomial using equispaced function values corresponding to
x  1, 0.5, 0, 0.5, and 1.

You might also like