![]()
![]()
Lab for Hermite Polynomial Interpolation
![]()
Background.
Hermite Polynomials. The cubic
Hermite polynomial p(x) has the interpolative properties
,
both the function values and their derivatives are known at the
endpoints of the interval
.
The Hermite polynomial is referred to as a "clamped cubic," where
"clamped" refers to the slope at the endpoints being fixed.
First load Mathematica's graphics package "Colors".
Report to be handed in.
Computer Exercises
Exercise 1. Find the cubic
Hermite polynomial or "clamped cubic" that satisfies
![[Graphics:hp.txtgr5.gif]](hp.txtgr5.gif)
Symbolic differentiation (integration too) is permitted with Mathematica.
Now set up four equations using the prescribed endpoint conditions.
It is useful to form the set of equations to be solved and the set of variables involved in the problem.
Now find the solution set to this linear system and store it in the variable solset.
Remember that we must dig out one set of braces using solset[[1]] before we can use the ReplaceAll command.
![]()
![[Graphics:hp.txtgr19.gif]](hp.txtgr19.gif)
More Background.
Clamped cubic splines.
A clamped cubic spline is obtained by forming a piecewise cubic
function which passes through the given set of knots
with
the condition the function values, their derivatives and second
derivatives of adjacent cubics agree at the interior nodes. The
endpoint conditions are
,
where
are given.
Exercise 2. Find the "clamped
cubic spline" that satisfies
![[Graphics:hp.txtgr24.gif]](hp.txtgr24.gif)
Set up the formulas for the cubic polynomials and form the equations to solve.
Solve for the coefficients and form the cubic functions.
Now graph the portion of each cubic in the interval over which it
is to be used.
Then combine the two piecewise cubic graphs to form the spline.
![]()
![[Graphics:hp.txtgr31.gif]](hp.txtgr31.gif)
Or we could define the piecewise cubic function S[z]:
![]()
![[Graphics:hp.txtgr34.gif]](hp.txtgr34.gif)
The clamped cubic spline forces the slope at the endpoints to be prescribed values.
More Background.
Natural cubic splines.
A natural cubic spline is obtained by forming a piecewise cubic
function which passes through the given set of knots
with
the condition the function values, their derivatives and second
derivatives of adjacent cubics agree at the interior nodes. The
endpoint conditions are
.
The natural cubic spline is said to be "a relaxed curve."
Exercise 3. Find the "natural
cubic spline" that satisfies
![[Graphics:hp.txtgr37.gif]](hp.txtgr37.gif)
Set up the formulas for the cubic polynomials and form the equations to solve.
Solve for the coefficients and form the cubic functions.
Now graph the portion of each cubic in the interval over which it
is to be used.
Then combine the two piecewise cubic graphs to form the spline.
![]()
![[Graphics:hp.txtgr44.gif]](hp.txtgr44.gif)
Or we could define the piecewise cubic function S[z]:
![]()
![[Graphics:hp.txtgr47.gif]](hp.txtgr47.gif)
Notice that the natural cubic spline is different from the clamped cubic spline, it is "a relaxed curve." (and happy too!)
![]()
![]()
(c) John H. Mathews, 1998