c17-5 (779605)

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

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

78317.5 Automated Allocation of Mesh Points17.5 Automated Allocation of Mesh Pointsdy=gdx(17.5.1)becomesdydx=gdqdqIn terms of q, equation (17.5.2) as an FDE might be written"!!dxdx1yk − yk−1 − 2g+ gdqdqk(17.5.2)#=0(17.5.3)k−1or some related version.

Note that dx/dq should accompany g. The transformation betweenx and q depends only on the Jacobian dx/dq. Its reciprocal dq/dx is proportional to thedensity of mesh points.Now, given the function y(x), or its approximation at the current stage of relaxation,we are supposed to have some idea of how we want to specify the density of mesh points.For example, we might want dq/dx to be larger where y is changing rapidly, or near to theboundaries, or both. In fact, we can probably make up a formula for what we would likedq/dx to be proportional to. The problem is that we do not know the proportionality constant.That is, the formula that we might invent would not have the correct integral over the wholerange of x so as to make q vary from 1 to M , according to its definition. To solve this problemwe introduce a second reparametrization Q(q), where Q is a new independent variable.

Therelation between Q and q is taken to be linear, so that a mesh spacing formula for dQ/dxdiffers only in its unknown proportionality constant. A linear relation impliesd2 Q=0dq2or, expressed in the usual manner as coupled first-order equations,(17.5.4)dQ(x)dψ=ψ=0(17.5.5)dqdqwhere ψ is a new intermediate variable. We add these two equations to the set of ODEsbeing solved.Completing the prescription, we add a third ODE that is just our desired mesh-densityfunction, namelyφ(x) =dQdQ dq=dxdq dx(17.5.6)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).In relaxation problems, you have to choose values for the independent variable at themesh points. This is called allocating the grid or mesh.

The usual procedure is to picka plausible set of values and, if it works, to be content. If it doesn’t work, increasing thenumber of points usually cures the problem.If we know ahead of time where our solutions will be rapidly varying, we can put moregrid points there and less elsewhere. Alternatively, we can solve the problem first on a uniformmesh and then examine the solution to see where we should add more points. We then repeatthe solution with the improved grid. The object of the exercise is to allocate points in sucha way as to represent the solution accurately.It is also possible to automate the allocation of mesh points, so that it is done“dynamically” during the relaxation process.

This powerful technique not only improvesthe accuracy of the relaxation method, but also (as we will see in the next section) allowsinternal singularities to be handled in quite a neat way. Here we learn how to accomplishthe automatic allocation.We want to focus attention on the independent variable x, and consider two alternativereparametrizations of it. The first, we term q; this is just the coordinate corresponding to themesh points themselves, so that q = 1 at k = 1, q = 2 at k = 2, and so on.

Between any twomesh points we have ∆q = 1. In the change of independent variable in the ODEs from x to q,784Chapter 17.Two Point Boundary Value Problemswhere φ(x) is chosen by us. Written in terms of the mesh variable q, this equation isdxψ=dqφ(x)(17.5.7)dx|d ln y|+∆δ dy/dx dQ1φ(x) ==+ dx∆yδ dQ =or(17.5.8)(17.5.9)where ∆ and δ are constants that we choose. The first term would give a uniform spacingin x if it alone were present.

The second term forces more grid points to be used where y ischanging rapidly. The constants act to make every logarithmic change in y of an amount δabout as “attractive” to a grid point as a change in x of amount ∆. You adjust the constantsaccording to taste. Other strategies are possible, such as a logarithmic spacing in x, replacingdx in the first term with d ln x.CITED REFERENCES AND FURTHER READING:Eggleton, P.

P. 1971, Monthly Notices of the Royal Astronomical Society, vol. 151, pp. 351–364.Kippenhan, R., Weigert, A., and Hofmeister, E. 1968, in Methods in Computational Physics,vol. 7 (New York: Academic Press), pp. 129ff.17.6 Handling Internal Boundary Conditionsor Singular PointsSingularities can occur in the interiors of two point boundary value problems. Typically,there is a point xs at which a derivative must be evaluated by an expression of the formS(xs ) =N (xs , y)D(xs , y)(17.6.1)where the denominator D(xs , y) = 0.

In physical problems with finite answers, singularpoints usually come with their own cure: Where D → 0, there the physical solution y mustbe such as to make N → 0 simultaneously, in such a way that the ratio takes on a meaningfulvalue. This constraint on the solution y is often called a regularity condition. The conditionthat D(xs , y) satisfy some special constraint at xs is entirely analogous to an extra boundarycondition, an algebraic relation among the dependent variables that must hold at a point.We discussed a related situation earlier, in §17.2, when we described the “fitting pointmethod” to handle the task of integrating equations with singular behavior at the boundaries.In those problems you are unable to integrate from one side of the domain to the other.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).Notice that φ(x) should be chosen to be positive definite, so that the density of mesh points iseverywhere positive. Otherwise (17.5.7) can have a zero in its denominator.To use automated mesh spacing, you add the three ODEs (17.5.5) and (17.5.7) to yourset of equations, i.e., to the array y[j][k]. Now x becomes a dependent variable! Q and ψalso become new dependent variables. Normally, evaluating φ requires little extra work sinceit will be composed from pieces of the g’s that exist anyway.

The automated procedure allowsone to investigate quickly how the numerical results might be affected by various strategiesfor mesh spacing. (A special case occurs if the desired mesh spacing function Q can be foundanalytically, i.e., dQ/dx is directly integrable. Then, you need to add only two equations,those in 17.5.5, and two new variables x, ψ.)As an example of a typical strategy for implementing this scheme, consider a systemwith one dependent variable y(x). We could set.

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

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

Тип файла PDF

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

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

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

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