Reaction continues even after the concentration is below zero in Simbiology
5 views (last 30 days)
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
Arthur Goldsipe on 2 May 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.
More Answers (2)
Achal Mahajan on 2 May 2022
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!
More Answers in the SimBiology Community