-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Numerical instability when solving equilibrium problems #156
Comments
Hi Justin, Interesting, I've never encountered an equilibrium constant with that extreme dimensionality. Does there exist an alternative formulation? It sounds not all different from https://en.wikipedia.org/wiki/Smoluchowski_coagulation_equation An other possible approach would be to apply a variable transformation and work in the logarithmic space, I've experimented some with this, see e.g.: |
Thanks, the 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. At this point, you can probably close this issue. |
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: