Institut für Astronomie und AstrophysikAbteilung AstronomieWaldhäuser Str. 64, D-72076 Tübingen, Germany |
TRAPZD
Compute the nth stage of refinement of an extended trapezoidal rule.
This procedure is called by QSIMP and QTRAP. Algorithm from Numerical Recipes, Section 4.2. TRAPZD is meant to be called iteratively from a higher level procedure.
TRAPZD, func, A, B, S, step, [ _EXTRA = ]
func - scalar string giving name of function to be integrated. This must be a function of one variable. A,B - scalars giving the limits of the integration
S - scalar giving the total sum from the previous iterations on input and the refined sum after the current iteration on output. step - LONG scalar giving the number of points at which to compute the function for the current iteration. If step is not defined on input, then S is intialized using the average of the endpoints of limits of integration.
Any supplied keywords will be passed to the user function via the _EXTRA facility.
(1) TRAPZD will check for math errors when computing the function at the endpoints, but not on subsequent iterations. (2) TRAPZD always uses double precision to sum the function values but the call to the user-supplied function is double precision only if one of the limits A or B is double precision.
Written W. Landsman August, 1991 Always use double precision for TOTAL March, 1996 Converted to IDL V5.0 W. Landsman September 1997 Pass keyword to function via _EXTRA facility W. Landsman July 1999
[Home Page] [Software, Documentation] [IDL Documentation] [Quick Reference] [Feedback]