Splines Interpolation
Splines Interpolation
Cubic splines
An example of a cubic spline that interpolates the same points (1,2), (2,1), (4,4),
and (5,3) is shown in Figure (b). The equations defining the spline are
Note the smooth transition from one Si to the next at the base points, or
“knots,’’ x = 2 and x = 4.
Warning!
“Given n points (x1,y1), . . . , (xn,yn), there is obviously one and only one linear
spline through the data points. This will not be true for cubic splines. We
will find that there are infinitely many through any set of data points. Extra
conditions will be added when it is necessary to nail down a particular spline
of interest.”
Properties of splines
To be a little more precise about the properties of a cubic spline, we make the
following definition: Assume that we are given the n data points (x1,y1), . . . ,
(xn,yn), where the xi are distinct and in increasing order. A cubic spline S(x)
through the data points (x1,y1), . . . , (xn,yn) is a set of cubic polynomials
These polynomials have the following properties:
We must check S1”(2) = S2”(2) and S2”(4) = S3”(4), both of which are
true so we can conclude that defining equations are in fact cubic
splines.
Constructing a spline from a set of data points means finding the coefficients bi,ci,di
that make Properties 1–3 hold. However, we need to impose some additional
conditions for the within part and end points of the splines. For the moment, we
can start with the natural splines:
Example 2
Find the natural cubic spline through (0,3), (1,−2), and (2,1)
The x-coordinates are x1 = 0, x2 = 1, and x3 = 2. The y-coordinates are a1 =
y1 = 3, a2 = y2 = −2, and a3 = y3 = 1, and the differences are δ1 = δ2 = 1, Δ1 =−5,
and Δ2 = 3. The tridiagonal matrix equation is