Mathematica Problem showing graphics in Mathematica

AI Thread Summary
The discussion revolves around solving an electrostatics problem related to the potential of a cylinder under specific conditions using Mathematica. The user shares their code for calculating the potential inside and outside the cylinder and visualizing it with a 3D plot. They provide a link to an output image of the cylinder and seek confirmation from others about the accuracy of their results. Another participant suggests checking for any lingering definitions in Mathematica that might affect the output. The conversation includes requests for others to share their results and images, along with additional resources like a notebook file for further examination. The focus remains on ensuring the correct visualization of the cylinder with a radius of 1, centered at the origin.
jorgext
Messages
8
Reaction score
0
Hi all,

I solved a problem of electrostatics potencial of a cylinder with special condicions. When I plotted the obtained solution, I used this code:

\[Epsilon] = 8.8541878176 10^-12;
R=1;
maxx=10;
Vin[\[Rho]_, \[Phi]_] := (2 \[Sigma] R)/(\[Pi] \[Epsilon])
Sum[If[OddQ[k], 1/k^2 Sin[k \[Phi]] (\[Rho]/R)^k, 0], {k, 0, maxx}]
Vout[\[Rho]_, \[Phi]_] := (2 \[Sigma] R)/(\[Pi] \[Epsilon])
Sum[If[OddQ[k], 1/k^2 Sin[k \[Phi]] (\[Rho]/R)^-k, 0], {k, 0,
maxx}]
V[\[Rho]_, \[Phi]_] :=
If[R < \[Rho], Vin[\[Rho], \[Phi]], Vout[\[Rho], \[Phi]]]
Show[
RevolutionPlot3D[
V[\[Rho], \[Phi]], {\[Rho], 0, 2}, {\[Phi], 0, 2 \[Pi]}],
Graphics3D[{Blue, Opacity[0.5], Cylinder[]}]
]I got this output:

http://www.alumnos.usm.cl/~jorge.lopezl/problem001.jpg

Do you get the same problem with the image?

I want to see a cylinder of radius R=1, centered in the origin with Z as vertical axis.

Greatings.

PS: Here is the NB file: http://www.alumnos.usm.cl/~jorge.lopezl/Griffiths%203.39.nb
 
Last edited by a moderator:
Physics news on Phys.org
I get a very nice cylinder of radius 1, as you said one should.
Are you sure you don't have some old definitions from earlier commands hanging around?

(Using Mathematica 6.0 btw)
 
That all code I used.

Where can I look for definitions?
 
Can you post the obtained image please?
 
I'll attach the notebook with the image in an output cell. If you evaluate the cell with "img = ..." you can do with it what you like (e.g. Export["filename", img, "format"]).
 

Attachments

Same problem, I added one constant that wasn't included.

Please check the file I attached here:

http://www.alumnos.usm.cl/~jorge.lopezl/cylinder.nb
 
Last edited by a moderator:
The cylinder is there in the image you posted.
 

Similar threads

Replies
11
Views
3K
Replies
2
Views
3K
Replies
3
Views
2K
Replies
1
Views
1K
Replies
1
Views
4K
Replies
5
Views
2K
Replies
8
Views
10K
Back
Top