To find the volume of the following region:
fn[x_, y_, z_]:= Abs[0.7*x*Exp[I*y] + 0.3*Sqrt[x^2 + 8*10^-5] + Sqrt[x^2 + 3*10^-3]*0.02*Exp[I*z]] R = ImplicitRegion[fn[x, y, z]<=3*10^-3, {{x, 0, 0.015}, {y, 0, 2*Pi}, {z, 0, 2*Pi}}] RegionPlot3D[ fn[x, y, z] <= 3*10^-3, {x, 0, 0.015}, {y, 0, 2*Pi}, {z, 0, 2*Pi}, PlotPoints -> 50, AxesLabel -> {x, y, z}, PlotStyle -> Directive[Yellow, Opacity[0.5]], Mesh -> None]
Use “Volume”:
Volume[R]
Volume::nmet: Unable to compute the volume of region
Use “NIntegrate”:
NIntegrate[ Boole[fn[x, y, z] <= 3*10^-3], {x, 0, 0.015}, {y, 0, 2*Pi}, {z, 0, 2*Pi}, Method -> {"GlobalAdaptive", "MaxErrorIncreases" -> 50000}, PrecisionGoal -> 3] // Timing
NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small.
NIntegrate::eincr: The global error of the strategy GlobalAdaptive has increased more than 50000 times. The global error is expected to decrease monotonically after a number of integrand evaluations… NIntegrate obtained 0.12219642052793653 and 0.007515502934285486 for the integral and error estimates.
{19.25, 0.122196}
The result is not convergent.
Use “MonteCarlo”:
NIntegrate[ Boole[fn[x, y, z] <= 3*10^-3], {x, 0, 0.015}, {y, 0, 2*Pi}, {z, 0, 2*Pi}, Method -> {"MonteCarlo", "MaxPoints" -> 10^12, "RandomSeed" -> 9}, PrecisionGoal -> 3] // Timing
{8.39063, 0.121479}
It is slow, and if set PrecisionGoal -> 5,
NIntegrate[ Boole[fn[x, y, z] <= 3*10^-3], {x, 0, 0.015}, {y, 0, 2*Pi}, {z, 0, 2*Pi}, Method -> {"MonteCarlo", "MaxPoints" -> 10^12, "RandomSeed" -> 9}, PrecisionGoal -> 5]
Running more than 2 minutes and can’t give a result.
Hope to find a better way to calculate the volume of this region, and realize:
1.high accuracy(at least PrecisionGoal -> 5)
2.good error estimate
3.fast
Thanks for your time.