INTEGRAL Function
Performs integration on m-dimensional surfaces in n-dimensional space.
Usage
result = INTEGRAL(d)
Input Parameters
d—The m-element vector of dimensions for the parametric grid used to describe the surface.
Returned Value
result—Scalar value of the integral of the function over the surface.
Keywords
surface—An n-element list of m-dimensional arrays of dimensions d. Since the value of the integral is independent of the choice of parameteric coordinates, the algorithm uses the canonical parametric grid defined by the indices into an array of dimensions d. The default surface is the region of parameter space occupied by this canonical grid.
metric—An n-element list of n-element lists of m-dimensional arrays of dimensions d, where (metric(i))(j) is the m-dimensional surface distribution of the ij componant of the metric defined on the n-dimensional space in which the surface is embedded. If a componant of the metric is constant then it should be given as a scalar instead of an array. Default is Euclidean.
integrand—An m-dimensional array of dimensions d, where the values of a scalar function are defined on the surface. If the function is constant, then it should be given as a scalar instead of an array. The default integrand is a constant equal to 1.
Discussion
The INTEGRAL function uses a multidimensional generalization of the trapezoidal rule to compute the integral of a scalar function over a parametric surface. The number of dimensions of the surface is arbitrary as is the number of dimensions of the space in which it is embedded. The metric for the space is also arbitrary.
Example
; Number of data points
n = 1d3
 ; Independent variable t
t = !Dpi * RANDOMU(s, n)
; Sort t.
t = t(SORT(t))
; Dependent variable x
x = SIN(t)
; Integrate x=sin(t) over [0,pi].
a = INTEGRAL([n], surface=LIST(t), integrand=x) 
; The analytic result is equal to 2.
PM, a
; PV-WAVE prints: 1.99998
For further examples, refer to the file <RW_DIR>/wave/lib/user/examples/integral_ex.pro.