AMICI-dev / AMICI

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

Handling conservation laws via solver constraints #2329

Open dweindl opened 7 months ago

dweindl commented 7 months ago

The CVODES constraint handling (see also #2327) would also allow us to enforce conservation laws, and probably make our code quite a bit simpler.

To be discussed whether we'd want to keep the current conservation law handling anyways in order to support other solver at some point, but it seems rather unlikely that this will happen.

This would also solve the currently missing/difficult handling of non-negativity constraints in combination with conservation laws.

This will, however, first require upgrading SUNDIALS (#1565).

[1] Note: relevant memory leaks fixed in v6.4.0

FFroehlich commented 7 months ago

Yes getting rid of the conservation laws would indeed be great. Is constraint handling also supported by the non-linear solvers? Moreover, we would have to figure out a way of applying the constraints when computing derivatives implicitly. Not an issue with positivity but more problematic with conservation laws.

dweindl commented 7 months ago

Is constraint handling also supported by the non-linear solvers?

Yes Wait, no. Contraints are checked after the non-linear solve.

Moreover, we would have to figure out a way of applying the constraints when computing derivatives implicitly.

That I don't know.

FFroehlich commented 7 months ago

Is constraint handling also supported by the non-linear solvers?

~Yes~ Wait, no. Contraints are checked after the non-linear solve.

Moreover, we would have to figure out a way of applying the constraints when computing derivatives implicitly.

That I don't know.

Both would be issues for steadystate solvers.