nag_1d_quad_inf_wt_trig (d01asc) calculates an approximation to the sine or the cosine transform of a function
over
:
(for a user-specified value of
).
nag_1d_quad_inf_wt_trig (d01asc) is based upon the QUADPACK routine QAWFE (
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
nag_1d_quad_wt_trig (d01anc). 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 by
Piessens et al. (1983), incorporates a global acceptance criterion (as defined by
Malcolm and Simpson (1976)) together with the
-algorithm (
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
nag_1d_quad_inf (d01amc) (with
).
In contrast to most other functions in
Chapter d01, nag_1d_quad_inf_wt_trig (d01asc) works only with a user-specified absolute error tolerance (
epsabs). Over the interval
it attempts to satisfy the absolute accuracy requirement
where
, for
and
.
However, when difficulties occur during the integration over the
th interval
such that the error flag
is nonzero, the accuracy requirement over subsequent intervals is relaxed. See
Piessens et al. (1983) for more details.
Malcolm M A and Simpson R B (1976) Local versus global strategies for adaptive quadrature ACM Trans. Math. Software 1 129–146
- In the cases where , additional information about the cause of the error can be obtained from the array , as follows:
-
- The maximum number of subdivisions 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 .
- If users declare and initialize fail and set as recommended then
- may be produced supplemented by messages indicating more precisely where problems were encountered by the function. However, if the default error handling, NAGERR_DEFAULT, is used then one of the following errors may occur. Please note the program will terminate when the first of such errors is detected.
- NE_ALLOC_FAIL
Dynamic memory allocation failed.
- NE_BAD_PARAM
On entry, argument
wt_func had an illegal value.
- NE_INT_ARG_LT
On entry, .
Constraint: .
On entry,
max_num_subint must not be less than 1:
.
- NE_QUAD_BAD_SPEC_INT
Bad integrand behaviour occurs at some points of the interval.
over sub-interval .
- NE_QUAD_BAD_SUBDIV
Extremely bad integrand behaviour occurs around the sub-interval
.
The same advice applies as in the case of
NE_QUAD_MAX_SUBDIV.
- NE_QUAD_BAD_SUBDIV_INT
Bad integration behaviour has occurred within one or more intervals.
- NE_QUAD_DIVERGENCE_SPEC_INT
The integral is probably divergent on the interval.
over sub-interval .
The extrapolation table constructed for convergence acceleration of the series formed by the integral contribution over the integral does not converge.
- NE_QUAD_MAX_INT
Maximum number of intervals allowed has been achieved. Increase the value of
maxintervals.
- NE_QUAD_MAX_SUBDIV
The maximum number of subdivisions has been reached: .
The maximum number of subdivisions within an interval has been reached without the accuracy requirements being achieved. Look at the integrand in order to determine the integration difficulties. If the position of a local difficulty within the interval can be determined (e.g., a singularity of the integrand or its derivative, a peak, a discontinuity, etc.) you will probably gain from splitting up the interval at this point and calling this function on the infinite subrange and an appropriate integrator on the finite subrange. Alternatively, consider relaxing the accuracy requirements specified by
epsabs or increasing the value of
max_num_subint.
- NE_QUAD_MAX_SUBDIV_SPEC_INT
The maximum number of subdivisions has been reached,
on the interval.
over sub-interval .
- NE_QUAD_NO_CONV
The integral is probably divergent or slowly convergent.
Please note that divergence can also occur with any error exit other than
NE_INT_ARG_LT,
NE_BAD_PARAM or
NE_ALLOC_FAIL.
- NE_QUAD_NO_CONV_SPEC_INT
The integral has failed to converge on the interval.
over sub-interval .
- NE_QUAD_ROUNDOFF_ABS_TOL
Round-off error prevents the requested tolerance from being achieved:
.
The error may be underestimated. Consider relaxing the accuracy requirements specified by
epsabs.
Round-off error is detected during extrapolation.
The requested tolerance cannot be achieved, because the extrapolation does not increase the accuracy satisfactorily; the returned result is the best that can be obtained.
The same advice applies as in the case of
NE_QUAD_MAX_SUBDIV.
- NE_QUAD_ROUNDOFF_TOL_SPEC_INT
Round-off error prevents the requested tolerance from being achieved on the interval.
over sub-interval .
nag_1d_quad_inf_wt_trig (d01asc) cannot guarantee, but in practice usually achieves, the following accuracy:
where
epsabs is the user-specified absolute error tolerance. Moreover it returns the quantity
abserr which, in normal circumstances, satisfies
The time taken by nag_1d_quad_inf_wt_trig (d01asc) depends on the integrand and on the accuracy required.
None.