290
9 Solving Partial Differential Equations
9.2 Finite Difference Methods
We shall now construct a numerical method for the diffusion equation. We know
how to solve ODEs, so in a way we are able to deal with the time derivative.
Very often in mathematics, a new problem can be solved by reducing it to a series
of problems we know how to solve. In the present case, it means that we must
do something with the spatial derivative ∂ 2 /∂x 2 in order to reduce the PDE to
ODEs. One important technique for achieving this, is based on finite difference
discretization of spatial derivatives.
9.2.1 Reduction of a PDE to a System of ODEs
Introduce a spatial mesh in Ω with mesh points
x 0 = 0 < x 1 < x 2 < · · · < x N = L .
The space between two mesh points x i and x i+1 , i.e. the interval [x i , x i+1 ], is called
a cell. We shall here, for simplicity, assume that each cell has the same length Δx =
x i+1 − x i , i = 0, . . . , N − 1.
9 Solving Partial Differential Equations
9.2 Finite Difference Methods
We shall now construct a numerical method for the diffusion equation. We know
how to solve ODEs, so in a way we are able to deal with the time derivative.
Very often in mathematics, a new problem can be solved by reducing it to a series
of problems we know how to solve. In the present case, it means that we must
do something with the spatial derivative ∂ 2 /∂x 2 in order to reduce the PDE to
ODEs. One important technique for achieving this, is based on finite difference
discretization of spatial derivatives.
9.2.1 Reduction of a PDE to a System of ODEs
Introduce a spatial mesh in Ω with mesh points
x 0 = 0 < x 1 < x 2 < · · · < x N = L .
The space between two mesh points x i and x i+1 , i.e. the interval [x i , x i+1 ], is called
a cell. We shall here, for simplicity, assume that each cell has the same length Δx =
x i+1 − x i , i = 0, . . . , N − 1.
