c6-8 (779509)

Файл №779509 c6-8 (Numerical Recipes in C)c6-8 (779509)2017-12-27СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла

252Chapter 6.Special FunctionsCITED REFERENCES AND FURTHER READING:Barnett, A.R., Feng, D.H., Steed, J.W., and Goldfarb, L.J.B. 1974, Computer Physics Communications, vol. 8, pp. 377–395. [1]Temme, N.M. 1976, Journal of Computational Physics, vol. 21, pp. 343–350 [2]; 1975, op. cit.,vol. 19, pp. 324–337.

[3]Barnett, A.R. 1981, Computer Physics Communications, vol. 21, pp. 297–314.Thompson, I.J., and Barnett, A.R. 1986, Journal of Computational Physics, vol. 64, pp. 490–509.Abramowitz, M., and Stegun, I.A. 1964, Handbook of Mathematical Functions, Applied Mathematics Series, Volume 55 (Washington: National Bureau of Standards; reprinted 1968 byDover Publications, New York), Chapter 10.6.8 Spherical HarmonicsSpherical harmonics occur in a large variety of physical problems, for example, whenever a wave equation, or Laplace’s equation, is solved by separation of variables in spherical coordinates.

The spherical harmonic Ylm (θ, φ),−l ≤ m ≤ l, is a function of the two coordinates θ, φ on the surface of a sphere.The spherical harmonics are orthogonal for different l and m, and they arenormalized so that their integrated square over the sphere is unity:ZZ2π1dφ−10d(cos θ)Yl0 m0 *(θ, φ)Ylm (θ, φ) = δl0 l δm0 m(6.8.1)Here asterisk denotes complex conjugation.Mathematically, the spherical harmonics are related to associated Legendrepolynomials by the equationsYlm (θ, φ) =2l + 1 (l − m)! mP (cos θ)eimφ4π (l + m)! l(6.8.2)By using the relationYl,−m (θ, φ) = (−1)m Ylm *(θ, φ)(6.8.3)we can always relate a spherical harmonic to an associated Legendre polynomialwith m ≥ 0.

With x ≡ cos θ, these are defined in terms of the ordinary Legendrepolynomials (cf. §4.5 and §5.5) byPlm (x) = (−1)m (1 − x2 )m/2dmPl (x)dxm(6.8.4)Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).Thompson, I.J., and Barnett, A.R. 1987, Computer Physics Communications, vol. 47, pp. 245–257.

[4]2536.8 Spherical HarmonicsThere are many bad ways to evaluate associated Legendre polynomials numerically. For example, there are explicit expressions, such as(l − m)(m + l + 1) 1 − x(−1)m (l + m)!(1 − x2 )m/2 1 −Plm (x) = m2 m!(l − m)!1!(m + 1)2#2(l − m)(l − m − 1)(m + l + 1)(m + l + 2) 1 − x−···+2!(m + 1)(m + 2)2(6.8.6)where the polynomial continues up through the term in (1 − x).

(See [1] forthis and related formulas.) This is not a satisfactory method because evaluationof the polynomial involves delicate cancellations between successive terms, whichalternate in sign. For large l, the individual terms in the polynomial become verymuch 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 upto 6 or 8, and in double precision (64-bit) for l up to 15 or 18, depending onthe precision required for the answer.

A more robust computational procedure istherefore desirable, as follows:The associated Legendre functions satisfy numerous recurrence relations, tabulated in [1-2] . These are recurrences on l alone, on m alone, and on both l andm simultaneously. Most of the recurrences involving m are unstable, and sodangerous for numerical work. The following recurrence on l is, however, stable(compare 5.5.1):l−mmm− (l + m − 1)Pl−2(l − m)Plm = x(2l − 1)Pl−1(6.8.7)It is useful because there is a closed-form expression for the starting value,mPm= (−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.)mUsing (6.8.7) with l = m + 1, and setting Pm−1= 0, we findmmPm+1= x(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 isSample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use.

Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited. To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).The first few associated Legendre polynomials, and their corresponding normalized spherical harmonics, areq1P00 (x) =1Y00 =4πq3P11 (x) = − (1 − x2 )1/2Y11 = − 8πsin θeiφq3P10 (x) =xY10 =cos θ4πq15P22 (x) = 3 (1 − x2 )Y22 = 14 2πsin2 θe2iφq15P21 (x) = −3 (1 − x2 )1/2 xY21 = − 8πsin θ cos θeiφq5 312P20 (x) = 12 (3x2 − 1)Y20 =4π ( 2 cos θ − 2 )(6.8.5)254Chapter 6.Special Functions#include <math.h>if (m < 0 || m > l || fabs(x) > 1.0)nrerror("Bad arguments in routine plgndr");m.pmm=1.0;Compute Pmif (m > 0) {somx2=sqrt((1.0-x)*(1.0+x));fact=1.0;for (i=1;i<=m;i++) {pmm *= -fact*somx2;fact += 2.0;}}if (l == m)return pmm;m .else {Compute Pm+1pmmp1=x*(2*m+1)*pmm;if (l == (m+1))return pmmp1;else {Compute Plm , l > m + 1.for (ll=m+2;ll<=l;ll++) {pll=(x*(2*ll-1)*pmmp1-(ll+m-1)*pmm)/(ll-m);pmm=pmmp1;pmmp1=pll;}return pll;}}}CITED REFERENCES AND FURTHER READING:Magnus, W., and Oberhettinger, F.

1949, Formulas and Theorems for the Functions of Mathematical Physics (New York: Chelsea), pp. 54ff. [1]Abramowitz, M., and Stegun, I.A. 1964, Handbook of Mathematical Functions, Applied Mathematics Series, Volume 55 (Washington: National Bureau of Standards; reprinted 1968 byDover Publications, New York), Chapter 8. [2]Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited.

To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).float plgndr(int l, int m, float x)Computes the associated Legendre polynomial Plm (x). Here m and l are integers satisfying0 ≤ m ≤ l, while x lies in the range −1 ≤ x ≤ 1.{void nrerror(char error_text[]);float fact,pll,pmm,pmmp1,somx2;int i,ll;6.9 Fresnel Integrals, Cosine and Sine Integrals2556.9 Fresnel Integrals, Cosine and Sine IntegralsFresnel IntegralsZC(x) =xcos0π t2 dt,2ZS(x) =xsin0π t2 dt2(6.9.1)The most convenient way of evaluating these functions to arbitrary precision isto use power series for small x and a continued fraction for large x. The series are π 4 x 9 π 2 x 5+−···C(x) = x −2 5 · 2!2 9 · 4! π 3 x 7 π 5 x11 π x3−+−···S(x) =2 3 · 1!2 7 · 3!2 11 · 5!(6.9.2)There is a complex continued fraction that yields both S(x) and C(x) simultaneously:√πz=(1 − i)x2(6.9.3)211 1/2 1 3/2 2···ez erfc z = √π z+ z+ z+ z+ z+2z1·23·41···= √π 2z 2 + 1 − 2z 2 + 5 − 2z 2 + 9 −(6.9.4)1+ierf z,C(x) + iS(x) =2whereIn the last line we have converted the “standard” form of the continued fraction toits “even” form (see §5.2), which converges twice as fast.

We must be careful notto evaluate the alternating series (6.9.2) at too large a value of x; inspection of theterms shows that x = 1.5 is a good point to switch over to the continued fraction.Note that for large xC(x) ∼π 11+sinx2 ,2 πx2S(x) ∼π 11−cosx22 πx2(6.9.5)Thus the precision of the routine frenel may be limited by the precision of thelibrary routines for sine and cosine for large x.Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)Copyright (C) 1988-1992 by Cambridge University Press.Programs Copyright (C) 1988-1992 by Numerical Recipes Software.Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable files (including this one) to any servercomputer, is strictly prohibited.

To order Numerical Recipes books,diskettes, or CDROMsvisit website http://www.nr.com or call 1-800-872-7423 (North America only),or send email to trade@cup.cam.ac.uk (outside North America).The two Fresnel integrals are defined by.

Характеристики

Тип файла
PDF-файл
Размер
133,82 Kb
Материал
Тип материала
Высшее учебное заведение

Тип файла PDF

PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.

Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
7027
Авторов
на СтудИзбе
260
Средний доход
с одного платного файла
Обучение Подробнее