Hello,
Im learning how to use SphericalPlot3D. Im using the following statement:
SphericalPlot3D[Cos[?],{?,0,?},{?,0,2 ?}]
I was expecting to get a cosine curve along y-axis rotated around the same axis. More or less like an hourglass. What I get is a sphere. What do I have to specify in SphericalPlot3D in order to get rotated vertical cosine?
When I use the following statement:
SphericalPlot3D[Cos[2 ?],{?,0,?},{?,0,2 ?}]
I would expect to get 2 hourglasses, one standing on the other along y-axis. I get something different. Where do I go wrong?
Thanks/Mikael
Hello Mikael,
this happens because the radius you are plotting becomes eventually negative. Try:
SphericalPlot3D[Abs @ Cos[\[Theta]], {\[Theta], 0, \[Pi]}, {?, 0, 2 \[Pi]}]
Regards – Henrik
Many thanks Henrik. Abs[Cos[Theta]] gives 2 spheres along y-axis not a cosine. Abs[Cos[2 Theta]] gives the same strange results as before. So the question remains.
Yes, it gives spheres - that is a consequence from Pythagoras. Maybe you have
SphericalPlot3D[Cos[\[Theta]]^2, {\[Theta], 0, \[Pi]}, {?, 0, 2 \[Pi]}]
in mind ?!? Regarding the second plot:
I would expect to get 2 hourglasses, one standing on the other along y-axis.
Whenever you plot something which is independent of \phi you get a rotational symmetric structure along the z axis.
I’m attaching a file showing what I have in mind. Maybe you can figure it out. According to the same paper it is the distance from origin that should vary as Cos[Theta]. Therefore I specified Cos[Theta] as first parameter in SphericalPlot3D, which according to Mathematica documentation shall be the radius function, which in this case is Cos[Theta]. I do not understand what I’m doing wrong. I have the same problem with PolarPlot when I remove the Phi-dimension. I get 2 circles instead of hourglass outline.
Yes, of course, any object not depending on Phi will be symmetric around axis (I call it y-axis, pointing up on your screen). 2 hourglasses standing on each other along y-axis is symmetrical.
Thanks/Mikael
Hi again Mikael,
I would qualify this hydrogen-2pz-orbital plot which you are referring to as somewhat misleading. The wave function is proportional to Y_(1,0), that is certainly true. But the according orbital - i.e. probability density - is proportional to |Y_(1,0)|^2. Therefore I was proposing Cos[\theta]^2. Nice presentations of spherical harmonics can be found e.g. on Wikipedia. There you can see those “two circles” as well.
Regards – Henrik
Thanks Henrik,
You are right, using Cos[Theta]^2 gives correct image for the example shown in my previous post. However for the following orbital, Cos[2 Theta], it does not even after squaring. It looks like we didn’t find right formula yet.
My experiments show that for Cos[Theta], I should square but for Cos[2 Theta] I should not!?
The spherical harmonics are well defined - I propose you go for good references. I can not see any problem here, and having Mathematica at your fingertips there are even less problems:
Wow, many thanks Henrik. It was SphericalHarmonicsY function that I tried to construct because I didn’t know it was available in Mathematica. You need to square it for plotting otherwise the plot will be wrong for l=1.