@@ -1706,11 +1706,20 @@ def _get_solutions(self):
17061706 self ._solutions = solve (iter (self ._equations .values ()), self ._reactants , force = False , positive = False , set = False )
17071707 return self ._solutions
17081708
1709+ def _get_rates_from_stoichiometry (self ):
1710+ rates = set ()
1711+ for reaction in self ._stoichiometry .values ():
1712+ if reaction ['rate' ]:
1713+ for symb in reaction ['rate' ].atoms ():
1714+ if isinstance (symb , Symbol ):
1715+ rates .add ( symb )
1716+ return rates
1717+
17091718 def _create_free_param_dictionary_for_controller (self , inputParams , initWidgets = None , showSystemSize = False , showPlotLimits = False ):
17101719 initWidgetsSympy = {parse_latex (paramName ): paramValue for paramName , paramValue in initWidgets .items ()} if initWidgets is not None else {}
17111720
17121721 paramValuesDict = {}
1713- for freeParam in self ._rates .union (self ._constantReactants ):
1722+ for freeParam in self ._get_rates_from_stoichiometry () .union (self ._constantReactants ):
17141723 paramValuesDict [str (freeParam )] = utils ._parse_input_keyword_for_numeric_widgets (
17151724 inputValue = utils ._get_item_from_params_list (inputParams , str (freeParam )),
17161725 defaultValueRangeStep = [defaults .MuMoTdefault ._initialRateValue , defaults .MuMoTdefault ._rateLimits [0 ], defaults .MuMoTdefault ._rateLimits [1 ], defaults .MuMoTdefault ._rateStep ],
@@ -1837,7 +1846,7 @@ def _getFuncs(self):
18371846 argList .append (reactant )
18381847 for reactant in self ._constantReactants :
18391848 argList .append (reactant )
1840- for rate in self ._rates :
1849+ for rate in self ._get_rates_from_stoichiometry () :
18411850 argList .append (rate )
18421851 if self ._systemSize is not None :
18431852 argList .append (self ._systemSize )
0 commit comments