Computational Physics 1 Home Page Title Page Module PH3707 Contents JJ II 10 Credits J I Page1 of 85 Go Back by Roger Stewart Full Screen Version date: Monday, 7 July 2008 Close Quit opttoa Physics Computational opttoa Physics Computational opttoa Physics Computational opttoa Physics Computational Home Page opttoa Physics Computational Physics Computational Title Page Contents opttoa Physics Computational Physics Computational opttoa Physics– Computational JJ II Computational Physics– opttoa Physics– Computational Computational Physics– opttoa Physics– Computational Computational Physics– opttoa Physics– Computational Computational Physics– J I Computational Physics Physics– Computational Computational Physics– Computational Physics opttoa Physics– Computational Computational Physics– Page2 of 85 opttoa Physics– Computational Computational Physics– opttoa Physics– Computational Computational Physics– opttoa Physics– Computational Computational Physics– Go Back Computational Physics Computational Physics Full Screen Close Computational Physics Computational Physics Quit Computational Physics Computational Physics ComputationalComputational Physics Physics Copyright c 2003 Dennis Dunn. Home Page Title Page Contents JJ II J I Page3 of 85 Go Back Full Screen Close Quit Contents Home Page Title Page Contents Contents 4 JJ II INTRODUCTION TO THE MODULE5 J I 1 ANALYSIS OF WAVEFORMS 21 Page4 of 85 1.1 Objectives 22 Go Back 1.2 Fourier Analysis 23 1.2.1 Why bother? 24 Full Screen 1.2.2 Aperiodic functions 25 Close 1.3 The Numerical Methods 26 Quit 1.4 Diffusion Equation 29 1.4.1 Exercises 30 2 EIGENVALUES AND EIGENVECTORS OF MATRICES 33 2.1 Objectives 34 2.2 Eigenvalues and eigenvectors of real symmetric or hermitian matrices 35 2.3 A Matrix Eigenvalue Package 39 2.4 Schrodinger¨ Equation 42 2.4.1 Harmonic Oscillator 43 Home Page 2.4.2 Spherically Symmetric 3D Systems 44 Title Page 3 RANDOM PROCESSES 48 3.1 Objectives 49 Contents 3.2 Introduction 50 JJ II 3.3 Random Number Generators 51 J I 3.3.1 The basic algorithm 51 3.4 Intrinsic Subroutine 52 Page5 of 85 3.4.1 Different number ranges 53 Go Back 3.4.2 Testing your random generator 54 Full Screen 3.5 Monte Carlo Integration 56 Close 3.5.1 Hit and Miss Method 56 3.5.2 Sampling Method 56 Quit 3.6 Nuclear Decay Chains 58 3.6.1 Analytic approach 58 3.6.2 Computer simulation 60 3.7 Exercises 61 4 MONTE CARLO SIMULATION 65 4.1 OBJECTIVES 66 4.2 EQUILIBRIUM AND FLUCTUATIONS 67 4.3 MONTE CARLO SIMULATIONS – THE PRINCIPLES 70 Home Page 4.4 The Metropolis Monte Carlo Algorithm 71 4.5 The Ising Model 72 Title Page 4.6 The Ising Model and the Monte Carlo Algorithm 73 Contents 4.7 Rationale 74 JJ II 4.8 MONTE CARLO SIMULATIONS – IN ACTION 75 4.9 Order Parameter - Magnetisation 76 J I 4.10 Temperature Scan (Annealing and Quenching) 77 Page6 of 85 4.11 MATHEMATICAL APPENDIX 78 Go Back 4.11.1 Fluctuations 78 4.11.2 Metropolis Monte Carlo Algorithm and Principle of Detailed Balance 79 Full Screen 4.11.3 Susceptibility and Fluctuations 80 Close 4.12 EXERCISES 82 Quit Index 85 INTRODUCTION TO THE MODULE Home Page Title Page Contents Version date: Monday, 7 July 2008 JJ II J I Page7 of 85 Go Back Full Screen Close Quit Introduction In this module you will be taught techniques employed in computational science and, in particular, computational physics using the FORTRAN95 language. The unit consists of four ‘computer ex- periments’, each of which must be completed within a specified time. Each ‘computer experiment’ is described in a separate chapter of this manual and contains a series of exercises for you to com- Home Page plete. You should work alone and should keep a detailed record of the work in a logbook that must be submitted for assessment at the end of each experiment. Title Page For three of the four projects, there will be a supervised laboratory session each week and further Contents unsupervised sessions. There will be no supervised sessions for the fourth project: These will be exercises in independent JJ II learning. The Salford Fortran95 compiler will be used in this course, and this may be started by double- J I clicking on the Plato icon under the “Programming - Salford Fortran 95” program group. A “FTN95 Page8 of 85 Help” facility is supplied with this software and can be found within the same program group. This help facility includes details of the standard FORTRAN95 commands as well as the compiler- Go Back specific graphics features. All of the programs needed during this course may be downloaded from the Part 3 - PH3707 Computational Physics page on the department’s web-server: Full Screen (www.rdg.ac.uk/physicsnet). Close Quit Web Site Information In addition to all the chapters and programs required for this course, there are links to other useful sites including a description of programming style; a description of computational science in gen- eral and FORTRAN programming in particular; a tutorial for FORTRAN90; and a description of object-oriented programming. Home Page Title Page Contents JJ II J I Page9 of 85 Go Back Full Screen Close Quit References Programming in Fortran 90/95 By J S Morgan and J L Schonfelder Published by N.A. Software 2002. 316 pages. Home Page This can be ordered online from Title Page www.fortran.com $15 Contents Fortran 95 Handbook By Jeanne Adams, Walt Brainerd, Jeanne Martin, Brian Smith, and Jerry Wagener JJ II Published by MIT Press, 1997. 710 pages. J I $55.00 Page 10 of 85 Fortran 95/2003 Explained Go Back By Michael Metcalf and John Reid Full Screen Oxford University Press ISBN 0-19-8526293-8 $35.00 Close Fortran 90 for Scientists and Engineers Quit By Brian Hahn Published by Arnold £19.99 Fortran 90/95 for Scientists and Engineers By Stephen J. Chapman McGraw-Hill, 1998 ISBN 0-07-011938-4 $68.00 Numerical Recipes in Fortran90 By William Press, Saul Teukolsky, William Vetterling, and Brian Flannery Published by Cambridge University Press, 1996. 550 pages. $49.00 Home Page A more complete list of reference texts is held at Title Page http://www.fortran.com/fortran/Books/books.html Contents where books can be ordered directly. JJ II J I Page 11 of 85 Go Back Full Screen Close Quit Logbooks You must keep an accurate and complete record of the work in a logbook. The logbook is what is assessed. In the logbook you should answer all the questions asked in the text, include copies of the programs with explanations of how they work, and record details of the program inputs and of the output created by the programs. On completion of each chapter you should write a brief summary Home Page of what has been achieved in the project. Title Page I am often asked what should go in the logbook. It is difficult to give a precise answer to this since each computer experiment is different but as a guide: it should have Contents JJ II • a complete record of your computer experiment; • sufficient detail for someone else to understand what you were doing and why; and J I • for someone else to be able to repeat the computer experiment. Page 12 of 85 In particular should also include: Go Back Full Screen • program listings; • a description of any changes you made to the programs; Close If you have made a succession of changes, you should not reproduce the complete program each time but simply specify what changes you have made and why you have made them. Quit • the data entered and results obtained from your programs (or, if there are a very large number of results, a summary of these results); • a comment on each set of results; You will lose marks if you simply record masses of computer output without commenting on its significance. • descriptions of any new techniques you have learned. It worked! A statement in your logbook of the form ”I tried the program and it worked” will not be looked on favorably. • What inputs did you provide to the program? Home Page • What output did you obtain? • What evidence do you have that this output is correct? Title Page Contents Program Testing JJ II It is always safe to assume that a program you have written is wrong in some way. If you have made some error with the programming language then the compiler will tell you about this: it may not J I always tell you precisely what is wrong! However it may be the case that what you have told the computer to do is not really what you Page 13 of 85 intended. Computers have no intelligence: You need to be very precise in your instructions. Go Back Every program should be tested. You do this by giving the program input data such that you know, or can can easily calculate, the result. If possible your method of calculation should be via a Full Screen different method than that which the computer is using: the method you have told the computer to use may be incorrect. Close Only when the program has passed your tests should you start to use it to give you new results. Quit Module Assessment The module comprises 4 computational projects. A record of each project must be kept in a logbook and the logbook submitted for assessment by the specified deadline. The final assessment will based on the best 3 project marks. Each project will be marked out of 20. A detailed marking scheme is given, in this manual, for each Home Page project. Title Page Guidelines on the assessment are given below.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages87 Page
-
File Size-