Get multiple ODE submodels working concurrently.
see: https://stackoverflow.com/q/34291639
If this can be achieved, remove locking from odes.py. Alternatively, just merge them mathematically.
Tune performance:
a) exchange arrays with LocalSpeciesPopulation
b) Make self.time_step dynamic, with longer time steps when the ODE solver uses larger internal steps and shorter ones when it uses shorter internal steps; tune self.time_step so the number of internal steps per time step approximates a pre-determined optimum.
c) In compute_population_change_rates, calculate each rate law only once.
Possible approach:
i) make a static, sparse stoichiometric matrix Srs of the reactions integrated by ODE submodel
ii) Ar = [r.eval() for r in all_rate_laws]
iii) get rate(species) = sum over species s(Ar * Srs)
Get multiple ODE submodels working concurrently. see: https://stackoverflow.com/q/34291639 If this can be achieved, remove locking from
odes.py
. Alternatively, just merge them mathematically.Tune performance: a) exchange arrays with
LocalSpeciesPopulation
b) Makeself.time_step
dynamic, with longer time steps when the ODE solver uses larger internal steps and shorter ones when it uses shorter internal steps; tuneself.time_step
so the number of internal steps per time step approximates a pre-determined optimum. c) Incompute_population_change_rates
, calculate each rate law only once. Possible approach: i) make a static, sparse stoichiometric matrix Srs of the reactions integrated by ODE submodel ii) Ar = [r.eval() for r in all_rate_laws] iii) get rate(species) = sum over species s(Ar * Srs)Use UniformSequence to schedule event times