Problem showing graphics in Mathematica

  • Context: Mathematica 
  • Thread starter Thread starter jorgext
  • Start date Start date
  • Tags Tags
    Graphics Mathematica
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 3K views
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: