LoLab-MSM / pysb

Python framework for Systems Biology modeling [Lopez Lab Mods]
BSD 2-Clause "Simplified" License
6 stars 8 forks source link

Update pysb.integrate.Solver to select odeint if intergrator='lsoda' #13

Closed JamesPino closed 9 years ago

JamesPino commented 9 years ago

Currently we use scipy. integrate.ode , which is a generic wrapper allowing multiple solvers (vode, zvode, lsoda, dopri5, dop853). It solves the ODEs using while self.integrator.successful() and self.integrator.t < self.tspan[-1]: self.y[i] = self.integrator.integrate(self.tspan[i]) # integration i += 1 There is some overhead in this that can be prevented between calling the fortran code and python. For lsoda, scipy has an lsoda specific solver. (http://docs.scipy.org/doc/scipy-0.15.1/reference/generated/scipy.integrate.odeint.html ). Using this method saves between 10~20%. I wrote a class to use this. However, if we choose another solver then we cannot use it. Basically I just need to merge them together and check. If integrator == 'lsoda': use this type.

We may want to just use the new simulator class?

JamesPino commented 9 years ago

Should we close this, or were we still going to look into a cleaner solution. I think Jeremy had an idea about using an inline lambda function which would clean up the two extra wrap functions.

alubbock commented 9 years ago

Rewritten using lambda functions in ee20151. Closing the issue.