integrateSphereStroud11: Integrate a function over the sphere in n-dimensions.

Description Usage Arguments Details Value References See Also Examples

View source: R/SphericalCubature.R

Description

Approximate the integral of a function f(x)=f(x[1],...,x[n]) over the unit sphere in n-space using Stroud's method of degree 11.

Usage

1

Arguments

f

function f(x)=f(x[1],...,x[n]) to integrate

n

dimension of the space, implemented for n in the range 3:16.

...

optional arguments passed to f( ). If these are specified, they should be labeled with a tag, e.g. param1=3.4

Details

This method works if the integrand is smooth. If the function changes rapidly, adaptive integration can be tried as described in 'See Also' below.

Value

A single number, the approximation to the integral.

References

Stroud integration and related functions, adapted from fortran code by John Burkhart found at
http://people.sc.fsu.edu/~jburkardt/f77_src/stroud/stroud.html
Based on the book by A. H. Stroud, Approximate Calculation of multiple integrals, 1971, page 296-297.

See Also

adaptIntegrateSpherePolar, adaptIntegrateBallPolar, adaptIntegrateSphereTri

Examples

1
2
f2 <- function( x ) { return(x[1]^2) }
integrateSphereStroud11( f2, n=3 )

Example output

Loading required package: cubature
Loading required package: SimplicialCubature
Loading required package: mvmesh
Loading required package: rcdd
If you want correct answers, use rational arithmetic.
See the Warnings sections added to help pages for
    functions that do computational geometry.

Loading required package: rgl
Loading required package: geometry
Loading required package: magic
Loading required package: abind
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE 
3: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 
[1] 4.18879

SphericalCubature documentation built on Jan. 13, 2021, 1:04 p.m.