0
$\begingroup$

I am new to Mathematica, trying to plotting spherical harmonics of a wave functon. I want to plot ${}Y^0_3$. So I typed

SphericalPlot3D[5 Cos^3[θ] - 3 Cos[θ], {θ, 0, Pi}, {φ, 0, 2 Pi}]

It gives me an empty plot like this:

Picture

When I copy the same equation

(5 Cos^3[θ] - 3 Cos[θ], {θ, 0, Pi}, {φ, 0, 2 Pi}) 

into Wolfram|Alpha, it gives me a 3d plot looks like "waves"(sorry, I couldn't put the picture because my reputaion is less than 10)

My main question is What's wrong with my input in Mathematica?

$\endgroup$

closed as off-topic by Szabolcs, MarcoB, corey979, happy fish, Artes Mar 27 '17 at 14:28

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Szabolcs, MarcoB, corey979, happy fish
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ I think the constant in the front of the equation is not important for spatial plot. So I didn't write it. $\endgroup$ – Chao Song Mar 26 '17 at 13:01
  • $\begingroup$ Possible duplicate of problem with coloring spherical harmonics $\endgroup$ – Artes Mar 27 '17 at 14:28
3
$\begingroup$

What is wrong is that Cos^3 is not a function. The following works:

SphericalPlot3D[5 Cos[theta]^3 - 3 Cos[theta], {theta, 0, Pi}, {phi, 0, 2 Pi}]

plot

To debug your issue, you could have tried to plot 5 Cos^3[theta] - 3 Cos[theta] for example and see that it gives an empty plot. Then plot 3 Cos[theta], etc. until you understand what's wrong.

$\endgroup$
  • $\begingroup$ I try it with ${}Y^1_3$ SphericalPlot3D[ E^(I$\phi$) Sin[$\theta$]] (5 Cos[$\theta$]^2 - 1), {$\theta$, 0, Pi}, {$\phi$, 0, 2 Pi}] It still empty. What's wrong? $\endgroup$ – Chao Song Mar 26 '17 at 14:08
  • $\begingroup$ E^(I*phi) is complex-valued. What output would you expect? $\endgroup$ – anderstood Mar 26 '17 at 14:18
  • $\begingroup$ may be it's a physics problem, It should be the Atomic d orbital. I misunderstood the physics process. $\endgroup$ – Chao Song Mar 26 '17 at 14:28
  • $\begingroup$ @Chao, shouldn't you be plotting the real part, the imaginary part, or the absolute value? $\endgroup$ – J. M. will be back soon Mar 26 '17 at 14:35
  • $\begingroup$ @ChaoSong Maybe relevant: en.wikipedia.org/wiki/Spherical_harmonics#Real_form $\endgroup$ – anderstood Mar 26 '17 at 14:40

Not the answer you're looking for? Browse other questions tagged or ask your own question.