headmyshoulder / odeint-v2

odeint - solving ordinary differential equations in c++ v2
http://headmyshoulder.github.com/odeint-v2/
Other
337 stars 102 forks source link

Per state absolute tolerance support? #255

Open wds15 opened 3 years ago

wds15 commented 3 years ago

Hi!

Other ODE software as the CVODES suite in Sundials allows for the specification of an absolute tolerance error for each state of the ODE. This functionality seems to be useful on some settings, see here:

https://github.com/stan-dev/math/pull/2244#issuecomment-744038070

The example considers a pharmacokinetic / pharmacodynamic (PK/PD) system. The PK system is about drug concentrations and the PD system deals with drug effects. As both things are measured differently it is reasonable to target different absolute tolerances.

Another interesting case is when one solves a PK system from which only few states are actually observed. In these problems one models different drug compartements, but one only observes the central compartement and hence the required precision is different.

Would such a feature be possible with odeint and something which can be implemented simply? To me it looks daunting to implement this such that it would be much appreciated if it can be made available ... or if it is not too hard to implement, then being pointed into the right direction.

Many thanks for considering.