
MATH 441/541 - Numerical Analysis
Eighth Meeting: Interpolation
Thursday, October 18th, 2007
Interpolation And Polynomial Approximation
ā¢Section 3.4 Cubic Spline Interpolation
1. Piecewise Polynomial Approximations
āāGlobal interpolationā versus ālocal interpolationā:
āVarying degree piecewise polynomial approximations and associated degrees of freedom:
(a) Piecewise Constant Interpolation
(b) Piecewise Linear Interpolation
(c) Piecewise Quadratic Interpolation
(d) Piecewise Cubic Interpolation ...
2. Cubic Splines
The most common piecewise-polynomial approximation.
āDefinition: Cubic Spline Interpolant
Given a function fdefined on [a, b] and a set of nodes a=x0< x1<Ā· Ā· Ā· < xn=b, a cubic
spline interpolant Sfor fis a function that satisfies where S(x) is a cubic polynomial,
denoted Sj(x), on the subinterval [xj, xj+1] for each j= 0,1,Ā· Ā· Ā· , n ā1; that satisfies the
following conditions:
(a) Interpolation Condition: S(xj) = f(xj) for each j= 0,1,Ā· Ā· Ā· , n;
(b) Continuity of Interpolant: Sj+1(xj+1 ) = Sj(xj+1) for each j= 0,1,Ā· Ā· Ā· , n ā2;
(c) Continuity of the Derivative: S0
j+1(xj+1) = S0
j(xj+1) for each j= 0,1,Ā· Ā· Ā· , n ā2;
(d) Continuity of the Second Derivative: S00
j+1(xj+1) = S00
j(xj+1) for each j= 0,1,Ā· Ā· Ā· , n ā2;
(e) One of the following sets of boundary conditions is satisfied:
i. Free or Natural Boundary: S00 (x0) = S00(xn) = 0 (Natural Spline)
ii. Clamped Boundary: S0(x0) = f0(x0) and S0(xn) = f0(xn) (Complete Cubic Spline)
iii. Not-a-Knot Condition: S00 is linear across [x0, x2] and [xnā2, xn] (i.e. you are
fitting a cubic polynomial across [x0, x2] and a cubic polynomial across [xnā2, xn]).
iv. Parabolic Endpoints: S00(x0) = S00(x1) and S00(xnā1) = S00 (xn) (i.e. the cubics
approach parabolas at their extremities.)
āA picture:
āThe general formula:
On each subinterval j,j= 0,Ā· Ā· Ā· , n ā1, we have
Sj(x) = aj+bj(xāxj) + cj(xāxj)2+dj(xāxj)3
āExample (Problem #12 from Section 3.4, p. 154):
Suppose we have a clamped cubic spline, s(x), for data from some function f(x) defined on
[1,3] and given by:
s(x) = (s0(x) = 3(xā1) + 2(xā1)2ā(xā1)3,if 1 ā¤x < 2
s1(x) = a+b(xā2) + c(xā2)2+d(xā2)3if 2 ā¤xā¤3
Given f0(1) = f0(3), find a,b,c, and d.
āSplines in MATLAB
1