Presentation is loading. Please wait.

Presentation is loading. Please wait.

Newton’s Interpolation. Newton Interpolation Newton’s Interpolating polynomial for a set of data {( x 1, y 1 ),( x 2, y 2 ),( x 3, y 3 ),…,( x m,y m )}

Similar presentations


Presentation on theme: "Newton’s Interpolation. Newton Interpolation Newton’s Interpolating polynomial for a set of data {( x 1, y 1 ),( x 2, y 2 ),( x 3, y 3 ),…,( x m,y m )}"— Presentation transcript:

1 Newton’s Interpolation

2 Newton Interpolation Newton’s Interpolating polynomial for a set of data {( x 1, y 1 ),( x 2, y 2 ),( x 3, y 3 ),…,( x m,y m )} will turn out to be exactly the same as Lagrange’s Interpolating polynomial but with fewer calculations needed to construct the polynomial. Newton’s idea was to look for a series of constants c 1, c 2, c 3,…, c m and write the polynomial in the form below: The constants c 1, c 2, c 3,…, c m are chosen so that: p(x 1 )=y 1, p(x 2 )=y 2, …, p(x m )=y m The constants c 1, c 2, c 3,…, c m can be solved for to find the following values:

3 Newton’s Interpolation (Recursively Defined) At first Newton’s Interpolation looks cumbersome and had to work with. Using recursion to define a sequence of polynomials p 1 (x), p 2 (x),…,p m (x) = p(x). The idea here is that each of the polynomials earlier in will be smaller and easier to compute and keep the information you need for the later polynomials in the sequence. They are defined below.

4 Example: Lets interpolate the data set: {(-2,5),(-1,4),(1,8)}. (Notice this has an interpolating polynomial of p(x) = x 2 + 2 x +5.) plug in x 2 = -1 plug in x 3 = 1 simplified

5 coefficients Take the difference of the y ’s and divide by the difference of the x ’s at each stage. We get the following: With more data points just extend the triangle across.

6 alldiffx ← True For[ i =1, i  m, i ++ For[ j =1, j < i, j ++, alldiffx=alldiffx and ( x i  x j )]] If alldiffx psum = y 1 For[ i =2, i  m, i ++ pprod = 1 pexpr=1 For[ j =1, j < i, j ++, pexpr = pexpr*( x – x j ) pprod = pprod*( x i – x j )] p(x) = psum psum = psum + ( y i – p(x i ) )/pprod * pexpr] (* else *) Print[“Data set can not be interpolated by a function”]


Download ppt "Newton’s Interpolation. Newton Interpolation Newton’s Interpolating polynomial for a set of data {( x 1, y 1 ),( x 2, y 2 ),( x 3, y 3 ),…,( x m,y m )}"

Similar presentations


Ads by Google