Locally Determined Splines

Instructor Note: Here you can read about a trick used to avoid propagation of variations, which is done by 'cutting' each segment from the others.

The shape-preserving local spline features artificially computed 1st-order derivatives at all nodes (dj, j = 1, N +1 ). Hence, it does not propagate variations as a global spline does. Indeed, the boundary conditions on the coordinates and the 1st-order derivatives (4 per each interval) determine each third-order polynomial segment completely, so there is no need to look for any extra equations.

Let's start by deriving dj, j = 2,N first. To compute these 1st-order derivatives at the intermediate nodes, very simple natural heuristic rules are employed:

If j-1j ≤ 0, where , then we set dj = 0;

Otherwise, di is a weighted harmonic mean expressed as

   

with the weight wj determined by lengths of two adjacent intervals as in this example,

Now, assuming that we have terminal derivatives y'1 and y'N+1, the conditions for deriving 4N unknown coefficients become

Instructor Note: Here you can read more about the so-called 'osculatory' interpolation.

For easy reference, the conditions for deriving unknown coefficients relying on y'1 and y'N+1 are repeated here:

You might ask if it is possible to avoid assigning the 1st-order derivatives at the endpoints. The answer is yes! We may use some heuristic rules to compute the 1st-order derivatives at the endpoints as well.

To this end, the piecewise cubic Hermite or 'osculatory' interpolation (another name for the local spline) uses one-sided (non-centered) three-point formulas to approximate these derivatives:


After computing these endpoint derivatives, two additional checks apply. First, if the sign of d1 happens to differ from the sign of d2, then d1 is set to zero (the same with dN+1 and dN). Second, if the node 2(N) is found to be a discrete local extremum, then the derivative d1 (dN+1) is limited to 3delta1 (3deltaN).

Instructor Note: Explore the original 'osculatory' and slope-varying local splines using this interactive media. You are welcome to compare these to the splines determined globally.



Open interactive graph full screen.

Click on the 'MATLAB Interpolating Functions' button in the left navigation area to see a list of MATLAB commands relevant to the subject of this tutorial.


Back to top.