# naginterfaces.library.quad.dim1_​inf_​wtrig¶

naginterfaces.library.quad.dim1_inf_wtrig(g, a, omega, key, epsabs, limlst=50, lw=800, liw=None, data=None)[source]

dim1_inf_wtrig calculates an approximation to the sine or the cosine transform of a function over :

(for a user-specified value of ).

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

https://www.nag.com/numeric/nl/nagdoc_29/flhtml/d01/d01asf.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.

omegafloat

The argument in the weight function of the transform.

keyint

Indicates which integral is to be computed.

.

.

epsabsfloat

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

limlstint, optional

An upper bound on the number of intervals needed for the integration.

lwint, optional

The value of (together with that of ) imposes a bound on the number of sub-intervals into which each interval 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 each interval 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 .

lstint

The number of intervals actually used for the integration.

erlstfloat, ndarray, shape

contains the error estimate corresponding to the integral contribution over the interval , for .

rslstfloat, ndarray, shape

contains the integral contribution over the interval , for .

ierlstint, ndarray, shape

contains the error flag corresponding to , for .

In the cases = 7, 8 or 9, additional information about the cause of the error can be obtained from the array , as follows:

The maximum number of has been achieved on the th interval.

Occurrence of round-off error is detected and prevents the tolerance imposed on the th interval from being achieved.

Extremely bad integrand behaviour occurs at some points of the th interval.

The integration procedure over the th interval does not converge (to within the required accuracy) due to round-off in the extrapolation procedure invoked on this interval. It is assumed that the result on this interval is the best which can be obtained.

The integral over the th interval is probably divergent or slowly convergent. It must be noted that divergence can occur with any other value of .

iwint, ndarray, shape

contains the maximum number of sub-intervals actually used for integrating over any of the intervals . 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, .

Constraint: .

Warns
NagAlgorithmicWarning
(errno )

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

(errno )

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

(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.

(errno )

Bad integration behaviour occurs within interval : : . Inspect for more details.

(errno )

The maximum number of intervals () has been reached: . Inspect for more details.

(errno )

Extrapolation does not converge to the requested accuracy. Inspect for more details.

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_inf_wtrig is based on the QUADPACK routine QAWFE (see Piessens et al. (1983)). It is an adaptive function, designed to integrate a function of the form over a semi-infinite interval, where is either or .

Over successive intervals

integration is performed by the same algorithm as is used by dim1_fin_wtrig(). The intervals are of constant length

where represents the largest integer less than or equal to . Since equals an odd number of half periods, the integral contributions over succeeding intervals will alternate in sign when the function is positive and monotonically decreasing over . The algorithm, described in Piessens et al. (1983), incorporates a global acceptance criterion (as defined by Malcolm and Simpson (1976)) together with the -algorithm (see Wynn (1956)) to perform extrapolation. The local error estimation is described by Piessens et al. (1983).

If and , the function uses the same algorithm as dim1_inf_general() (with ).

In contrast to the other functions in submodule quad, dim1_inf_wtrig works only with an absolute error tolerance (). Over the interval it attempts to satisfy the absolute accuracy requirement

where , for and .

However, when difficulties occur during the integration over the th sub-interval such that the error flag is nonzero, the accuracy requirement over subsequent intervals is relaxed. See Piessens et al. (1983) for more details.

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

Wynn, P, 1956, On a device for computing the transformation, Math. Tables Aids Comput. (10), 91–96