# Mathematica Problem showing graphics in Mathematica

#### jorgext

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 [Broken]

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 [Broken]

Last edited by a moderator:
Related MATLAB, Maple, Mathematica, LaTeX, Etc News on Phys.org

#### CompuChip

Homework Helper
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)

#### jorgext

That all code I used.

Where can I look for definitions?

#### jorgext

Can you post the obtained image please?

#### CompuChip

Homework Helper
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

• 17 KB Views: 104

#### jorgext

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 [Broken]

Last edited by a moderator:

#### Dale

Mentor
The cylinder is there in the image you posted.

### Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving