Back to November Calendar            ←Previous Entry                             Next Entry→

November 11, 2005

Spline Representations III

 

================================

Ok-I can’t quite get the mistake, so I’m going to take a more straightforward approach. We want to specify coefficients for two cubic functions meeting the zero and first order continuity conditions:

                      

Now,  and .  Then, plugging x = 3 into the first cubic and its derivative, we have

                                                          

which is easy to solve:   and

 

Similarly, plugging x = 3 into the second equation and its derivative produces  and  while plugging x = 6 into these produces the system

                                                          

whose solution is  and .  This produces a spline (shown in green and shifted up one unit from its initial position) as shown here

This is well and good, except that it doesn’t meet the second order condition since y”(3) would be –4/3 for the first cubic and  –22/9 for the second.

 

Let’s suppose we know the slope at all control points except the last and that the 2nd order continuity condition is satisfied.  So 

x

0

3

6

y

0

4

1

m

1

1/2

free

Clearly d1 = 0, d2 = 4, c1 = 1 and c2 = ½.  So we need 4 independent equations for a1, a2, b1 and b2: The value of the first cubic at its right endpoint; the slope of the first cubic at its right endpoint yield this 2x2 system

                                                           

which yields b1 = ½  and a1 =  –7/54.

 

The 2nd order continuity condition yields the value of b2:

                                                  

…and the value of the second cubic at its right endpoint yields the final parameter:

                                              

So the spline is

                       

whose green graph overlays the red and blue cubics below:

 

 

So now I get!  To do a cubic-splines thing, one usually starts with more than 4 points (here I have only 3) and one finds the slopes that satisfy the 1st and 2nd order continuity conditions.  Think about degrees of freedom in a cubic: there are 4.