naginterfaces.library.quad.dim1_fin_sing(f, a, b, points, epsabs, epsrel, lw=800, liw=None, data=None)[source]

dim1_fin_sing is a general purpose integrator which calculates an approximation to the integral of a function over a finite interval :

where the integrand may have local singular behaviour at a finite number of points within the integration interval.

Deprecated since version 27.1.0.0: dim1_fin_sing will be removed in naginterfaces 31.3.0.0. Please use dim1_fin_brkpts() instead. See also the Replacement Calls document.

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

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/d01/d01alf.html

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

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

Parameters
xfloat

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 .

afloat

, the lower limit of integration.

bfloat

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

pointsfloat, array-like, shape

The user-specified break-points.

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

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, and .

Constraint: .

(errno )

On entry, break-points are specified outside : and .

(errno )

On entry, .

Constraint: .

(errno )

On entry, is too small. . Minimum possible dimension: .

(errno )

On entry, is too small. . Minimum possible dimension: .

Warns
NagAlgorithmicWarning
(errno )

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

(errno )

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

(errno )

Extremely bad integrand behaviour occurs around the sub-interval .

(errno )

Round-off error is detected in the extrapolation table.

(errno )

The integral is probably divergent or slowly convergent.

Notes

dim1_fin_sing is based on the QUADPACK routine QAGP (see Piessens et al. (1983)). It is very similar to dim1_fin_bad(), but allows you to supply ‘break-points’, points at which the integrand is known to be difficult. It employs an adaptive algorithm, using the Gauss -point and Kronrod -point rules. The algorithm, described in de Doncker (1978), incorporates a global acceptance criterion (as defined by Malcolm and Simpson (1976)) together with the -algorithm (see Wynn (1956)) to perform extrapolation. The user-supplied ‘break-points’ always occur as the end points of some sub-interval during the adaptive process. The local error estimation is described in Piessens et al. (1983).