Computational Physics in Python

The following handouts were developed for my section of the course Physics 281, Computational Physics which uses Mark Newman’s excellent introduction Computational Physics as the course text.  These handouts are intended to supplement Newman’s book with some additional topics:

  • Using Spyder and Anaconda Distribution
  • More advanced plotting and graphics with Matplotlib including 3D plotting, animations, and introductory image analysis
  • Least-squares fitting of models to data (linear and nonlinear)
  • Using scipy and numpy for special functions, linear algebra, numerical integration, integrating ODEs, Fourier analysis, random number distributions.
  • Quick intro to Jupyter Notebook
  • Introductory object-oriented Python
  • Additional programming features including: Controlling output format, writing data files, using modules, optional and keyword function arguments, list comprehensions, tuples, and exception handling.

Here are the handouts: