Scientific Computing Chap07
Scientific Computing Chap07
Scientific Computing
An Introductory Survey
Second Edition
by Michael T. Heath
Chapter 7
Interpolation
(ti, yi), i = 1, . . . , m,
with t1 < t2 < . . . < tm, determine function
f : R → R such that
f (ti) = yi, i = 1, . . . , m
3
Interpolation vs Approximation
4
Issues in Interpolation
5
Choosing Interpolant
6
Functions for Interpolation
• Polynomials
• Piecewise polynomials
• Trigonometric functions
• Exponential functions
• Rational functions
7
Basis Functions
Ax = y
for n-vector x of parameters xj , where entries
of m × n matrix A are given by aij = φj (ti)
8
Existence, Uniqueness, and Conditioning
9
Polynomial Interpolation
10
Monomial Basis
φj (t) = tj−1, j = 1, . . . , n,
give interpolating polynomial of form
11
Example: Monomial Basis
1 0 0 x2 = −1 ,
1 1 1 x3 0
p2(t) = −1 + 5t − 4t2
12
Monomial Basis, continued
13
Monomial Basis, continued
14
Monomial Basis, continued
15
Evaluating Polynomials
For example,
1−4t+5t2−2t3+3t4 = 1+t(−4+t(5+t(−2+3t)))
17
Lagrange Basis Functions
18
Example: Lagrange Interpolation
(t − t1)(t − t2)
+y3
(t3 − t1)(t3 − t2)
19
Newton Interpolation
20
Newton Interpolation, continued
21
Example: Newton Interpolation
1 t2 − t1 0 x2 = y 2
1 2 0 x2 = −1 ,
1 3 3 x3 0
yj+1 − pj (tj+1)
xj+1 =
πj+1(tj+1)
23
Divided Differences
xj = f [t1, t2, . . . , tj ]
25
Orthogonal Polynomials, continued
26
Orthogonal Polynomials, continued
27
Chebyshev Polynomials
28
Chebyshev Points
1 .
..............• ......................•
..................
..•.
.
. .
...
. .
. .. ....• .........
... . . .
.
. ..
...
.. ..
. . .
. .
. .. ...........
..•.
. . .. .. .. •.......
..... .. .. .. .. .. .. ....
.. .. .
. .
. .
. .
. .. .• .
...•... ...
. .. .. .. .. .. .......
.. . .. .. .. .. .. .. ....
... .. .. .. .. .. .. .. .. ...
•... .. .. .. .. .. .. .. .. •.
.• •.. •.. •..
. .•. .•. .•. •.. •.. •....
0
−1 0 1
f (n)(θ)
f (t)−pn−1(t) = (t−t1)(t−t2) · · · (t−tn),
n!
where θ is some (unknown) point in interval
[t1, tn]
30
Interpolating Continuous Functions, cont.
31
High-Degree Polynomial Interpolation
32
Nonconvergence
33
Placement of Interpolation Points
34
Placement of Points, continued
1.0 .......
.......... ............
. .....
. ...... ......
...... .....
.....
...... .....
0.5 ..
... .. .
. . . .. .. .... .. ....................
..
.
...
.
. .
. .. ............
.. .
. .................. ....................
.. .
. .. ............. ............................................
.............. ........ ...
.................................................................................. ........... ........................................ ........
.....................
0.0 .
−1.0 −0.5 0.0 0.5 1.0
35
Taylor Polynomial
0 f 00(a)
pn(t) = f (a) + f (a)(t − a) + (t − a)2 + · · ·
2
f (n)(a)
+ (t − a)n
n!
38
Hermite Interpolation
39
Hermite Cubic Interpolation
40
Cubic Spline Interpolation
42
Example: Cubic Spline Interpolation
α1 + α2t1 + α3t2 3
1 + α4 t1 = y1 ,
43
Example Continued
α1 + α2t2 + α3t2 3
2 + α4 t2 = y2
β1 + β2t2 + β3t2
2 + β 4 t3=y ,
2 2
β1 + β2t3 + β3t2
3 + β 4 t3=y
3 3
α2 + 2α3t2 + 3α4t2 2
2 = β2 + 2β3 t2 + 3β4 t2
44
Example Continued
2α3 + 6α4t1 = 0,
2β3 + 6β4t3 = 0
45
Hermite Cubic vs Spline Interpolation
46
Hermite Cubic vs Spline Interpolation
8 •......
....
....
.......
6 •.................................... monotone
•....
... Hermite cubic
...
4 ...
...
...
...
2 ...............
• .....................•
..................•
...................................•
.................•
..
0
0 2 4 6 8 10
8 •.....
...
....
.......................................
6 •.. ...
•.....
... cubic spline
...
4 ...
...
...
...
2 ...
• .... ..................•
............................• ...................................•
.................•
.
..
0
0 2 4 6 8 10
47
B-splines
48
B-splines, continued
49
B-splines
1.0 ......................................................
Bi0 ...
...
...
0.5 ...
..
...
...
...
0.0 t .
i ti+1 ti+2 ti+3 ti+4
..
1.0 .
................
. .
...... 1 ..........
.
. Bi
. .....
0.5 .
....... .....
.....
.
... .....
. .
... .....
...
. .....
....
. ....
0.0 t ti+1 ti+2 ti+3 ti+4
i
1.0
............................
.
..........
. ......
0.5 .
..
.. Bi 2 .....
...
..
. ......
..
.... ......
..
...
. .......
.
..
..
..
... ...........
.
.................
. ...................
0.0 t ti+1 ti+2 ti+3 ti+4
i
1.0
...............
.
...
............ 3...................
.
0.5 ... Bi .......
..
....... .......
........
.
..
...
. ...........
..
..
..
..
..
.. ...........................
0.0 t ........................................ ...............
i ti+1 ti+2 ti+3 ti+4
50
B-splines, continued
P∞ k
3. For all t, i=−∞ Bi (t) = 1
k , . . . , Bk
5. Set of functions {B1−k n−1 } is linearly
independent on interval [t1, tn] and spans
space of all splines of degree k having knots
ti
51
B-splines, continued
52
B-splines, continued
53