Routine ID: D114 | |
---|---|
Author(s): B. Lautrup | Library: MATHLIB |
Submitter: | Submitted: 23.07.1971 |
Language: Fortran | Revised: 10.01.1986 |
RIWIAD is an adaptive multidimensional integration subroutine based on an original by G. Sheppey. It permits numerical integration of a large class of functions, in particular those that are irregular at the border of the integration region. The integral is always performed over the unit hypercube.
Structure:
SUBROUTINE subprogram
User Entry Names: RIWIAD
Files Referenced: Unit 6
External References: RNDM (V104)
user-supplied FUNCTION subprogram
COMMON Block Names and Lengths:
ANSWER2,
INTERN7, OPTION3, PARAMS4,
RANDOM1, STORE77, STORE110001
Usage:
See Long Write-up for a description of all features. Here only the standard use is described.
The COMMON block PARAMS must always be set by the user: COMMON /PARAMS/ ACC,NDIM,NSUB,ITER
FUNCTION EXAMPLE(Q) REAL EXAMPLE,Q DIMENSION Q(7) ... ENDThis program defines EXAMPLE as a function of the 7 variables . The sequence
EXTERNAL EXAMPLE COMMON /PARAMS/ ACC,NDIM,NSUB,ITER ACC=0.01 NDIM=7 NSUB=10000 ITER=5 CALL RIWIAD(EXAMPLE) ...will then integrate EXAMPLE over the 7 variables , all in the interval from 0 to 1, i.e. over the 7-dimensional unit hypercube. The result will be printed in detail in a readily understandable form.
The program allows extensive user control via the COMMON blocks. See Long Write-up for details.
Method:
RIWIAD is iterative and in a given iteration it divides the unit hypercube into a certain number of subvolumes by means of a given set of intervals on each axis. Within each subvolume it estimates the mean value and variance of the integrand by random sampling, and then calculates the Riemann sum over the subvolumes. Using the variances found projected onto each axis it calculates a set of new interval divisions to be used in the next iteration. It returns when the desired accuracy is obtained or when the maximum number of iterations has been performed.
Restrictions:
There is, in principle, no limitations on the number of dimensions, although the present version only allows up to 9-dimensional integrals. The maximal dimensionality can easily be increased.
Notes:
G.A. Erskine