Главная » Просмотр файлов » Thompson - Computing for Scientists and Engineers

Thompson - Computing for Scientists and Engineers (523188), страница 56

Файл №523188 Thompson - Computing for Scientists and Engineers (Thompson - Computing for Scientists and Engineers) 56 страницаThompson - Computing for Scientists and Engineers (523188) страница 562013-09-15СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 56)

*/doubleint k;value,Hzero,Hone,Gauss,norm,Hn;302SECOND-ORDER DIFFERENTIAL EQUATIONSHzero = 1; Hone = 2*x; Gauss = exp ( -x*x/2 ) ;if (n==O) return Hzero*Gauss;if (n==l) return Hone*Gauss/sqrt(2);norm = 2;for (k=2; k<=n; k++) /* Hn by recurrence on k */{Hn = 2*(x*Hone-(k-l)*Hzero);Hzero = Hone; Hone = Hn; /* update */norm = 2*k*norm;return}Hn*Gauss/sqrt(norm);The two lowest-order Hermite polynomials and the recurrence relations for thehigher-order polynomials are as given by (8.89) and (8.90). The factor normcomes from (8.88).Having made these changes, with appropriate declarations of new variables, weare ready to use the program to explore the numerical solutions of the quantum-oscillator wave functions.Exercise 8.29Run your modified program for the Noumerov method applied to the Schrödinger equation with input values n = 0, xmax = 3, h = 0.02, which are all dimensionless variables. Within the energy loop use values near the energyeigenvalue, E0 = 1.

Check that your results agree with Figure 8.18. nFIGURE 8.18 Numerical solution of the quantum harmonic oscillator Schrödinger equation forenergies near the n = 0 eigenstate, using the Noumerov algorithm with stepsize h = 0.02.8.5NOUMEROV METHOD FOR LINEAR SECOND-ORDER EQUATIONS303Note that unusually small values of the stepsize h are needed to accurately track thedecaying exponential or Gaussian function. Figure 8.18 displays the numericalwave function values y [k] that approximate y(x). The three values of the energy E are close to the energy eigenstate value of unity for n = 0. Note that (towithin ±O.002) the numerical solution that best fits the analytical solution differsfrom unity by 0.025. If you vary the stepsize h you will find that the discrepancyfrom unity decreases steadily as h decreases. Also, the decaying behavior of thenumerical solution is extremely sensitive to the relative accuracy of the two startingvalues.

Why not explore these two aspects of the numerical solution yourself?Exercise 8.30(a) Run your Schrödinger equation program as in Exercise 8.29, but now varyh from say 0.1 to 0.01 with (for minimum confusion) energy fixed at the energy eigenvalue of unity. Is the solution converging toward the analytical solution as h decreases?(b) Modify the program so that y[2] is 1 + 10-6 times the analytical value. Repeat the calculations made in Exercise 8.29. Verify that for large x this part-permillion change in a starting value is amplified about 1000 times when x = 3 isreached. nIt should now be clear to you that it is not good practice to use a numerical algorithm iteratively in a direction for which the function tends to decrease overall.

Forexample, the increasing exponential function investigated by the Noumerov algorithm in Exercise 8.26 has part-per-million accuracy, whereas the accuracy at xmaxfor a decreasing exponential, as investigated in the two preceding exercises, is onlypart-per-cent or worse. Therefore, iteration by numerical algorithms should, whenever feasible, be carried out in the direction of increasing magnitude of y.In our present example of the quantum oscillator one could begin with the Gaussian solutions at large x, then iterate inward.

Unless you had selected an energyeigenstate, the solution would diverge near the origin because of the presence of thatother solution of the second-order differential equation, the one irregular (divergent)near the origin. Such an iteration direction should give results that are much lesssensitive to the stepsize than is the iteration direction we are using. An alternativescheme for numerical solution of such a “stiff’ differential equation as we are tryingto solve is presented in Section 8.6.Finally, it is interesting to take a quantum leap and try the Noumerov method forthe quantum oscillator on a state of higher energy, for which there is an oscillatingregion of the wave function followed by a decaying region for larger x if E is nearlyan eigenstate value.

Try it and see.Exercise 8.31Run the Noumerov method program for the Schrödinger equation with inputvalues n = 3, xmax = 3, h = 0.02, which are all dimension-free variables.Within the energy loop use values near the energy eigenvalue, E3 = 7, according to (8.87). Your results should be similar to those in Figure 8.19. n304SECOND-ORDER DIFFERENTIAL EQUATIONSFIGURE 8.19 Numerical solution of the quantum harmonic oscillator Schrödinger equation forenergies near the n = 3 eigenstate, using the Noumerov algorithm with stepsize h = 0.02.In Figure 8.19 the value that best fits the analytical solution is at an energy = E of 7.06, close to the analytical value of 7.

The numerical solution is indistinguishable from the analytical solution within the resolution of the graph.Clearly the values of E = 6.70 or E = 7.40 do not give energy eigenstates.Now that you understand how to solve the Schrödinger equation numerically toreasonable accuracy by using the Noumerov method, you will probably find it interesting (depending on your level of experience with quantum machanics) to exploreother potentials both for bound states (as here) and for scattering states.The subject of numerical solution of ordinary differential equations is vast. Youcan learn more about the analytical and numerical aspects in, for example, Chapters 9 and 10 of Nakamura’s book and in Jain’s compendium of numerical methods.

Several programs in C are provided in Chapter 15 of the numerical recipesbook by Press et al.8.6INTRODUCTION TO STIFF DIFFERENTIAL EQUATIONSWhen applying the Noumerov algorithm to solve the differential equations for exponential-type functions in Section 8.5 we were struck by an unusual contrast.Namely, if we iterated the numerical solution in the direction that the function wasgenerally increasing, as in Exercise 8.29, then the algorithm was remarkably accurate, typically at least part-per-million accurate for a stepsize h = 0.1.

By comparison, if the solution was iterated so that the function was generally decreasing, as inExercises 8.30 and 8.31, then even for h = 0.02 only part-per-cent accuracy wasobtained.8.6INTRODUCTION TO STIFF DIFFERENTIAL EQUATIONS305Although we suggested at the end of Section 8.5 that one way around this problem is always to iterate in the direction of x such that the function is generally increasing in magnitude, this is often not possible or not practicable. Alternativeschemes are presented in this section. We first describe what is meant by a “stiff’differential equation, then we give two prescriptions that may remove the stiffness,due to Riccati and to Madelung.What is a stiff differential equation?Suppose that in the second-order differential equation(8.91)we have that F (x) >> 0 for a wide range of x.

For any small range of x values,small enough that F does not change appreciably over this range, the solutions of(8.91) will be of the form(8.92)in which A+ and A- are constants.Exercise 8.32(a) Verify the correctness of this approximate form of the solution of (8.91) bycalculating the second derivative of this expression with respect to x, includingthe variation of F with respect to x. Show that if(8.93)then the approximation is appropriate.(b) Show that this condition can be weakened to(8.94)by appropriately moving the x origin and adjusting A+ and A-. nIn many scientific and numerical applications the appropriate solution of (8.91)is the exponentially decaying one.

For example, we may have the boundary condition thatso that A+ = 0 is required. If inaccuracies of the numerical algorithm or of roundoff error allow a small amount of exponentially-increasing solution to insinuate itself into the decaying solution, this increasing solutionpart will usually quickly increase. The differential equation is then “stiff’ to solve,and its solution is an unstable problem in the sense discussed in Section 4.3.306SECOND-ORDER DIFFERENTIAL EQUATIONSOne way of appreciating this insidious behavior is to consider the effect of asmall error, on the right-hand side of (8.91). The error in y" (x) is then FSince F >> 0, this amplifies the curve strongly upward or downward, dependingThis problem was introduced in Exercise 8.30 (b)on whetherand the subsequent discussion.

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

Тип файла
PDF-файл
Размер
4,66 Mb
Тип материала
Учебное заведение
Неизвестно

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

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