Note: PRELIMINARY VERSION
An explicit method for the 1D diffusion equation
The initial-boundary value problem for 1D diffusion
Forward Euler scheme
Implementation
Verification
Numerical experiments
Implicit methods for the 1D diffusion equation
Backward Euler scheme
Sparse matrix implementation
Crank-Nicolson scheme
The unifying \( \theta \) rule
Experiments
The Laplace and Poisson equation
Analysis of schemes for the diffusion equation
Properties of the solution
Analysis of discrete equations
Analysis of the finite difference schemes
Analysis of the Forward Euler scheme
Analysis of the Backward Euler scheme
Analysis of the Crank-Nicolson scheme
Analysis of the Leapfrog scheme
Summary of accuracy of amplification factors
Analysis of the 2D diffusion equation
Explanation of numerical artifacts
Exercises
Exercise 1: Explore symmetry in a 1D problem
Exercise 2: Investigate approximation errors from a \( u_x=0 \) boundary condition
Exercise 3: Experiment with open boundary conditions in 1D
Exercise 4: Simulate a diffused Gaussian peak in 2D/3D
Exercise 5: Examine stability of a diffusion model with a source term
Diffusion in heterogeneous media
Discretization
Implementation
Stationary solution
Piecewise constant medium
Implementation of diffusion in a piecewise constant medium
Axi-symmetric diffusion
Spherically-symmetric diffusion
Diffusion in 2D
Discretization
Numbering of mesh points versus equations and unknowns
Algorithm for setting up the coefficient matrix
Implementation with a dense coefficient matrix
Verification: exact numerical solution
Verification: convergence rates
Implementation with a sparse coefficient matrix
The Jacobi iterative method
Implementation of the Jacobi method
Test problem: diffusion of a sine hill
The relaxed Jacobi method and its relation to the Forward Euler method
The Gauss-Seidel and SOR methods
Scalar implementation of the SOR method
Vectorized implementation of the SOR method
Direct versus iterative methods
The Conjugate gradient method
What is the recommended method for solving linear systems?
Random walk
Random walk in 1D
Statistical considerations
Playing around with some code
Equivalence with diffusion
Implementation of multiple walks
Demonstration of multiple walks
Ascii visualization of 1D random walk
Random walk as a stochastic equation
Random walk in 2D
Random walk in any number of space dimensions
Multiple random walks in any number of space dimensions
Applications
Diffusion of a substance
Heat conduction
Porous media flow
Potential fluid flow
Streamlines for 2D fluid flow
The potential of an electric field
Development of flow between two flat plates
Flow in a straight tube
Tribology: thin film fluid flow
Propagation of electrical signals in the brain
Exercises
Exercise 6: Stabilizing the Crank-Nicolson method by Rannacher time stepping
Project 7: Energy estimates for diffusion problems
Exercise 8: Splitting methods and preconditioning
Problem 9: Oscillating surface temperature of the earth
Problem 10: Oscillating and pulsating flow in tubes
Problem 11: Scaling a welding problem
Exercise 12: Implement a Forward Euler scheme for axi-symmetric diffusion
Bibliography