From: Syed on
Hi,
When I ran my model simulation in simbiology, some of the concentration of the species/metabolites become negative which is theoretically not possible. I would like to put constraint on the metabolites so that they cannot take any negative value. How would I do that in Simbiology?
Thank You
From: Pramod on
Hi Syed,
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

- Pramod

"Syed " <baker(a)ipk-gatersleben.de> wrote in message <hn2ljl$p1p$1(a)fred.mathworks.com>...
> Hi,
> When I ran my model simulation in simbiology, some of the concentration of the species/metabolites become negative which is theoretically not possible. I would like to put constraint on the metabolites so that they cannot take any negative value. How would I do that in Simbiology?
> Thank You