c4-6 (779483)

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

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

4.6 Multidimensional Integrals161Golub, G.H. 1973, SIAM Review, vol. 15, pp. 318–334. [10]Kronrod, A.S. 1964, Doklady Akademii Nauk SSSR, vol. 154, pp. 283–286 (in Russian). [11]Patterson, T.N.L. 1968, Mathematics of Computation, vol. 22, pp. 847–856 and C1–C11; 1969,op. cit., vol. 23, p. 892. [12]Piessens, R., de Doncker, E., Uberhuber, C.W., and Kahaner, D.K. 1983, QUADPACK: A Subroutine Package for Automatic Integration (New York: Springer-Verlag).

[13]Carnahan, B., Luther, H.A., and Wilkes, J.O. 1969, Applied Numerical Methods (New York:Wiley), §§2.9–2.10.Ralston, A., and Rabinowitz, P. 1978, A First Course in Numerical Analysis, 2nd ed. (New York:McGraw-Hill), §§4.4–4.8.4.6 Multidimensional IntegralsIntegrals of functions of several variables, over regions with dimension greaterthan one, are not easy.

There are two reasons for this. First, the number of functionevaluations needed to sample an N -dimensional space increases as the N th powerof the number needed to do a one-dimensional integral. If you need 30 functionevaluations to do a one-dimensional integral crudely, then you will likely need onthe order of 30000 evaluations to reach the same crude level for a three-dimensionalintegral. Second, the region of integration in N -dimensional space is defined byan N − 1 dimensional boundary which can itself be terribly complicated: It neednot be convex or simply connected, for example. By contrast, the boundary of aone-dimensional integral consists of two numbers, its upper and lower limits.The first question to be asked, when faced with a multidimensional integral,is, “can it be reduced analytically to a lower dimensionality?” For example,so-called iterated integrals of a function of one variable f(t) can be reduced toone-dimensional integrals by the formulaZxZ t3Z t2dtn−1 · · ·dt2f(t1 )dt1000Z x1=(x − t)n−1 f(t)dt(n − 1)! 0Ztndtn0(4.6.1)Alternatively, the function may have some special symmetry in the way it dependson its independent variables.

If the boundary also has this symmetry, then thedimension can be reduced. In three dimensions, for example, the integration of aspherically symmetric function over a spherical region reduces, in polar coordinates,to a one-dimensional integral.The next questions to be asked will guide your choice between two entirelydifferent approaches to doing the problem.

The questions are: Is the shape of theboundary of the region of integration simple or complicated? Inside the region, isthe integrand smooth and simple, or complicated, or locally strongly peaked? DoesSample 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).Stoer, J., and Bulirsch, R.

1980, Introduction to Numerical Analysis (New York: Springer-Verlag),§3.6.Johnson, L.W., and Riess, R.D. 1982, Numerical Analysis, 2nd ed. (Reading, MA: AddisonWesley), §6.5.162Chapter 4.Integration of FunctionsIf, on the basis of the above guidelines, you decide to pursue the repeated onedimensional integration approach, here is how it works. For definiteness, we willconsider the case of a three-dimensional integral in x, y, z-space. Two dimensions,or more than three dimensions, are entirely analogous.The first step is to specify the region of integration by (i) its lower and upperlimits in x, which we will denote x1 and x2 ; (ii) its lower and upper limits in y at aspecified value of x, denoted y1 (x) and y2 (x); and (iii) its lower and upper limitsin z at specified x and y, denoted z1 (x, y) and z2 (x, y).

In other words, find thenumbers x1 and x2 , and the functions y1 (x), y2 (x), z1 (x, y), and z2 (x, y) such thatZ Z ZI≡dx dy dzf(x, y, z)ZZx2x1Zy2 (x)dx=y1 (x)(4.6.2)z2 (x,y)dydz f(x, y, z)z1 (x,y)For example, a two-dimensional integral over a circle of radius one centered onthe origin becomesZZ1dx−1√1−x2√− 1−x2dy f(x, y)(4.6.3)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 problem require high accuracy, or does it require an answer accurate only toa percent, or a few percent?If your answers are that the boundary is complicated, the integrand is notstrongly peaked in very small regions, and relatively low accuracy is tolerable, thenyour problem is a good candidate for Monte Carlo integration.

This method is verystraightforward to program, in its cruder forms. One needs only to know a regionwith simple boundaries that includes the complicated region of integration, plus amethod of determining whether a random point is inside or outside the region ofintegration. Monte Carlo integration evaluates the function at a random sample ofpoints, and estimates its integral based on that random sample. We will discuss it inmore detail, and with more sophistication, in Chapter 7.If the boundary is simple, and the function is very smooth, then the remainingapproaches, breaking up the problem into repeated one-dimensional integrals, ormultidimensional Gaussian quadratures, will be effective and relatively fast [1].

Ifyou require high accuracy, these approaches are in any case the only ones availableto you, since Monte Carlo methods are by nature asymptotically slow to converge.For low accuracy, use repeated one-dimensional integration or multidimensionalGaussian quadratures when the integrand is slowly varying and smooth in the regionof integration, Monte Carlo when the integrand is oscillatory or discontinuous, butnot strongly peaked in small regions.If the integrand is strongly peaked in small regions, and you know where thoseregions are, break the integral up into several regions so that the integrand is smoothin each, and do each separately.

If you don’t know where the strongly peaked regionsare, you might as well (at the level of sophistication of this book) quit: It is hopelessto expect an integration routine to search out unknown pockets of large contributionin a huge N -dimensional space. (But see §7.8.)1634.6 Multidimensional IntegralsyxFigure 4.6.1.Function evaluations for a two-dimensional integral over an irregular region, shownschematically. The outer integration routine, in y, requests values of the inner, x, integral at locationsalong the y axis of its own choosing. The inner integration routine then evaluates the function atx locations suitable to it.

This is more accurate in general than, e.g., evaluating the function on aCartesian mesh of points.Now we can define a function G(x, y) that does the innermost integral,Zz2 (x,y)G(x, y) ≡f(x, y, z)dz(4.6.4)z1 (x,y)and a function H(x) that does the integral of G(x, y),Zy2 (x)H(x) ≡G(x, y)dy(4.6.5)y1 (x)and finally our answer as an integral over H(x)Zx2H(x)dxI=(4.6.6)x1In an implementation of equations (4.6.4)–(4.6.6), some basic one-dimensionalintegration routine (e.g., qgaus in the program following) gets called recursively:once to evaluate the outer integral I, then many times to evaluate the middle integralH, then even more times to evaluate the inner integral G (see Figure 4.6.1).

Currentvalues of x and y, and the pointer to your function func, are passed “over the head”of the intermediate calls through static top-level variables.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).outer integrationinner integration164Chapter 4.Integration of Functionsstatic float xsav,ysav;static float (*nrfunc)(float,float,float);nrfunc=func;return qgaus(f1,x1,x2);}float f1(float x)This is H of eq.

(4.6.5).{float qgaus(float (*func)(float), float a, float b);float f2(float y);float yy1(float),yy2(float);xsav=x;return qgaus(f2,yy1(x),yy2(x));}float f2(float y)This is G of eq. (4.6.4).{float qgaus(float (*func)(float), float a, float b);float f3(float z);float z1(float,float),z2(float,float);ysav=y;return qgaus(f3,z1(xsav,y),z2(xsav,y));}float f3(float z)The integrand f (x, y, z) evaluated at fixed x and y.{return (*nrfunc)(xsav,ysav,z);}The necessary user-supplied functions have the following prototypes:floatfloatfloatfloatfloatfunc(float x,float y,float z);yy1(float x);yy2(float x);z1(float x,float y);z2(float x,float y);The 3-dimensional function to be integrated.CITED REFERENCES AND FURTHER READING:Stroud, A.H. 1971, Approximate Calculation of Multiple Integrals (Englewood Cliffs, NJ: PrenticeHall).

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

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

Тип файла PDF

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

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

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

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