Abstract:
Differential equations are involved in many felds. Often these cannot be solved exactly, so they must be approximated. To do this, we derive a fourth order finite difference scheme for non-uniform meshes. This is paired with a second order finite difference scheme for non-uniform meshes to generate an error estimate for the second order finite difference scheme. The difference between the solutions obtained from the two schemes is used to generate an error estimate for the second order finite difference scheme. The schemes are tested in three cases for order of convergence and quality of error estimate. The first test case is boundary value ordinary differential equations, the second test case is 1D partial differential equations, and the third case is 2D partial differential equations. There were two methods to define boundary conditions in the 2D partial differential equation, either in Dirichlet or Neumann form. We found that both finite difference schemes had an experimental order of convergence consistent with the expected theoretical order of convergence in the boundary value ordinary differential equation and 1D partial differential equation (PDE) cases. This was also demonstrated in the 2D PDE case when using boundary conditions in Neumann form. Only the fourth order scheme showed experimentally and theoretically consistent convergence rates on 2D PDEs when using Dirichlet boundary conditions. The error estimate was within one order of magnitude of the true error for the second order finite difference scheme in all cases where the subintervals in the meshes were small enough to allow the Taylor's series, upon which the finite difference schemes are based, to hold. We conclude that the schemes can be used within a computational algorithm incorporating adaptive meshing and error control features.