Reaction continues even after the concentration is below zero in Simbiology
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I am trying to simulate a simple reaction model in Simbiology but met a problem that the system would let concentration reach negative.
As reagent (A) is consumed in the reaction, its concentration would decrease with time, however with enough time, Simbiology would let this concentration go negative. Is there a way that reaction could be stopped after all reagent is used up? In anothoer word, once A=0 the reaction won't go beyond from that point as time continues (all the reagent and product will reach balance and not change any more).
The idea is similar to add an "if (A<=0) A=0" judgement but I do not know how to do it in simbiology. I tried to add "A=max(A,0)" in repeated assignment but it won't work. Thinking about event trigger too but it seems Event could only work at the first time of triggering.
Thank you in advance
0 Commenti
Risposta accettata
Arthur Goldsipe
il 2 Mag 2022
I answered a similar question here. As I mention there, there's currently no way to completely prevent negative numbers in all cases. But it's generally safe to ignore small negative values small (relative to your specified solver tolerances). If the magnitude of the negative numbers is large, it could indicate a modeling error and/or a problem with solver tolerances. If you see such negative numbers, you should try to understand what is causing them and make an appropriate change to your model. If there is some sort of feedback that causes negative numbers to get mangified, you may need to modify the expression for the reaction rate. For example, if X is a species that is negative, you might want to replace occurences of X in rate expression with max(0,X). I would recommend this over trying to use an event or repeated assignment rule.
3 Commenti
Più risposte (2)
Achal Mahajan
il 2 Mag 2022
Hi,
This post might be useful https://www.mathworks.com/matlabcentral/answers/78266-non-negative-values-for-species-in-simbiology. The same problem has been discussed in detail. Feel free to reach out again if it does not work for you!
Torsten
il 2 Mag 2022
If the reaction rate of A is proportional to A (as it should be), you usually don't get problems with negative concentrations.
0 Commenti
Community
Più risposte nel SimBiology Community
Vedere anche
Categorie
Scopri di più su Extend Modeling Environment in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!