Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Spherical Harmonics' topicStudent Support Forum > General > Archives > "Spherical Harmonics"

Next Comment >Help | Reply To Topic
Author Comment/Response
Volker Presser
07/26/07 04:01am

Hello,

as a newbie to mathematica, this question may be trivial to answer - anyhow for me it's kinda problem.

I'm trying to plot a spherical harmonic equation (already simplified so that the problem is reduced to a "simple" multiplication). So essentially, we have in spherical coordinates:

r = Sum(Cij*Yij)

In detail, this looks like the following:

C00 = 1;
C20 = 0.49599;
C21P = 0;
C21M = 0;
C22P = 0;
C22M = 0;
C40 = -0.20588;
C41P = 0;
C41M = 0;
C42P = 0;
C42M = 0;
C43P = 0;
C43M = 0;
C44P = 0.00018;
C44M = 0;
C60 = 0.02890;
C61P = 0;
C61M = 0;
C62P = 0;
C62M = 0;
C63P = -0.24377;
C63M = 0;
C64P = 0;
C64M = 0;
C65P = 0;
C65M = 0;
C66P = 0;
C66M = 0;

Y00 = 1;
Y20 = 0.5*(3*(Cos (Theta))^2 - 1);
Y21P = 2*Cos (Theta)*Sin (Theta)*Cos (Phi);
Y21M = 2*Cos (Theta)*Sin (Theta)*Sin (Phi);
Y22P = (Sin (Theta))^2*Cos (2*Phi);
Y22M = (Sin (Theta))^2*Sin (2*Phi);
Y40 = 0.12500*(35*(Cos (Theta))^4 - 30*(Cos (Theta))^2 + 3);
Y41P = 0.94695*(7*(Cos (Tehta))^2 - 3)*Cos (Theta)*Sin (Theta)*
Cos (Phi);
Y41M = 0.94695*(7*(Cos (Tehta))^2 - 3)*Cos (Theta)*Sin (Theta)*
Sin (Phi);
Y42P = 0.77778*(7*(Cos (Tehta))^2 - 1)*(Sin (Theta))^2*Cos (2*Phi);
Y42M = 0.77778*(7*(Cos (Tehta))^2 - 1)*(Sin (Theta))^2*Sin (2*Phi);
Y43P = 3.07920*Cos (Theta)*(Sin (Theta))^3*Cos (3*Phi);
Y43M = 3.07920*Cos (Theta)*(Sin (Theta))^3*Sin (3*Phi);
Y44P = (Sin (Theta))^4*Cos (4*Phi);
Y44M = (Sin (Theta))^4*Sin (4*Phi);
Y60 = 0.06250*(231*(Cos (Theta))^6 - 315*(Cos (Theta))^4 +
105*(Cos (Theta))^2 - 5);
Y61P = 0.69140*(33*(Cos (Theta))^4 - 30*(Cos (Theta))^2 - 5)*
Cos (Theta)*Sin (Theta)*Cos (Phi);
Y61M = 0.69140*(33*(Cos (Theta))^4 - 30*(Cos (Theta))^2 - 5)*
Cos (Theta)*Sin (Theta)*Sin (Phi);
Y62P = 0.64549*(33*(Cos (Theta))^4 - 18*(Cos (Theta))^2 +
1)*(Sin (Theta))^2*Cos (2*Phi);
Y62M = 0.64549*(33*(Cos (Theta))^4 - 18*(Cos (Theta))^2 +
1)*(Sin (Theta))^2*Sin (2*Phi);
Y63P = 1.41685*(11*(Cos (Theta))^2 - 3)*Cos (Theta)*(Sin (Theta))^3*
Cos (3*Phi);
Y63M = 1.41685*(11*(Cos (Theta))^2 - 3)*Cos (Theta)*(Sin (Theta))^3*
Sin (3*Phi);
Y64P = 0.81675*(11*(Cos (Theta))^2 - 1)*(Sin (Theta))^4*Cos (4*Phi);
Y64M = 0.81675*(11*(Cos (Theta))^2 - 1)*(Sin (Theta))^4*Sin (4*Phi);
Y65P = 3.86393*Cos (Theta)*(Sin (Theta))^5*Cos (5*Phi);
Y65M = 3.86393*Cos (Theta)*(Sin (Theta))^5*Sin (5*Phi);
Y66P = (Sin (Theta))^6*Cos (6*Phi);
Y66M = (Sin (Theta))^6*Sin (6*Phi);

Then I define:

all = Y00*C00 + Y20*C20 + Y21P*C21P + Y21M*C21M + Y22P*C22P +
Y22M*C22M + Y40*C40 + Y41P*C41P + Y41M*C41M + Y42P*C42P +
Y42M*C42M + Y43P*C43P + Y43M*C43M + Y44P*C44P + Y44P*C44P +
Y60*C60 + Y61P*C61P + Y61M*C61M + Y62P*C62P + Y62M*C62M +
Y63P*C63P + Y63M*C63M + Y64P*C64P + Y64M*C64M + Y65P*C65P +
Y65M*C65M + Y66P*C66P + Y66M*C66M;

And now I try to Plot all that:

SphericalPlot3D[all, {Theta, 0, Pi}, {Phi, 0, 2 Pi}]

However, the resulting Plot remains blank. Can anyone help me to solve this problem?

Thanks a lot!

Best regards,

Volker

Attachment: spherical harmonics.nb, URL: ,

Subject (listing for 'Spherical Harmonics')
Author Date Posted
Spherical Harmonics Volker Presser 07/26/07 04:01am
Re: Spherical Harmonics Gopinath Ven... 07/26/07 3:28pm
Next Comment >Help | Reply To Topic