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.

Overview

An overview of the course and logistics.

Course materials:

Basics of Computation

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

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

Programming Practices

Version control, testing, ...

Examples:

Differentiation / Integration

Numerical approximations for sampled and analytic functions.

Examples:
  • Comparison of different numerical derivatives: fprime.py
  • Compound trapezoidal integration: trap.py
  • Compound Simpson's integration: simp.py
  • Gauss-Legendre quadrature example: erf.py

Interpolation / Root-finding

Basic methods for reconstructing functions and finding zeros.

Examples:

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.

Examples:

FFTs

An overview Fourier transforms.

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

Fitting

Fitting models functions to data.

Readings: 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): fdadvect.py
  • Convergence for the finite-difference upwind advection: fdupwind.py fdupwind_converge.py
  • Second-order finite-volume method (piecewise linear reconstruction) for linear advection: fv_advection.py
    (alternately, here's a Fortran verison that also does piecewise parabolic reconstruction: advect.f90)
  • Second-order finite-volume method for Burger's equation: burgers.py

Laplace & Poisson Equations / Elliptic PDEs

Smoothing, multigrid, and FFT methods for elliptic equations.

Readings: Course materials:
Examples:

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: diffexplicit.py
  • Backward-difference (implicit) diffusion: diffimplicit.py
  • Crank-Nicolson differenced diffusion (direct solve): diffCNimplicit.py
  • Multigrid solution of diffusion (C-N discretization): diffMG.py
  • Diffusion-reaction equation, using Strang-splitting (this can be thought of as a model for a flame): diffusion-reaction.py
  • Viscous burgers equation (2nd-order piecewise linear f-v method for advection + 2nd-order implicit method for diffusion): burgersvisc.py
  • A cell-centered approximate projection: project.py

Monte Carlo Methods

Random sampling applied to integration and optimization.

Readings: Course materials:
Examples:

Genetic Algorithms

Optimization techniques using evolutionary concepts.

Examples:

Parallel Computing

An overview of techniques used in high performance computing.

Readings: Course materials:
Examples:

Machine Learning

Using neural networks for simply learning tasks.

Readings:
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: riemann-phase.py
  • pyro: hydro by example—A python-based teaching code we'll use
  • hydro1d: A simple, 1-d, finite-volume, gamma-law hydrodynamics solver

Summary

What have we learned?

Readings: Course materials: