Group Abstract Group Abstract

Message Boards Message Boards

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

Posted 10 years ago

Hi,

I have a triple integral and i would like to plot it in Mathematica to understand the object and the implications of its volume under the curve.

It's easy to integrate and the answer is 57375 / 64.

The triple Integral is as follows:

? ? ? x^3 * y^5 * z dxdydz z = (1,2); y = (z, 4z); and x = (z/y, 2z/y)

I have done the following, most of the syntax i copied from another demonstration but i still think it is not the real shape of the object in question:

r = ImplicitRegion[{z > 0, y > 0, z >= 0}, {x, y, z}];
 i = HoldForm[
    Integrate[x^3*y^5*z, {z, 1, 2}, {y, z, 4*z}, {x, z/y, 2*z/y}]];
 cp = ContourPlot3D[{z, y, z}, {x, 0, 40}, {y, 0, 40}, {z, 0, 40}, 
    Mesh -> None, ContourStyle -> {Red, Green, Blue, Orange}, 
    PlotLegends -> "Expressions"];
 rp = RegionPlot3D[r, PlotPoints -> 100, Background -> Black];
 TraditionalForm[
  Column[{r, Row[{i, "=", ReleaseHold[i]}], 
    Row[{"Volume[r]= ", Volume[r]}], Row[{cp, rp}]}, 
   Alignment -> Center]]

Can someone help me to plot the actual object in 3D?

Thanks

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

You can look into the various ways of plotting multivariable functions, look here and here.

To get a plot larger, use the ImageSize option.

Here is one method, introduced in version 10.2,

DensityPlot3D[x^3*y^5*z, {z, 1, 2.5}, {y, 0, 7}, {x, 0, 2.5}, 
 RegionFunction -> 
  Function[{x, y, z}, 
   1 <= z <= 2 && z <= y <= 4 z && z/y <= x <= 2 z/y], 
 PlotPoints -> 100]

Mathematica graphics

POSTED BY: Jason Biggs
Posted 10 years ago
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