Truncation error or local truncation error is error made by numerical algorithms that arises from taking finite number of steps in computation. It is present even with infinite-precision arithmetic, because it is caused by truncation of the infinite Taylor series to form the algorithm.
Use of arbitrarily small steps in numerical computation is prevented by round-off error, which are the consequence of using finite precision floating point numbers on computers.
Let represent the difference equation approximating the PDE at the -th mesh point, with exact solution . For example,
represent the difference equation approximating the following PDE
at the -th mesh point. If is replaced by at the mesh points of the , where is the exact solution of the PDEs, the value of is called the local truncation error at the -th mesh point. clearly measures the amount by which the exact solution values of the PDE at the mesh points of the do not satisfy the at the point .
Continuing the above example gives us
Using Taylor expansions, it is easy to express in terms of power of and and partial derivatives of at . This leads us to the computation of the local truncation error.
It is sometimes possible to approximate a parabolic or hyperbolic equation by a finite-difference scheme that is stable (i.e. limits the amplification of all the components of the initial conditions), but which has a solution that converges to the solution of a different differential equation as the mesh lengths tend to zero. Such a difference scheme is said to be inconsistent or incompatible with the PDE.
The real importance of the concept of consistency lies in a theorem by Lax which states that if a linear finite-difference equation is consistent with a properly posed linear initial-value problem then stability guarantees convergence of to as the mesh lengths tend to zero. Consistency can be defined in either of two equivalent but slightly different ways.
The more general definition is as follows. Let represent the PDE in the independent variables and , with exact solution . Let represent the approximating finite-difference equation with exact solution . Let be a continuous function of and with a sufficient number of continuous derivatives to enable to be evaluated at the point .
Then the truncation error at the point is defined by
If as and , the difference equation is said to be consistent or compatible with the PDE. Most authors put because .
For example, let us consider the following parabolic equation
where and .
Backward Euler + second order central finite difference discretization.
We split equally the domain into parts and the domain into parts, i.e. -th mesh point is of the following form
We are now in a position to discretize the problem as follows
where . At , that is , one has
and at , that is , one obtains
The local truncation error and consistency
The above discretization can be rewritten as following
where with the following boundary conditions
Now we have
By Taylor’s expansion
Thus, the principle part of the local truncation error is
In view of the local truncation error, one can easily see that the local truncation error is a polynomial of two variables and which implies that the method is consistent.