The solid is defined by implicit function below:
$$\frac{51}{100} (\cos x \cos y+\cos x \cos z+\cos y \cos z)+\cos x+\cos y+\cos z+1\le0$$ where $x,y,z\in[0,2\pi]$
I tried three different approaches with Mathematica to calculate the solid's volume:
Monte Carlo :
ClearAll["Global`*"]; n = 1025; SeedRandom[20170524]; f[x_] := (Cos /@ x // Total) + 51/100*Dot[Cos /@ RotateRight @ x, Cos /@ x] + 1 Count[Flatten @ (f /@ RandomReal[{0, 2 Pi}, {n, 3}]), u_ /; u <= 0]/ n*(2.0 Pi)^3
immediate integral over implicit region:
NIntegrate[1, {x, y, z} ∈ ImplicitRegion[ 1 + Cos[x] + Cos[y] + Cos[z] + 51/100 (Cos[x] Cos[y] + Cos[x] Cos[z] + Cos[y] Cos[z]) <= 0 && 0 <= x <= 2 Pi && 0 <= y <= 2 Pi && 0 <= z <= 2 Pi, {x, y, z}]]
Boole integrand over cube
NIntegrate[ Boole[1 + Cos[x] + Cos[y] + Cos[z] + 51/100 (Cos[x] Cos[y] + Cos[x] Cos[z] + Cos[y] Cos[z]) <= 0], {x, 0, 2 Pi}, {y, 0, 2 Pi}, {z, 0, 2 Pi}, WorkingPrecision -> 50]
Different approaches lead to different results.
Which one is more reliable and why since it seems there is no closed form result for this problem? Is it possible to evaluate the volume of this solid at arbitrary precision with Mathematica?
f[x]
). $\endgroup${x,y,z}[Element]Implicit...
part looks incorrectly entered. $\endgroup$8 NIntegrate[Boole[1 - Cos[x] - Cos[y] - Cos[z] + 51 (Cos[x] Cos[y] + Cos[x] Cos[z] + Cos[y] Cos[z])/100 <= 0], {x, 0, π}, {y, 0, π}, {z, 0, π}]
$\endgroup$