naginterfaces.library.quad.dim1_​gauss_​wres

naginterfaces.library.quad.dim1_gauss_wres(key, a, b, n)[source]

dim1_gauss_wres returns the weights and abscissae appropriate to a Gaussian quadrature formula with a specified number of abscissae. The formulae provided are for Gauss–Legendre, rational Gauss, Gauss–Laguerre and Gauss–Hermite.

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

https://www.nag.com/numeric/nl/nagdoc_28.5/flhtml/d01/d01tbf.html

Parameters
keyint

Indicates the quadrature formula.

Gauss–Legendre quadrature on a finite interval, using normal weights.

Gauss–Laguerre quadrature on a semi-infinite interval, using normal weights.

Gauss–Laguerre quadrature on a semi-infinite interval, using adjusted weights.

Gauss–Hermite quadrature on an infinite interval, using normal weights.

Gauss–Hermite quadrature on an infinite interval, using adjusted weights.

Rational Gauss quadrature on a semi-infinite interval, using adjusted weights.

afloat

The parameters and which occur in the quadrature formulae described in Notes.

bfloat

The parameters and which occur in the quadrature formulae described in Notes.

nint

, the number of weights and abscissae to be returned.

Returns
weightfloat, ndarray, shape

The weights.

abscisfloat, ndarray, shape

The abscissae.

Raises
NagValueError
(errno )

On entry, .

Constraint: , , , , or .

(errno )

The value of and/or is invalid for Gauss-Laguerre quadrature.

On entry, .

On entry, and .

Constraint: .

(errno )

The value of and/or is invalid for Gauss-Hermite quadrature.

On entry, .

On entry, and .

Constraint: .

(errno )

The value of and/or is invalid for rational Gauss quadrature.

On entry, .

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

The -point rule is not among those stored.

On entry: .

-rule used: .

(errno )

Underflow occurred in calculation of normal weights.

Reduce or use adjusted weights: .

(errno )

No nonzero weights were generated for the provided parameters.

Notes

dim1_gauss_wres returns the weights and abscissae for use in the Gaussian quadrature of a function . The quadrature takes the form

where are the weights and are the abscissae (see Davis and Rabinowitz (1975), Fröberg (1970), Ralston (1965) and Stroud and Secrest (1966)).

Weights and abscissae are available for Gauss–Legendre, rational Gauss, Gauss–Laguerre and Gauss–Hermite quadrature, and for a selection of values of (see Parameters).

  1. Gauss–Legendre Quadrature:

    where and are finite and it will be exact for any function of the form

  2. Rational Gauss quadrature, adjusted weights:

    and will be exact for any function of the form

  3. Gauss–Laguerre quadrature, adjusted weights:

    and will be exact for any function of the form

  4. Gauss–Hermite quadrature, adjusted weights:

    and will be exact for any function of the form

  5. Gauss–Laguerre quadrature, normal weights:

    and will be exact for any function of the form

  6. Gauss–Hermite quadrature, normal weights:

    and will be exact for any function of the form

Note: the Gauss–Legendre abscissae, with , , are the zeros of the Legendre polynomials; the Gauss–Laguerre abscissae, with , , are the zeros of the Laguerre polynomials; and the Gauss–Hermite abscissae, with , , are the zeros of the Hermite polynomials.

References

Davis, P J and Rabinowitz, P, 1975, Methods of Numerical Integration, Academic Press

Fröberg, C E, 1970, Introduction to Numerical Analysis, Addison–Wesley

Ralston, A, 1965, A First Course in Numerical Analysis, pp. 87–90, McGraw–Hill

Stroud, A H and Secrest, D, 1966, Gaussian Quadrature Formulas, Prentice–Hall