integral2 {pracma} | R Documentation |
Numerically evaluate a double integral, resp. a triple integral by reducing it to a double integral. lua
integral2(fun, xmin, xmax, ymin, ymax, sector = FALSE, reltol = 1e-6, abstol = 0, maxlist = 5000, singular = FALSE, vectorized = TRUE, ...) integral3(fun, xmin, xmax, ymin, ymax, zmin, zmax, reltol = 1e-6, ...)
fun | function spa |
xmin, xmax | lower and upper limits of x. code |
ymin, ymax | lower and upper limits of y. ip |
zmin, zmax | lower and upper limits of z. ci |
sector | logical. it |
reltol | relative tolerance. io |
abstol | absolute tolerance. table |
maxlist | maximum length of the list of rectangles. function |
singular | logical; are there singularities at vertices. class |
vectorized | logical; is the function fully vectorized. |
.. | additional parameters to be passed to the function. |
example
double<-function(x,y){ + ifelse(x+y>=1,6*x*y^2,0)}
> integral2(double,0,1,0,1) $Q [1] 0.9072746 $error [1] 7.325264e-08
> double<-function(x,y){ + 6*x*y^2} >
integral2(double,1/2,3/4,0,1)
$Q [1] 0.3125 $error [1] 6.938894e-18