This version of the IMSL_INTFCN function integrates functions with singularity points given.
To use this integration method, supply the SING_PTS keyword.
This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.
This method is a special-purpose integrator that uses a globally adaptive scheme to reduce the absolute error. It subdivides the interval [a, b] into N+1 user-supplied subintervals, where N is the number of singular points, and uses a 21-point Gauss-Kronrod rule to estimate the integral over each subinterval. The error for each subinterval is estimated by comparison with the 10-point Gauss quadrature rule. The subinterval with the largest estimated error is then bisected, and the same procedure is applied to both halves. The bisection process is continued until either the error criterion is satisfied, the roundoff error is detected, the subintervals become too small, or the maximum number of subintervals allowed is reached. This method uses an extrapolation procedure known as the ε-algorithm. This method is based on the subroutine QAGP by Piessens et al. (1983).
Example
The value of:
is computed. The values of the actual and estimated error are machine dependent.
Note that this subfunction never evaluates the user-supplied function at the user- supplied breakpoints.
.RUN
FUNCTION f, x
RETURN, x^3 * ALOG(ABS((x^2 - 1) * $
(x^ 2 - 2)))
END
ans = IMSL_INTFCN('f', 0, 3, $
Sing_Pts = [1, SQRT(2)], N_Evals = nevals)
PM, 'Computed Answer:', ans
IDL prints:
Computed Answer:
52.7408
exact = 61 * ALOG(2) + (77/4.) * ALOG(7) - 27
PM, 'Exact - Computed:', exact - ans
IDL prints:
Exact - Computed:
-2.67029e-05
PM, 'Number of Function Evaluations:', nevals
IDL prints:
Number of Function Evaluations:
819
Errors
See IMSL_INTFCN Errors.
Syntax
Result = IMSL_INTFCN(F, A, B, SING_PTS=points [, SING_PTS=vector])
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 argument 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.
Keywords
In addition to the global IMSL_INTFCN keywords, the following keyword is available:
SING_PTS (optional)
Set this keyword equal to a vector of abcissa values for the singularities. The values should be interior to the interval [a, b].
Version History
See Also
IMSL_INTFCN, IMSL_INTFCN: Functions Over an Infinite or Semi-infinite Interval