Problem showing graphics in Mathematica

In summary: I don't see any problems with it.In summary, the conversation revolved around solving a problem of electrostatics potential for a cylinder with specific conditions. The solution was plotted using a code and the obtained output was a cylinder of radius 1 centered at the origin with the vertical axis as Z. There was some discussion about old definitions and a constant being added, but in the end, the image was confirmed to be correct.
  • #1
jorgext
8
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
  • #2
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)
 
  • #3
That all code I used.

Where can I look for definitions?
 
  • #4
Can you post the obtained image please?
 
  • #5
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

  • cylinder.nb
    17 KB · Views: 324
  • #6
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:
  • #7
The cylinder is there in the image you posted.
 

1. Why am I having trouble displaying graphics in Mathematica?

There could be several reasons for this issue. It could be due to outdated graphics drivers, incompatible graphics card, or a bug in the software. It is recommended to check for updates, make sure your graphics card is supported, and report any potential bugs to the Mathematica support team.

2. How can I improve the quality of graphics in Mathematica?

There are a few ways to improve the quality of graphics in Mathematica. You can adjust the resolution of the graphics, use anti-aliasing, or use higher quality rendering options. Additionally, using high-resolution images as input can also improve the quality of the graphics.

3. How do I export graphics from Mathematica?

To export graphics from Mathematica, you can use the "Export" function and specify the desired file format. You can also use the right-click menu on the graphics and select "Save Graphic As" to save it as an image file. Alternatively, you can copy and paste the graphics into other applications.

4. Can I customize the appearance of graphics in Mathematica?

Yes, you can customize the appearance of graphics in Mathematica by using various styling and labeling functions. You can also change the color, size, and shape of different elements in the graphics. The "Graphics" documentation in Mathematica provides a comprehensive list of customization options.

5. How can I troubleshoot issues with graphics in Mathematica?

If you are experiencing issues with graphics in Mathematica, you can try restarting the software, updating your graphics drivers, or using the "Clear" function to reset the graphics environment. If the issue persists, you can seek help from the Mathematica support team or consult the documentation for further troubleshooting steps.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
11
Views
2K
Replies
5
Views
1K
Replies
4
Views
2K
  • Introductory Physics Homework Help
Replies
1
Views
822
  • Introductory Physics Homework Help
Replies
1
Views
998
  • Classical Physics
Replies
0
Views
144
  • Advanced Physics Homework Help
Replies
1
Views
3K
  • Differential Equations
Replies
5
Views
2K
  • Advanced Physics Homework Help
Replies
8
Views
7K
Back
Top