MathGroup Archive 1990

[Date Index] [Thread Index] [Author Index]

Search the Archive

Spherical Harmonic summary

Thanks to everyone who responded to my query about
evaluating the spherical harmonic function Ylm
for theta=0 and phi=0. 

Given the way mathematica evaluates expressions, the
most stable way to obtain this result is to use:

SphericalHarmonicY[2,0,theta,phi] /. {theta->0, phi->0}
(Several people pointed out variations of this command).

John Schmidt writes that Wolfram acknowledges the error messages
when asking for expressions like SphericalHarmonicY[2,0,0,0]
be a bug, which may get fixed in a future release.

Meanwhile, I have discovered that when I ask for the *plot*,
say, using the command:

Plot[{ SphericalHarmonicY[2,0,theta,phi] /.phi->0 },

Mathematica barfs up a few complaints, and then
goes on to draw the correct plot, presumably applying a limiting
algorithm at theta->0. 
This also happens for the simpler command:

Plot[SphericalHarmonicY[2,0,theta,0], {theta,0,Pi}] .

By the way, what I'm using all this for is to make animations of
Earth's free oscillations from an earthquake, for my class
in Geophysics. If anybody wants to see the 1st Toroidal mode
of oscillation, run this script, and then animate it (on
the Macintosh):
l:=2; m:=0;
utheta:=(w/Sin[theta]) D[ylm,phi];
uphi:=-w D[ylm,theta];
A:= .2;
amp:=A Cos[tphase];
u:=theta+amp utheta; v:=phi+amp uphi;
{Sin[u] Cos[v], Sin[u] Sin[v], Cos[u]},
{theta, 0, Pi, Pi/15}, {phi,0,2Pi,Pi/15},
ViewPoint->{2.872, 1.166, 1.356}],

Peter R. Shaw    pshaw at
Woods Hole Oceanographic Institution

  • Prev by Date: Re: Fitting data with Mathematica
  • Next by Date: Re: LISP/Mathematica Interface
  • Previous by thread: Re: Fitting data with Mathematica
  • Next by thread: Re: LISP/Mathematica Interface