Spline Interpolant (Not in Base Package)

Returns an array Interpolant of length n, which contains the second derivatives of the spline interpolating function g(x) at the tabulated points , where i = 0, 1,..., n – 1. Details

Y Array is the input array. If the number of elements in the X Array is different from the number of elements in the Y Array, the VI sets the output Interpolant to an empty array and returns an error.
X Array If the number of elements in the X Array is different from the number of elements in the Y Array, the VI sets the output interpolation value and interpolation error to NaN and returns an error.
initial boundary is the first derivative of interpolating function g(x) at . The default is 10^30, which causes this VI to set the initial boundary condition for a natural spline. Refer to Spline Interpolant Details for a definition of g(x).
final boundary is the first derivative of interpolating function g(x) at . The default is 10^30, which causes this VI to set the final boundary condition for a natural spline.
Interpolant is the second derivative of interpolating function g(x). Interpolant is the second derivative of interpolating function g(x) at points , i = 0, 1,…, n – 1.
error returns any error or warning condition from the VI.

Spline Interpolant Details

Input arrays X Array and Y Array are of length n and contain a tabulated function,

with

initial boundary and final boundary are the first derivative of the interpolating function g(x) at points 0 and n – 1, respectively. g(x) passes all the points formed by inputs X Array and Y Array. The output Interpolant can be used in the Spline Interpolation VI.

If initial boundary and final boundary are equal to or greater than 10^30, the VI sets the corresponding boundary condition for a natural spline, with zero second derivative on that boundary.

The interpolating function g(x) passes through all the points

where i = 0, 1, …, n – 1.

The VI obtains the interpolating function g(x) by interpolating every interval with a cubic polynomial function that meets the following conditions:

  1. g(x) has continuous first and second derivatives everywhere in the range

    :

For the preceding conditions, i = 0, 1, …, n – 2.

From the last condition, we derive the following equations:

These are n – 2 linear equations with n unknowns i = 0, 1, …, n – 1. This VI computes

from initial boundary and final boundary using the formula

Here

You can derive this formula from the preceding conditions. This VI then uses

to solve all the

for i = 1, …, n – 2.

is the output Interpolant. You can use Interpolant as an input to the Spline Interpolation VI to interpolate y at any value of

.