# Plotting an equation with three independent in Cylindrical coordinates

I have a function in cylindrical co-ordinate with 3 independent coorrdinates, give by:

f[r_, z_, v_] := -(Sqrt[E^(-(r^2/32) - z^2/32) - v^2]/$Pi]) + 45/392 r^2 Sqrt[E^(-(r^2/32) - z^2/32) - v^2] - ( 1.5957691216057308 E^(-(r^2/32) - z^2/ 32) (-1 - E^(r^2/32 + z^2/32) + E^(r^2/32 + z^2/32) v^2))/(1 - 2 (-E^(-(r^2/32) - z^2/32) + v^2))^(3/2) - ( 2 Sqrt[E^(-(r^2/32) - z^2/32) - v^2] (1 - 2 Log[-4 (-E^(-(r^2/32) - z^2/32) + v^2)]))/(49 $$Pi])  As this has 3 independent variables, I need to have a 4D plot. Hence I used DensityPlot3D. [![DensityPlot3D\[ftrGenK\[\[2$$$, {r, -20, 20}, {z, -20, 20}, {v, -1, 1},
AxesLabel -> {"r", "z", "v"},
AxesStyle -> Directive$Black, FontSize -> 15$,
AxesStyle -> Directive$Black, FontSize -> 15$,
ColorFunction -> "Rainbow", LabelStyle -> Directive$Bold, Black$,
TicksStyle -> Directive$Thick, Black, 15$, PlotLabel -> "$Kappa$=2",
PlotLegends ->
BarLegend${"Rainbow", {0, 1}}, LegendMarkerSize -> 150, LegendMargins -> {{0, 0}, {20, 0}}$\]][1]][1]


I got a plot like this:

As my equation is in cylindrical coordinates, is this correct way to do this?? I think the plot have come issue. Can you please help me Thanks in advance

• First, in cylindrical coordinate we have three variables with specific ranges z(0, infinity), \theta (0,2pi) and r (0, infinity) . You have to define this clearly. Your code is a mess, you did not define ftrGenK[]. Can you revise your code and make it more clear? Aug 5 '18 at 13:20

In Cartesian coordinates, it looks like two eggs in a frying pan

f[r_, z_, v_] := -(Sqrt[E^(-(r^2/32) - z^2/32) - v^2]/\[Pi]) +
45/392 r^2 Sqrt[
E^(-(r^2/32) - z^2/32) -
v^2] - (1.5957691216057308 E^(-(r^2/32) - z^2/32) (-1 -
E^(r^2/32 + z^2/32) + E^(r^2/32 + z^2/32) v^2))/(1 -
2 (-E^(-(r^2/32) - z^2/32) + v^2))^(3/2) - (2 Sqrt[
E^(-(r^2/32) - z^2/32) - v^2] (1 -
2 Log[-4 (-E^(-(r^2/32) - z^2/32) + v^2)]))/(49 \[Pi])
DensityPlot3D[
f[Sqrt[x^2 + y^2], z, ArcTan[y/x]], {x, 0, 20}, {y, -10,
10}, {z, -10, 10}, AxesLabel -> {"x", "y", "z"},
AxesStyle -> Directive[Black, FontSize -> 15],
AxesStyle -> Directive[Black, FontSize -> 15],
ColorFunction -> "Rainbow", LabelStyle -> Directive[Bold, Black],
TicksStyle -> Directive[Thick, Black, 15], PlotLabel -> "\[Kappa]=2",
PlotLegends ->
BarLegend[{"Rainbow", {0, 1}}, LegendMarkerSize -> 150,
LegendMargins -> {{0, 0}, {20, 0}}]]


• Thanks a lot.. I had to make some changes.. but finally it worked. Thank you for the idea. Thank you Aug 7 '18 at 12:26