naginterfaces.library.fit.dim2_​cheb_​eval

naginterfaces.library.fit.dim2_cheb_eval(mfirst, k, l, x, xmin, xmax, y, ymin, ymax, a)[source]

dim2_cheb_eval evaluates a bivariate polynomial from the rectangular array of coefficients in its double Chebyshev series representation.

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

https://support.nag.com/numeric/nl/nagdoc_30/flhtml/e02/e02cbf.html

Parameters
mfirstint

The index of the first and last value in the array at which the evaluation is required respectively (see Further Comments).

kint

The degree of and of , respectively, in the polynomial.

lint

The degree of and of , respectively, in the polynomial.

xfloat, array-like, shape

, for , must contain the values at which the evaluation is required.

xminfloat

The lower and upper ends, and , of the range of the variable (see Notes).

The values of and may depend on the value of (e.g., when the polynomial has been derived using dim2_cheb_lines()).

xmaxfloat

The lower and upper ends, and , of the range of the variable (see Notes).

The values of and may depend on the value of (e.g., when the polynomial has been derived using dim2_cheb_lines()).

yfloat

The value of the coordinate of all the points at which the evaluation is required.

yminfloat

The lower and upper ends, and , of the range of the variable (see Notes).

ymaxfloat

The lower and upper ends, and , of the range of the variable (see Notes).

afloat, array-like, shape

The Chebyshev coefficients of the polynomial. The coefficient defined according to the standard convention (see Notes) must be in .

Returns
fffloat, ndarray, shape

gives the value of the polynomial at the point , for .

Raises
NagValueError
(errno )

On entry, , and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

Unexpected internal failure when evaluating the polynomial.

Notes

This function evaluates a bivariate polynomial (represented in double Chebyshev form) of degree in one variable, , and degree in the other, . The range of both variables is to . However, these normalized variables will usually have been derived (as when the polynomial has been computed by dim2_cheb_lines(), for example) from your original variables and by the transformations

(Here and are the ends of the range of which has been transformed to the range to of . and are correspondingly for . See Further Comments). For this reason, the function has been designed to accept values of and rather than and , and so requires values of , etc. to be supplied by you. In fact, for the sake of efficiency in appropriate cases, the function evaluates the polynomial for a sequence of values of , all associated with the same value of .

The double Chebyshev series can be written as

where is the Chebyshev polynomial of the first kind of degree and argument , and is similarly defined. However the standard convention, followed in this function, is that coefficients in the above expression which have either or zero are written , instead of simply , and the coefficient with both and zero is written .

The function first forms , with replaced by , for each of . The value of the double series is then obtained for each value of , by summing , with replaced by , over . The Clenshaw three term recurrence (see Clenshaw (1955)) with modifications due to Reinsch and Gentleman (1969) is used to form the sums.

References

Clenshaw, C W, 1955, A note on the summation of Chebyshev series, Math. Tables Aids Comput. (9), 118–120

Gentleman, W M, 1969, An error analysis of Goertzel’s (Watt’s) method for computing Fourier coefficients, Comput. J. (12), 160–165