Sunteți pe pagina 1din 13

Simulations in Physics

Harvey Gould, Jan Tobochnik, and Wolfgang Christian February 11, 2011

Chapter 1

Preface
Computer simulations are now an integral part of contemporary basic and applied physics and computation has become as important as theory and experiment. The ability to compute is now part of the essential repertoire of research scientists. Since writing the rst two editions of our text, more courses devoted to the study of physics using computers have been introduced into the physics curriculum, and many more traditional courses are incorporating numerical examples. We are gratied to see that our text has helped shape these innovations. The purpose of our book includes the following: 1. To provide a means for students to do physics. 2. To give students an opportunity to gain a deeper understanding of the physics they have learned in other courses. 3. To encourage students to discover physics in a way similar to how physicists learn in the context of research. 4. To introduce numerical methods and new areas of physics that can be studied with these methods. 5. To give examples of how physics can be applied in a much broader context than it is discussed in the traditional physics undergraduate curriculum. 6. To teach objejct oriented programming in the context of doing science. Our overall goal is to encourage students to learn about science through experience and by asking questions. Our objective always is understanding, not the generation of numbers. The major change in this edition is the use of the Java programming language instead of True Basic, which was used in the rst two editions. We chose Java for some of the same reasons we originally chose True Basic. Java is available for all popular operating systems, and is platform independent, contains built-in graphics capabilities, is freely available, and has all the features needed to write powerful computer simulations. There is an abundance of free open source tools available 1

CHAPTER 1. PREFACE

for Java programmers, including the Eclipse integrated development environment. Because Java is popular, it continues to evolve, and its speed is now comparable to other languages used in scientic programming. In addition, Java is object oriented, which has become the dominant paradigm in computer science and software engineering, and therefore learning Java is excellent preparation for students with interests in physics and computer science. Java programs can be easily adapted for delivery over the Web. Finally, as for True Basic, the non-graphical parts of our programs can easily be converted to other languages such as C/C++, whose syntax is similar to Java. When we chose True Basic for our rst edition, introductory computer science courses were teaching Pascal. When we continued with True Basic in the second edition, computer science departments were experimenting with teaching C/C++. Finally, we are able to choose a language that is commonly taught and used in many contexts. Thus, it is likely that some of the students reading our text will already know Java and can contribute much to a class that uses our text. Java provides many powerful libraries for building a graphical user interface and incorporating audio, video and other media. If we were to discuss these libraries, students would become absorbed in programming tasks that have little or nothing to do with physics. For this reason our text uses the Open Source Physics library, which makes it easy to write programs that are simpler and more graphically oriented than those that we wrote in True Basic. In addition, the Open Source Physics library is useful for other computational physics projects that are not discussed in this text, as well as general programming tasks. This library provides for easy graphical input of parameters, tabular output of data, plots, visualizations and animations, and the numerical solution of ordinary dierential equations. It also provides several useful data structures. The Open Source Physics library was developed by Wolfgang Christian, with the contributions and assistance of many others. The book, Open Source Physics: A Users Guide with Examples by Wolfgang Christian, is available separately and discusses the Open Source Physics library in much more detail. A CD that comes with the Users Guide contains the source code for the Open Source Physics library, the programs in this book, as well as ready to run versions of these programs. The source code and the library also can be downloaded freely from <www.opensourcephysics.org/sip>. The ease of doing visualizations is a new and important aspect of Java and the Open Source Physics library, givng Java an advantage over other languages such as C++ and Fortran, which do not have built-in graphics capabilities. For example, when debugging a program, it is frequently much quicker to detect when the program is not working by looking at a visual representation of the data, rather than by scanning the data as lists of numbers. Also, it is easier to choose the appropriate values of the parameters by varying them and visualizing the results. Finally, more insight is likely to be gained by looking at a visualization than a list of numbers. Because animations and the continuous plotting of data usually cause a program to run more slowly, we have designed our programs so that the graphical output can be turned o or implemented infrequently during a simulation. Java provides support for interacting with a program during runtime. The Open Source Physics library makes this interaction even easier, so that we can write programs that use a mouse to input data such as the location of a charge, or toggle the value of a cell in a lattice. We also do not need to input how long a simulation should run and can stop the program at any time to change parameters. As with our previous editions, we assume no background in computer programming. Much of the text can be understood by students with only a semester each of physics and calculus.

CHAPTER 1. PREFACE

Chapter 3 introduces Java and the Open Source Physics library. In Chapter 4 we discuss the concept of interfaces and how to use some of the important interfaces in the Open Source Physics library. Later chapters introduce more Java and Open Source Physics constructs as needed, but essentially all of the chapters after Chapter 4 can be studied independently and in any order. We include many topics that are sometimes considered too advanced for undergraduates, such as random walks, chaos, fractals, percolation, simulations of many particle systems, and topics in the theory of complexity, but we introduce these topics so that very little background is required. Other chapters discuss optics, electrodynamics, relativity, rigid body motion, and quantum mechanics, which require knowledge of the physics found in the corresponding standard undergraduate courses. This text is written so that the physics drives the choice of algorithms and the programming syntax that we discuss. We believe that students can learn how to program more quickly with this approach because they have an immediate context, namely doing simulations, in which to hone their skills. In the beginning most of the programming tasks involve modifying the programs in the text. Students should then be given some assignments that require them to write their own programs by following the format of those in the text. The students may later develop their own style as they work on their projects. Our text is most appropriately used in a project oriented course that lets students with a wide variety of backgrounds and abilities work at their own pace. The courses that we have taught using this text have a laboratory component. From our experience we believe that active learning where students are directly grappling with the material in this text is the most ecient. In a laboratory context students who already know a programming language can help those who do not. Also, students can further contribute to a course by sharing their knowledge from various backgrounds in physics, chemistry, computer science, mathematics, biology, economics, and other subjects. Although most of our text is at the undergraduate level, many of the topics are considered to be graduate level, and thus would be of interest to graduate students. One of us regularly teaches a laboratory-based course on computer simulation with both undergraduate and graduate students. Because the course is project-oriented, students can go at their own pace and work on dierent problems. In this context, graduate and undergraduate students can learn much from each other. Some instructors who might consider using our text in a graduate level context might think that our text is not suciently rigorous. For example, in the suggested problems we usually do not explicitly ask students to do an extensive data analysis. However, we do discuss how to estimate errors in Chapter 12. We encourage instructors to ask for a careful data analysis on at least one assignment, but we believe that it is more important for students to spend most of their time in an exploratory mode where the focus is on gaining physical insight and obtaining numerical results that are qualitatively correct. There are four types of suggested student activities. The exercises, which are primarily found in the beginning of the text, are designed to help students learn specic programming techniques. The problems, which are scattered throughout each chapter, are open-ended and require students to run, analyze, and modify programs given in the text, or write new, but similar programs. Students will soon learn that the format for most of the programs is very similar. Starred problems require either signicantly more background or work, and may require the writing of a program from scratch. However, the programs for these problems still follow a similar format. The projects at the end of most of the chapters are usually more time consuming and would be appropriate for term projects or independent student research. Many new problems and projects have been added

CHAPTER 1. PREFACE

to this edition while others have been improved and some have been eliminated. Instructors and students should view the problem descriptions and questions as starting points for thinking about the system of interest. It is important that students read the problems even if they do not plan to do them. We encourage instructors to ask students to write laboratory reports for at least some of the problems. The appendix to Chapter 1 provides guidance on what these reports should include. Part of the beauty and fun of doing computer simulations is that one is forced to think about the choice of algorithm, its implementation, the choice of parameters, what to measure, and the results. Do the results make sense? What happens if you change a parameter? What if you change the algorithm? Much physics can be learned in this way. Although all the programs discussed in the text can be downloaded freely, most are listed in the text to encourage students to read them carefully. Students might nd some useful techniques that they can use elsewhere, and the discussion in the text frequently refers to the listings. A casual perusal of the text might suggest that the text is bereft of gures. One reason that we have not included more gures is that most of the programs in the text have an important visual component in color. Black and white gures pale in comparison. Much of the text is meant to be read while working on the programs. Thus, students can easily see the plots and animations produced by the programs while they are reading the text. As new technologies become available and the backgrounds and expectations of students change, the question of what is worth knowing needs to be reconsidered. Today calculators not only do arithmetic and numerical operations, but most can do algebra, calculus, and plotting. Students have lost the sense of number and most can only do the simplest mathematical manipulations in their head. On the other hand, most students feel comfortable using computers and gathering information o the Web. Because there exist programs and applets that can perform many of the simulations in this text, why should students learn how to write their own programs? We have at least two answers. First, most innovative scientic research involves writing programs that do not t into the domains of existing software. More importantly, we believe that students obtain a deeper understanding of the physics and the algorithms themselves by writing and modifying their own programs. Just as we need to insure that students can carry out basic mathematical operations without a calculator so that they understand what these operations mean, we must do the same when it comes to computational physics. The recommended readings at the end of each chapter have been selected for their pedagogical value rather than for completeness or for historical accuracy. We apologize to our colleagues whose work has been inadvertently omitted, and we would appreciate suggestions for new and additional references. Because students come with a dierent skill set than most of their instructors, it is important that instructors realize that certain aspects of this text might be easier for their students than for them. Some instructors might be surprised that much of the code for organizing the simulations is hidden in the Open Source Physics library (although the source code is freely available). Some instructors will initially think that Chapter 3 contains too much material. However, from the students perspective this material is not that dicult to learn. They are used to downloading les, using various software environments, and learning how to make software do what they want. The dicult parts of the text, where instructor input is most needed, is understanding the physics and the algorithms. Converting algorithms to programs also is dicult for many students, and we

CHAPTER 1. PREFACE

spend much time in the text explaining the programs that implement various algorithms. In some cases instructors will nd it dicult to set up an environment to use Java and the Open Source Physics library. Because this task depends on the operating system, we have placed instructions on how to set up an environment for Java and Open Source Physics at <opensourcephysics.org>. This web site also contains links to updates of the evolving Open Source Physics library as well as other resources for this text including the source code for the programs in the text. We acknowledge generous support from the National Science Foundation which has allowed us to work on many ideas that have found their way into this textbook. We also thank Kipton Barros, Mario Belloni, Doug Brown, Francisco Esquembre, and Joshua Gould for their advice, suggestions, and contributions to the Open Source Physics library and to the text. We thank Anne Cox for suggesting numerous improvements to the narrative and for hosting an Open Source Physics developers workshop at Eckerd College. We are especially thankful to students and faculty at Clark University, Davidson College, and Kalamazoo College who have generously commented on the Open Source Physics project as they class tested early versions of this manuscript. Carlos Ortiz helped prepare the index for this book. Many individuals reviewed parts of the text and we thank them for their assistance. They include Lowell M. Boone, Roger Cowley, Shamanthi Fernando, Alejandro L. Garcia, Alexander L. Godunov, Rubin Landau, Donald G. Luttermoser, Cristopher Moore, Anders Sandvik, Ross Spencer, Dietrich Stauer, Jutta Luettmer-Strathmann, Daniel Suson, Matthias Troyer, Slavomir Tuleja, and Michael T. Vaughn. We thank all our friends and colleagues for their encouragement and support. We are grateful to our wives, Patti Gould, Andrea Moll Tobochnik, and Barbara Christian, and to our children, Joshua, Emily, and Evan Gould, Steven and Howard Tobochnik, and Katherine, Charlie, and Konrad Christian for their encouragement and understanding during the course of this work. It takes a village to raise a child and a community to write a textbook. No book of this length can be free of typos and errors. We encourage readers to email us about errors that they nd and suggestions for improvements. Our plan is to continuously revise our book, so that the next edition will be more timely. Harvey Gould Clark University Worcester, MA 01610 hgould@clarku.edu Jan Tobochnik Kalamazoo College Kalamazoo, MI 49006-3295 jant@kzoo.edu Wolfgang Christian Davidson College Davidson, NC 28036-6926 wochristian@davidson.edu

Contents
1 Preface 2 Introduction 2.1 Importance of computers in physics . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 2.3 2.4 2.5 The importance of computer simulation . . . . . . . . . . . . . . . . . . . . . . . . Programming languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Object oriented techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How to use this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 13 13 15 16 18 19 24 24 26 32 38 42 47 53 59 59 61 63 66 68 69 71 79 80

3 Tools for Doing Simulations 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Simulating free fall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 3.4 3.5 3.6 3.7 Getting started with object oriented programming . . . . . . . . . . . . . . . . . . Inheritance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Open Source Physics library . . . . . . . . . . . . . . . . . . . . . . . . . . . . Animation and Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Model-View-Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 Simulating Particle Motion 4.1 Modied Euler algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9 Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Drawing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Specifying the state of a system using arrays . . . . . . . . . . . . . . . . . . . . . The ODE interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The ODESolver interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Eects of Drag Resistance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Two-Dimensional Trajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Decay processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

CONTENTS 4.10 Visualizing Three-Dimensional Motion . . . . . . . . . . . . . . . . . . . . . . . . 4.11 Levels of Simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7 83 88

5 Oscillations 100 5.1 Simple Harmonic Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 5.2 The Motion of a Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 5.3 5.4 5.5 5.6 5.7 Damped Harmonic Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 Response to External Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Electrical Circuit Oscillations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Accuracy and Stability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

6 Few-Body Problems: The Motion of the Planets 123 6.1 Planetary Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 6.2 6.3 6.4 6.5 6.6 6.7 6.8 The Equations of Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Circular and Elliptical Orbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Astronomical Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126 Log-log and Semilog Plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 Simulation of the Orbit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 Impulsive Forces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Velocity Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

6.9 A Mini-Solar System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139 6.10 Two-Body Scattering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143 6.11 Three-body problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150 6.12 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153 7 The Chaotic Motion of Dynamical Systems 7.1 7.2 7.3 7.4 7.5 7.6 7.7 159

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 A Simple One-Dimensional Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160 Period Doubling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 Universal Properties and Self-Similarity . . . . . . . . . . . . . . . . . . . . . . . . 171 Measuring Chaos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176 *Controlling Chaos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182 Higher-Dimensional Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186

7.8 Forced Damped Pendulum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189 7.9 *Hamiltonian Chaos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193 7.10 Perspective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

CONTENTS

7.11 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201 8 Random Processes 8.1 8.2 8.3 8.4 8.5 8.6 8.7 8.8 217

Order to Disorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 Random Walks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223 Modied Random Walks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 The Poisson Distribution and Nuclear Decay . . . . . . . . . . . . . . . . . . . . . 237 Problems in Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240 Method of Least Squares . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Applications to Polymers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246 Diusion Controlled Chemical Reactions . . . . . . . . . . . . . . . . . . . . . . . . 254

8.9 Random Number Sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257 8.10 Variational Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261 8.11 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266 Appendix 10: Random Walks and the Diusion Equation . . . . . . . . . . . . . . . . . 270 9 The Dynamics of Many Particle Systems 277 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277 9.2 The Intermolecular Potential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 9.3 9.4 9.5 9.6 9.7 9.8 9.9 Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 The Numerical Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279 Periodic Boundary Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280 A Molecular Dynamics Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283 Thermodynamic Quantities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295 Radial Distribution Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 Hard disks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

9.10 Dynamical Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 9.11 Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320 9.12 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323 10 Normal Modes and Waves 337 10.1 Coupled Oscillators and Normal Modes . . . . . . . . . . . . . . . . . . . . . . . . 337 10.2 Numerical Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343 10.3 Fourier Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346 10.4 Two-Dimensional Fourier Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 10.5 Fourier Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359 10.6 Power Spectrum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

CONTENTS

10.7 Wave Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364 10.8 Interference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369 10.9 Fraunhofer Diraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376 10.10Fresnel Diraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 379 Appendix 9A: Complex Fourier Series . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382 Appendix 9B: Fast Fourier Transform . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383 Appendix 9C: Plotting Scalar Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 11 Electrodynamics 391 11.1 Static Charges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 11.2 Electric Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 11.3 Electric Field Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 11.4 Electric Potential . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 11.5 Numerical Solutions of Boundary Value Problems . . . . . . . . . . . . . . . . . . . 404 11.6 Random Walk Solution of Laplaces Equation . . . . . . . . . . . . . . . . . . . . . 413 11.7 *Fields Due to Moving Charges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416 11.8 *Maxwells Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423 11.9 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433 Appendix A: Plotting Vector Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434 438

12 Numerical and Monte Carlo Methods

12.1 Numerical Integration Methods in One Dimension . . . . . . . . . . . . . . . . . . 438 12.2 Simple Monte Carlo Evaluation of Integrals . . . . . . . . . . . . . . . . . . . . . . 448 12.3 Multidimensional Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451 12.4 Monte Carlo Error Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 452 12.5 Nonuniform Probability Distributions . . . . . . . . . . . . . . . . . . . . . . . . . 456 12.6 Importance Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460 12.7 Metropolis Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 12.8 *Neutron Transport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 13 Percolation 479 13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479 13.2 The Percolation Threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482 13.3 Finding Clusters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491 13.4 Critical Exponents and Finite Size Scaling . . . . . . . . . . . . . . . . . . . . . . . 499 13.5 The Renormalization Group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502 13.6 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510

CONTENTS

10

14 Fractals and Kinetic Growth Models 519 14.1 The Fractal Dimension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519 14.2 Regular Fractals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 528 14.3 Kinetic Growth Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531 14.4 Fractals and Chaos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 14.5 Many Dimensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 14.6 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552 15 Complex Systems 559 15.1 Cellular Automata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 559 15.2 Self-Organized Critical Phenomenon . . . . . . . . . . . . . . . . . . . . . . . . . . 573 15.3 The Hopeld Model and Neural Networks . . . . . . . . . . . . . . . . . . . . . . . 581 15.4 Growing Networks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 15.5 Genetic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592 15.6 Lattice Gas Models of Fluid Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599 15.7 Overview and Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 610 16 Monte Carlo Simulations of Thermal Systems 622 16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 16.2 The Microcanonical Ensemble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 16.3 The Demon Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624 16.4 The Demon as a Thermometer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 16.5 The Ising Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630 16.6 The Metropolis Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 16.7 Simulation of the Ising Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 16.8 The Ising Phase Transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 16.9 Other Applications of the Ising Model . . . . . . . . . . . . . . . . . . . . . . . . . 656 16.10Simulation of Classical Fluids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660 16.11Optimized Monte Carlo Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . 666 16.12 Other Ensembles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 671 16.13More Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676 16.14Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 678

CONTENTS

11

17 Quantum Systems 706 17.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 17.2 Review of Quantum Theory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 17.3 Bound State Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 17.4 Time Development of Eigenstate Superpositions . . . . . . . . . . . . . . . . . . . . 717 17.5 The Time-Dependent Schrdinger Equation . . . . . . . . . . . . . . . . . . . . . . 723 o 17.6 Fourier Transformations and Momentum Space . . . . . . . . . . . . . . . . . . . . 729 17.7 Variational Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 732 17.8 Random Walk Solutions of the Schrdinger Equation . . . . . . . . . . . . . . . . . 735 o 17.9 Diusion Quantum Monte Carlo . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741 17.10Path Integral Quantum Monte Carlo . . . . . . . . . . . . . . . . . . . . . . . . . . 745 17.11Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 748 Appendix A: Visualizing Complex Functions . . . . . . . . . . . . . . . . . . . . . . . . 750 18 Visualization and Rigid Body Dynamics 756 18.1 Two-Dimensional Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . 756 18.2 Three-Dimensional Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . 761 18.3 The Three-DimensionalOpen Source Physics Library . . . . . . . . . . . . . . . . . 766 18.4 Dynamics of a Rigid Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 770 18.5 Quaternion Arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774 18.6 Quaternion equations of motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 777 18.7 Rigid Body Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 783 18.8 Motion of a spinning top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788 18.9 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 791 19 Seeing in Special and General Relativity 799

19.1 Special Relativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799 19.2 General Relativity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 804 19.3 Dynamics in Polar Coordinates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805 19.4 Black Holes and Schwarzschild Coordinates . . . . . . . . . . . . . . . . . . . . . . 807 19.5 Particle and Light Trajectories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 809 19.6 Seeing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811 19.7 General Relativistic Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811 19.8 The Kerr Metric . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 812 19.9 Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814 19.10References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 814

CONTENTS

12

20 Epilogue: The Unity of Physics 816 20.1 The Unity of Physics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816 20.2 Spiral Galaxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 817 20.3 Numbers, Pretty Pictures, and Insight . . . . . . . . . . . . . . . . . . . . . . . . . 819 20.4 Constrained Dynamics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 821 20.5 What are Computers Doing to Physics? . . . . . . . . . . . . . . . . . . . . . . . . 824

S-ar putea să vă placă și