[Math] cubic spline interpolation – derivative known –

cubicsinterpolation

I at the moment trying to understand how to apply the interpolation method stated above.

I have been given a start and end position, and for both position i know what their slope is. $\dot{X_a} = \alpha$ and $\dot{X_b} = \beta$ a,b being the start- and end position.

So far i see these as the required information for even being able to to solve the interpolation curve.

The note i am using states this.

Equations

the first and second equation makes sense. I don't get how the last two equate each other, as they could potentially (very likely) explain two different curves, and thus not equate each other. Is this an error in my note, or am i missing something here?

Best Answer

From the last equations, they are defining the cubic splines as follows:

$$S_i(t)=a_it^3+b_it^2+c_it+d_i, \quad \quad t_{i-1}\leq t \leq t_i\\ S_{i+1}(t)=a_{i+1}t^3+b_{i+1}t^2+c_{i+1}t+d_{i+1}, \quad \quad t_{i}\leq t \leq t_{i+1}$$

The second last equation states that at the end points, the first derivative of the right end point of the $i-1$'s interval (which is $t_i$) should be equal to the first derivative of the left end point of the $i$'s interval (which is also $t_i$).

The left hand side of the equation comes from $S_i(t)$. The right hand side comes from $S_{i+1}(t)$.

Same ideal applying to the second derivative gives you the last equation.

Notice that all the coefficients $a_i,...,d_i$ in each interval are to be determined. So there is no contradiction.

In each interval there are four unknown coefficients to determine. These give two equations. Combining with the equations that states the continuity on both end points will provide four equations to determine the four coefficients:

$$a_it_i^3+b_it_i^2+c_it_i+d_i=a_{i+1}t_i^3+b_{i+1}t_i^2+c_{i+1}t_i+d_{i+1}$$

Here is a picture: enter image description here

The only known information is the velocity at $t_0$ and $t_N$. This is given by the first two equations. At each other end points (the intermediate $t_i$'s), you can only equate the velocity from either side.