Title: Algorithm for Cubic Splines
1Algorithm for Cubic Splines
2Boundary Condition for Natural Splines
Boundary conditions for a natural spline y0
yn 0
We can use the Thomas algorithm to solve the
tridiagonal systems of equations.
3Difficult Data
4Difficult Data
11 Points
Spline
The cubic spline interpolation does NOT
oscillates (at least not in this case)
5Difficult Data
5 Points
6Difficult Data
7 Points
7Difficult Data
11 Points
8Difficult Data
21 Points
9A Constant Data Set
Use 11 constant support points
10A Constant Data Set
Use 11 constant support points. Perturb the
middle one
The polynominal exhibits large oscillations away
from the perturbation.
11A Straight Line with Small Random Noise
Use 21 constant support points. Small Random
Noise superposed.
12The Cubic Spline Smoothness Theorem
If g(x) is the natural cubic spline function that
interpolates a twice-continuously differentiable
function f at knots a x0ltx1ltltxnb, then
13The Cubic Spline Smoothness Theorem
If the last term on the rhs would be 0, we would
be finished because then
Lets use integration by parts to show that this
term is indeed 0
14The Cubic Spline Smoothness Theorem
g is a cubic polynominal in each interval, ---gtgt
third derivative is a constant, ci, in each
interval.
15Examples of Natural Cubic Spline Interpolation
16Natural Cubic Spline Interpolation
171st and 2nd Derivatives from Cubic Splines
We can use cubic splines to obtain the first and
second derivative from a series of points
The 2nd derivative is a by-product of our
calculation of the cubic splines.
We had found before that the 1st derivative of a
cubic spline function is given by
18The 1st Derivative
19The 2nd Derivative
20The Ionosphere over Logan
21The Ionosphere over Logan
22The Ionosphere over Logan
For many applications (for example ray tracing)
the 1st derivative of the density profile needs
to be known.