Module for Cubic Splines
Check out the new Numerical Analysis Projects page.
Cubic Spline
Interpolant. Suppose
that
are n+1 points,
where
. The
function
is
called a cubic
spline if there
exists n cubic
polynomials
with
coefficients
that
satisfy the properties:
I. ![]()
for
.
II.
for
.
The spline passes through each data
point.
III.
for
.
The
spline forms a continuous function over [a,b].
IV.
for
.
The
spline forms a smooth function.
IV.
for
.
The
second derivative is continuous.
Natural
Spline. There
exists a unique cubic spline with the free boundary
conditions
and
.
Remark. The
natural spline is the curve obtained by forcing a flexible elastic
rod through the points but letting the slope at the ends be free to
equilibrate to the position that minimizes the oscillatory behavior
of the curve. It is useful for fitting a curve to
experimental data that is significant to several significant
digits.
Program
(Natural Cubic Spline). To
construct and evaluate the cubic spline interpolant
for the
data points
, using
the free boundary
conditions
and
.
Mathematica Subroutine (Natural Cubic Spline).
![[Graphics:Images/CubicSplinesMod_gr_24.gif]](Images/CubicSplinesMod_gr_24.gif)
Example
1. Construct the natural cubic spline for the
points
that
has the endpoint constraints
.
Solution
1.
Example
2. Construct the natural cubic spline for the
points
that
has the endpoint constraints
.
Use Mathematica's procedure SplineFit.
Remark. There are five
popular types of splines: natural
spline, clamped spline, extrapolated spline, parabolically terminated
spline, endpoint curvature adjusted spline.
When Mathematica constructs a cubic spline it uses the
"natural cubic spline."
Solution
2.
Clamped
Spline. There
exists a unique cubic spline with the first derivative boundary
conditions
and
.
A property of
clamped cubic splines.
A
practical feature of splines is the minimum of the oscillatory
behavior they possess. Consequently, among all functions
f(x) which are twice continuously differentiable on [a,b] and
interpolate a given set data points
, the cubic spline has "less wiggle." The next result
explains this phenomenon.
Theorem
(Minimum property of clamped cubic splines). Assume
that
and
is
the unique clamped cubic spline interpolant
for
which passes through
and satisfies the clamped end conditions
and
. Then
![]()
.
Program
(Clamped Cubic Spline). To
construct and evaluate the cubic spline
interpolant S(x) for
the n+1 data
points
, using
the first derivative boundary
conditions
and
.
![[Graphics:Images/CubicSplinesMod_gr_52.gif]](Images/CubicSplinesMod_gr_52.gif)
Example
3. Construct the clamped cubic spline for the
points
that
has the endpoint constraints
.
Solution
3.
Research Experience for Undergraduates
Cubic
Splines Cubic
Splines
Internet hyperlinks to web sites and a bibliography of
articles.
Downloads (Cubic
Splines Cubic
Splines).
Download this Mathematica notebook.
(c) John H. Mathews 2003