Closed joefresna closed 6 years ago
Please provide an example or description of why this functionality is problematic, and how a problem arises from using substitute()
%%model
$
U -> \alpha : \gamma_1
(G) -> U : p
$
model1 = mmt.parseModel(In[2])
model2 = model1.substitute('p = q')
print(model1._rates)
print(model2._rates)
{gamma_{1}, p}
{gamma_{1}, G, q}
OK, but why is this a problem? Where is _rates
being used that this would cause a problem?
Arguably the constant reactants should function like rates and be shown as such, since they are parameters of the model
it's a problem because:
model1
and model2
are not consistentNot sure this is a huge issue, can tidy up later but; showRates()
functions correctly for both models.
Take a look at existing views for how to handle constant reactant widgets - these should already be handled by the base class, and, I believe, should be ordered as constant reactants first, in alphabetical order, then rates in alphabetical order. Check you're not reinventing the wheel!
Not sure how integer vs float for constant reactants; I think they need to be floats >= 0 ... what do you think @tbose1 ?
constant rate widget is not shown in model1
but only in model2
should this value be considered as a proportion of the system size?
When deriving the ODEs via Master equation and system size expansion they absorb the volume and will be expressed as fractions just as time-dependent reactants (in the book by van Kampen it seems to be the same). If you apply showODEs_vKE() to the Brusselator, for example, then the constant reactant is expressed as concentration. It is still shown as '(constant reactant)' on the slider - this needs to be changed I think.
@joefresna OK that sounds like a problem and not what I expected @tbose1 I don't fully follow what happens / is recommended so suggest we discuss in person
@jarmarshall to fix this, and make constant reactant slider labels have format \Phi_(X)
I don't think that constant reactant should be added to the
MuMoTmodel._rates
list. Although, in case this is necessary, it should be consistent before and after asubstitute()
Shouldn't constant reactants be treated in the same way of other reactants?