The QROMO function evaluates the integral of a function over the open interval ( A, B ) using a modified Romberg's method.
QROMO is based on the routine
qromo
described in section 4.4 of
Numerical Recipes in C: The Art of Scientific Computing
(Second Edition), published by Cambridge University Press, and is used by permission.
A scalar string specifying the name of a user-supplied IDL function to be integrated. This function must accept a single scalar argument X and return a scalar result. It must be defined over the open interval ( A, B ).
For example, if we wish to integrate the fourth-order polynomial
we define a function HYPER to express this relationship in the IDL language:
The upper limit of the integration. B can be either a scalar or an array. If the MIDEXP keyword is specified, B is assumed to be infinite, and should not be supplied by the user.
Note: If arrays are specified for A and B , then QROMO integrates the user-supplied function over the interval [ A i , B i ] for each i . If either A or B is a scalar and the other an array, the scalar is paired with each array element in turn.
The fractional accuracy desired, as determined by the extrapolation error estimate. For single-precision calculations, the default value is 1.0 ¥ 10 -6 . For double-precision calculations, the default value is 1.0 ¥ 10 -12 .
Set to specify the maximum allowed number of mid quadrature points to be 3 (JMAX - 1) . The default value is 14.
Use the
midexp()
function (see
Numerical Recipes
, section 4.4) as the integrating function. If the MIDEXP keyword is specified, argument B is assumed to be infinite, and should not be supplied by the user.
To integrate the HYPER function (listed above) over the open interval (2, · ) and print the result:
INT_2D , INT_3D , INT_TABULATED , QROMB , QSIMP