PHYS6350-ComputationalPhysics
PHYS6350-ComputationalPhysics copied to clipboard
Lecture notes and code for the course PHYS6350 Computational Physics at the University of Houston
Computational Physics course (PHYS 6350)
This repository contains the lecture notes and computer code for the graduate course PHYS6350 Computational Physics taught at the University of Houston.
The course is designed for graduate/advanced undergraduate physics students. The focus is on the concepts behind the numerical methods used in computational physics over the implementation. For this reason, most of the code is in Python and uses Jupyter Notebooks for presentation. For the same reason, many standard routines (such as linear equation solvers) are reimplemented.
Textbooks
There is no assigned textbook but the following textbooks can be useful:
- Computational Physics by Mark Newman (Some parts of this text are available on the author’s website: http://www-personal.umich.edu/~mejn/cp/index.html)
- Numerical Recipes: The Art of Scientific Computing, Third Edition - by W.H. Press, et al.
Many of the problems and examples are taken from the first book, these are referenced in the lecture notes where applicable.
Syllabus
The syllabus for the course taught in Spring 2023 is available here
Lecture notes and code
- Lecture notes: folder
lectures - Sample programs and notebooks: folder
code
Course outline
-
Plotting [Lecture (pdf), Code (ipynb)]
-
Floating-point precision [Lecture (pdf), Code (ipynb)]
-
Interpolation [Lecture (pdf), Code (ipynb)]
- Nearest-neighbor
- Linear
- Interpolating polynomial
- Bilinear (two variables)
-
Non-linear equations
- Lecture 1 (pdf, pptx), Code (ipynb)
- Bisection method
- Secant and Newton-Raphson method
- Lecture 2 (pdf, pptx)
- Roots of a polynomial (ipynb)
- Multi-dimenstional Newton and Broyden methods (ipynb)
- Search for extrema (minimum/maximum) (ipynb)
- Lecture 1 (pdf, pptx), Code (ipynb)
-
Numerical integration
- Lecture 1 (pdf, pptx), Code (ipynb)
- Rectangle, trapezoidal, and Simpson rules
- Composite and adaptive rules, error control
- Improper integrals
- Lecture 2 (pdf), Code (ipynb)
- Newton-Cotes quadrature
- Clenshaw-Curtis quadrature
- Gaussian quadrature
- Lecture 1 (pdf, pptx), Code (ipynb)
-
Numerical differentiation [Lecture (pdf), Code (ipynb)]
- Forward, backward, and central difference
- High-order approximations and derivatives
- Balancing truncation and round-off errors
-
Ordinary differential equations (ODE) [Code (ipynb)]
- Lecture 1 (pdf)
- Euler, midpoint (RK2), and RK4 methods
- Adaptive step
- Stiff equations, stability, and implicit methods
- Systems of ODEs
- Simple pendulum
- Lecture 2 (pdf))
- Leapfrog, modified midpoint and Bulirsch-Stoer methods
- Simple pendulum
- Comet motion, SIR model
- Boundary value problems and the shooting method
- Lecture 1 (pdf)
-
Classical mechanics problems [Lecture (pdf, pptx), Code (ipynb)]
- Three-body problem
- Non-linear pendulum
- Double pendulum and chaotic motion (simulation + animation code (ipynb))
-
Molecular dynamics [Lecture (pdf), Code (ipynb)]
- Classical N-body problem
- Lennard-Jones fluid
- Equilibration and thermodynamics
-
Linear algebra [Code (ipynb)]
- Lecture 1 (pdf)
- Gaussian elimination
- Pivoting
- LU-decomposition
- Lecture 2 (pdf)
- Matrix inversion
- Tri- and band-diagonal systems
- QR decomposition
- Eigenvalue problem
- Lecture 1 (pdf)
-
Partial differential equations (PDE) [Code (ipynb)]
- Lecture 1 (pdf)
- Boundary value problems
- Finite difference method
- Jacobi and Gauss-Seidel methods
- Lecture 2 (pdf, pptx)
- Initial value problems
- FTCS, implicit, and Crank-Nicolson schemes
- Heat equation
- Wave equation
- Lecture 1 (pdf)
-
Random numbers and Monte Carlo methods [Code (ipynb)]
- Lecture 1 (pdf)
- Pseudo-random number generators
- Computing integrals
- As the area under the curve
- Mean-value method
- Sampling non-uniformly distributed random numbers
- Inverse transform sampling
- Rejection sampling
- Lecture 2 (pdf)
- Multi-dimensional integrals
- Importance sampling
- Lecture 1 (pdf)
-
Statistical physics problems
- Lecture 1 (pdf), Code (ipynb)
- Markov Chain Monte Carlo (MCMC)
- Metropolis-Hastings algorithm
- 2D Ising model
- Lecture 2 (pdf. pptx), Code (ipynb)
- Simulated annealing
- Percolation threshold simulation
- Lecture 1 (pdf), Code (ipynb)
-
Quantum mechanics [Lecture (pdf), Code (ipynb)]
- Matrix method for eigenenergies and eigenstates
- Time-dependent Schroedinger equation
-
Fourier transform [Lecture (pdf), Code (ipynb)]
- Discrete Fourier Transform
- Fast Fourier Transform
-
Introduction to Machine Learning [Lecture (pdf)]
- Based on Google machine learning crash course https://developers.google.com/machine-learning/crash-course
-
Introduction to Parallel Computing [Lecture (pdf)]
- Basic terminology
- OpenMP examples (cpp)
- Molecular dynamics with NVIDIA CUDA (cpp)
Usage
Feel free to use and redistribute the material with an appropriate reference.
Copyright (C) 2023 Volodymyr Vovchenko