|
IDL Analyst Reference Guide: Quadrature |
|
This version of the IMSL_INTFCN function integrates functions with algebraic-logarithmic singularities.
| Note The Alpha and Beta arguments must be supplied to use this integration method. |
Result = IMSL_INTFCN(f, a, b, Alpha, Beta,
/ALGEBRAIC | /ALG_LEFT_LOG | /ALG_LOG | /ALG_RIGHT_LOG)
The value of:

is returned, where w (x) is defined by one of the keywords below. 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.
The strength of the singularity at a. Must be greater than –1.
Strength of the singularity at b. Must be greater than –1.
In addition to the global IMSL_INTFCN keywords listed in the main section under Keywords, exactly one of the following keywords may be specified:
Set this keyword to use the weight function
. This is the default weight function for this method.
Set this keyword to use the weight function
.
Set this keyword to use the weight function
.
Set this keyword to use the weight function
.
This method is a special-purpose integrator that uses a globally adaptive scheme to reduce the absolute error. It computes integrals whose integrands have the special form w (x) f (x), where w (x) is a weight function. A combination of modified Clenshaw-Curtis and Gauss-Kronrod formulas is employed. This method is based on the subroutine QAWS, which is fully documented by Piessens et al. (1983).
If this method is used, the function should be coded to protect endpoint singularities if they exist.
The value of:

is computed.
.RUN
; Define the function to be integrated.
FUNCTION f, x
RETURN, SQRT((1 + x))
END
ans = $
IMSL_INTFCN('f', 0, 1, /Alg_Left_Log, 1.0, .5 )
; Call IMSL_INTFCN with keyword Alg_Left_Log set and values for the
; method parameters alpha and beta.
PM, 'Computed Answer:', ans
; Output the results.
; Computed Answer: -0.213395
exact = (3 * ALOG(2) - 4)/9
PM, 'Exact - Computed:', exact - ans
; Exact - Computed: 1.49012e-08
See Errors.
IDL Online Help (March 06, 2007)