Non negative values for species in Simbiology

3 次查看(过去 30 天)
During my simulations, I find that I get negative values for species that simply cannot be negative (such as mRNA concentrations). Is there a way to not allow this to occur?
It's slightly troubling as my equation rates should go to zero as the species approaches zero...

采纳的回答

Arthur Goldsipe
Arthur Goldsipe 2013-6-7
Hi Kieran,
I'm just going to paste an answer to a similar question from a MATLAB newsgroup post (with thanks to Pramod for the original answer). You can also find a similar discussion about negative values when solving ODEs in the section titled "Advice on controlling unphysical negative values" of the documentation on the CVODE solver from the SUNDIALS suite.
-----
There is no way to constrain your metabolite/species values to positive only. However, if the concentration of a species is negative within absolute tolerance of zero, it should be interpreted as zero. If the concentration is significantly negative, then the dynamics in your model may not be physical (i.e. the dynamics in the system is driving a particular species to be negative)
I am assuming that you are able to simulate your model without any error and are concerned why some states that should not be negative from the dynamics, show up negative.
To elaborate, SimBiology uses two kinds of tolerances: RelativeTolerance and AbsoluteTolerance. When the solver is integrating the states of the model it ensures that the magnitude of error is below: max (abs(y(i))*RelativeTolerance, AbsoluteTolerance) for each state y(i). In your case it seems that the negative values are within this tolerance and can be interpreted as zero.
You change your tolerances as follows. For example if m1 is your model then:
m1.getconfigset.SolverOptions.RelativeTolerance = 1E-4
m1.getconfigset.SolverOptions.AbsoluteTolerance = 1E-7

更多回答(0 个)

社区

更多回答在  SimBiology Community

类别

Help CenterFile Exchange 中查找有关 Scan Parameter Ranges 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by