naginterfaces.library.quad.dim1_​fin_​wsing

naginterfaces.library.quad.dim1_fin_wsing(g, a, b, alfa, beta, key, epsabs, epsrel, lw=800, liw=None, data=None)[source]

dim1_fin_wsing is an adaptive integrator which calculates an approximation to the integral of a function over a finite interval :

where the weight function has end point singularities of algebraico-logarithmic type.

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

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

Parameters
gcallable retval = g(x, data=None)

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

Parameters
xfloat

The point at which the function must be evaluated.

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
retvalfloat

The value of evaluated at .

afloat

, the lower limit of integration.

bfloat

, the upper limit of integration.

alfafloat

The argument in the weight function.

betafloat

The argument in the weight function.

keyint

Indicates which weight function is to be used.

.

.

.

.

epsabsfloat

The absolute accuracy required. If is negative, the absolute value is used. See Accuracy.

epsrelfloat

The relative accuracy required. If is negative, the absolute value is used. See Accuracy.

lwint, optional

The value of (together with that of ) imposes a bound on the number of sub-intervals into which the interval of integration may be divided by the function. The number of sub-intervals cannot exceed . The more difficult the integrand, the larger should be.

liwNone or int, optional

Note: if this argument is None then a default value will be used, determined as follows: .

The number of sub-intervals into which the interval of integration may be divided cannot exceed .

dataarbitrary, optional

User-communication data for callback functions.

Returns
resultfloat

The approximation to the integral .

abserrfloat

An estimate of the modulus of the absolute error, which should be an upper bound for .

wfloat, ndarray, shape

Details of the computation see Further Comments for more information.

iwint, ndarray, shape

contains the actual number of sub-intervals used. The rest of the array is used as workspace.

Raises
NagValueError
(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

The maximum number of subdivisions () has been reached: , and .

(errno )

Round-off error prevents the requested tolerance from being achieved: and .

(errno )

Extremely bad integrand behaviour occurs around the sub-interval .

Notes

In the NAG Library the traditional C interface for this routine uses a different algorithmic base. Please contact NAG if you have any questions about compatibility.

dim1_fin_wsing is based on the QUADPACK routine QAWSE (see Piessens et al. (1983)) and integrates a function of the form , where the weight function may have algebraico-logarithmic singularities at the end points and/or . The strategy is a modification of that in dim1_fin_osc_fn(). We start by bisecting the original interval and applying modified Clenshaw–Curtis integration of orders and to both halves. Clenshaw–Curtis integration is then used on all sub-intervals which have or as one of their end points (see Piessens et al. (1974)). On the other sub-intervals Gauss–Kronrod ( point) integration is carried out.

A ‘global’ acceptance criterion (as defined by Malcolm and Simpson (1976)) is used. The local error estimation control is described in Piessens et al. (1983).

References

Malcolm, M A and Simpson, R B, 1976, Local versus global strategies for adaptive quadrature, ACM Trans. Math. Software (1), 129–146

Piessens, R, de Doncker–Kapenga, E, Überhuber, C and Kahaner, D, 1983, QUADPACK, A Subroutine Package for Automatic Integration, Springer–Verlag

Piessens, R, Mertens, I and Branders, M, 1974, Integration of functions having end-point singularities, Angew. Inf. (16), 65–68