6
$\begingroup$

Bug introduced in 10.0.0 and fixed in 10.0.2


Given a MeshRegion:

region = DelaunayMesh[RandomReal[1, {50, 3}]]

Mathematica graphics

We can numerically Integrate over it easily:

NIntegrate[x^2 y^2 z^2, {x, y, z} ∈ region]

0.0169908561

We can also Integrate over its boundary:

NIntegrate[x^2 y^2 z^2, {x, y, z} ∈ RegionBoundary@region]

0.151404597

if you replace DelaunayMesh with ConvexHullMesh, which yields a BoundaryMeshRegion, the same process works fine. This does not come as a surprise as the documentation for NIntegrate suggests that integrating over regions in this way is possible.

Now we turn our attention to NArgMin. We can mimic the built-in RegionNearest as follows:

dist[x_?VectorQ, y_?VectorQ] /; Length[x] == Length[y] := Sqrt @ Total[(x - y)^2]   

regN[region_, point_] := NArgMin[{dist[point, x], x ∈ region}, x]

We can use it as follows:

regN[Disk[], {2, 3}]

{0.55470039, 0.832050166}

regN[Sphere[], {2, 3, 4}]

{0.371392166, 0.557086686, 0.742780105}

Note that Disk[] and Sphere[] are Regions. Let's try our MeshRegion from above:

regN[region, {2, 3, 4}]

Mathematica graphics

So, it looks like while NIntegrate works fine with MeshRegion and BoundaryMeshRegion objects, other functions (NArgMin, NArgMax, NMinValue, NMaxValue, NMinimize, NMaximize etc.) that claim to work over regions fail for both. Is this an omission in documentation or implementation, or am I totally missing something here?

$\endgroup$
  • 2
    $\begingroup$ No, this is missing implementation. By all means mention it to the support. Concerning why, Shphere[], Disk[], etc work - those are symbolic (exact) regions and go to the symbolic regions solver, which is not the case for MeshRegions. $\endgroup$ – user21 Aug 11 '14 at 6:44
  • $\begingroup$ @user21. Thanks for confirming, I'll let them know about this. $\endgroup$ – RunnyKine Aug 11 '14 at 10:19
2
$\begingroup$

This has been confirmed by Wolfram Technology Group as a bug.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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