WebCab Portfolio Web Services for .NET v5.0 Demo

Interpolation.CubicSpline2ndDifferential Method 

Evaluates the second derivatives of the cubic spline interpolation polynomial at the given functions tabulation points when the first derivative at the boundary (equivalently the end points) is known.

public double[] CubicSpline2ndDifferential(
   double[] tabulationPointsInX,
   double[] functionValuesAtTabulationPoints,
   double derivativeInterpolationAt0,
   double derivativeInterpolationAtn_1
);

Parameters

tabulationPointsInX
An array of doubles which are the values at which the function is tabulated, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i]).
functionValuesAtTabulationPoints
An array of doubles which are the values of the function evaluated at the interpolation points, i.e. functionValuesAtTabulationPoints[i] = f(tabulationPointsInX[i]).
derivativeInterpolationAt0
The first derivative of the interpolation function at the point tabulationPointsInX[0].
derivativeInterpolationAtn_1
The first derivative of the interpolation function at the point tabulatedPointInX[n-1].

Return Value

An array of doubles which are equal to the 2nd derivatives of the interpolation function at the interpolation points.

Remarks

Knowledge of the second derivative is required in order to uniquely determine the cubic spline.

Description of the parameters

Given arrays tabulationPointsInX[0..n-1] and tabulationPointsInY[0..n-1] containing a tabulated function, i.e. tabulationPointsInY[i] = f(tabulationPointsInY[i]), with tabulationPointsInX[0] < tabulationPointsInX[1] < ... < tabulationPointsInX[n-1], and given values derivativeInterpolationAt0 and derivativeInterpolationAtn_1 for the first derivative of the interpolating function at the points tabulationPointsInX[0] and tabulationPointsInX[n-1], respectively. This method returns an array of length n, that contains the second derivatives of the interpolation function at the tabulation points tabulationPointsInX[i]. If derivativeInterpolationAt0 and/or derivativeInterpolationAtn_1 are equal to 1030 or larger, then the method sets the second derivative at the boundary to be zero.

Remark: If the two arrays have different lengths, the shorter one will be used as reference. The two arrays should be at least 2 elements long.

Exceptions

Exception TypeCondition
InterpolationExceptionThrown when the input values do not meet the requirements mentioned above.

See Also

Interpolation Class | Portfolio Namespace