# Spline Interpolation (G Dataflow)

Version:

Returns a spline interpolated value at a single value given the tabulated values (x[i], y[i]) and the second derivatives of the cubic spline interpolating function that this node obtains from the Spline Interpolant node.

## Y

Tabulated values of the dependent variable.

## X

Tabulated values of the independent variable.

## interpolant

The second derivative of the cubic spline interpolating function.

You can obtain interpolant from the Spline Interpolant node. The number of elements in the three input arrays X, Y, and interpolant should be the same. Otherwise, this node sets the output interpolation value to NaN and returns an error.

## x value

A single value. x value must fall within the range [X0, Xn - 1].

## error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

## interpolation value

The cubic spline interpolation of f at the single value.

## error out

Error information. The node produces this output according to standard error behavior.

## Algorithm for Calculating the Interpolation Value

The points are formed by the input arrays X and Y.

On the interval [xi, xi + 1], the following equation defines interpolation value y.

$y=A{y}_{i}+B{y}_{i+1}+C{y\prime \prime }_{i}+D{y\prime \prime }_{i+1}$

where

$A=\frac{{x}_{i+1}-x}{{x}_{i+1}-{x}_{i}}$
$B=1-A$
$C=\frac{1}{6}\left({A}^{3}-A\right){\left({x}_{i+1}-{x}_{i}\right)}^{2}$
$D=\frac{1}{6}\left({B}^{3}-B\right){\left({x}_{i+1}-{x}_{i}\right)}^{2}$

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported