Continuing from the previous post, the new xl_Spline-Matrix.zip spreadsheet includes functions for 1D and 2D linear and cubic splines.

The basic 1D spline allows for output of linear splines, or 5 different types of cubic spline, as listed above.

Output may be spline values at listed points, spline parameters for each spline segment, or spline integration or slope.

Additional data allows input of end slopes or curvatures for cubic splines, slope data for hermite splines, or end type and tension for Catmull-Rom splines:

The screenshots below show input and results for all six spline types, passing through 5 points:

Output of spline segment data, integration, and slope and curvature values is shown below:

Input and output for the 2D spline function is shown below.

The screenshots below show 2D splines fitted to tabular data for air density under varying pressure and temperature:

The xl_Spline1DFit function finds the least squares fit of a cubic spline with a specified number of segments, with optional weighting and/or constraints:

Alternative spline fits:

The xl_SplineInt and xl_SplineDiff functions provide integration and differentiation data for any of the spline types. They are equivalent to output options 3 or 4 with the xl_Spline1d function:

### Like this:

Like Loading...

*Related*

Great article. Nicely pointed out. Thanks for sharing.

LikeLike