0
$\begingroup$

I want to compare the number $x$ with $x' = x + \Delta x$.

If I have selected an absolute tolerance $atol = 0.1$, then:

\begin{equation} |\Delta x| < atol \implies x' \approx x \end{equation}

If I have selected a relative tolerance $rtol = 0.1$, then:

\begin{equation} \left|\frac{\Delta x}{x}\right| <rtol \implies x' \approx x \end{equation}

What happens when I set $rtol = atol = 0.1$? Does the relative tolerance check override the absolute tolerance check?

$\endgroup$

1 Answer 1

1
$\begingroup$

That very much depends on how it is implemented in a specific software, so you need to check either the documentation or the source code. For lsoda, the documentation states:

The estimated local error in Y(i) will be controlled
so as to be roughly less (in magnitude) than

EWT(i) = RTOL*ABS(Y(i)) + ATOL     if ITOL = 1, or
EWT(i) = RTOL*ABS(Y(i)) + ATOL(i)  if ITOL = 2.

Thus the local error test passes if, in each
component, either the absolute error is less than
ATOL (or ATOL(i)), or the relative error is less
than RTOL.

Use RTOL = 0.0 for pure absolute error control, and
use ATOL = 0.0 (or ATOL(i) = 0.0) for pure relative
error control.  Caution:  Actual (global) errors may
exceed these local tolerances, so choose them
conservatively.

So in this case, whichever tolerance is satisfied overrides the other.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.