WebCab Functions for .NET v2.0

Interpolation.CubicSpline2ndDifferential Method 

Calculates 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 given.

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 where the k-th term corresponds to the value of the second derivative of the cubic spline interpolation polynomial of the k-th tabulation point. Note that the length of the returned array will be equal to the number of points at which the function is tabulated.

Remarks

The values of the second derivatives can be used within CubicSplinePointwisePreEvaluation in order to evaluate the interpolation function at a given point.

Details

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.

Remarks of this methods application

Exceptions

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

See Also

Interpolation Class | WebCab.Libraries.Math.Interpolation Namespace