# Matplotlib compatibility patch for Pyodide
import matplotlib
if not hasattr(matplotlib.RcParams, "_get"):
matplotlib.RcParams._get = dict.get
1. Numerical Methods for PDEs#
Attribution
This chapter is written by Marcel Zijlema. Find out more here.
In Chapter Numerical Modelling ordinary differential equations (ODEs) have been treated. Their solutions are simply functions of a single independent variable representing time. Frequently, physical systems often evolve not only in time but also in spatial dimensions. Such systems are described by mathematical equations called the partial differential equations (PDEs). Examples are the Navier-Stokes equations that describe the motion of fluids, such as water in oceans, rivers and lakes and air around planes and cars, and the Maxwell’s equations describing the propagation of electric and magnetic fields through a medium or vacuum.
It is virtually impossible to solve the PDEs analytically, and one must therefore rely on numerical methods to find an approximate solution. These methods result in discrete (algebraic) equations which can be solved in a finite sequence of algebraic operations on a computer.
Various numerical approaches are used to discretize differential equations: finite difference methods, finite volume methods, finite element methods, spectral methods, etc. The key notions related to these discretization methods are consistency and stability. They play an important role in the construction of a suitable (accurate and stable) numerical scheme.
In this chapter, first, a brief review of partial differential equations is provided. Next, discretizations of the diffusion equation by employing the finite difference method are considered. This is followed by the approximations of the advection equation and finally the advection-diffusion equation.