正在加载图片...
6.8 Spherical Harmonics 253 The first few associated Legendre polynomials,and their corresponding nor- malized spherical harmonics,are P8(z)=1 Y00= 标 P(x)=-(1-x2)1/2 h1=-V房sin9eo PO(r)=z Y10= V层cos0 P(x)=3(1-x2) y2=号V2尝sin20e2io P(x)=-3(1-x2)1/2x Y21=-V8m 15 sin 0 cos ei 83g P(a)=是(3x2-1) Y20=√(侵cos20-) (6.8.5) 11800 There are many bad ways to evaluate associated Legendre polynomials numer- ically.For example,there are explicit expressions,such as m因=0+a-2 (0-m)(m+l+1) 2mm!(I-m)! 1(m+1) +-=m0-m+m+1+2(() 2(m+1)(m+2) 5今 Press. (6.8.6) where the polynomial continues up through the term in (1-x)-m.(See [1]for this and related formulas.This is not a satisfactory method because evaluation 、g罗色% OF SCIENTIFIC( of the polynomial involves delicate cancellations between successive terms,which alternate in sign.For large l,the individual terms in the polynomial become very much larger than their sum,and all accuracy is lost. In practice,(6.8.6)can be used only in single precision (32-bit)for l up to 6 or 8,and in double precision(64-bit)for I up to 15 or 18,depending on the precision required for the answer.A more robust computational procedure is therefore desirable,as follows: The associated Legendre functions satisfy numerous recurrence relations,tab- 10-521 ulated in[1-21.These are recurrences on I alone,on m alone,and on both l Numerica and m simultaneously.Most of the recurrences involving m are unstable,and so 43106 dangerous for numerical work.The following recurrence on I is,however,stable (compare 5.5.1): (l-m)Pm=x(2l-1)P1-(l+m-1)P2 (6.8.7) It is useful because there is a closed-form expression for the starting value, Pm=(-1)m(2m-1)(1-x2)m/2 (6.8.8) (The notation n!!denotes the product of all odd integers less than or equal to n.) Using (6.8.7)with l =m +1,and setting Prm1=0,we find Pm+1=(2m+1)Pm (6.8.9) Equations(6.8.8)and(6.8.9)provide the two starting values required for(6.8.7) for general l. The function that implements this is6.8 Spherical Harmonics 253 Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). The first few associated Legendre polynomials, and their corresponding nor￾malized spherical harmonics, are P0 0 (x)= 1 Y00 = 1 4π P1 1 (x) = − (1 − x2)1/2 Y11 = − 3 8π sin θeiφ P0 1 (x) = x Y10 = 3 4π cos θ P2 2 (x) = 3 (1 − x2) Y22 = 1 4 15 2π sin2 θe2iφ P1 2 (x) = −3 (1 − x2)1/2x Y21 = − 15 8π sin θ cos θeiφ P0 2 (x) = 1 2 (3x2 − 1) Y20 = 5 4π ( 3 2 cos2 θ − 1 2 ) (6.8.5) There are many bad ways to evaluate associated Legendre polynomials numer￾ically. For example, there are explicit expressions, such as P m l (x) = (−1)m(l + m)! 2mm!(l − m)! (1 − x2) m/2  1 − (l − m)(m + l + 1) 1!(m + 1) 1 − x 2  + (l − m)(l − m − 1)(m + l + 1)(m + l + 2) 2!(m + 1)(m + 2) 1 − x 2 2 −··· (6.8.6) where the polynomial continues up through the term in (1 − x)l−m. (See [1] for this and related formulas.) This is not a satisfactory method because evaluation of the polynomial involves delicate cancellations between successive terms, which alternate in sign. For large l, the individual terms in the polynomial become very much larger than their sum, and all accuracy is lost. In practice, (6.8.6) can be used only in single precision (32-bit) for l up to 6 or 8, and in double precision (64-bit) for l up to 15 or 18, depending on the precision required for the answer. A more robust computational procedure is therefore desirable, as follows: The associated Legendre functions satisfy numerous recurrence relations, tab￾ulated in [1-2]. These are recurrences on l alone, on m alone, and on both l and m simultaneously. Most of the recurrences involving m are unstable, and so dangerous for numerical work. The following recurrence on l is, however, stable (compare 5.5.1): (l − m)P m l = x(2l − 1)P m l−1 − (l + m − 1)P m l−2 (6.8.7) It is useful because there is a closed-form expression for the starting value, P m m = (−1)m(2m − 1)!!(1 − x2) m/2 (6.8.8) (The notation n!! denotes the product of all odd integers less than or equal to n.) Using (6.8.7) with l = m + 1, and setting P m m−1 = 0, we find P m m+1 = x(2m + 1)P m m (6.8.9) Equations (6.8.8) and (6.8.9) provide the two starting values required for (6.8.7) for general l. The function that implements this is
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有