CH-04 (523172), страница 4
Текст из файла (страница 4)
A set of 5 (x,y) points is given as (1,2), (2,4), (4,5), (5,2), (6,0), apply theLagrangian interpolation formulas to find the y for x = 3 by parabolicinterpolation using the middle three points. Check the answer by (a)without fitting the three points by a parabolic equation, and (b) by derivingthe parabolic equation and then substituting x equal to 3 to find the y value.3. Apply the Lagrangian formula to curve-fit the following listed data nearx = 5 by a cubic equation.
Use the derived cubic equation to find the yvalue at x = 4.5.xy1224374125204. Use the data set given in Problem 3 to exactly curve-fit them by a quarticequation y(x) = a1 + a2x + a3x2 + a4x3 + a5x4. Do this manually based onthe Lagrangian formula.5. Write a program and call it ExactFit.Ln5 for computation of the coefficients a1–5 in the y(x) expression in Problem 4.6.
Generalize the need in Problem 4 by extending the exact fit of N given(x,y) points by a polynomial y(x) = a1 + a2x + … + aixi–1 + … + aNxN–1based on the Lagrangian formula. Call this program ExactFit.LnN.7. Based on the Lagrangian formula, use the first four of the five points givenin Problem 1 to interpolate the y value at x = 2.5 and then the last fourof the five points also at x = 2.5.8. Write a program and call it Expand.1 which will expand the set of fivepoints given in Problem 2 to a set of 21 points by using an increment ofx equal to 0.2 and linear interpolation based on the Lagrangian formula.For any x value which is not equal to any of the x values of the five given© 2001 by CRC Press LLC9.10.11.12.13.14.15.points, this x value is to be tested to determine between which two pointsit is located. These two given points are to be used in the interpolationprocess by setting N equal to 2 in the program LagrangI.
This procedureis to be repeated for x values between 1 and 6 in computation of all newy values.As for Problem 8 except parabolic interpolation is to be implemented.Call the new program Expand.2.Extend the concept discussed in Problems 8 and 9 to develop a generalprogram Expand.M for using N given points and Mth-order Lagrangianinterpolation to obtain an expanded set.Apply the function InterpolatingPolynomial of Mathematica to solveProblems 1 and 2.Check the result of Problem 4 by Mathematica.Apply LagrangI.m to solve Problem 1 by MATLAB.Apply LagrangI.m to solve Problem 2 by MATLAB.Apply LagrangI.m to solve Problem 7 by MATLAB.4.5 REFERENCE1. R.
C. Weast, Editor-in-Chief, CRC Standard Mathematical Tables, the ChemicalRubber Co. (now CRC Press LLC), Cleveland, OH, 1964, p. 381.© 2001 by CRC Press LLC.