ebook img

Theoretical Physics on the Personal Computer PDF

219 Pages·1988·9.68 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Theoretical Physics on the Personal Computer

E.W. Schmid G. Spitz W. Losch Theoretical Physics on the Personal Computer Erich W. Schmid Gerhard Spitz Wolfgang Losch Theoretical Physics on the Personal Computer With 152 Figures Springer-Verlag Berlin Heidelberg New York London Paris Tokyo Professor Dr. Erich W. Schmid Dr. Gerhard Spitz Wolfgang Losch Institut fOr Theoretische Physik, Universilal T Obingen , Auf der Morgenstelle 14, 0-7400 TGbingen, Fed. Rep. of Germany Translator: A. H. Armstrong "Everglades", B rimpton Common, Reading, RG74 RY Berks, UK Tille 01 the original German edition: Theoretische Physik mit dem Personal Computer ISBN-13: 978-3-642-97090-0 e-ISBN- 13: 978-3-642-97088-7 001: 10.10071978-3-642·97088·7 C Springer-Verlag, Berlin, Heidelberg 1987 library 01 Congress Cataloging-in 'Publication Data. Schmid, Erich W., 1931-. Theoretical physics on the personal computer. Translation of: Theoretische Physik mit dem Personal-Computer. Includes Index. 1. Mathematical physics- Data processing. 2. Microcomputers. l. Spilz. Gerhard, 1955-. II. l OSch, Wolf· gang, 1956·.111. Tille. aC20.7.E4S3S13 1988 530.1 '028'5526 88·4638 This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specil ically the rights 01 transtation. reprint ing, reuse of illustrations, recitation, broad- casting, reproduction on microtUms or in other ways, and storage in deta bankS. Duplication 01 this publicallon or parts thereof is only permitted under the provisions 01 the German Copyright l aw of September 9, 1965, in tis version 01 June 24. 1985, and a copyright lee must always be paid. Violations fail under the prosecution act 01 the German Copyright law. e Springer-Verlag Berlin Heidelberg 1988 Softcover reprint of the hardcover 1st edition 1988 The use of registered names, trademarks, etc. in th is publication does not imply, even in the absence of a speci l ic statement, that such names are exempt from the relevant protective laws and regulations and therefore lree lor general use. PI. llle nole: Before using the programs contained in this book. please consult for techriical advice the manuals provided by the respective manulaclurer 0 1t he computer - and any additional plug-in-boards- to be used. The authors and the publisher accept no el gal responsibility lor any damage caused by improper use of instructions and programs contained wi th in. The programs appearing here have been tested carefully. Nevertheless we can offer no guarantee for the correct lunctioning of the programs. Preface to the English Edition We would like to thank Mr. A.H. Armstrong, who translated this book, for his many valuable suggestions and corrections. We also acknowledge a stimulating response from our readers. Mr. J. Peeck sent us a diskette containing the pro- grams modified to run on an ATARI computer. Mr. H.U. Zimmermann sent us diskettes, on which the graphics software of the book is adapted to the require- ments of the FORTRAN-77 compiler by MICROSOFT. Readers interested in these adaptations should contact the authors. Tiibingen, January 1988 E. W. Schmid, G. Spitz v Preface to the German Edition This book is based on the lecture course "Computer applications in Theo- retical Physics", which has been offered at the University of Tiibingen since 1979. This course had as its original aim the preparation of students for a nu- merical diploma course in theoretical physics. It soon became clear, however, that the course provides a valuable supplement to the fundamental lectures in theoretical physics. Whereas teaching in this field had previously been prin- cipally characterised by the derivation of equations, it is now possible to give deeper understanding by means of application examples. A graphical presen- tation of numerical results proves to be important in emphasizing the physics. Interaction with the machine is also valuable. At the end of each calculation the computer should ask the question: "Repeat the calculation with new data (yes/no)?". The student can then answer "yes" and input the new data, e.g. new starting values for position and velocity in solving an equation of motion. The programming of a user-friendly dialogue is not really difficult, but time consuming. At the beginning of the course the student therefore constructs only the numerical parts of the programs. The numerical parts are therefore deleted from the programs under consideration, and newly programmed by the student. Later on, the programming of the graphical output and of the dialogue is taught. In the initial phase of the course several assistants contributed in the prepa- ration of the teaching schedule. We are particularly grateful to Dr. K. Hahn, Dr. R. Kircher, Dr. H. Leeb, Dr. M. Orlowski and Dr. H. Seichter. For suggest- ing and discussing the example of "the electrostatic lens", we thank Prof. Dr. F. Lenz and Prof. Dr. E. Kasper. Until 1985 this course had been held at the terminals of the Computer Centre of the University of Tiibingen. After the arrival of powerful personal computers the students themselves showed a desire to have the course adapted to these machines. With the welcome cooperation of IBM the FORTRAN pro- grams for all the chapters were rewritten for the personal computer as a diploma task (W. Losch). In order to make the programs accessible to a wider circle of users this book was produced. We wish you great fun on the personal computer! Tiibingen, October 1987 E. W. Schmid, G. Spitz VII Contents 1. Introduction........................ ........ ....... ........ ... 1 1.1 Programming of the Numerical Portions of the Programs .... 3 1.2 Programming of the Input and Output ...................... 5 2. Numerical Differentiation and Introduction into Screen Dialogue ...................................................... 10 2.1 Formulation of the Problem. ....... ........ ....... ........ .. 10 2.2 Mathematical Methods .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2.3 Programming ............................................... 12 2.4 Exercises ................................................... 17 2.5 Solutions to the Exercises ................................... 17 3. Numerical Integration ....................................... 20 3.1 Formulation of the Problem. ................................ 20 3.2 Numerical Methods ......................................... 21 3.2.1 The Trapezoidal Rule ................................. 21 3.2.2 The Simpson Rule .................................... 22 3.2.3 Newton-Cotes Integration ............................. 23 3.2.4 The Gauss-Legendre Integration.. ............... ...... 23 3.3 Programming............................................... 27 3.4 Exercises ................................................... 31 3.5 Solutions to the Exercises ................................... 31 4. Harmonic Oscillations with Sliding and Static Friction, Graphical Output of Curves ................................ 33 4.1 Formulation of the Problem ................................. 33 4.2 Numerical Treatment ....................................... 34 4.2.1 Transformation of the Differential Equation..... ....... 34 4.2.2 The Euler Method.................................... 35 4.3 Programming ................................................ 35 4.4 Exercises ................................................... 39 4.5 Solutions to the Exercises ................................... 39 5. Anharmonic Free and Forced Oscillations ................. 41 5.1 Formulation of the Problem........ ..... ... . ...... ... ... . . .. 41 5.2 Numerical Treatment ....................................... 42 IX 5.2.1 Improvement of the Euler Method..................... 42 5.2.2 The Runge-Kutta Method............................. 44 5.3 Programming ............................................... 45 5.4 Exercises ................................................... 47 5.5 Solutions to the Exercises ................................... 48 6. Coupled Harmonic Oscillations ............................. 51 6.1 Formulation of the Problem................ ....... .......... 51 6.2 Numerical Method .......................................... 52 6.3 Programming ............................................... 53 6.4 Exercises ................................................... 55 6.5 Solutions to the Exercises ................................... 55 7. The Flight Path of a Space Craft as a Solution of the Hamilton Equations .......................................... 57 7.1 Formulation of the Problem ............................... " 57 7.2 Mathematical Methods...................................... 61 7.2.1 Mesh Width Adaptation in the Runge-Kutta Method.. 61 7.2.2 Coordinate Transformation...... ...................... 64 7.3 Programming............................................... 65 7.3.1 Hamilton's Equations of Motion....... ................ 65 7.3.2 Automatic Mesh Width Adjustment in the Runge-Kutta Method................................. 67 7.3.3 Coordinate Transformation...... ........... ........... 69 7.3.4 Main Program ........................................ 71 7.4 Exercises ................................... "................ 77 7.5 Solutions to the Exercises ................................... 77 8. The Celestial Mechanics Three-body Problem............ 79 8.1 Formulation of the Problem ................................. 79 8.2 Mathematical Method ...................................... 83 8.3 Programming............................................... 83 8.4 Exercises ................................................... 87 8.5 Solutions to the Exercises ................................... 87 9. Computation of Electric Fields by the Method of Successive Over-relaxation .................................. 88 9.1 Formulation of the Problem........ ............... ........ .. 88 9.2 Numerical Method........................................... 90 9.2.1 Discretisation of Laplace's Equation..... ....... ....... 90 9.2.2 The Method of Successive Over-relaxation............. 91 9.3 Programming............................................... 93 9.4 Exercises ................................................... 98 9.5 Solutions to the Exercises ................................... 98 x 10. The Van der Waals Equation ............................... 100 10.1 Formulation of the Problem................................ 100 10.2 Numerical Method ......................................... 102 10.3 Programming .............................................. 104 10.4 Exercises .................................................. 110 10.5 Solutions to the Exercises .................................. 111 11. Solution of the Fourier Heat Conduction Equation and the "Geo-Power Station" ............................... 113 11.1 Formulation of the Problem ................................ 113 11.2 Method of Solution ........................................ 115 11.3 Programming .............................................. 117 11.4 Exercises .................................................. 119 11.5 Solutions to the Exercises .................................. 120 12. Group and Phase Velocity in the Example of Water Waves 123 12.1 Formulation of the Problem................................ 123 12.2 Numerical Method ......................................... 127 12.3 Programming.............................................. 129 12.4 Exercises .................................................. 132 12.5 Solutions to the Exercises .................................. 132 13. Solution of the Radial Schrodinger Equation by the Fox-Goodwin Method ................................... 134 13.1 Formulation of the Problem ................................ 134 13.2 Numerical Method of Solution ............................. 138 13.3 Programming .............................................. 140 13.4 Exercises .................................................. 142 13.5 Solutions to the Exercises .................................. 143 14. The Quantum Mechanical Harmonic Oscillator ........... 147 14.1 Formulation of the Problem................................ 147 14.2 Numerical Method ......................................... 148 14.3 Programming .............................................. 151 14.4 Exercises .................................................. 154 14.5 Solutions to the Exercises .................................. 154 15. Solution of the Schrodinger Equation in Harmonic Oscillator Representation ................................... 156 15.1 Formulation of the Problem ................................ 156 15.2 Numerical Method ......................................... 157 15.3 Programming .............................................. 158 15.4 Exercises .................................................. 161 15.5 Solutions to the Exercises .................................. 161 XI 16. The Ground State of the Helium Atom by the Hylleraas Method ............................................ 163 16.1 Formulation of the Problem................................ 163 16.2 Setting up the State Basis and the Matrix Equation........ 165 16.3 Programming .............................................. 170 16.4 Exercises .................................................. 178 16.5 Solutions to the Exercises .................................. 178 17. The Spherical Harmonics .................................... 179 17.1 Formulation of the Problem................................ 179 17.2 Numerical Method......................................... 182 17.3 Programming .............................................. 183 17.4 Exercises .................................................. 185 17.5 Solutions to the Exercises .................................. 186 18. The Spherical Bessel Functions ............................. 187 18.1 Formulation of the Problem................................ 187 18.2 Mathematical Method ..................................... 189 18.3 Programming .............................................. 190 18.4 Exercises .................................................. 193 18.5 Solutions to the Exercises .................................. 193 19. Scattering of an Uncharged Particle from a Spherically Symmetric Potential ............................... '.' . . . . . . . . 195 19.1 Formulation ofthe Problem...................... ........... 195 19.2 Mathematical Treatment of the Scattering Problem ........ 198 19.3 Programming .............................................. 201 19.4 Exercises .................................................. 204 19.5 Solutions to the Exercises.................................. 205 References ......................................................... 207 Subject Index ..................................................... 209 XII 1. Introduction The solution of numerical problems in theoretical physics was until a few years ago the domain of large computers. In recent years there have appeared on the market personal computers which are as powerful as the large computers of the early sixties. Apart from their high computational performance, personal com- puters offer interactive capabilities and the rapid graphical output of results, which were not available twenty years ago. Personal computers accordingly offer us a wide field of possibilities in education and research. In education it used to be customary to convey an understanding of the fundamentals of theoretical physics by deduction. Understanding could be con- solidated and deepened by the solution of exercises, but the number of analyt- ically soluble examples is unfortunately rather limited. The personal computer now enables us to increase significantly the number of examples by the inclu- sion of examples which can be solved numerically. The computed results can be graphically displayed in an instructive way. Moreover, in interaction with the computer one can easily vary the physical parameters and the boundary or starting conditions arid so become familiar with a whole family of solutions. This clarifies in particular the connection between theory and experiment. The emphasis in teaching is today moving from the derivation of equations towards application. The personal computer is also a useful tool in theoretical physics research. It performs valuable service in the development and testing of new computer programs. Anybody who has worked for years with large computers, serving many users simultaneously in so-called Time Sharing Mode, knows the joy of having a computer entirely to himself, rather than having to wait in a queue. In applying to complicated scientific studies a program developed on a personal computer, one will still have recourse to large computers. It is most conve- nient when there is a cable connection between personal computer and large computer. This book is an attempt to facilitate the introduction of the personal computer into education and research. The programs of the book have been tested on personal computers of the IBM PCI AT type, with mathematical co- processor, 512KB main memory, hard disc, EGA board and Professional FOR- TRAN compiler. The programs were also tried out on other IBM-compatible machines (even without hard discs). In most cases no problems arose, provided that the machines were equipped with a mathematical co-processor and one of the usual graphics boards. A memory capacity of 512 KB is required for only

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.