SKopecz / PositiveIntegrators.jl

A Julia library of positivity-preserving time integration methods
https://skopecz.github.io/PositiveIntegrators.jl/
MIT License
13 stars 4 forks source link

Feature: production-destruction-rest systems #43

Closed ranocha closed 2 months ago

ranocha commented 5 months ago

It would be great to support systems that are not necessarily conservative but have a conservative part (treated via the Patankar trick) and an additional part (integrated as usual in RK methods).

ranocha commented 2 months ago

I cam across this again. It would be nice if we could add additional (production) terms that are not weighted by the (modified) Patankar trick

SKopecz commented 2 months ago

If you use a PDSProblem you can put these terms on the diagonal of the production matrix P. Only the off-diagonal terms of P have corresponding destruction terms and will be weighted.

ranocha commented 2 months ago

I see, thanks. So the off-diagonal terms of the production matrix are used to setup the corresponding conservative production-destruction system, the diagonal terms are used as they are in the underlying Runge-Kutta method (and should be non-negative), and the destruction terms from the additional destruction vector are weighted by the Patankar trick 👍 Do we have some tests for this setup?

SKopecz commented 2 months ago

Within our problem library prob_pds_stratreac is such a nonconservative PDS. In runtests.jl all tests that have the keyword "nonconservative" in the title deal with this kind of problems.

ranocha commented 2 months ago

Thanks!