0
$\begingroup$

As in the title: I'm trying to Nintegrate over an ImplicitRegion, this error appears. No idea what it means. Nothing in the docs. It appears on this line:

NIntegrate[ΔPtt[r3, r1, r2,  0, ϕ1, 0, l, 1, 1] , 
  {r1, r2, r3, ϕ1} ∈ IntegrationRegionReduced, PrecisionGoal -> 2, MaxRecursion -> 20]

where ΔPtt[r3, r1, r2, 0, ϕ1, 0, l, 1, 1] is a normal (although very long) function.

$\endgroup$
4
  • 4
    $\begingroup$ The message is rather descriptive: you are trying to integrate over a 4-manifold, while the method only works up to dimension 3. I guess your real question is how to overcome this limitation? $\endgroup$ May 29, 2019 at 17:04
  • $\begingroup$ I don't understand where is the problem, actually. NIntegrate? or the function? The region? $\endgroup$ May 29, 2019 at 18:49
  • $\begingroup$ I write that because in another notebook I use Nintegrate over a region with 6 dimensions and it seems not to be bothering. So I don't understand what's wrong here.That's what I am asking. $\endgroup$ May 29, 2019 at 18:57
  • $\begingroup$ Unless you post the complete code, answers are going to be speculation. $\endgroup$
    – user21
    May 30, 2019 at 11:09

1 Answer 1

3
$\begingroup$

As noted in the comments, the message means that NIntegrate can only integrate over regions with have a RegionEmbeddingDimension of 1, 2 or 3.

RegionEmbeddingDimension[IntegrationRegionReduced]

probably returns 4. Unfortunately, you do not provide the region, so there is no way anyone can suggest ways around that.

NIntegrate can very well integrate over a 4 dim ImplicitRegion, like in

NIntegrate[1, Element[{x, y, z, w}, ImplicitRegion[
 {x <= y || z >= w}, {{x, 0, 1}, {y, 0, 1}, {z, 0, 1}, {w, 0, 1}}]]]

However, in some cases the implicit region is so complicated that the finite element method needs to be used to discretize the region and that method only works in 1,2 and 3D.

As a side question, how should the message be formulated that you had understood it?

$\endgroup$
5
  • $\begingroup$ that cannot be what the message means, as I said in the comments. In another notebook I used NIntegrate with a region with 7 dimensions, so this cannot be it. Also, nowehere is stated that NIntegrate has this limitation. As it shouldn't have. $\endgroup$ May 30, 2019 at 10:03
  • 1
    $\begingroup$ I am the developer of that functionality in NIntegrate and that is what the message means. Now, since you did not share the region or that other region I can only speculate. NIntegrate can very well integrate over a 4 dim ImplicitRegion, like in NIntegrate[1, Element[{x, y, z, w}, ImplicitRegion[{x <= y || z >= w}, {{x, 0, 1}, {y, 0, 1}, {z, 0, 1}, {w, 0, 1}}]]]. However, in some cases the implicit region is so complicated that the finite element method needs to be used to discretize the region and that method only works in 1,2 and 3D. Unless you post the region.... $\endgroup$
    – user21
    May 30, 2019 at 11:03
  • 1
    $\begingroup$ @LowFieldTheory, ... not much can be done for you. $\endgroup$
    – user21
    May 30, 2019 at 11:04
  • $\begingroup$ You should write this in the documentation, I shouldn't ask for that here. "However, in some cases the implicit region is so complicated that the finite element method needs to be used to discretize the region and that method only works in 1,2 and 3D." how is someone supposed to know? Anyway, I already solved by simplifying a bit the region. If you write this explanation in the answer more clearly I can accept it. $\endgroup$ May 30, 2019 at 12:34
  • $\begingroup$ @LowFieldTheory, updated the answer. The main question is how should the message have been worded that you would have understood the content. What I could do is add an example to the message reference. The main reference page for NIntegrate is out of my control. If you feel strongly about it, I suggest you send the example to [email protected]. But again, the main issue is that the message was misunderstood and that is something I can fix if you tell me what would have helped you. $\endgroup$
    – user21
    May 30, 2019 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.