Module

for

B-Splines

Cubic spline construction using the B-spline function.

Under special circumstances a basis set of splines can be used to form a cubic B-spline function.  This concept makes the construction of a spline very easy, it is just at linear combination:

All we need to do is solve for the   coefficients .  And to make things even more appealing, the linear system to be solved has a tri-diagonal "appearance":

= .

Caution must prevail when solving this underdetermined system of    equations in   unknowns.  Two end conditions must be supplied for constructing the coefficients and .  These end conditions are specially crafted to form either a natural cubic spline or a clamped cubic spline.

How can such an elegant construction possible ?  It's simple, you must have a uniform grid of points   on the interval  .  The uniform spacing is and the interpolation nodes to be used are for  .  The equally spaced abscissa's are

The corresponding ordinates are    and the data points are  .  They are often times referred to as the knots because this is where we join the piecewise cubics, like pieces of string "knotted" together to form a larger piece of string.  If this is your situation, then the B-spline construction is for you.

Caveat. If you have unequally spaced points, then this is construction does not apply and construction of the cubic spline require a more cumbersome algorithm because each piecewise cubic will need to be individually crafted in order to meet all the conditions for a cubic spline.

The basic B-spline function.

Construction of cubic B-spline interpolation can be accomplished by first considering the following basic function.

The function is a piecewise continuous on the interval , it is zero elsewhere.  In advanced courses this simple concept is glamorized by saying that is a function with "compact support."  That is, it is supported (or non-zero) only on a small set.

``````

``````

The graph of the function .

``````
``````

```
Global`B```

Verify that   is a cubic spline.

Each part of   is piecewise cubic.
Are the functions  ,    and    continuous for all   ?
Since    is composed of the piecewise functions ,,,,,, all that is necessary is to see if they join up properly at the nodes  .  However, this will take 15 computations to verify.  This is where Mathematica comes in handy.  Follow the link below if you are interested in the proof.

Proof  B-Splines  B-Splines

The above proof that    is a cubic spline used the formulas ,,,,,.
It is the analytic way to do things and illustrates "precise mathematical" reasoning.

If you trust graphs, then just look at the graphs of  ,  ,  and   and try to determine if they are continuous.
However, there might be problems lurking about.  If you seek the mathematical truth you should look at the next cell link.

A careful look at the derivatives.  B-Splines  B-Splines

Let's translate the B-spline over to the node and use the uniform step size .

``````

```
```

Now form the linear combination for the spline.

``````

```

```

At each of the nodes for   computation will reveal that

``````

```

```

```

```

```

```

```

```

```
```

If the B-spline is to go through the points   for  , then the following equations must hold true

for   .

For the natural cubic spline, we want the second derivatives to be zero at the left endpoint  .

Therefore we must have   .

Computation will reveal that

To construct the natural cubic spline, we must have

.

We can solve this equation for the spline coefficient

``````

```
```

For the natural cubic spline, we want the second derivatives to be zero at the right endpoint  .

Therefore we must have   .

Computation will reveal that

To construct the natural cubic spline, we must have

.

We can solve this equation for the spline coefficient

``````

```
```

The above construction shows how to calculate all the coefficients .

``````

```

```

Computer Programs  B-Splines  B-Splines

Method I.  B-spline construction using equations.

Illustration using 7 knots.

The following example uses  n = 6.  There are  n+3 = 9  equations to solve and  n+1 = 7  data points or knots.  First set up the 9 equations to be solved.

``````

```

```

Example 1.  Construct the natural cubic spline for the 7 points
This requires that the spline has the second derivative endpoint constraints   .
Solution 1.

Example 2.  The construction in Example 1 used the basic functions which have support that is slightly wider than the interval containing the abscissas.
This can be verified by graphing   on a larger interval.
Solution 2.

Research Experience for Undergraduates

B-Splines  B-Splines  Internet hyperlinks to web sites and a bibliography of articles.

Return to Numerical Methods - Numerical Analysis

(c) John H. Mathews 2004