|
IDL Analyst Reference Guide: Quadrature |
|
This version of the IMSL_INTFCN function integrates two-dimensional iterated integrals.
| Note The TWO_DIMENSIONAL keyword must be supplied to use this integration method. |
Result = IMSL_INTFCN(f, a, b, g, h, /TWO_DIMENSIONAL)
The value of:

is returned. If no value can be computed, the floating-point value NaN (Not a Number) is returned.
A scalar string specifying the name of a user-supplied function to be integrated. The function f accepts one scalar parameter and returns a single scalar of the same type.
A scalar expression specifying the lower limit of integration.
A scalar expression specifying the upper limit of integration.
Scalar string specifying the name of a user-supplied IDL Analyst function used to evaluate the lower limit of the inner integral. Function g accepts one scalar parameter and returns a single scalar of the same type.
Scalar string specifying the name of a user-supplied IDL Analyst function used to evaluate the upper limit of the inner integral. Function h accepts one scalar parameter and returns a single scalar of the same type.
In addition to the global IMSL_INTFCN keywords listed in the main section under Keywords, the following keyword must be specified:
Set this keyword to integrate a two-dimensional iterated integral.
This method approximates the following two-dimensional iterated integral:

The lower-numbered rules are used for less smooth integrands, while the higher-order rules are more efficient for smooth (oscillatory) integrands.
If this method is used, the function should be coded to protect endpoint singularities if they exist.
This example computes the value of the integral:

.RUN
; Define the function to be integrated.
FUNCTION f, x, y
RETURN, SIN(x + y)
END
.RUN
; Define the function for the lower limit of the inner integral.
FUNCTION g, x
RETURN, x
END
.RUN
; Define the function for the upper limit of the inner integral.
FUNCTION h, x
RETURN, 2 * x
END
ans = IMSL_INTFCN('f',0,1,'g','h',/Two_Dimensional)
; Call IMSL_INTFCN with keyword Two_Dimensional set and the names
; of the functions defining the limits of the inner integral.
PM, 'Computed Answer:', ans
Computed Answer:
0.407609
exact = -SIN(3)/3 + SIN(2)/2
PM, 'Exact - Computed:', exact - ans
Exact - Computed:
-5.96046e-08
See Errors.
IDL Online Help (March 06, 2007)