Improve numerical stability when integrating the ODE system #68
Labels
bug
Something isn't working
enhancement
New feature or request
help wanted
Extra attention is needed
Milestone
I encountered some numerical problems when attempting to solve a large system (observe the initial concentration,
1e-5
):gives rise to (observe the explosion in the benzaldehyde concentration and the negative hemiaminal concentration, among other discrepancies):
and the following profile:
When using
1e-6
as concentration, reaction time becomes sane (0.0001 s versus 1e+11 s), plus the graph becomes flat (no reaction, that is; final concentrations are precisely the same as in the beginning).When using
1e-4
as concentration, I get an overflow:Discussion
The above is a problem with the Jacobian, which we currently numerically approximate (EDIT: more precisely, the initial rate is probably poorly estimated). That is not ideal, so I propose a couple of things to mitigate this problem:
Bear in mind that this is probably related to #65.
EDIT: I think we can consider two other things:
rtol
, a good starting point is1e-6
)atol
, a good starting point is1e-11
)EDIT: Other things to consider:
The text was updated successfully, but these errors were encountered: