c4-1 (779478)

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

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

130Chapter 4.Integration of FunctionsCITED REFERENCES AND FURTHER READING:Carnahan, B., Luther, H.A., and Wilkes, J.O. 1969, Applied Numerical Methods (New York:Wiley), Chapter 2.Isaacson, E., and Keller, H.B. 1966, Analysis of Numerical Methods (New York: Wiley), Chapter 7.Acton, F.S. 1970, Numerical Methods That Work; 1990, corrected edition (Washington: Mathematical Association of America), Chapter 4.Stoer, J., and Bulirsch, R. 1980, Introduction to Numerical Analysis (New York: Springer-Verlag),Chapter 3.Ralston, A., and Rabinowitz, P. 1978, A First Course in Numerical Analysis, 2nd ed. (New York:McGraw-Hill), Chapter 4.Dahlquist, G., and Bjorck, A.

1974, Numerical Methods (Englewood Cliffs, NJ: Prentice-Hall),§7.4.Kahaner, D., Moler, C., and Nash, S. 1989, Numerical Methods and Software (Englewood Cliffs,NJ: Prentice Hall), Chapter 5.Forsythe, G.E., Malcolm, M.A., and Moler, C.B. 1977, Computer Methods for MathematicalComputations (Englewood Cliffs, NJ: Prentice-Hall), §5.2, p. 89. [1]Davis, P., and Rabinowitz, P. 1984, Methods of Numerical Integration, 2nd ed. (Orlando, FL:Academic Press).4.1 Classical Formulas for Equally SpacedAbscissasWhere would any book on numerical analysis be without Mr.

Simpson and his“rule”? The classical formulas for integrating a function whose value is known atequally spaced steps have a certain elegance about them, and they are redolent withhistorical association. Through them, the modern numerical analyst communes withthe spirits of his or her predecessors back across the centuries, as far as the timeof Newton, if not farther. Alas, times do change; with the exception of two of themost modest formulas (“extended trapezoidal rule,” equation 4.1.11, and “extendedSample 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).of various orders, with higher order sometimes, but not always, giving higheraccuracy. “Romberg integration,” which is discussed in §4.3, is a general formalismfor making use of integration methods of a variety of different orders, and werecommend it highly.Apart from the methods of this chapter and of Chapter 16, there are yetother methods for obtaining integrals.

One important class is based on functionapproximation. We discuss explicitly the integration of functions by Chebyshevapproximation (“Clenshaw-Curtis” quadrature) in §5.9. Although not explicitlydiscussed here, you ought to be able to figure out how to do cubic spline quadratureusing the output of the routine spline in §3.3.

(Hint: Integrate equation 3.3.3over x analytically. See [1].)Some integrals related to Fourier transforms can be calculated using the fastFourier transform (FFT) algorithm. This is discussed in §13.9.Multidimensional integrals are another whole multidimensional bag of worms.Section 4.6 is an introductory discussion in this chapter; the important technique ofMonte-Carlo integration is treated in Chapter 7.1314.1 Classical Formulas for Equally Spaced Abscissasx0x1x2xNxN + 1open formulas use these pointsclosed formulas use these pointsFigure 4.1.1.

Quadrature formulas with equally spaced abscissas compute the integral of a functionbetween x0 and xN +1 . Closed formulas evaluate the function on the boundary points, while openformulas refrain from doing so (useful if the evaluation algorithm breaks down on the boundary points).midpoint rule,” equation 4.1.19, see §4.2), the classical formulas are almost entirelyuseless. They are museum pieces, but beautiful ones.Some notation: We have a sequence of abscissas, denoted x0 , x1 , . .

. , xN ,xN+1 which are spaced apart by a constant step h,xi = x0 + ihi = 0, 1, . . . , N + 1(4.1.1)A function f(x) has known values at the xi ’s,f(xi ) ≡ fi(4.1.2)We want to integrate the function f(x) between a lower limit a and an upper limitb, where a and b are each equal to one or the other of the xi ’s. An integrationformula that uses the value of the function at the endpoints, f(a) or f(b), is calleda closed formula. Occasionally, we want to integrate a function whose value at oneor both endpoints is difficult to compute (e.g., the computation of f goes to a limitof zero over zero there, or worse yet has an integrable singularity there).

In thiscase we want an open formula, which estimates the integral using only xi ’s strictlybetween a and b (see Figure 4.1.1).The basic building blocks of the classical formulas are rules for integrating afunction over a small number of intervals. As that number increases, we can findrules that are exact for polynomials of increasingly high order. (Keep in mind thathigher order does not always imply higher accuracy in real cases.) A sequence ofsuch closed formulas is now given.Closed Newton-Cotes FormulasTrapezoidal rule:Z x2f(x)dx = hx111f1 + f222+ O(h3 f 00 )(4.1.3)Here the error term O( ) signifies that the true answer differs from the estimate byan amount that is the product of some numerical coefficient times h3 times the valueSample 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).h132Chapter 4.Integration of FunctionsSimpson’s rule:Zx3f(x)dx = hx1411f1 + f2 + f3333+ O(h5 f (4) )(4.1.4)Here f (4) means the fourth derivative of the function f evaluated at an unknownplace in the interval. Note also that the formula gives the integral over an intervalof size 2h, so the coefficients add up to 2.There is no lucky cancellation in the four-point formula, so it is also exact forpolynomials up to and including degree 3.Simpson’sZ38rule:x4f(x)dx = hx19933f1 + f2 + f3 + f48888+ O(h5 f (4) )(4.1.5)The five-point formula again benefits from a cancellation:Bode’s rule:Zx5x16424641414f1 + f2 + f3 + f4 + f5f(x)dx = h4545454545+ O(h7 f (6) ) (4.1.6)This is exact for polynomials up to and including degree 5.At this point the formulas stop being named after famous personages, so wewill not go any further.

Consult [1] for additional formulas in the sequence.Extrapolative Formulas for a Single IntervalWe are going to depart from historical practice for a moment. Many textswould give, at this point, a sequence of “Newton-Cotes Formulas of Open Type.”Here is an example:Zx5x0555555f1 + f2 + f3 + f4f(x)dx = h24242424+ O(h5 f (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).of the function’s second derivative somewhere in the interval of integration.

Thecoefficient is knowable, and it can be found in all the standard references on thissubject. The point at which the second derivative is to be evaluated is, however,unknowable. If we knew it, we could evaluate the function there and have a higherorder method! Since the product of a knowable and an unknowable is unknowable,we will streamline our formulas and write only O( ), instead of the coefficient.Equation (4.1.3) is a two-point formula (x1 and x2 ). It is exact for polynomialsup to and including degree 1, i.e., f(x) = x.

One anticipates that there is athree-point formula exact up to polynomials of degree 2. This is true; moreover, by acancellation of coefficients due to left-right symmetry of the formula, the three-pointformula is exact for polynomials up to and including degree 3, i.e., f(x) = x3 :4.1 Classical Formulas for Equally Spaced Abscissas133Zx1f(x)dx = h[f1 ]+ O(h2 f 0 )(4.1.7)x013+ O(h3 f 00 )f(x)dx = h f1 − f2(4.1.8)22x0Z x116523f1 − f2 + f3+ O(h4 f (3) )f(x)dx = h(4.1.9)121212x0Z x15937955f1 − f2 + f3 − f4+ O(h5 f (4) )(4.1.10)f(x)dx = h24242424x0Zx1Perhaps a word here would be in order about how formulas like the above canbe derived.

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

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

Тип файла PDF

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

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

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

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