Lecture 21
Lecture 21
Interpolation
Finite
divided
Second finite divided difference
difference
The data points used in this equation does not need to be equally spaced or the
abscissa value does not need to be in ascending order.
Problem
Fit a nth order polynomial to the four points used in example 1. The four
points are x0=1, x1=4, x2=5, x3=6, f(x0)=ln1=0, f(x1)= ln4=1.386294,
f(x2)=ln5=1.60938 and f(x3)= ln6=1.791759. Note that the true value of ln2
is 0.6931472.
Solution:
Problem
Fit a nth order polynomial to the four points used in example 1. The four
points are x0=1, x1=4, x2=5, x3=6, f(x0)=ln1=0, f(x1)= ln4=1.386294,
f(x2)=ln5=1.60938 and f(x3)= ln6=1.791759. Note that the true value of ln2
is 0.6931472.
Solution:
Problem
Fit a nth order polynomial to the four points used in example 1. The four
points are x0=1, x1=4, x2=5, x3=6, f(x0)=ln1=0, f(x1)= ln4=1.386294,
f(x2)=ln5=1.60938 and f(x3)= ln6=1.791759. Note that the true value of ln2
is 0.6931472.
Solution:
Problem
Fit a nth order polynomial to the three points used in example 1. The four
points are x0=1, x1=4, x2=6, x3=5, f(x0)=ln1=0, f(x1)= ln4=1.386294 and
f(x2)= ln6=1.791759, f(x3)=ln5=1.60938. Note that the true value of ln2 is
0.6931472.
Solution:
2nd Divided
Difference
Problem
Fit a nth order polynomial to the three points used in example 1. The four
points are x0=1, x1=4, x2=6, x3=5, f(x0)=ln1=0, f(x1)= ln4=1.386294 and
f(x2)= ln6=1.791759, f(x3)=ln5=1.60938. Note that the true value of ln2 is
0.6931472.
Solution:
3rd Divided Difference
f 3 (2) 0+(2-1)0.462098+(2-1)(2-4)(-0.051873)
(2-1)(2-4)(2-6)(0.0078654)
= 0.628768579
Et% = 9.3%
Errors of Newton’s Interpolating
Polynomials
As with the case of Taylor series, a formulation for truncation error
can be obtained:
Practice Problem
Error Estimates to determine the appropriate order of
interpolation of the function f(x)=ln2 at x=2. The eight points are
x0=1, x1=4, x2=6, x3=5, x4=3, x5=1.5, x6=2.5, x7=3.5. Note that the true
value of ln2 is 0.6931472.
Practice Problem
Error Estimates to determine the appropriate order of
interpolation of the function f(x)=ln2 at x=2. The eight points are
x0=1, x1=4, x2=6, x3=5, x4=3, x5=1.5, x6=2.5, x7=3.5. Note that the true
value of ln2 is 0.6931472.
f(x i )-f(x j )
• First finite divided difference: f(x i , x j )=
x i -x j
f[xn, xn-1, xn-2, xn-3] f[xn, xn-1, xn-2, xn-3]-f[xn-1, xn-2, xn-3, xn-4] xn - xn-4 f[xn, xn-1, xn-2, xn-3, xn-4]
0.007865529 -0.003912775 2 -0.001956387
0.003952754 0.003755955 -2.5 -0.001502382
0.00770871 0.007652115 -3.5 -0.002186319
0.015360825 0.005195802 -1.5 -0.003463868
0.020556626
• Seventh f[x , x , x , x , x , x , x ]
f[x n , x n-1 , x n-2 , x n-3 , x n-4 , x n-5 , x n-6 , x n-7 ]= n n-1 n-2 n-3 n-4 n-5 n-6
finite x n - x n-7
divided f[x n-1 , x n-2 , x n-3 , x n-4 , x n-5 , x n-6 , x n-7 ]
difference: -
x -x n n-7
f[xn, xn-1, xn-2, xn-3, xn-4, xn-5, xn-6]- f[xn, xn-1, xn-2, xn-3, xn-4, xn-5,
f[xn, xn-1, xn-2, xn-3, xn-4, xn-5, xn-6] f[xn-1, xn-2, xn-3, xn-4, xn-5, xn-6, xn-7] (xn - xn-7) xn-6, xn-7]
-0.000301368 0.000191244 2.5 7.64977E-05
-0.000110124
Practice Problem
Newton’s Divided Difference Interpolating Polynomial