naginterfaces.library.interp.dim1_​ratnl¶

naginterfaces.library.interp.dim1_ratnl(x, f)[source]

dim1_ratnl produces, from a set of function values and corresponding abscissae, the coefficients of an interpolating rational function expressed in continued fraction form.

For full information please refer to the NAG Library document for e01ra

https://www.nag.com/numeric/nl/nagdoc_29/flhtml/e01/e01raf.html

Parameters
xfloat, array-like, shape

must be set to the value of the th data abscissa, , for .

ffloat, array-like, shape

must be set to the value of the data ordinate, , corresponding to , for .

Returns
mint

, the number of terms in the continued fraction representation of .

afloat, ndarray, shape

contains the value of the parameter in , for . The remaining elements of , if any, are set to zero.

ufloat, ndarray, shape

contains the value of the parameter in , for . The are a permuted subset of the elements of . The remaining locations contain a permutation of the remaining , which can be ignored.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, is very close to : , , and .

(errno )

A continued fraction of the required form does not exist.

Notes

dim1_ratnl produces the parameters of a rational function which assumes prescribed values at prescribed values of the independent variable , for . More specifically, dim1_ratnl determines the parameters , for and , for , in the continued fraction

where

and

such that , for . The value of in (1) is determined by the function; normally . The values of form a reordered subset of the values of and their ordering is designed to ensure that a representation of the form (1) is determined whenever one exists.

The subsequent evaluation of (1) for given values of can be carried out using dim1_ratnl_eval().

The computational method employed in dim1_ratnl is the modification of the Thacher–Tukey algorithm described in Graves–Morris and Hopkins (1981).

References

Graves–Morris, P R and Hopkins, T R, 1981, Reliable rational interpolation, Numer. Math. (36), 111–128