Group Abstract Group Abstract

Message Boards Message Boards

3DPlot triple integrals volume (x,y,z) under a curve?

Posted 10 years ago
POSTED BY: vick ratnam
6 Replies

Plotting your curve is difficult, since it is a function of 3 dimensions, you would need to do a ContourPlot3D. But plotting the region in question is not too difficult. The straightforward way to do this is with RegionPlot3D

RegionPlot3D[
 ImplicitRegion[
  1 <= z <= 2 && z <= y <= 4 z && z/y <= x <= 2 z/y, {x, y, z}], 
 PlotPoints -> 100]

Mathematica graphics

But the trouble is that it looks awful, so you can use a function created by Simon Woods, detailed here,

contourRegionPlot3D[region_, {x_, x0_, x1_}, {y_, y0_, y1_}, {z_, z0_, z1_}, 
  opts : OptionsPattern[]] := Module[{reg, preds},
  reg = LogicalExpand[region && x0 <= x <= x1 && y0 <= y <= y1 && z0 <= z <= z1];
  preds = Union@Cases[reg, _Greater | _GreaterEqual | _Less | _LessEqual, -1];
  Show @ Table[ContourPlot3D[
     Evaluate[Equal @@ p], {x, x0, x1}, {y, y0, y1}, {z, z0, z1}, 
     RegionFunction -> Function @@ {{x, y, z}, Refine[reg, p] && Refine[! reg, ! p]},
     opts], {p, preds}]]
contourRegionPlot3D[
 1 <= z <= 2 && z <= y <= 4 z && z/y <= x <= 2 z/y, {z, 1, 2.5}, {y, 
  0, 7}, {x, 0, 2.5}, AxesLabel -> {"x", "y", "z"}]

Mathematica graphics

POSTED BY: Jason Biggs
Posted 10 years ago

Thanks a lot Jason!

Cheers

POSTED BY: vick ratnam
POSTED BY: Jason Biggs
Posted 10 years ago

What about plotting the curve? You said it was difficult!

What we have plotted is only the range of the object, isn't it?

By the way how do you get the plot bigger in your last reply?

Thanks a lot for your help!

POSTED BY: vick ratnam

Apparently ImplicitRegion is new to version 10 - in your original code you had ImplicitRegion, you should notice that it is in blue, meaning it isn't defined.

This will also work,

RegionPlot3D[
 1 <= z <= 2 && z <= y <= 4 z && z/y <= x <= 2 z/y, {z, 1, 2.5}, {y, 
  0, 7}, {x, 0, 2.5}, PlotPoints -> 100]  
POSTED BY: Jason Biggs
Posted 10 years ago

Hi,

Thanks for replying!

The second plot works fine. However, i'm not able to duplicate your first plot. I'm using Mathematica 9 Home Edition.

The error I'm getting is as follows:

RegionPlot3D::argr: RegionPlot3D called with 1 argument; 4 arguments are expected. >>

Can you help with this one?

Thanks

POSTED BY: vick ratnam
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard