naginterfaces.library.quad.md_​simplex

naginterfaces.library.quad.md_simplex(ndim, vert, f, minord, finvls, data=None)[source]

md_simplex returns a sequence of approximations to the integral of a function over a multidimensional simplex, together with an error estimate for the last approximation.

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

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/d01/d01paf.html

Parameters
ndimint

, the number of dimensions of the integral.

vertfloat, array-like, shape

must be set to the th component of the th vertex for the simplex integration region, for , for . If , must be unchanged since the previous call of md_simplex.

fcallable retval = f(x, data=None)

must return the value of the integrand at a given point.

Parameters
xfloat, ndarray, shape

The coordinates of the point at which the integrand must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The value of the integrand at the given point.

minordint

Must specify the highest order of the approximations currently available in the array .

Indicates an initial call.

Indicates that have already been computed in a previous call of md_simplex.

finvlsfloat, array-like, shape

If , must contain approximations to the integral previously computed by md_simplex.

dataarbitrary, optional

User-communication data for callback functions.

Returns
vertfloat, ndarray, shape

These values are unchanged. The rest of the array is used for workspace and contains information to be used if another call of md_simplex is made with . In particular contains the volume of the simplex.

minordint

.

finvlsfloat, ndarray, shape

Contains these values unchanged, and the newly computed values . is an approximation to the integral of polynomial degree .

esterrfloat

An absolute error estimate for .

Raises
NagValueError
(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

The volume of the simplex integration region is too large or too small to be represented on the machine.

Notes

md_simplex computes a sequence of approximations , for , to an integral

where is an -dimensional simplex defined in terms of its vertices. is an approximation which will be exact (except for rounding errors) whenever the integrand is a polynomial of total degree or less.

The type of method used has been described in Grundmann and Moller (1978), and is implemented in an extrapolated form using the theory from de Doncker (1979).

References

de Doncker, E, 1979, New Euler–Maclaurin Expansions and their application to quadrature over the -dimensional simplex, Math. Comput. (33), 1003–1018

Grundmann, A and Moller, H M, 1978, Invariant integration formulas for the -simplex by combinatorial methods, SIAM J. Numer. Anal. (15), 282–290