Summary#

Things you should know about or how to do#

  • Floating point representation and roundoff error: what sets the scale of roundoff errors and the maximum and minimum floats that can be stored.

  • Finite differencing of derivatives, including the idea of the order of the approximation and the optimal step size

  • Interpolation: how to do simple linear interpolation; the difference between cubic interpolation and a cubic spline; how to do interpolation in >1D

  • Integration: Newton-Cotes methods; Gaussian quadrature and how to implement it; how to estimate the error in a numerical integration; Monte-Carlo integration and its error

  • Random numbers: how to generate samples from a distribution, including built-in NumPy/SciPy functions, rejection/transformation/ratio of uniforms methods, or using Metropolis-Hastings.

  • Matrix operations and decompositions in Numpy, especially SVD. The idea of condition number and how to calculate it.

  • Newton’s method for minimizing a function or finding roots

  • Integrating differential equations: the difference between explicit and implicit methods. Advantages and disadvantages of both methods. What is meant by the term stiff equation.

  • Different types of errors: numerical instability, amplitude errors, phase errors, von Neumann stability analysis

  • How to implement an adaptive step-size. The difference between absolute and relative errors.

  • What makes an integrator symplectic. The idea of a pseudo-Hamiltonian. The leapfrog method.

  • Differences between initial value and boundary value problems. Basic idea of relaxation methods.

  • Methods for solving the linear system \(\mathbf{Ax} = \mathbf{b}\): inversion including with SVD, conjugate gradient for sparse matrices.

  • How to implement boundary conditions in finite difference schemes

  • The discrete Fourier transform: frequency spacing, maximum spacing, aliasing, leakage

  • The difference between convolution and cross-correlation and how to implement them in Fourier space. Zero-padding and why/when it is needed.

Problems that we looked at#

Laplace’s equation

Diffusion

Advection-diffusion

Wave equation

Thermodynamics

Orbits

Least-squares fitting