Skip to content

General advice on choice of tolerances

Kyle Baron edited this page Sep 21, 2019 · 3 revisions

Source: CVodeWFtolerances in User Documentation for cvode v2.8.2
Accessed: http://lagrange.univ-lyon1.fr/docs/sundials/2.6.2/doc/cvode/cv_guide.pdf

General advice on choice of tolerances

For many users, the appropriate choices for tolerance values in reltol and abstol are a concern. The following pieces of advice are relevant. (1) The scalar relative tolerance reltol is to be set to control relative errors. So reltol = 10−4 means that errors are controlled to .01%. We do not recommend using reltol larger than 10−3 . On the other hand, reltol should not be so small that it is comparable to the unit roundoff of the machine arithmetic (generally around 1.0E-15).

(2) The absolute tolerances abstol (whether scalar or vector) need to be set to control absolute errors when any components of the solution vector y may be so small that pure relative error control is meaningless. For example, if y[i] starts at some nonzero value, but in time decays to zero, then pure relative error control on y[i] makes no sense (and is overly costly) after y[i] is below some noise level. Then abstol (if scalar) or abstol[i] (if a vector) needs to be set to that noise level. If the different components have different noise levels, then abstol should be a vector. See the example cvRoberts dns in the cvode package, and the discussion of it in the cvode Examples document [19]. In that problem, the three components vary between 0 and 1, and have different noise levels; hence the abstol vector. It is impossible to give any general advice on abstol values, because the appropriate noise levels are completely problem-dependent. The user or modeler hopefully has some idea as to what those noise levels are.

(3) Finally, it is important to pick all the tolerance values conservatively, because they control the error committed on each individual time step. The final (global) errors are some sort of accumulation of those per-step errors. A good rule of thumb is to reduce the tolerances by a factor of .01 from the actual desired limits on errors. So if you want .01% accuracy (globally), a good choice is reltol = 10−6 . But in any case, it is a good idea to do a few experiments with the tolerances to see how the computed solution values vary as tolerances are reduced.

Clone this wiki locally