naginterfaces.library.quad.md_gauss¶
- naginterfaces.library.quad.md_gauss(nptvec, weight, abscis, f, data=None)[source]¶
md_gauss
computes an estimate of a multidimensional integral (from to dimensions), given the analytic form of the integrand and suitable Gaussian weights and abscissae.For full information please refer to the NAG Library document for d01fb
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/d01/d01fbf.html
- Parameters
- nptvecint, array-like, shape
must specify the number of points in the th dimension of the summation, for .
- weightfloat, array-like, shape
Must contain in succession the weights for the various dimensions, i.e., contains the th weight for the th dimension, with
- abscisfloat, array-like, shape
Must contain in succession the abscissae for the various dimensions, i.e., contains the th abscissa for the th dimension, with
- 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 evaluated at .
- dataarbitrary, optional
User-communication data for callback functions.
- Returns
- mdintfloat
The estimate of the integral.
- Raises
- NagValueError
- (errno )
On entry, is too small. . Minimum possible dimension: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Notes
md_gauss
approximates a multidimensional integral by evaluating the summationgiven the weights and abscissae for a multidimensional product integration rule (see Davis and Rabinowitz (1975)). The number of dimensions may be anything from to .
The weights and abscissae for each dimension must have been placed in successive segments of the arrays and ; for example, by calling
dim1_gauss_wres()
ordim1_gauss_wgen()
once for each dimension using a quadrature formula and number of abscissae appropriate to the range of each and to the functional dependence of on .If normal weights are used, the summation will approximate the integral
where is the weight function associated with the quadrature formula chosen for the th dimension; while if adjusted weights are used, the summation will approximate the integral
You must supply a function to evaluate
at any values of within the range of integration.
- References
Davis, P J and Rabinowitz, P, 1975, Methods of Numerical Integration, Academic Press