It is possible to use finite differences of a smooth function to estimate the derivative of the function. Let
map a function to its derivative, and let
be the finite difference.
By Taylor’s theorem,
and so the first derivative can be estimated using either forward or backward difference:
Define the operators
Note that is an even function of
and
is an odd function of
. Relating to the Taylor series,
Hence
provides finite difference symmetric difference estimates of the first and second order derivatives of a function.
Application of Finite Difference Approximation to Partial Differential Equations.
One of the simplest partial differential equations is the 1-dimensional heat equation, described by
where operationally is the partial derivative of
with respect to variable
.
In the current context, is some positive constant and
is a function of position
and time
. A complete specification requires specification of boundary conditions, which for simplicity will be taken to be
. A solution will describe the evolution of
over time.
Forward Difference Approximation
Using the forward difference for estimating and the symmetric difference for estimating
, the PDE becomes
Finite methods require discretization of the underlying domain of definition. For simplicity, let and
, and let
be the approximation of
satisfying
This is a finite difference equation where given the value of at time index
, the value of
at time index
is explicitly given as
To make the problem computable, the mesh has to be finite and so the domain of definition is a finite rectangle . Hence the computation will be restricted to points
and
. Those points that fall outside these ranges will assumed to have value
.
Under certain conditions, one of which is the requirement that , the finite computation provides an estimate of the actual solution that converges as the mesh size of the grid approaches zero.
A simple double loop program can generate the mesh solution over the rectangle with a single loop initializing the boundary condition.
