$$ \newcommand{\half}{\frac{1}{2}} \newcommand{\halfi}{{1/2}} \newcommand{\tp}{\thinspace .} \newcommand{\uex}{{u_{\small\mbox{e}}}} \newcommand{\xpoint}{\boldsymbol{x}} \newcommand{\normalvec}{\boldsymbol{n}} \newcommand{\Oof}[1]{\mathcal{O}(#1)} \renewcommand{\u}{\boldsymbol{u}} \newcommand{\f}{\boldsymbol{f}} \newcommand{\stress}{\boldsymbol{\sigma}} \newcommand{\I}{\boldsymbol{I}} \newcommand{\T}{\boldsymbol{T}} \newcommand{\ii}{\boldsymbol{i}} \newcommand{\jj}{\boldsymbol{j}} \newcommand{\kk}{\boldsymbol{k}} \newcommand{\Ix}{\mathcal{I}_x} \newcommand{\Iy}{\mathcal{I}_y} \newcommand{\Iz}{\mathcal{I}_z} \newcommand{\It}{\mathcal{I}_t} \newcommand{\setb}[1]{#1^0} % set begin \newcommand{\sete}[1]{#1^{-1}} % set end \newcommand{\setl}[1]{#1^-} \newcommand{\setr}[1]{#1^+} \newcommand{\seti}[1]{#1^i} \newcommand{\Real}{\mathbb{R}} \newcommand{\Integer}{\mathbb{Z}} $$

Finite difference methods for wave motion

Hans Petter Langtangen [1, 2]

[1] Center for Biomedical Computing, Simula Research Laboratory
[2] Department of Informatics, University of Oslo

Nov 3, 2016


This is still a preliminary version.

Table of contents

Simulation of waves on a string
      Discretizing the domain
      The discrete solution
      Fulfilling the equation at the mesh points
      Replacing derivatives by finite differences
      Formulating a recursive algorithm
      Sketch of an implementation
Verification
      A slightly generalized model problem
      Using an analytical solution of physical significance
      Manufactured solution
      Constructing an exact solution of the discrete equations
Implementation
      Callback function for user-specific actions
      The solver function
      Verification: exact quadratic solution
      Visualization: animating the solution
      Running a case
      Working with a scaled PDE model
Vectorization
      Operations on slices of arrays
      Finite difference schemes expressed as slices
      Verification
      Efficiency measurements
      Remark on the updating of arrays
Exercises
      Exercise 1: Simulate a standing wave
      Exercise 2: Add storage of solution in a user action function
      Exercise 3: Use a class for the user action function
      Exercise 4: Compare several Courant numbers in one movie
      Project 5: Calculus with 1D mesh functions
Generalization: reflecting boundaries
      Neumann boundary condition
      Discretization of derivatives at the boundary
      Implementation of Neumann conditions
      Index set notation
      Verifying the implementation of Neumann conditions
      Alternative implementation via ghost cells
Generalization: variable wave velocity
      The model PDE with a variable coefficient
      Discretizing the variable coefficient
      Computing the coefficient between mesh points
      How a variable coefficient affects the stability
      Neumann condition and a variable coefficient
      Implementation of variable coefficients
      A more general PDE model with variable coefficients
      Generalization: damping
Building a general 1D wave equation solver
      User action function as a class
      Pulse propagation in two media
Exercises
      Exercise 6: Find the analytical solution to a damped wave equation
      Problem 7: Explore symmetry boundary conditions
      Exercise 8: Send pulse waves through a layered medium
      Exercise 9: Explain why numerical noise occurs
      Exercise 10: Investigate harmonic averaging in a 1D model
      Problem 11: Implement open boundary conditions
      Exercise 12: Implement periodic boundary conditions
      Exercise 13: Compare discretizations of a Neumann condition
      Exercise 14: Verification by a cubic polynomial in space
Analysis of the difference equations
      Properties of the solution of the wave equation
      More precise definition of Fourier representations
      Stability
      Numerical dispersion relation
      Extending the analysis to 2D and 3D
Finite difference methods for 2D and 3D wave equations
      Multi-dimensional wave equations
      Mesh
      Discretization
Implementation
      Scalar computations
      Vectorized computations
      Verification
Using classes to implement a simulator
Exercises
      Exercise 15: Check that a solution fulfills the discrete model
      Project 16: Calculus with 2D mesh functions
      Exercise 17: Implement Neumann conditions in 2D
      Exercise 18: Test the efficiency of compiled loops in 3D
Applications of wave equations
      Waves on a string
      Waves on a membrane
      Elastic waves in a rod
      The acoustic model for seismic waves
      Sound waves in liquids and gases
      Spherical waves
      The linear shallow water equations
      Waves in blood vessels
      Electromagnetic waves
Exercises
      Exercise 19: Simulate waves on a non-homogeneous string
      Exercise 20: Simulate damped waves on a string
      Exercise 21: Simulate elastic waves in a rod
      Exercise 22: Simulate spherical waves
      Problem 23: Earthquake-generated tsunami over a subsea hill
      Problem 24: Earthquake-generated tsunami over a 3D hill
      Problem 25: Investigate Matplotlib for visualization
      Problem 26: Investigate visualization packages
      Problem 27: Implement loops in compiled languages
      Exercise 28: Simulate seismic waves in 2D
      Project 29: Model 3D acoustic waves in a room
      Project 30: Solve a 1D transport equation
      Problem 31: General analytical solution of a 1D damped wave equation
      Problem 32: General analytical solution of a 2D damped wave equation
References