Description Usage Arguments Details Value References See Also Examples
View source: R/SphericalCubature.R
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.
1 | integrateSphereStroud11(f, n, ...)
|
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 |
This method works if the integrand is smooth. If the function changes rapidly, adaptive integration can be tried as described in 'See Also' below.
A single number, the approximation to the integral.
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.
adaptIntegrateSpherePolar
, adaptIntegrateBallPolar
, adaptIntegrateSphereTri
1 2 | f2 <- function( x ) { return(x[1]^2) }
integrateSphereStroud11( f2, n=3 )
|
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.