Computational Physics

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Bookmark is added through MasterPDF. A complete introduction to the field of computational physics, with examples and exercises in the Python programming language. Computers play a central role in virtually every major physics discovery today, from astrophysics and particle physics to biophysics and condensed matter. This book explains the fundamentals of computational physics and describes in simple terms the techniques that every physicist should know, such as finite difference methods, numerical quadrature, and the fast Fourier transform. The book offers a complete introduction to the topic at the undergraduate level, and is also suitable for the advanced student or researcher who wants to learn the foundational elements of this important field.

Author(s): Mark Newman
Publisher: CreateSpace Independent Publishing Platform
Year: 2012

Language: English
Commentary: Bookmark is added through MasterPDF.
Pages: 561

CONTENTS
PREFACE
1 INTRODUCTION
2 PYTHON PROGRAMMING FOR PHYSICISTS
2.1 GETTING STARTED
2.2 BASIC PROGRAMMING
2.2.1 VARIABLES AND ASSIGNMENTS
2.2.2 VARIABLE TYPES
2.2.3 OUTPUT AND INPUT STATEMENTS
2.2.4 ARITHMETIC
2.2.5 FUNCTIONS, PACKAGES, AND MODULES
2.2.6 BUILT-IN FUNCTIONS
2.2.7 COMMENT STATEMENTS
2.3 CONTROLLING PROGRAMS WITH "IF" AND "WHILE"
2.3.1 THE IF STATEMENT
2.3.2 THE WHILE STATEMENT
2.3.3 BREAK AND CONTINUE
2.4 LISTS AND ARRAYS
2.4.l LISTS
2.4.2 ARRAYS
2.4.3 READING AN ARRAY FROM A FILE
2.4.4 ARITHMETIC WITH ARRAYS
2.4.5 SLICING
2.5 "FOR" LOOPS
2.6 USER-DEFINED FUNCTIONS
2.7 GOOD PROGRAMMING STYLE
3 GRAPHICS AND VISUALIZATION
3.1 GRAPHS
3.2 SCATTER PLOTS
3.3 DENSITY PLOTS
3.4 30 GRAPHICS
3.5 ANIMATION
FURTHER EXERCISES
4 ACCURACY AND SPEED
4.1 VARIABLES AND RANGES
4.2 NUMERICAL ERROR
4.3 PROGRAM SPEED
5 INTEGRALS AND DERIVATIVES
5.1 FUNDAMENTAL METHODS FOR EVALUATING INTEGRALS
5.1.1 THE TRAPEZOIDAL RULE
5.1.2 SIMPSON'S RULE
5.2 ERRORS ON INTEGRALS
5.2.1 PRACTICAL ESTIMATION OF ERRORS
5.3 CHOOSING THE NUMBER OF STEPS
5.4 ROMBERG INTEGRATION
5.5 HIGHER-ORDER INTEGRATION METHODS
5.6 GAUSSIAN QUADRATURE
5.6.1 NONUNIFORM SAMPLE POINTS
5.6.2 SAMPLE POINTS FOR GAUSSIAN QUADRATURE
5.6.3 ERRORS ON GAUSSIAN QUADRATURE
5.7 CHOOSING AN INTEGRATION METHOD
5.8 INTEGRALS OVER INFINITE RANGES
5.9 MULTIPLE INTEGRALS
5.10 DERIVATIVES
5.10.1 FORWARD AND BACKWARD DIFFERENCES
5.10.2 ERRORS
5.10.3 CENTRAL DIFFERENCES
5.10.4 HIGHER-ORDER APPROXIMATIONS FOR DERIVATIVES
5.10.5 SECOND DERIVATIVES
5.10.6 PARTIAL DERIVATIVES
5.10.7 DERIVATIVES OF NOISY DATA
5.11 INTERPOLATION
FURTHER EXERCISES
6 SOLUTION OF LINEAR AND NONLINEAR EQUATIONS
6.1 SIMULTANEOUS LINEAR EQUATIONS
6.1.1 GAUSSIAN ELIMINATION
6.1.2 BACKSUBSTITUTION
6.1.3 PIVOTING
6.1.4 LU DECOMPOSITION
6.1.5 CALCULATING THE INVERSE OF A MATRIX
6.1.6 TRIDIAGONAL AND BANDED MATRICES
6.2 EIGENVALUES AND EIGENVECTORS
6.3 NONLINEAR EQUATIONS
6.3.1 THE RELAXATION METHOD
6.3.2 RATE OF CONVERGENCE OF THE RELAXATION METHOD
6.3.3 RELAXATION METHOD FOR TWO OR MORE VARIABLES
6.3.4 BINARY SEARCH
6.3.5 NEWTON'S METHOD
6.3.6 THE SECANT METHOD
6.3.7 NEWTON'S METHOD FOR TWO OR MORE VARIABLES
6.4 MAXIMA AND MINIMA OF FUNCTIONS
6.4.1 GOLDEN RATIO SEARCH
6.4.2 THE GAUSS-NEWTON METHOD AND GRADIENT DESCENT
7 FOURIER TRANSFORMS
7.1 FOURIER SERIES
7.2 THE DISCRETE FOURIER TRANSFORM
7.2.1 POSITIONS OF THE SAMPLE POINTS
7.2.2 Two-DIMENSIONAL FOURIER TRANSFORMS
7.2.3 PHYSICAL INTERPRETATION OF THE FOURIER TRANSFORM
7.3 DISCRETE COSINE AND SINE TRANSFORMS
7.3.1 TECHNOLOGICAL APPLICATIONS OF COSINE TRANSFORMS
7.4 FAST FOURIER TRANSFORMS
7.4.1 FORMULAS FOR THE FFT
7.4.2 STANDARD FUNCTIONS FOR FAST FOURIER TRANSFORMS
7.4.3 FAST COSINE AND SINE TRANSFORMS
FURTHER EXERCISES
8 ORDINARY DIFFERENTIAL EQUATIONS
8.1 FIRST-ORDER DIFFERENTIAL EQUATIONS WITH ONE VARIABLE
8.1.1 EULER'S METHOD
8.1.2 THE RUNGE-KUTTA METHOD
8.1.3 THE FOURTH-ORDER RUNGE-KUTTA METHOD
8.1.4 SOLUTIONS OVER INFINITE RANGES
8.2 DIFFERENTIAL EQUATIONS WITH MORE THAN ONE VARIABLE
8.3 SECOND-ORDER DIFFERENTIAL EQUATIONS
8.4 VARYING THE STEP SIZE
8.5 OTHER METHODS FOR DIFFERENTIAL EQUATIONS
8.5.1 THE LEAPFROG METHOD
8.5.2 TIME REVERSAL AND ENERGY CONSERVATION
8.5.3 THE VERLET METHOD
8.5.4 THE MODIFIED MIDPOINT METHOD
8.5.5 THE BULIRSCH-STOER METHOD
8.5.6 INTERVAL SIZE FOR THE BULIRSCH-STOER METHOD
8.6 BOUNDARY VALUE PROBLEMS
8.6.1 THE SHOOTING METHOD
8.6.2 THE RELAXATION METHOD
8.6.3 EIGENVALUE PROBLEMS
FURTHER EXERCISES
9 PARTIAL DIFFERENTIAL EQUATIONS
9.1 BOUNDARY VALUE PROBLEMS AND THE RELAXATION METHOD
9.2 FASTER METHODS FOR BOUNDARY VALUE PROBLEMS
9.2.1 OVERRELAXATION
9.2.2 THE GAUSS-SEIDEL METHOD
9.3 INITIAL VALUE PROBLEMS
9.3.1 THE FTCS METHOD
9.3.2 NUMERICAL STABILITY
9.3.3 THE IMPLICIT AND CRANK-NICOLSON METHODS
9.3.4 SPECTRAL METHODS
FURTHER EXERCISES
10 RANDOM PROCESSES AND MONTE CARLO METHODS
10.1 RANDOM NUMBERS
10.1.1 RANDOM NUMBER GENERATORS
10.1.2 RANDOM NUMBER SEEDS
10.1.2 RANDOM NUMBER SEEDS
10.1.3 RANDOM NUMBERS AND SECRET CODES
10.1.4 PROBABILITIES AND BIASED COINS
10.1.5 NONUNIFORM RANDOM NUMBERS
10.2 MONTE CARLO INTEGRATION
10.2.1 THE MEAN VALUE METHOD
10.2.2 INTEGRALS IN MANY DIMENSIONS
10.2.3 IMPORTANCE SAMPLING
10.3 MONTE CARLO SIMULATION
10.3.1 IMPORTANCE SAMPLING AND STATISTICAL MECHANICS
10.3.2 THE MARKOV CHAIN METHOD
10.4 SIMULATED ANNEALING
FURTHER EXERCISES
11 USING WHAT YOU HAVE LEARNED
APPENDIX A INSTALLING PYTHON
APPENDIX B DIFFERENCES BETWEEN PYTHON VERSIONS
APPENDIX C GAUSSIAN QUADRATURE
APPENDIX D CONVERGENCE OF MARKOV CHAIN MONTE CARLO CALCULATIONS
APPENDIX E USEFUL PROGRAMS
E.1 GAUSSIAN QUADRATURE
E.2 SOLUTION OF TRIDIAGONAL OR BANDED SYSTEMS OF EQUATIONS
E.3 DISCRETE COSINE AND SINE TRANSFORMS
E.4 COLOR SCHEMES
INDEX
INDEX