1
$\begingroup$

I'm a beginner with both Mathematica and multi-variable calculus. I want to plot and find the volume of the solid enclosed by the surfaces defined by

\begin{eqnarray} x^2+y^2 = & 4 \cr x-y+2z = & 4 \cr x = & 0 \cr y = & 0 \cr z = & 0 \cr \end{eqnarray}

Every time I see an equation where $z = 0$, I'm unable to interpret it in 3D form. Help will be much appreciated.

$\endgroup$

closed as off-topic by LLlAMnYP, MarcoB, Bob Hanlon, b.gates.you.know.what, Öskå Sep 19 '15 at 11:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – LLlAMnYP, MarcoB, Bob Hanlon, b.gates.you.know.what, Öskå
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 4
    $\begingroup$ @ Sam202: something like this? RegionPlot3D[ ImplicitRegion[ x^2 + y^2 <= 4 && x - y + 2 z <= 4 && 0 < x < 4 && 0 < y < 4 && 0 < z < 4, {x, y, z}]] $\endgroup$ – Dr. Wolfgang Hintze Sep 18 '15 at 8:18
  • $\begingroup$ There are many ways to do this. Please post your code so we can see how you tried to do it. $\endgroup$ – C. E. Sep 18 '15 at 8:57
8
$\begingroup$

There are a number of ways to do this. Sometimes use of Reduce simplifies the constraints but as Dr Hintze's comment shows Mathematica handles boolean statements well.

To illustrate:

reg = Reduce[
  0 <= x^2 + y^2 <= 4 && x - y + 2 z <= 4 && z >= 0 && y >= 0 && 
   x >= 0, {x, y, z}]

Visualizing region and enclosing planes and cylinder:

rp = RegionPlot3D[reg, {x, 0, 2}, {y, 0, 2}, {z, 0, 3}, 
  PlotPoints -> 100, MaxRecursion -> 5, Mesh -> False]

con[p_] := 
  Graphics3D[{Opacity[p], Cylinder[{{0, 0, 0}, {0, 0, 3}}, 2], 
    InfinitePlane[{#1, #2, (4 - #1 + #2)/2} & @@@ {{1, 0}, {0, 1}, {1,
         1}}], InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 1, 0}}], 
    InfinitePlane[{0, 0, 0}, {{0, 0, 1}, {0, 1, 0}}], 
    InfinitePlane[{0, 0, 0}, {{1, 0, 0}, {0, 0, 1}}]}, 
   PlotRange -> {{0, 2}, {0, 2}, {0, 3}}];
Manipulate[Show[rp, con[p]], {p, 0, 1}]

enter image description here

You can calculate volumes in a number of ways, e.g.

r = ImplicitRegion[reg, {{x, 0, 2}, {y, 0, 2}, {z, 0, 3}}];
Integrate[1, {x, 0, 2}, {y, 0, Sqrt[4 - x^2]}, {z, 0, (4 - x + y)/2}]
Integrate[1, {x, y, z} ∈ r]
Volume[r]

All yield $2\pi$.

Please play. I have not made this efficient.

$\endgroup$

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