0

I need help figuring out how to plot in cylindrical coordinates. I read that CylindricalPlot3D was replaced with RevolutionPlot3D. Here is my function:

Integrate[ r^3*(Cos[ θ])^2, { θ, 0, 2 π}, {r, 0, 1}, {z, 0, 2 r}]
(2 π)/5

when I try RevolutionPlot3D I get:

RevolutionPlot3D[ r^3*(Cos[θ])^2, { θ, 0, 2 π}, {r, 0, 1}, {z, 0, 2 r}]
RevolutionPlot3D::nonopt: Options expected (instead of {z,0,2 r}) beyond position 3 
in RevolutionPlot3D[r^3 Cos[θ]^2,{ θ,0,2 π},{r,0,1},{z,0,2 r}]. 
An option must be a rule or a list of rules. >>
Artes
  • 57,212
  • 12
  • 157
  • 245
user10977
  • 41
  • 3
  • @Kuba I wonder if people take the time to reformat code would it be too much extra to replace i -> I? Sorry for nitpicking, but you inter-edited my edit which I discarded :) Also \[Theta] to θ. – István Zachar Dec 06 '13 at 07:56
  • i'm sorry i don't know what code reformat i was supposed to use. i'm trying to plot this triple integral volume. – user10977 Dec 06 '13 at 07:59
  • @IstvánZachar you are right, I was not paying attention. About greek letters, I replace them only when I'm on pc with the addon for it, now I'm not :) – Kuba Dec 06 '13 at 08:00
  • Thanks @Kuba, a tidy edit is a good edit. Now I go on to find another stackexchanger to bully :) User10977: You could format code blocks with CTRL+K, quotes with CTRL+Q. Look up help. – István Zachar Dec 06 '13 at 08:05
  • oh ok. anyway, any idea why it's not working – user10977 Dec 06 '13 at 08:05
  • 1
    @user10977, what are you trying to visualise, the function r^3 Cos[θ]^2 or the volume over which you have integrated it? – Simon Woods Dec 06 '13 at 09:40
  • 1
    Your syntax is not valid for CylindricalPlot3D either. Do you have existing code you are trying to run? If not, why the reference to CylindricalPlot3D? – Mr.Wizard Dec 06 '13 at 17:33

1 Answers1

1

RevolutionPlot3D accepts only a maximum of two variables for iteration in the form RevolutionPlot3D[f, {t, ...}, {θ, ...}]. Nevertheless, one can manipulate the third:

Manipulate[RevolutionPlot3D[r^3*(Cos[θ])^2, {θ, 0, 2 π}, {z, 0, 2 r}, 
  AxesLabel -> {"X", "Y", "Z"}, SphericalRegion -> True, Mesh -> False, 
  PlotRange -> {{-7, 7}, {-7, 7}, {-2, 2}}, BoxRatios -> {1, 1, .5}],
 {{r, π/2}, 0.001, π}]

Mathematica graphics

cormullion
  • 24,243
  • 4
  • 64
  • 133
István Zachar
  • 47,032
  • 20
  • 143
  • 291
  • thank you very much for the response but that's not what it is supposed to look like. it needs to be the solid volume solid that lies within the cylinder x^2+y^2=1, above the plain z=0 ,and below the cone z^2=4x^2+4y^2. i converted to cylindrical coordinates (z,r,theta) – user10977 Dec 06 '13 at 08:51
  • @user10977 So you want this RegionPlot3D[x^2 + y^2 < 1 && z^2 < 4 x^2 + 4 y^2, {x, -1, 1}, {y, -1, 1}, {z, 0, 2}, PlotPoints -> 40, MaxRecursion -> 3, PlotRange -> All, Mesh -> None, PlotStyle -> Opacity@.3] but done with RevolutionPlot3D? – István Zachar Dec 06 '13 at 12:30
  • Yes yes thank you that is exactly the shape i need you are the best. It does not need to be with RevolutionPlot3D. I should have explained myself more clearly. I'm looking to create a graph with that solid/volume that i can manipulate the variables just like this example: http://demonstrations.wolfram.com/data/001571/0007/ExploringCylindricalCoordinates/ExploringCylindricalCoordinates-source.nb – user10977 Dec 07 '13 at 00:25
  • here is the page it comes from http://demonstrations.wolfram.com/ExploringCylindricalCoordinates/ – user10977 Dec 07 '13 at 00:35