Computational Physics (4th Ed.)
Problem Solving with Python

Authors:

Language: English
Publication date:
· 17x24.4 cm · Paperback
Computational Physics

The classic in the field for more than 25 years, now with increased emphasis on data science and new chapters on quantum computing, machine learning (AI), and general relativity

Computational physics combines physics, applied mathematics, and computer science in a cutting-edge multidisciplinary approach to solving realistic physical problems. It has become integral to modern physics research because of its capacity to bridge the gap between mathematical theory and real-world system behavior.

Computational Physics provides the reader with the essential knowledge to understand computational tools and mathematical methods well enough to be successful. Its philosophy is rooted in ?learning by doing?, assisted by many sample programs in the popular Python programming language. The first third of the book lays the fundamentals of scientific computing, including programming basics, stable algorithms for differentiation and integration, and matrix computing. The latter two-thirds of the textbook cover more advanced topics such linear and nonlinear differential equations, chaos and fractals, Fourier analysis, nonlinear dynamics, and finite difference and finite elements methods. A particular focus in on the applications of these methods for solving realistic physical problems.

Readers of the fourth edition of Computational Physics will also find:

  • An exceptionally broad range of topics, from simple matrix manipulations to intricate computations in nonlinear dynamics
  • A whole suite of supplementary material: Python programs, Jupyter notebooks and videos

Computational Physics is ideal for students in physics, engineering, materials science, and any subjects drawing on applied physics.

1. Introduction
1.1. Computational Physics and Computational Science
1.2. This Book's Subjects
1.3. This Book's Problems
1.4. This Book's Language: The Python Ecosystem of Packages
1.5. NEW: Installing Python and Its Packages

2. Python Programming Basics and Visualizations
2.1. Making Computers Obey
2.2. Program, Shells, Editors, and All that
2.3. Variables
2.4. Operations
2.5. Functions, Packages, and Modules
2.6. I/O
2.7. Control Statements
2.8. Arrays, Matrices, Lists
2.9. Floating-Point Numbers-Limits
2.10. Problem: Summing Series
2.11. Visualizations with Matplotlib
2.12. Plotting Exercises
2.13. Algebraic Tools

3. Errors and Uncertainties in Computations
3.1. Types of Errors
3.2. Error in Bessel Function Computations
3.3. Experimental Error Investigation

4. Monte Carlo: Randomness, Walks, and Decays
4.1. Deterministic Randomness
4.2. Random Sequences
4.3. Random Walks
4.4. Protein Folding & Self-Avoiding Walks
4.5. Problem: Spontaneous Decay Physics
4.6. Decay Implementation and Visualization

5. Differentiation
5.1. Differentiation
5.2. Forward Difference
5.3. Central Difference
5.4. Extrapolated Difference
5.5. Errors
5.6. Second Derivatives

6. Integration
6.1. Quadrature as Box Counting
6.2. Trapezoid Rule
6.3. Simpson's Rule
6.4. Errors
6.5. Gaussian Quadrature
6.6. Higher Order Rules
6.7. Monte Carlo Integration (Stone Throwing)
6.8. Mean Value Integration
6.9. Exercises
6.10. N-D Monte Carlo
6.11. Integrating Rapidly Varying Functions
6.12. Variance Reduction
6.13. Importance Sampling
6.14. von Neumann Rejection

7. Matrix Computing
7.1. Problem: Masses on String -
Newton-Raphson
7.2. Why Matrix Computing?
7.3. Classes of Matrix Problems
7.4. Gaussian vs Inverse Methods for Solving Linear Equations
7.5. Lists, Arrays, Matrices (Again)
7.6. Numerical Python (NumPy) Arrays
7.7. Testing Matrix Programs

8. Trial-and-Error Searching and Data Fitting
8.1. Problem:Quantum States in a Box
8.2. Trial-and-Error Roots via Bisection
8.3. Newton'Raphson Searching
8.4. Problem: T Dependence of Magnetization
8.5. Problem: Fitting An Experimental Spectrum
8.6. Interpolation Methods
8.7. Problem: Fitting Exponential Decay
8.8. Least-Squares Fitting
8.9. Exercises: Decay, Heat Flow, Hubble's Law
8.10. Linear Quadratic Fits
8.11. Nonlinear Fit to Breit-Wigner

9. Differential Equations & Nonlinear Oscillations
9.1. Free Nonlinear Oscillations
9.2. Nonlinear Models
9.3. Types of Differential Equations
9.4. Dynamic Form for ODEs
9.5. ODE Algorithms and Euler's Method
9.6. Runge-Kutta Method
9.7. Predictor-Corrector Method
9.8. Nonlinear Oscillation Solutions
9.9. Nonlinear Resonances, Beats, Friction
9.10. Extension: Time-Dependent Forces

10. ODE Applications: Eigenvalues, Scattering, Projectiles
10.1. Quantum States for Arbitrary Potentials
10.2. Eigenvalues via ODE plus Search
10.3. Explorations
10.4. Classical Chaotic Scattering
10.5. Objects Falling from the Sky
10.6. Projectile Motion with Drag
10.7. Two- and Three-Body Orbits, Chaotic Weather

11. Program Optimization, Tuning, and GPU Programming
11.1. General Program Optimization Exascale Computing via Multinode- Multicore GPUs
11.2. Optimized Matrix Programming with NumPy
11.3. Empirical Performance of Hardware
11.4. Programming for the Data Cache
11.5. Graphical Processing Units for High Performance Computing
11.6. Practical Tips for Multicore and GPU Programming

12. Data Science I: Fourier Analysis
12.1. Problem: Fourier Analysis of Nonlinear Oscillations
12.2. Fourier Series
12.3. Exercise: Summation of Series
12.4. Fourier Transforms
12.5. Discrete Fourier Transforms
12.6. Filtering Noisy Signals
12.7. Autocorrelation Noise Reduction
12.8. Filtering via Transforms
12.9. Fast Fourier Transforms (FFT)
12.10. FFT Implementation & Assessment

13. Data Science II: Wavelet and Principal Components Analyses for Nonstationary Signals & Data Compression
13.1. Spectral Analysis of Nonstationary Signals
13.2. Wavelet Basics
13.3. Wave Packets and Uncertainty Principle
13.4. Short-Time Fourier Transforms
13.5. The Wavelet Transform
13.6. Discrete Wavelet Transforms, Multiresolution Analysis
13.7. Principal Components Analysis

14. Neural Nets and Machine Learning

15. Nonlinear Population Dynamics
15.1. Bug Population Dynamics
15.2. The Logistic Map (Model)
15.3. Properties of Nonlinear Maps
15.4. Mapping Implementation
15.5. Bifurcation Diagram Analysis
15.6. Logistic Map Randomness
15.7. Exploring Other Maps
15.8. Chaotic Signal: Lyapunov Coeffient
15.9. Coupled Predator-Prey Models
15.10. The Lotka-Volterra Model
15.11. Predator-Prey Chaos

16. Continuous Nonlinear Dynamics
16.1. Chaotic Pendulum
16.2. Phase-Space Orbits
16.3. Bifurcations of Chaotic Pendulums
16.4. Alternate Problem: The Double Pendulum
16.5. Fourier/Wavelet Analysis of Chaos
16.6. Alternate Phase-Space Plots
16.7. Further Explorations

17. Fractals and Statistical Growth Models
17.1. Fractional Dimension
17.2. The Sierpinski Gasket
17.3. Growing Plants
17.4. Ballistic Deposition
17.5. Length of Coastline (Problem
17.6. Correlated Growth, Forests, Films
17.7. Globular Cluster, Diffusion-Limited Aggregation
17.8. Fractals in Bifurcation Plot
17.9. Fractals from Cellular Automata
17.10. Perlin Noise Adds Realism
17.11. Exercises

18. Thermodynamic Simulations
18.1. Magnets via Metropolis Algorithm
18.2. An Ising Chain
18.3. Statistical Mechanics
18.4. Metropolis Algorithm
18.5. Magnets via Wang-Landau Sampling

21. Molecular Dynamics Simulations
21.1. Molecular Dynamics Theory
21.2. Connection to Thermodynamic Variables
21.3. Periodic Boundary Conditions and Potential Cutoff
21.4. Verlet and Velocity-Verlet Algorithms
21.5. 1D Implementation and Exercise
21.6. Analysis

22. Soft Matter and Jamming

23. Electrostatics via Finite Differences
23.1. PDE Review
23.2. Electrostatic Potentials
23.3. Fourier Series Solutions
23.4. Finite-Difference Algorithm
23.5. Assessment via Surface Plot
23.6. Capacitor Problems
23.7. Electric Field Visualization
23.8. Review Exercise

24. Electrostatics via Finite Elements
24.1. Finite-Element Method
24.2. Field due to Charge Density
24.3. Analytic Solution
24.4. Finite-Element Solution
24.5. Implementation and Exercises
24.6. 2D Finite Elements

25. Heat Flow via Time Stepping
25.1. Leapfrog Algorithm
25.2. The Parabolic Heat Equation
25.3. Analytic Solution
25.4. Time Stepping Solution
25.5. von Neumann Stability Assessment
25.6. Implementation
25.7. Assessment and Visualization
25.8. Crank-Nicolson Improvement

26. Waves on Strings and Membranes
26.1. Hyperbolic Equation of Vibrating String
26.2. Normal-Mode Solution
26.3. Time Stepping Algorithm
26.4. Implementation
26.5. Assessment and Exploration
26.6. With Friction
26.7. With Variable Tension, Density
26.8. Catenary and Frictional Wave Exercises
26.9. Vibrating 2D Membrane
26.10. Analytical Solution
26.11. Numerical Solution

27. Quantum Wave Packets
27.1. Time-Dependent Schrödinger Equation
27.2. Finite-Difference Algorithm
27.3. 2D Finite-Difference
27.4. Bound and Diffracted Packets
27.5. Packet-Packet Scattering
27.6. Implementation and Visualization

28. Electromagnetic Waves
28.1. Finite-Difference Time Domain
28.2. Maxwell's Equations
28.3. FDTD Algorithm
28.4. Circularly Polarized Waves
28.5. Wave Plates
28.6. FDTD Exercises and Assessment

29. Shocks Waves and Solitons
29.1. Shallow Water Shocks and Solitons
29.2. Continuity and Advection Equations
29.3. Shock Waves via Burgers? Equation
29.4. Lax-Wendroff Algorithm
29.5. Including Dispersion
29.6. KdeV Equation
29.7. Analytic KdeV Solitons
29.8. Numeric KdeV Solitons
29.9. Phase Space and Crossing Solitons
29.10. Pendulum Chain Solitons
29.11. Including Dispersion
29.12. Continuum Limit, the Sine-Gordon Equation
29.13. Analytic SGE Solution
29.14. Numeric Solution: 2D SGE Solitons

30. General Relativity
30.1. Visualizing Wormholes
30.2. Gravitational Lensing
30.3. Particle Orbits in GR
30.4. Riemann and Ricci Tensors
30.5. GR Code Listings

31. Appendices
31.1. Installing Packages
31.2. Chapter-Linked Video Lectures & Slides
31.3. Jupyter Notebooks
31.4. Web Materials

Rubin H. Landau, PhD, is Professor Emeritus in the Department of Physics at Oregon State University, Corvallis, Oregon, USA. In his long and distinguished research career he has been instrumental in the development of computational physics as a defined subject, and founded both the Computational Physics Degree Program and the Northwest Alliance for Computational Science and Engineering.

Manuel J. Páez, PhD, is a Professor in the Department of Physics at the University of Antioquia in Medellin, Colombia. He teaches courses in both physics and programming, and he and Professor Landau have collaborated on pathbreaking computational physics investigations.

Cristian C. Bordeianu, PhD, taught Physics and Computer Science at the Military College “Stefan cel Mare,” Campulung Moldovenesc, Romania.