You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a biological system with the following reactions:
1. 50 A <-> A_50
2. A_50 + B <-> A_50 B
I want to determine [A_50 B] as a function of [A]_initial.
I have setup a series of Equilibrium objects and defined an EqSystem. Everything works as expected, however the results are numerically unstable for some combinations of equilibrium constants and concentrations.
I think the issue is the massive difference between the equilibrium constants for the two reactions (K_1 = 1e233, k_2=1e6). For some combinations of initial concentrations, this produces bogus results and gives Too much of at least one component errors.
I'm not sure if it's possible to improve the numerical stability, but it would really help if something could be done.
Here is a minimal example that gives this problem:
Interesting, I've never encountered an equilibrium constant with that extreme dimensionality.
Since I haven't worked with those kinds of problems I can't say anything for sure, but I agree with your analysis. Also, double precision floating points have an maximum representable value of ~10**308 which some of these numbers then come uncomfortably close to (from a logarithmic point of view of course).
Thanks, the NumSysLog does seem to help, although some instability still crops up.
Yes, the equilibrium constant is enormous, which is basically due to the 50:1 stoichiometry of aggregate formation. In reality, my problem is actually a bit more complex and there are other coupled equilibria involved. Capturing all of this in a numerically stable model is proving challenging.
I'm working on a biological system with the following reactions:
I want to determine [A_50 B] as a function of [A]_initial.
I have setup a series of
Equilibrium
objects and defined anEqSystem
. Everything works as expected, however the results are numerically unstable for some combinations of equilibrium constants and concentrations.I think the issue is the massive difference between the equilibrium constants for the two reactions (K_1 = 1e233, k_2=1e6). For some combinations of initial concentrations, this produces bogus results and gives
Too much of at least one component
errors.I'm not sure if it's possible to improve the numerical stability, but it would really help if something could be done.
Here is a minimal example that gives this problem:
The text was updated successfully, but these errors were encountered: