This repository contains the lecture notes and computer code for the graduate course PHYS6350 Computational Physics taught at the University of Houston in Spring 2023 & Spring 2025.
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.
The materials presented in this repository should be useful both for self-study, as a reference for the course PHYS6350 Computational Physics, and for instructors to use as a reference for their own courses.
The lecture notes have been done in Jupyter notebook format and converted to HTML using Jupyter Book. The online version of the lecture notes is available at https://vovchenko.net/computational-physics/
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.
The syllabus for the course is available for Spring 2023 and Spring 2025 editions.
-
Function Interpolation [Lecture (pdf), Code (ipynb)]
- Linear interpolation
- Polynomial Interpolation in Lagrange and Newton forms
- Bilinear interpolation (two variables)
-
Linear Algebra and Matrices
-
Non-Linear Equations
-
Numerical integration
-
Numerical differentiation [Lecture (pdf), Code (ipynb)]
- Forward, backward, and central difference
- High-order approximations and derivatives
- Balancing truncation and round-off errors
- Automatic differentiation
-
Ordinary differential equations (ODE)
- Lecture 1 [pdf, pptx, Code (ipynb)]
- Euler, midpoint (RK2), and RK4 methods
- Adaptive step
- Stiff equations, stability, and implicit methods
- Systems of ODEs
- Simple pendulum
- Lecture 2 [pdf, pptx, Code (ipynb)]
- Leapfrog, modified midpoint and Bulirsch-Stoer methods
- Simple pendulum
- Comet motion, SIR model
- Boundary value problems and the shooting method
- Lecture 1 [pdf, pptx, Code (ipynb)]
-
Classical mechanics problems [Lecture (pdf, pptx), Code (ipynb)]
- Three-body problem
- Non-linear pendulum
- Double pendulum and chaotic motion (simulation + animation code)
-
Molecular dynamics [Lecture (pdf, pptx), Code (ipynb)]
- Classical N-body problem
- Lennard-Jones fluid
- Equilibration and thermodynamics
-
Partial differential equations (PDE)
-
Random numbers and Monte Carlo methods
- Lecture 1 [pdf, pptx, Code (ipynb)]
- 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, pptx, Code (ipynb)]
- Multi-dimensional integrals
- Importance sampling
- Lecture 1 [pdf, pptx, Code (ipynb)]
-
Statistical physics problems
-
Quantum mechanics
-
Fourier transform [Lecture (pdf), Code (ipynb)]
- Discrete Fourier Transform
- Fast Fourier Transform