d01as calculates an approximation to the sine or the cosine transform of a function over :
(for a user-specified value of ).
Syntax
C# |
---|
public static void d01as( D01..::..D01AS_G g, double a, double omega, int key, double epsabs, out double result, out double abserr, int limlst, out int lst, double[] erlst, double[] rslst, int[] ierlst, out int subintvls, out int ifail ) |
Visual Basic |
---|
Public Shared Sub d01as ( _ g As D01..::..D01AS_G, _ a As Double, _ omega As Double, _ key As Integer, _ epsabs As Double, _ <OutAttribute> ByRef result As Double, _ <OutAttribute> ByRef abserr As Double, _ limlst As Integer, _ <OutAttribute> ByRef lst As Integer, _ erlst As Double(), _ rslst As Double(), _ ierlst As Integer(), _ <OutAttribute> ByRef subintvls As Integer, _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void d01as( D01..::..D01AS_G^ g, double a, double omega, int key, double epsabs, [OutAttribute] double% result, [OutAttribute] double% abserr, int limlst, [OutAttribute] int% lst, array<double>^ erlst, array<double>^ rslst, array<int>^ ierlst, [OutAttribute] int% subintvls, [OutAttribute] int% ifail ) |
F# |
---|
static member d01as : g : D01..::..D01AS_G * a : float * omega : float * key : int * epsabs : float * result : float byref * abserr : float byref * limlst : int * lst : int byref * erlst : float[] * rslst : float[] * ierlst : int[] * subintvls : int byref * ifail : int byref -> unit |
Parameters
- g
- Type: NagLibrary..::..D01..::..D01AS_G
A delegate of type D01AS_G.
- a
- Type: System..::..DoubleOn entry: , the lower limit of integration.
- omega
- Type: System..::..DoubleOn entry: the parameter in the weight function of the transform.
- key
- Type: System..::..Int32On entry: indicates which integral is to be computed.
- .
- .
Constraint: or .
- epsabs
- Type: System..::..DoubleOn entry: the absolute accuracy required. If epsabs is negative, the absolute value is used. See [Accuracy].
- result
- Type: System..::..Double%On exit: the approximation to the integral .
- abserr
- Type: System..::..Double%On exit: an estimate of the modulus of the absolute error, which should be an upper bound for .
- limlst
- Type: System..::..Int32On entry: an upper bound on the number of intervals needed for the integration.Suggested value: is adequate for most problems.Constraint: .
- lst
- Type: System..::..Int32%On exit: the number of intervals actually used for the integration.
- erlst
- Type: array<System..::..Double>[]()[][]An array of size [limlst]On exit: contains the error estimate corresponding to the integral contribution over the interval , for .
- rslst
- Type: array<System..::..Double>[]()[][]An array of size [limlst]On exit: contains the integral contribution over the interval , for .
- ierlst
- Type: array<System..::..Int32>[]()[][]An array of size [limlst]On exit: contains the error flag corresponding to , for . See [Error Indicators and Warnings].
- subintvls
- Type: System..::..Int32%On exit: subintvls contains the actual number of sub-intervals used.
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
d01as is based on the QUADPACK routine QAWFE (see Piessens et al. (1983)). It is an adaptive method, 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 d01an. 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 method uses the same algorithm as d01am (with ).
In contrast to the other methods in D01 class, d01as works only with an 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 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
Error Indicators and Warnings
Note: d01as may return useful information for one or more of the following detected errors or warnings.
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(W, LW, IW) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
- The maximum number of subdivisions allowed with the given workspace 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 d01as on the infinite subrange and an appropriate integrator on the finite subrange. Alternatively, consider relaxing the accuracy requirements specified by epsabs or increasing the amount of workspace.
- Round-off error prevents the requested tolerance from being achieved. Consider requesting less accuracy.
- Extremely bad local integrand behaviour causes a very strong subdivision around one (or more) points of the interval. The same advice applies as in the case of .
- The requested tolerance cannot be achieved because the extrapolation does not increase the accuracy satisfactorily; the returned result is the best which can be obtained. The same advice applies as in the case of .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 d01as on the infinite subrange and an appropriate integrator on the finite subrange. Alternatively, consider relaxing the accuracy requirements specified by epsabs or increasing the amount of workspace.Please note that divergence can occur with any nonzero value of ifail.
- The integral is probably divergent, or slowly convergent. Please note that divergence can occur with any nonzero value of ifail.
On entry, or , or .
- Bad integration behaviour occurs within one or more of the intervals . Location and type of the difficulty involved can be determined from the vector ierlst.
- Maximum number of intervals () allowed has been achieved. Increase the value of limlst to allow more cycles.
- The extrapolation table constructed for convergence acceleration of the series formed by the integral contribution over the intervals , does not converge to the required accuracy.
On entry, .
In the cases , or , additional information about the cause of the error can be obtained from the array ierlst, 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 .
Accuracy
Parallelism and Performance
None.
Further Comments
None.