PolynomialInterpolationExample

PolynomialInterpolationExample - POLYNOMIAL INTERPOLATION...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
B.J. Fregly Spring 2011 POLYNOMIAL INTERPOLATION EXAMPLE As discussed in lecture, there are three methods for performing polynomial interpolation of a specific number of data points: 1. General method 2. Newton’s method 3. Lagrange’s method Below we perform linear, quadratic, and cubic polynomial interpolation of sets of two, three, and four data points, respectively, using each of the three methods noted above. The data points to be used for interpolation are specified as follows: Linear interpolation: (-10,7), (10,-53) Quadratic interpolation: (-10,7), (0,7), (10,-53) Cubic interpolation: (-10,7), (-5,22), (5,-23), (10,-53) (note: these points are NOT uniformly spaced, which is not a problem) The underlying function from which these data points were sampled is shown below: -10 -5 0 5 10 -60 -50 -40 -30 -20 -10 0 10 20 30 x y 1. GENERAL METHOD The general approach solves the determinate linear system of equations = A zb where z contains the unknown polynomial coefficients. The general form of the polynomial function to be fitted is 23 12 3 4 ( ) ... = + +++ fx a ax ax ax For linear interpolation, we seek to find 1 a and 2 a in the function () = + f xa a x using the two data points (-10,7), (10,-53). The resulting two equations in the two unknowns 1 a and 2 a are 10 7 10 53 = + =− aa Rewriting these two equations in matrix form yields
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 B.J. Fregly Spring 2011 N N 1 2 11 0 7 0 5 3 ⎡⎤ ⎤⎡ = ⎢⎥ ⎥⎢ ⎦⎣ ⎣⎦ ±²³²´ a a b z A This determinate linear system of equations can be solved for the unknown vector z via 1 = zA b or using the backslash (\) operator in Matlab. Performing this operation yields 23 3 = z Thus, 1 a = -23 and 2 a = -3 so that the final linear interpolation function for the two specified data points is () 2 3 3 = −− f xx Similarly, for quadratic interpolation, we seek to find 1 a , 2 a , and 3 a in the function 2 12 3 =+ + f xa a x a x using the three data points (-10,7), (0,7), (10,-53). Following a similar process as above, 3 123 3 10 100 7 007 10 100 53 += ++= + aa a aaa a Rewriting these three equations in matrix form yields N N 1 2 3 0 1 0 0 7 10 0 7 1 10 100 53 = ±²²³²²´ a a a zb A Solving this determinate linear system of equations yields 7 3 0.3 = z Thus, 1 a = 7, 2 a = -3, and 3 a = -0.3 so that the final quadratic interpolation function for the three specified data points is 2 () 7 3 0 . 3 =− − f x Finally, for cubic interpolation, we seek to find 1 a , 2 a , 3 a , and 4 a in the function 23 3 4 + f x a ax ax ax using the four data points (-10,7), (-5,22), (5,-23), (10,-53). Following a similar process as above,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/05/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.

Page1 / 6

PolynomialInterpolationExample - POLYNOMIAL INTERPOLATION...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online