I have the following problem. Let's say we have a 2D region, let me be very explicit:
R = ImplicitRegion[
Cos[x] + Cos[y] + Cos[z] ==
1.5, {{x, -π, π}, {y, -π, π}, {z, -π, π}}];
I'd like to integrate some function over this surface (looks like potato), for example it's area is given by integral over the surface of function equal to 1:
NIntegrate[1, {x, y, z} ∈ R]
Unfortunately, the result is the input, i.e. Mathematica doesn't know how to do the integration. Never mind, we can always discretize region:
dR = DiscretizeRegion[R, MaxCellMeasure -> 100]
Now, it works!
NIntegrate[1, {x, y, z} ∈ dR]
gives
46.2047
Some odd function:
NIntegrate[x, {x, y, z} ∈ dR]
gives:
0.0000340503
Should be zero from (anti)symmetry, but nevermind, it's the matter of discretization step.
But now, when I try (the result should also be close to zero):
NIntegrate[Sin[x], {x, y, z} ∈ dR]
The output is rather lengthy and intriguing error "tdlen: Objects of unequal length in \
{NIntegrateSimplexQuadratureDump
U$14954[1], ..." and "Could not complete external evaluation at instruction 186; proceeding \
with uncompiled evaluation." - what does it mean? How different is Sin[x]
from x
? The result after listing those errors is -0.000115624
(sounds likely), but it takes longer (significantly). How can I integrate ANY function over ANY 2D implicit region (the one I chose is something that can't be done analytically to demonstrate nature of this error)? What's nature of these errors? Did someone else run into the same or similar problem as me? Thanks.
P.S.: I tried with f[x_,y_,z_]:= (Sin[x]^2+Sin[y]^2+Sin[z]^2)^(-1/2)
and for this function the result is not even a number, it's lot of errors and the input.
I have Mathematica student version 10.0.2.0 running on Win 10.
NIntegrate[Sin[x], {x, y, z} ∈ R]
works for me. $\endgroup$Boole[]
instead? $\endgroup$