The INT_2D function computes the double integral of a bivariate function using iterated Gaussian quadrature. The algorithm's transformation data is provided in tabulated form with 15 decimal accuracy.
This routine is written in the IDL language. Its source code can be found in the file
int_2d.pro
in the
lib
subdirectory of the IDL distribution.
A scalar string specifying the name of a user-supplied IDL function that defines the bivariate function to be integrated. The function must accept X and Y and return a scalar result.
For example, if we wish to integrate the following function:
We define a function FXY to express this relationship in the IDL language:
A two-element vector containing the lower (A) and upper (B) limits of integration with respect to the variable x .
A scalar string specifying the name of a user-supplied IDL function that defines the lower (P( x )) and upper (Q( x )) limits of integration with respect to the variable y . The function must accept x and return a two-element vector result.
For example, we might write the following IDL function to represent the limits of integration with respect to y :
Compute the double integral of the bivariate function.
end ; Define the limits of integration for y as a function of x.
AB_Limits = [0.0, 2.0] ; Define limits of integration for x.
Using the function and limits defined above, integrate with 48 and 96 point formulas using a dy-dx order of integration and double-precision arithmetic:
PRINT, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 48, /DOUBLE)
PRINT, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 96, /DOUBLE)
INT_2D with 48 transformation points yields: 0.055142668
INT_2D with 96transformation points yields: 0.055142668
Compute the double integral of the bivariate function.
end ; Define the limits of integration for y as a function of x.
AB_Limits = [0.0, 4.0] ; Define limits of integration for x.
Using the function and limits defined above, integrate with 48 and 96 point formulas using a dy-dx order of integration and double-precision arithmetic:
PRINT, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 48, /DOUBLE, /ORDER)
PRINT, INT_2D('Fxy', AB_Limits, 'PQ_Limits', 96, /DOUBLE, ORDER)
INT_2D with 48 transformation points yields: 0.055142678
INT_3D , INT_TABULATED , QROMB , QROMO , QSIMP