Non negative values for species in Simbiology

16 views (last 30 days)
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...

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 7 Jun 2013
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

More Answers (0)

Communities

More Answers in the  SimBiology Community

Categories

Find more on Scan Parameter Ranges in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!