Chapter 3, Interpolation and Extrapolation
Chapter 3, Interpolation and Extrapolation
Extrapolation
Interpolation & Extrapolation
(xi,yi)
1 x1 x2
1 xN 1
1
c0 y1
2 N 1
1 x2 x2 x2 c1 y
2
N 1
1 xN xN cN 1 yN
2
x N
1/ p
x p
| x1 | | x2 |
p p
| xN | p
• Matrix norm
|| Ax ||
A sup
x 0 || x ||
sup: supremum
Commonly Used Norms
• Vector norm
N N
|| x ||1 | x j |, || x ||2 j
x 2
j 1 j 1
|| x || max | x j |
j
• Matrix norm
N
|| A ||1 max | aij |, || A ||2 Where μ is the maximum
j
i 1 eigenvalue of matrix ATA.
N
|| A || max | aij |
i
j 1
Lagrange’s Formula
• It can be verified that the solution to the
Vandermonde equation is given by the
N
formula below:
N ( x x j )
f ( x) li ( x) yi , li ( x) N
j i , j 1
i 1
( xi x j )
j i , j 1
Italian-French mathematician
associated with many classic
mathematics and physics –
Lagrange multipliers in
minimization of a function,
Lagrange’s interpolation
formula, Lagrange’s theorem in
group theory and number
theory, and the Lagrangian
(L=T-V) in mechanics and
Euler-Lagrange equations.
Neville’s Algorithm
• Evaluate Lagrange’s interpolation formula
f(x) at x, given the data points (xi,yi).
• Interpolation tableau P
x1: y1 = P1
P12
x2: y2 = P2 P123
P23 P1234
x3: y3 = P3 P234 Pi,i+1,i+2,…,i+n is a polynomial of
P34 degree n in x that passes
through the points (xi,yi),
x4: y4 = P4 (xi+1,yi+1), …, (xi+n,yi+n) exactly.
Determine P12 from P1 & P2
• Given the value P1 and P2 at x=x1 and x2,
we find linear interpolation
P12(x) = λ(x) P1+[1-λ(x)] P2
Since P12(x1) = P1 and P12(x2) = P2, we
must have
λ(x1) = 1, λ(x2) = 0
so
λ(x) = λ12= (x-x2)/(x1-x2)
Determine P123 from P12 & P23
• We write
P123(x) = λ(x) P12(x) + [1-λ(x)] P23(x)
P123(x2) = P2 already for any choice of λ(x). We
require that P123(x1)=P12(x1) =P1 and
P123(x3)=P23(x3) =P3, thus λ(x1) = 1, λ(x3) = 0
Or
x x3
( x) 13
x1 x3
Recursion Relation for P
• Given two m-point interpolated value P
constructed from point i,i+1,i+2,…,i+m-1,
and i+1,i+2,…,i+m, the next level m+1
point interpolation from i to i+m is a convex
combination:
Pi (i 1)(i 2)...(i m ) ( x) Pi (i 1)...(i m 1) 1 ( x) P(i 1)(i 2)...(i m )
x xi m
where ( x) (i )(i m )
xi xi m
Use Small Difference C & D
P1 C1,1 = P12-P1 ( xi x)(Cm,i 1 Dm,i )
Cm1,i
P12 xi xi m1
D1,1 C2,1=P123-P12
P123
P2
D2,1
C1,2 C3,1=P1234-P123
P23
D1,2 P1234
C2,2
P3 P234 D3,1=P1234-P234
C1,3
P34 D2,2=P234-P34
P0
P =λ PA + (1-λ)PB
C1=PB –P0 D2=P-PB
PB
C2 P PA P P0 (PA P0 ) D2 (C1 D1 )
PA (1 )PB P0 (PA P0 )
(1 )(C1 D1 )
• Evaluate f(3) given 4-points (0,1), (1,2),
(2,3),(4,0).
C0,1=1 Cm1,i (1 (i )(i m 1) )(Cm,i 1 Dm,i )
x1=0, y1=1 =P1
C1,1 = 3 x xi m1
D0,1=1 (i )(i m1)
xi xi m1
C2,1= 0
C0,2=2 D1,1= 2
P23(x)
(x5,y5)
x
Piecewise Polynomial Interpolation
y
Discontinuous derivatives
across segment
P1234(x)
P1234(x)
(x2,y2) (x3,y3) P2345(x)
(x5,y5)
x
Cubic Spline
• Given N points (xi,yi), i=1,2,…,N, for each
interval between points i to i+1, fit to cubic
polynomials such that Pi(xi)=yi and
Pi(xi+1)=yi+1.
• Make 1st and 2nd derivatives continuous
across intervals, i.e., Pi(n)(xi+1) = P(n)i+1(xi+1),
n = 1 and 2.
• Fix boundary condition to P’’(x1 or N)=0, or
P’(x1 or N ) = const, to completely specify.
Reading
• NR, Chapter 3