Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.1K Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Does SliceContourPlot3D work with cylindrical (or spherical) coordinates?

Posted 10 years ago

Hi, I am trying to SliceContourPlot3D a function of cylindrical coordinates. The slice that I want is r=const. I expect to get a ring-shaped picture that will show axial and azimuthal distribution of my function, as I go around the axis. However, what I get is a flat slice. It is inside a rectangular box with dimensions Rmax, 2pi and zmax, which looks like the SliceContourPlot3D treats my cylindrical coordinates as cartesian x,y,and z. I can't find any options in SliceContourPlot3D which would tell it that I mean cylindrical coordinates. Is it possible to SliceContourPlot in cylindrical coordinates and if yes, how?

Thanks very much

yz

POSTED BY: Yuri Zuev
4 Replies
Posted 10 years ago

Yes, and that's more or less what I am doing, but:

Due to cylindrical symmetry of my problem (a system of PDE's) there are more equations to solve in cartesian than in cylindrical coordinates. There is no theta dependence or theta component to the field I am solving for, so I don't have the theta equation. The system is already fairly computationally intensive, especially if I reduce granularity, so reducing the number of equations would help.

Thanks for your help, I really appreciate it.

POSTED BY: Yuri Zuev

You can rewrite the cylindrical equation into the equivalent cartesian equation with a simple replacement

Thread[{r, \[Theta], z} -> 
  CoordinateTransform["Cartesian" -> "Cylindrical", {x, y, z}]]

As for the cylinder x^2 + y^2 = 100, it seems to work for me:

cylEq = r^2 + z^2;
coordTransform = 
  Thread[{r, \[Theta], z} -> 
    CoordinateTransform["Cartesian" -> "Cylindrical", {x, y, z}]];
cartEq = cylEq /. coordTransform;
SliceContourPlot3D[cartEq, 
 x^2 + y^2 == 100, {x, -10, 10}, {y, -10, 10}, {z, -10, 10}]
POSTED BY: Gianluca Gorni
Posted 10 years ago

Thank you. Yes, that works, however if I have the solution to my equations in cylindrical coordinates, the SliceContourPlot3D will not easily understand x^2 + y^2 = 100. Hence the dilemma.

POSTED BY: Yuri Zuev

It seems that SliceContourPlot3D only works in cartesian coordinates. However, you can probably adapt it to your situation by replacing r==1 with the cartesian x^2 + y^2 == r^2

SliceContourPlot3D[x^2 + y^2 + z^2, 
 x^2 + y^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard