Académique Documents
Professionnel Documents
Culture Documents
Interpolation
Lecture’s Goals
1. Interpolation methods:
– Lagrange’s Interpolation
– Newton’s Interpolation
– Hermite’s Interpolation
– Rational Function Interpolation
– Spline (Linear,Quadratic, & Cubic)
1
INTERPOLATION
Polynomial Interpolation Methods
- Lagrange Interpolation Polynomial:
a straightforward, but computational awkward way to construct an
interpolating polynomial.
Lagrange Interpolation
This method is generally the easiest to work. The data does not
have to be equally spaced and is useful for finding the points
between quadratic and cubic methods. However, it does not
provide an accurate model for large sets of terms.
P x L1 x y1 L2 x y 2
Pn1x L1 x y1 L2 x y2 Ln x yn
where:
Lk x
x x1 x x2 x xn1 x xn
xk x1 xk x2 xk xn1 xk xn
2
INTERPOLATION
The function can be defined as:
Pn1 x C1 x x2 x x3 x xn
C2 x x1 x x3 x xn
Cn x x1 x x2 x xn1
Ck x
yk
xk x1 xk x2 xk xk 1 xk xk 1 xk xn1 xk xn
The method works for quadratic and cubic polynomials. As you
add additional points in the degree of the polynomial increases.
So if you have n points it will fit a (n-1)th degree polynomial.
What are the coefficients of the polynomial and what is the value of
P2(2.3)?
x y
1.1 10.6
1.7 15.2
3 20.3
3
INTERPOLATION
y1 10.6
C1 9.298
x1 x2 x1 x3 1.1 1.7 1.1 3.0
15.2
C2 19.4872
1.7 1.11.7 3.0
20.3
C3 8.2186
3.0 1.13.0 1.7
The values are evaluated
Lagrange Interpolation
25
20
y values
15
10
0
1 1.5 2 2.5 3
x values
4
INTERPOLATION
What happens if we increase the number of data points?
x y Ci
1.1 10.6 28.1765
1.7 15.2 129.9145
3 20.3 6.4208
1.4 13.4 -116.3194
2.2 18.7 -53.125
Lagrange Interpolation
25
20
Y Values
15
10
0
1 1.5 2 2.5 3
X Values
5
INTERPOLATION
Lagrange Interpolation Program
The Lagrange interpolation is broken up into two programs to
evaluate the new polynomial.
Newton Interpolation
The Newton interpolation uses a divided difference method. The
technique allows one to add additional points easily.
P x a0
a1 x x1
a2 x x1 x x2
d 0 y1
y2 y1
d1
x2 x1
y3 y2 y2 y1
x x x2 x1 d 2 d1
dd1 3 2
x3 x1 x3 x1
The function can be defined as:
6
INTERPOLATION
Pn1x d 0 d1 x x1
dd1x x1 x x2
ddddn-1x x1 x x2 x xn1
What are the coefficients of the polynomial and what is the value of
P2(2.3)?
X Y
0 1
1 2
2 4
3 8
4 16
7
INTERPOLATION
X Y d dd ddd dddd
0 1
y2 y1 2 1
1
x2 x1 1 0
d 2 d1 2 1
1 2 0.5
x3 x1 2 0
dd2 dd1 1 0.5
y3 y2 4 2 0.1667
2 x4 x1 30
x3 x2 2 1
4 16
P4 x y1 c1 * x x1 c2 * x x1 x x2
c3 * x x1 x x2 x x3
c4 * x x1 x x2 x x3 x x4
P4 x 1 1* x 0 0.5 * x 0 x 1
0.1667 * x 0 x 1 x 2
0.04167 * x 0 x 1 x 2 x 3
8
INTERPOLATION
Newton Interpolation
18
16
14
12
Y Values
10
8
6
4
2
0
0 1 2 3 4
X Values
9
INTERPOLATION
10