If you are looking for the code to find the errors you want
to be here. For the following, let
W = | Um - Um+1 |
I. Max Error The max error is the simplest error,
where you just find the max value of the absolute difference between the two solutions:
| W |
II. Average Error
The average error or L2 norm error is the square root of the integral of
| W |^2.
III. Energy Error
The energy error is ( (5/3)^m * the sum over Vm of (W(y) - W(x))^2 )^(1/2)
where y is a neighbor of x.
IV. A Posteriori Error The posteriori error is
basically L2 norm of -Lu+qu-f. The advantage here is that there is no reference to the theoretical solution,
thereby allowing us to measure the error of any solution to any f and q functions. It should be noted that the
slopes associated with the energy error tends to be the average of the slopes calculated from the average error
and the posteriori error. This is because, generally speaking, each derivative you take makes the approximation
worse, and the average error involves no derivatives, while the energy error involves the first derivative (squared),
and the posteriori error operates on the level of the laplacian, which is like 2 derivatives, therby yielding the
worst errors.
|