c6-10 (779511)

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

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

2596.10 Dawson’s Integral}if (err < EPS) break;odd=!odd;}if (k > MAXIT) nrerror("maxits exceeded in cisi");}if (x < 0.0) *si = -(*si);}CITED REFERENCES AND FURTHER READING:Stegun, I.A., and Zucker, R. 1976, Journal of Research of the National Bureau of Standards,vol. 80B, pp. 291–311; 1981, op. cit., vol. 86, pp. 661–686.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), Chapters 5 and 7.6.10 Dawson’s IntegralDawson’s Integral F (x) is defined byZ2F (x) = e−xx2et dt(6.10.1)0The function can also be related to the complex error function by√i π −z2e[1 − erfc(−iz)] .F (z) =2(6.10.2)A remarkable approximation for F (x), due to Rybicki [1], is21 X e−(z−nh)F (z) = lim √h→0πn(6.10.3)n oddWhat makes equation (6.10.3) unusual is that its accuracy increases exponentiallyas h gets small, so that quite moderate values of h (and correspondingly quite rapidconvergence of the series) give very accurate approximations.We will discuss the theory that leads to equation (6.10.3) later, in §13.11, asan interesting application of Fourier methods.

Here we simply implement a routinebased on the formula.It is first convenient to shift the summation index to center it approximately onthe maximum of the exponential term. Define n0 to be the even integer nearest tox/h, and x0 ≡ n0 h, x0 ≡ x − x0 , and n0 ≡ n − n0 , so that002N1 X e−(x −n h),F (x) ≈ √π n0 =−N n0 + n0n0 odd(6.10.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).}*si=sums;*ci=sumc+log(t)+EULER;260Chapter 6.Special Functionswhere the approximate equality is accurate when h is sufficiently small and N issufficiently large. The computation of this formula can be greatly speeded up ifwe note that00020e−(x −n h) = e−x e−(n h)220e2x hn0.(6.10.5)#include <math.h>#include "nrutil.h"#define NMAX 6#define H 0.4#define A1 (2.0/3.0)#define A2 0.4#define A3 (2.0/7.0)float dawson(float x)RReturns Dawson’s integral F (x) = exp(−x2 ) 0x exp(t2 )dt for any real x.{int i,n0;float d1,d2,e1,e2,sum,x2,xp,xx,ans;static float c[NMAX+1];static int init = 0;Flag is 0 if we need to initialize, else 1.if (init == 0) {init=1;for (i=1;i<=NMAX;i++) c[i]=exp(-SQR((2.0*i-1.0)*H));}if (fabs(x) < 0.2) {Use series expansion.x2=x*x;ans=x*(1.0-A1*x2*(1.0-A2*x2*(1.0-A3*x2)));} else {Use sampling theorem representation.xx=fabs(x);n0=2*(int)(0.5*xx/H+0.5);xp=xx-n0*H;e1=exp(2.0*xp*H);e2=e1*e1;d1=n0+1;d2=d1-2.0;sum=0.0;for (i=1;i<=NMAX;i++,d1+=2.0,d2-=2.0,e1*=e2)sum += c[i]*(e1/d1+1.0/(d2*e1));√ans=0.5641895835*SIGN(exp(-xp*xp),x)*sum;Constant is 1/ π.}return ans;}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 first factor is computed once, the second is an array of constants to be stored,and the third can be computed recursively, so that only two exponentials need be02evaluated.

Advantage is also taken of the symmetry of the coefficients e−(n h) bybreaking the summation up into positive and negative values of n0 separately.In the following routine, the choices h = 0.4 and N = 11 are made. Becauseof the symmetry of the summations and the restriction to odd values of n, the limitson the do loops are 1 to 6. The accuracy of the result in this float version is about2 × 10−7 . In order to maintain relative accuracy near x = 0, where F (x) vanishes,the program branches to the evaluation of the power series [2] for F (x), for |x| < 0.2.6.11 Elliptic Integrals and Jacobian Elliptic Functions261Other methods for computing Dawson’s integral are also known [2,3] .CITED REFERENCES AND FURTHER READING:Rybicki, G.B.

1989, Computers in Physics, vol. 3, no. 2, pp. 85–87. [1]6.11 Elliptic Integrals and Jacobian EllipticFunctionsElliptic integrals occur in many applications, because any integral of the formZR(t, s) dt(6.11.1)where R is a rational function of t and s, and s is the square root of a cubic orquartic polynomial in t, can be evaluated in terms of elliptic integrals. Standardreferences [1] describe how to carry out the reduction, which was originally doneby Legendre. Legendre showed that only three basic elliptic integrals are required.The simplest of these isZ xdtp(6.11.2)I1 =(a1 + b1 t)(a2 + b2 t)(a3 + b3 t)(a4 + b4 t)ywhere we have written the quartic s2 in factored form.

In standard integral tables [2],one of the limits of integration is always a zero of the quartic, while the other limitlies closer than the next zero, so that there is no singularity within the interval. Toevaluate I1 , we simply break the interval [y, x] into subintervals, each of whicheither begins or ends on a singularity. The tables, therefore, need only distinguishthe eight cases in which each of the four zeros (ordered according to size) appears asthe upper or lower limit of integration.

In addition, when one of the b’s in (6.11.2)tends to zero, the quartic reduces to a cubic, with the largest or smallest singularitymoving to ±∞; this leads to eight more cases (actually just special cases of the firsteight). The sixteen cases in total are then usually tabulated in terms of Legendre’sstandard elliptic integral of the 1st kind, which we will define below. By a change ofthe variable of integration t, the zeros of the quartic are mapped to standard locationson the real axis.

Then only two dimensionless parameters are needed to tabulateLegendre’s integral. However, the symmetry of the original integral (6.11.2) underpermutation of the roots is concealed in Legendre’s notation. We will get back toLegendre’s notation below. But first, here is a better way:Carlson [3] has given a new definition of a standard elliptic integral of the first kind,Zdt1 ∞pRF (x, y, z) =(6.11.3)2 0(t + x)(t + y)(t + z)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).Cody, W.J., Pociorek, K.A., and Thatcher, H.C.

1970, Mathematics of Computation, vol. 24,pp. 171–178. [2]McCabe, J.H. 1974, Mathematics of Computation, vol. 28, pp. 811–816. [3].

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

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

Тип файла PDF

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

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

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

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