naginterfaces.library.quad.dim2_​fin

naginterfaces.library.quad.dim2_fin(ya, yb, phi1, phi2, f, absacc, data=None)[source]

dim2_fin attempts to evaluate a double integral to a specified absolute accuracy by repeated applications of the method described by Patterson (1968) and Patterson (1969).

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

https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/d01/d01daf.html

Parameters
yafloat

, the lower limit of the integral.

ybfloat

, the upper limit of the integral. It is not necessary that .

phi1callable retval = phi1(y, data=None)

must return the lower limit of the inner integral for a given value of .

Parameters
yfloat

The value of for which the lower limit must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The lower limit of the inner integral for the given value of .

phi2callable retval = phi2(y, data=None)

must return the upper limit of the inner integral for a given value of .

Parameters
yfloat

The value of for which the upper limit must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The upper limit of the inner integral for the given value of .

fcallable retval = f(x, y, data=None)

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

Parameters
xfloat

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

yfloat

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 .

absaccfloat

The absolute accuracy requested.

dataarbitrary, optional

User-communication data for callback functions.

Returns
ansfloat

The estimated value of the integral.

nptsint

The total number of function evaluations.

Raises
NagValueError
(errno )

The outer integral has not converged, and of the inner integrals have not converged with points: . may still contain an approximate estimate of the integral, but its reliability will decrease as increases.

(errno )

The outer integral has converged, but of the inner integrals have not converged with points: . may still contain an approximate estimate of the integral, but its reliability will decrease as increases.

Warns
NagAlgorithmicWarning
(errno )

The outer integral has not converged with points. However, all the inner integrals have converged, and may still contain an approximate estimate of the integral.

Notes

dim2_fin attempts to evaluate a definite integral of the form

where and are constants and and are functions of the variable .

The integral is evaluated by expressing it as

Both the outer integral and the inner integrals are evaluated by the method, described by Patterson (1968) and Patterson (1969), of the optimum addition of points to Gauss quadrature formulae.

This method uses a family of interlacing common point formulae. Beginning with the -point Gauss rule, formulae using , , , , and finally points are derived. Each new formula contains all the points of the earlier formulae so that no function evaluations are wasted. Each integral is evaluated by applying these formulae successively until two results are obtained which differ by less than the specified absolute accuracy.

References

Patterson, T N L, 1968, On some Gauss and Lobatto based integration formulae, Math. Comput. (22), 877–881

Patterson, T N L, 1969, The optimum addition of points to quadrature formulae, errata, Math. Comput. (23), 892