Errors in Numerical Methods

All the numerical methods for solving parabolic partial differential equations in one spatial dimension combine the methods for solving boundary value problems with the methods for solving initial value problems. As one might expect, the error in solving the partial differential equation is some combination of the errors in solving boundary value problems and initial value problems. It is not always straightforward to assess the error.

As an illustration of errors for partial differential equations, we give results for a chemical reactor with radial dispersion. The problem models dispersion of mass and heat in a reactor to oxidize o-xylene to phthalic anhydride, and involves five species plus temperature. (ref). Here we just look at the solution using various numerical parameters. The average concentration down the reactor is shown in Figure 1. At z = 0.5, the average concentration of o-xylene goes to zero, since it is all reacted. Thus, we use the average concentration at the point z = 0.4 and examine how that value depends upon the numerical parameters.

The problem is solved using the orthogonal collocation method (link) with a method (rkf45 in FORTRAN) that is very similar to ode45 in MATLAB. Thus, the solution depends upon the number of terms used in orthogonal collocation (N) and the error tolerances given the ODE integrator (e). Tabular results are shown in the Table. The question is: what is the exact answer?

Values of <c> at z = 0.4
e N = 1 N = 3 N = 6
1 0.7653 no solution  
0.1 0.6588 0.1398  
0.01 0.6067 0.6109  
0.001 0.6035971 0.6207  
1.00E-04 0.6033213 0.6223334  
1.00E-05 0.6034129 0.6223087  
1.00E-06 0.6033979 0.6223275  
1.00E-08     0.6223572

ODE errors - compare with best solution of ODEs
e N = 1 N = 3
1 0.1619021  
0.1 0.0554021 0.4825275
0.01 0.0033021 0.0114275
0.001 0.0001992 0.0016275
1.00E-04 7.66E-05 5.9E-06
1.00E-05 1.5E-05 1.88E-05

PDE errors - compare with best solution of PDE
e N = 1 N = 3
1 1.43E-01  
0.1 3.64E-02 4.83E-01
0.01 1.57E-02 1.15E-02
0.001 1.88E-02 1.66E-03
1.00E-04 1.90E-02 2.38E-05
1.00E-05 1.89E-02 4.85E-05
1.00E-06 1.90E-02 2.97E-05

Clearly for a given N, we have a set of ODEs; the accuracy of the solution to that set is determined by the user specification of the error tolerance e. As the tolerance gets smaller and smaller, the time step used is smaller and smaller, and the solution is more accurate. Table I shows that, for fixed N, the changes in <c> become smaller and smaller as the error tolerance is decreased. Figure 2 shows that further reduction in e will not change the solution obtained with a specific N. If one uses the value of <c> for the smallest error tolerance as the exact solution for that N, and plots the error versuse, one obtains Figure 3. In this case, the 'exact solution' is different for N = 1 and N = 3, since they extrapolate to different values as e goes to zero. The overall behavior is what we expect: as the error tolerance is decreased, the solution to the set of ODEs becomes more and more accurate. It is just that we want the solution to the partial differential equations, too. Thus, let us take as the best estimate of the solution to the partial differential equations the value 0.6223572 and compare all solutionsto that value. The error so determined is shown in Figure 4. Now, as the error tolerance is decreased for N =1 we get to a point where no further decrease in e makes the solution more accurate. This is because the set of equations for N = 1 has some error built into it - error caused by the approximation of the partial differential equations by sets of ordinary differential equations. When we look at the error for N = 3, we do achieve reduction in PDE error as the error tolerance is reduced, because there is less error because the spatial approximation is better. In summary:

Take Home Lesson: When solving partial differential equations, it is important to consider convergence of the approximation with respect to two parameters: one determining the spatial accuracy (here N) and one determining the accuracy of integration of the ordinary differential equations (here e).

Figure 2. Values of Average Concentration

Figure 3. Error in Ordinary Differential Equations

Figure 4. Error in Partial Differential Equation