Comparing total error against truncation error at each grid point resulting from the numerical solution of u''(x)=exp(x) using finite difference discretization

Nasser M. Abbasi, 10/25/2010


The differential equation "truncation_error_1.gif" with Dirichlet boundary conditions u[0]=0,u[1]=0 is solved numerically by approximating u''[x] by "truncation_error_2.gif"where h is the spacing between grid points. The truncation error τ at each "truncation_error_3.gif" is given by "truncation_error_4.gif"while the total error e at the same point is given by "truncation_error_5.gif" where "truncation_error_6.gif" is the numerical solution found at that point and "truncation_error_7.gif" is the exact solution u(x) evaluated at the same point.
A small program is written to show the distribution of e and τ along the length of the domain [0,1] as h is made smaller and smaller.
This was run for few iterations, where h was divided by half each time, the system was solved for U and the result is shown in a series of plots.







Observations on the above plots

The total error e was largest in the middle of the grid, and smallest at the edges, while the truncation error was smallest at the left edge and largest at the right edge.
Comparing e to τ on each grid point is useful to understand the distribution of errors along the domain, but for verification that the numerical solution converges to the exact solution as h becomes smaller, the grid norm of e is the one examined to verify that it is less than or equal to the grid norm of τ.
Therefore, the following plots are generated which shows how "truncation_error_13.gif" compares to "truncation_error_14.gif"  as h becomes smaller. These norms are grid norms and not the standard norms.



Observations on the above plots

The total error has smaller grid norm. This shows convergence, since this implies that ||e||"truncation_error_17.gif", therefore showing that "truncation_error_18.gif"=O(1) which is the condition for convergence. The above results confirms this for this problem.

Spikey Created with Wolfram Mathematica 7.0