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. To see special characters and have links work these handouts must be downloaded rather than just viewed:
- Course intro slides
- Getting started with Anaconda Distribution
- Cheat sheet for Jupyter Notebook (and Google Colab) also as a Jupyter Notebook
- Good programming style
- More Python features
- Plotting and Graphics with Matplotlib and Mayavi
- Using Latex to put special characters and formulas in plots
- Introduction to Matrices
- Fitting models to data and dfit.py
- Summary of numerical methods
- Solving partial differential equations
- Object-oriented programming in Python also video lecture on OOP (a bit rough)
- Good coding in any language