0
$\begingroup$

I have 5 inequalities with some parameters like dh, din and thetawhich I intend to vary.

In Mathematica, I am trying to:

  1. Check if the inequalities have a solution.
  2. Find the common volume if they do.

I tried this:

theta = 85* Pi/180;
dh = 0.5;
din = 1.016;
dout = 1.27;
zz = z*Cos[theta] - x*Sin[theta];
xx = z*Sin[theta] + x*Cos[theta];
yy = y;
region1 = z^2 >= (dh/2 + 0.0254)^2 - (dout/2)^2*x^2/(x^2 + y^2);
region2 = (din/2)^2 < x^2 + y^2 < (dout/2)^2;
region3 = -1 <= z <= 1;
region4 = zz^2 <= (dh/2)^2 - (dout/2)^2*xx^2/(xx^2 + yy^2);
region5 = (din/2)^2 <= xx^2 + yy^2 <= (dout/2)^2;
region = region1 && region2 && region3 && region4 && region5;
AbsoluteTiming[Resolve[Exists[{x, y, z}, region], Reals]]

whose execution is not completing.

Plotting with

AbsoluteTiming[RegionPlot3D[region1 && region2 && region3 && region4 && region5, 
{x , -1.27/2, 1.27/2}, {y, -1.27/2, 1.27/2}, {z, -1, 1}, PlotRange  
-> {{-0.7, 0.7}, {-0.7, 0.7}, {-0.7, 0.7}}, AspectRatio -> 1, PlotPoints -> 500, 
MaxRecursion -> 15]]

gives an inaccurate, broken volume after 15 minutes of running.

Numerical integration gives 0 (possibly due to some volumes being negative?)

How can I quickly and accurately find if the regions have a common volume and if they do, the magnitude of the common volume?

$\endgroup$
1
$\begingroup$

Only concerning the visalisation, but this

Show[RegionPlot3D[ region1 && region2 && region5,
{x, 0, 0.7}, {y, 0.001, 0.7}, {z, 0, 0.7}, AspectRatio -> 1, PlotPoints -> 100],
RegionPlot3D[region4, {x, 0, 0.7}, {y, 0.001, 0.7}, {z, 0, 0.7}]]

renders in seconds.

$\endgroup$
  • $\begingroup$ I am able to plot them separately. I need to know if they intersect or not. A plot is not practical because I need to do the same with hundreds of different values of theta. $\endgroup$ – Shivanand Jul 14 '16 at 21:53

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.