class="resources" Spline Interpolant (Not in Base Package) - LabVIEW 7.1 Help - Support - National Instruments
Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

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 x[i], where i = 0, 1, …, n – 1. Details  Example

Y is the array of dependent values. If the number of elements in the X is different from the number of elements in the Y, the VI sets the output Interpolant to an empty array and returns an error.
X is the array of independent values. If the number of elements in the X is different from the number of elements in the Y, the VI sets the output Interpolant to an empty array and returns an error.
initial boundary is the first derivative of interpolating function g(x) at x0, g'x0. The default is 1.00E+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 x[n – 1], g'(x[n – 1]). The default is 1.00E+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 from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Spline Interpolant Details

Input arrays X and Y are of length n and contain a tabulated function, as shown in the following equation.

f(xi) = yi

with

x0 < x1 < …xn – 1

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 and Y.

If initial boundary and final boundary are equal to or greater than 1030, 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

{xi, yi}, g(xi) = yi

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

The VI calculates the interpolating function g(x) by interpolating every interval [xi, xi + 1] with a cubic polynomial function pi(x) that meets the following conditions:

  1. pi(xi) = yi
  2. pi(xi + 1) = yi + 1
  3. g(x) has continuous first and second derivatives everywhere in the range [x0, xn – 1]:

    1. p'i(xi) = p'i + 1(xi)
    2. p"i(xi) = p"i + 1(xi)

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

x0 x xn – 1.

Example

Refer to the Interpolation Solver VI in the labview\examples\analysis\intpxmpl.llb directory for an example of using the Spline Interpolant VI.

 


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit