AMICI-dev / AMICI

Advanced Multilanguage Interface to CVODES and IDAS
https://amici.readthedocs.io/
Other
108 stars 30 forks source link

Additional check for steady-state convergence #1767

Open plakrisenko opened 2 years ago

plakrisenko commented 2 years ago

Feature description Currently WrmsNorm is used with the formula

Figure}), where Figure

Maybe it would make sense to add possibility to check individual elements and not the sum:

Figure

dilpath commented 1 year ago

I would also suggest Euclidean distance and, independently of this issue, that $\mathrm{rtol}$ and $\mathrm{atol}$ are checked independently, e.g. for Euclidean distance:

$$ \sqrt{\sum_i \dot x^2_i} < \mathrm{rtol} \times \sqrt{\sum_i x^2_i} \qquad \mathrm{OR} \qquad \sqrt{\sum_i \dot x^2_i} < \mathrm{atol} $$

Here's the downsides of each approach

Unless additional checks are implemented to identify the issues for WrmsNorm and individual elements, then users may fail to see that these issues are occurring.

The Euclidean distance fails noticeably: the steady-state computation will fail, so users will be forced to relax tolerances, if they expect a steady-state.