1
$\begingroup$

As of Mathematica version 10, one can integrate over regions (see https://www.wolfram.com/mathematica/new-in-10/symbolic-geometry/integrate-over-regions.html )

As a toy example, I am using this from the documentation:

 \[ScriptCapitalR] = ConvexHullMesh[RandomReal[1, {50, 3}]] NIntegrate[x^2 y^2 z^2, {x, y, z} \[Element] \[ScriptCapitalR]] 

I'd like to know what numerical method it is using for the integral, and what alternatives are possible. When I select from the list of NIntegrate methods in the documentation (e.g., GlobalAdaptive, LocalAdaptive, etc) via

 NIntegrate[x^2 y^2 z^2, {x, y, z} \[Element] \[ScriptCapitalR], Method -> "GlobalAdaptive"] 

it gives the error message:

Method "GlobalAdaptive" is not applicable for a region domain. Continuing with method Automatic.

I can't figure out what method Automatic is calling (although it seems to be adaptive, based on some error messages I get when I try a highly oscillatory integrand).

Is there documentation somewhere of what methods can be called when NIntegrate is called over a region?

$\endgroup$
6
  • $\begingroup$ Mathematica accepts Method -> "FiniteElement" $\endgroup$ Commented Mar 3, 2023 at 14:39
  • $\begingroup$ Thanks. Do you know if this is the default? Or what other options work (other than going through them one at a time)? $\endgroup$ Commented Mar 3, 2023 at 16:39
  • $\begingroup$ I don't know, I tried it out. $\endgroup$ Commented Mar 3, 2023 at 16:43
  • $\begingroup$ Also, that method seems to not be listed here: reference.wolfram.com/language/tutorial/… Is there are more up-to-date list? I was going to go through them, but the one you pointed out isn't even on the list so I'm wondering what other ones I'd miss... $\endgroup$ Commented Mar 3, 2023 at 16:44
  • $\begingroup$ Method -> "InterpolationPointsSubdivision" works too $\endgroup$ Commented Mar 3, 2023 at 17:26

1 Answer 1

1
$\begingroup$

As I understand it, most of the methods of NIntegrate assume the domain of integration to be a Cuboid in n dimensions and use it. In order to make integration over a Cuboid, the Boole command can be applied. For example,

SeedRandom[1234]; \[ScriptCapitalR] = ConvexHullMesh[RandomReal[1, {50, 3}]] NIntegrate[x^2 y^2 z^2, {x, y, z} \[Element] \[ScriptCapitalR]] 

0.0192459

NIntegrate[x^2 y^2 z^2*Boole[{x, y, z} \[Element] \[ScriptCapitalR]], {x, 0, 1},{y, 0, 1}, {z, 0, 1}, Method -> "LocalAdaptive"] 

0.0192453

PS.That approach may be useful in the case of improper integrals. Compare

NIntegrate[ 1/Sqrt[RealAbs[x - y]], {x, y, z} \[Element] \[ScriptCapitalR]] 

which returns the input with

NIntegrate[1/Sqrt[RealAbs[x - y]] Boole[{x, y, z} \[Element] \[ScriptCapitalR]], {x, 0, 1}, {y, 0, 1}, {z, 0, 1}, Exclusions -> {x == y}, AccuracyGoal -> 4, PrecisionGoal -> 4, Method -> "LocalAdaptive"] 

1.65825

$\endgroup$
0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.