Getting Ready / Prereqs

Students are assumed to know how to program in a language of their choice. Examples in the class will be provided in python.

Homework assignments will be turned in via the git version control software, managed through github for education. Students should register for a github account.


# topic assigned due PDF
1 differentiation / integration 09/07/2017 09/19/2017 homework1.pdf
2 roots / ODEs 09/21/2017 10/03/2017 homework2.pdf
3 linear algebra 10/03/2017 10/10/2017 homework3.pdf
4 FFTs 10/10/2017 10/17/2017 homework4.pdf
5 hyperbolic PDEs 10/17/2017 10/26/2017
6 parabolic / elliptic PDEs 10/31/2017 11/09/2017 homework6.pdf
7 Monte Carlo / optimization 11/09/2017 11/21/2017 homework7.pdf
8 final project 12/07/2017 project.pdf


An overview of the course and logistics.

Course materials:

Basics of Computation

How computers store numbers, types of errors, ...

Readings: Course materials: Examples:
  • A simple example of integer overflow in Fortran: overflow.f90
  • Determining machine epsilon in python:
  • Demonstration of python's variable-sized integers:

Programming Practices

Version control, testing, ...

Readings: Course materials: Examples:

Differentiation / Integration

Numerical approximations for sampled and analytic functions.

Readings: Course materials: Examples:
  • Comparison of different numerical derivatives:
  • Compound trapezoidal integration:
  • Compound Simpson's integration:
  • Gauss-Legendre quadrature:


Basic methods for reconstructing functions.

Readings: Course materials: Examples:


Basic methods finding zeros.

Readings: Course materials: Examples:
  • Root finding example (bisection, Newton, and secant):

Ordinary Differential Equations

Methods for explicit and implicit integration, boundary-value and eigenvalue problems.

Readings: Course materials: Examples:

Linear Algebra

Basic methods for solving linear systems.

Readings: Course materials: Examples:


An overview Fourier transforms.

Readings: Course materials: Examples:
  • A discrete Fourier transform:
  • Some simple examples of FFT and inverse FFT using the numpy FFT routines. These all take real-valued functions as input:
  • Simple example of filtering in frequency space:
  • Some examples of a two-dimensional FFT and image processing: luna_bw.png (image used in the examples)
  • A fast Fourier transform:
  • Fortran timing of DFT vs. FFT: fft_dft.f90


Fitting models functions to data.

Course materials: Examples:

Advection / Hyperbolic PDEs

Finite-volume methods for linear advection and Burgers' equation.

Readings: Course materials: Examples:
  • Simple finite-difference advection (both upwind or FTCS):
  • Convergence for the finite-difference upwind advection:
  • Second-order finite-volume method (piecewise linear reconstruction) for linear advection:
    (alternately, here's a Fortran verison that also does piecewise parabolic reconstruction: advect.f90)
  • Second-order finite-volume method for Burger's equation:

Laplace & Poisson Equations / Elliptic PDEs

Smoothing, multigrid, and FFT methods for elliptic equations.

Readings: Course materials: Examples: Multimedia:

Diffusion / Parabolic PDEs / Multiphysics PDEs

Explicit and implicit methods for the heat equation.

Readings: Course materials: Examples:
  • Time-explicit diffusion on a cell-centered grid:
  • Backward-difference (implicit) diffusion:
  • Crank-Nicolson differenced diffusion (direct solve):
  • Multigrid solution of diffusion (C-N discretization):
  • Diffusion-reaction equation, using Strang-splitting (this can be thought of as a model for a flame):
  • Viscous burgers equation (2nd-order piecewise linear f-v method for advection + 2nd-order implicit method for diffusion):
  • A cell-centered approximate projection:

Monte Carlo Methods

Random sampling applied to integration and optimization.

Readings: Course materials: Examples: Other applications:

Genetic Algorithms

Optimization techniques using evolutionary concepts.

Readings: Course materials: Examples:

Parallel Computing

An overview of techniques used in high performance computing.

Readings: Course materials: Examples:

Machine Learning

Using neural networks for simple learning tasks.

Readings: Online resources: Course materials: Examples:

Computational Fluid Dynamics

Second-order finite-volume methods for hydrodynamics.

Readings: Course materials: Examples:
  • SymPy notebook deriving the eigenstructure of the primitive variable Euler matrix: euler.ipynb
  • Phase diagram (u-p plane) of the Riemann problem:
  • pyro: hydro by example—A python-based teaching code we'll use
  • hydro1d: A simple, 1-d, finite-volume, gamma-law hydrodynamics solver


What have we learned?

Readings: Course materials: