This version of the IMSL_INTFCN function integrates two-dimensional iterated integrals. To use this integration method, supply the TWO_DIMENSIONAL keyword.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

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.

Example


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

IDL prints:

Computed Answer:
  0.407609
exact = -SIN(3)/3 + SIN(2)/2
 
PM, 'Exact - Computed:', exact - ans

IDL prints:

Exact - Computed:
-5.96046e-08

Errors


See IMSL_INTFCN Errors.

Syntax


Result = IMSL_INTFCN(F, A, B, G, H, /TWO_DIMENSIONAL)

Return Value


The value of:

is returned. If no value can be computed, the floating-point value NaN (Not a Number) is returned.

Arguments


F

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

A scalar expression specifying the lower limit of integration.

B

A scalar expression specifying the upper limit of integration.

g

Scalar string specifying the name of a user-supplied IDL Advanced Math and Stats 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.

H

Scalar string specifying the name of a user-supplied IDL Advanced Math and Stats 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.

Keywords


In addition to the global IMSL_INTFCN keywords, the following keyword is available:

TWO_DIMENSIONAL (optional)

Set this keyword to integrate a two-dimensional iterated integral.

Version History


6.4

Introduced

See Also


IMSL_INTFCN