MathGroup Archive 2009

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

Search the Archive

SphericalHarmonics strange behavior

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100961] SphericalHarmonics strange behavior
  • From: "lbloy at seas.upenn.edu" <lbloy at seas.upenn.edu>
  • Date: Thu, 18 Jun 2009 20:47:43 -0400 (EDT)

Hi all,

working with some spherical harmonics and have some questions about the code as implemented in mathematica.

based on http://mathworld.wolfram.com/SphericalHarmonic.html

I put together the following code to see what is implemented

th1 = 1.324;
ph1 = 5.231;

diffY[l_, m_, t_, p_] := 
  Module[{val1, val2}, val1 = SphericalHarmonicY[l, m, t, p]; 
        val2 = 
    Sqrt[((2*l + 1)*(l - m)!)/((4*Pi)*(l + m)!)]*
     LegendreP[l, m, Cos[t]]*E^(I*m*p); 
        Print[{val1, val2, Abs[val1 - val2]}]; 
   Return[Abs[val1 - val2]]; ]; 

diffY[1, 1, th1, ph1]

diffY[1, -1, th1, ph1]

Clearly there is some sign error somewhere I was wondering if anyone had any suggestions.

thanks
Luke


  • Prev by Date: Re: Manipulate function
  • Next by Date: Re: Problem with 3d graphics on Linux
  • Previous by thread: Re: Text and multiple calculations in an IF condition
  • Next by thread: Re: SphericalHarmonics strange behavior