wiki:u/erica/norms

Version 4 (modified by Erica Kaminski, 11 years ago) ( diff )

Order of accuracy

The order of accuracy, n, of a scheme is defined by the equation,

where E is the error and h is the grid spacing. The error of a scheme should fall off with decreasing the grid spacing (i.e. the intercell distance), and how fast it falls off we say depends on the order of accuracy.

How to compute the error is the subject of the rest of this wiki page.

Computing the error for a scalar

This is the simplest type of error to compute. For a scalar function at one point (say the solution of an ODE at a given time), the error can be broken down as either absolute or relative.

The absolute error

If is your approximate solution, and z is the exact solution, then the absolute error is just given by . This is an okay measure when z is in units scaled to a magnitude order of 1. (If not, then the error will may appear unexpectedly large or small due to scaling).

Relative error

This measure always gives the same error, regardless of units working in. The error is often , where k is roughly the number of digits the approximation is correct to.

Note on choice

It is often just best to scale the problem so that the measured quantities scale roughly to magnitude order of 1 (so the absolute error is a fine measure), and that the quantities are not many orders different than each other for unphysical reasons. This will help prevent bugs in numerical schemes.

Error of vectors

Now we are considering how to compute the error of an approximate vector of s quantities at a given position (say from solving a system of s equations at a given point). This is different than scalars in that now we must think of norms of error vectors (scalar measures of their "lengths"). There are 3 different ways to measure their "lengths", namely the 1-norm, 2-norm, and infinity-norm (aka max-norm).

If we define the error vector as , then the different norms are given by,

1-norm:

,

2-norm:

, and

infinity-norm:

Note the bound on the infinity-norm that we don't get from the others, this may be helpful in determining the error of some schemes.

These norms are equivalent so long as the dimension of z is fixed as h goes to 0.

This is NOT true when approximating functions!!

Note: See TracWiki for help on using the wiki.