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.

Homework

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

Overview

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: precision.py
  • Demonstration of python's variable-sized integers: fac.py

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: fprime.py
  • Compound trapezoidal integration: trap.py
  • Compound Simpson's integration: simp.py
  • Gauss-Legendre quadrature:

Interpolation

Basic methods for reconstructing functions.

Readings: Course materials: Examples:

Root-finding

Basic methods finding zeros.

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

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:

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
  • 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
  • Fortran timing of DFT vs. FFT: fft_dft.f90

Fitting

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): 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
Multimedia:

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: 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: 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 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: