Spline Interpolation - Algorithm To Find The Interpolating Cubic Spline

Algorithm To Find The Interpolating Cubic Spline

A third order polynomial for which

can be written in the symmetrical form

(1)

where

(2)

and

(3)

(4)

As one gets that

(5)

(6)

Setting and in (5) and (6) one gets from (2) that indeed, and that

(7)

(8)

If now

are n+1 points and

(9)

where

are n third degree polynomials interpolating in the interval, for such that

for

then the n polynomials together define a differentiable function in the interval and

(10)

(11)

for where

(12)

(13)

(14)

If the sequence is such that in addition

for

the resulting function will even have a continuous second derivative.

From (7), (8), (10) and (11) follows that this is the case if and only if

\frac {k_{i-1}}{x_i-x_{i-1}} + \left(\frac {1}{x_i-x_{i-1}}+ \frac {1}{{x_{i+1}-x_i}}\right)\ 2k_i+
\frac {k_{i+1}}{{x_{i+1}-x_i}} = 3\ \left(\frac {y_i - y_{i-1}}{{(x_i-x_{i-1})}^2}+\frac {y_{i+1} - y_i}{{(x_{i+1}-x_i)}^2}\right)

(15)

for

The relations (15) are n-1 linear equations for the n+1 values .

For the elastic rulers being the model for the spline interpolation one has that to the left of the left-most "knot" and to the right of the right-most "knot" the ruler can move freely and will therefore take the form of a straight line with . As should be a continuous function of one gets that for "Natural Splines" one in addition to the n-1 linear equations (15) should have that

i.e. that

(16)

(17)

(15) together with (16) and (17) constitute n+1 linear equations that uniquely define the n+1 parameters .

Read more about this topic:  Spline Interpolation

Famous quotes containing the words find and/or cubic:

    If I must choose which I would elevate
    The people or the already lofty mountains,
    I’d elevate the already lofty mountains.
    The only fault I find with old New Hampshire
    Is that her mountains aren’t quite high enough.
    Robert Frost (1874–1963)

    One of the great natural phenomena is the way in which a tube of toothpaste suddenly empties itself when it hears that you are planning a trip, so that when you come to pack it is just a twisted shell of its former self, with not even a cubic millimeter left to be squeezed out.
    Robert Benchley (1889–1945)