Reaction continues even after the concentration is below zero in Simbiology
조회 수: 9 (최근 30일)
이전 댓글 표시
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
채택된 답변
Arthur Goldsipe
2022년 5월 2일
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
추가 답변 (2개)
Achal Mahajan
2022년 5월 2일
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
2022년 5월 2일
If the reaction rate of A is proportional to A (as it should be), you usually don't get problems with negative concentrations.
댓글 수: 0
커뮤니티
더 많은 답변 보기: SimBiology Community
참고 항목
카테고리
Help Center 및 File Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!