Welcome to the L3 Harris Geospatial documentation center. Here you will find reference guides and help documents.
﻿

IMSL_CSINTERP

IMSL_CSINTERP

The IMSL_CSINTERP function computes a cubic spline interpolant, specifying various endpoint conditions. The default interpolant satisfies the not-a-knot condition.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

The IMSL_CSINTERP function computes a C2 cubic spline interpolant to a set of data points (xi, fi) for the following:

i = 0, ..., (N_ELEMENTS(Xdata) – 1) = (n – 1)

The breakpoints of the spline are the abscissas. For all univariate interpolation functions, the abscissas need not be sorted. Endpoint conditions are to be selected by the user. The user can specify not-a-knot, or first or second derivatives at each endpoint or C2 periodicity can be requested (see de Boor 1978, Chapter 4). If no defaults are selected, then the not-a-knot spline interpolant is computed. If the PERIODIC keyword is selected, then all other keywords are ignored and a C2 is computed. In this case, if the Fdata values at the left and right endpoints are not the same, a warning message is issued and the right value is set equal to the left. If the LEFT and ILEFT or RIGHT and IRIGHT keywords are used, the user has the ability to select the values of the first or second derivative at either endpoint. The default case (when the keyword is not used) is the not-a-knot condition on that endpoint. Thus, when no keywords are chosen, this function produces the not-a-knot interpolant.

If the data (including the endpoint conditions) arise from the values of a smooth (for example, C4) function f, i.e., fi = f(xi), then the error behaves in a predictable fashion. Let ξ be the breakpoint vector for the above spline interpolant. Then, the maximum absolute error satisfies: where the following is true: Examples

Example 1

In this example, a cubic spline interpolant to function values is computed and plotted along with the original data. Since the default settings are used, the interpolant is determined by the not-a-knot condition (see de Boor 1978).

x = FINDGEN(11)/10

; Generate the abscissas.
f = SIN(15 * x)

; Generate the function values.
pp = IMSL_CSINTERP(x, f)

; Compute the spline interpolant.
ppval = IMSL_SPVALUE(FINDGEN(100)/99, pp)
PLOT, FINDGEN(100)/99, ppval

; Plot the results.
OPLOT, x, f, Psym = 6 Example 2

In this example, a cubic spline interpolant to function values is computed. The value of the derivative at the left endpoint and the value of the second derivative at the right endpoint are specified. The resulting spline and original data are then plotted as shown in the figure below.

x = FINDGEN(11)/10
y = SIN(15 * x)
pp = IMSL_CSINTERP(x, y, ILeft = 1, Left = 0, \$
IRight = 2, Right = -225 * SIN(15))
ppval = IMSL_SPVALUE(FINDGEN(100)/99, pp)
PLOT, FINDGEN(100)/99, ppval
OPLOT, x, y, Psym = 6 Errors

Warning Errors

MATH_NOT_PERIODIC: Data are not periodic. The rightmost Fdata value is set to the leftmost Fdata value.

Fatal Errors

MATH_DUPLICATE_XDATA_VALUES: The Xdata values must be distinct.

Syntax

Result = IMSL_CSINTERP(Xdata, Fdata [, /DOUBLE] [, /ILEFT=value] [, /IRIGHT=value] [, /LEFT=value] [, /PERIODIC] [, /RIGHT=value])

Return Value

The value of the exponentially scaled modified Bessel function of the first kind of order zero or one evaluated at x.

Arguments

Xdata

One-dimensional array containing the abscissas of the interpolation problem

Fdata

One-dimensional array containing the ordinates for the interpolation problem

Keywords

DOUBLE (optional)

If present and nonzero, then double precision is used.

ILEFT (optional)

Sets the value for the first or second derivative of the interpolant at the left endpoint. The keyword ILEFT is used to specify which derivative is set: ILEFT = 1 for the first derivative and ILEFT = 2 for the second derivative. The only valid values for ILEFT are 1 or 2. If ILEFT is specified, then the keyword LEFT also must be used.

IRIGHT (optional)

Sets the value for the first or second derivative of the interpolant at the right endpoint. The keyword IRIGHT is used to specify which derivative is set: IRIGHT = 1 for the first derivative and IRIGHT = 2 for the second derivative. The only valid values for IRIGHT are 1 or 2. If IRIGHT is specified, then the keyword RIGHT also must be used.

LEFT (optional)

Sets the value for the first or second derivative of the interpolant at the left endpoint. Use with the keyword ILEFT. If ILEFT = i, then the interpolant s satisfies

s(i)(xL) = LEFT. Here, xL is the leftmost abscissa.

PERIODIC (optional)

If present and nonzero, computes the C2 periodic interpolant to the data. The following is satisfied:

s(i) (xL) = s(i) (xR)      i = 0, 1, 2

where s, xL, and xR are defined above.

RIGHT (optional)

Sets the value for the first or second derivative of the interpolant at the right endpoint. Use with the keyword IRIGHT. If IRIGHT = i, then the interpolant s satisfies

s(i)(xR) = RIGHT. Here, xR is the rightmost abscissa.

Version History

 6.4 Introduced

© 2019 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us