segrelab / comets

Computation of Microbial Ecosystems in Time and Space
MIT License
19 stars 10 forks source link

Varying dilution rate #43

Open bigsuicideparty opened 2 years ago

bigsuicideparty commented 2 years ago

I would like to set up a chemostat-like simulation where the dilution rate increases over time. How would i best implement this in comets? Thanks!

jeremymchacon commented 2 years ago

That's an interesting problem. Are you thinking a continuous change in rate, or step changes at specified times?

Right now there isn't a way to temporally vary the rate. It would be reasonably straightforward to chain simulations and alter the rate between them, although if this was to be done at every time step, it would be slow and I would put in a feature request, which I would get to in the next couple of months. If it is in steps, I can write a sample script which describes how to do it.

bigsuicideparty commented 2 years ago

Thanks for the response. I would appreciate a help with a step-wise increase. Ideally, though the feed rate would increase exponentially over time.

jeremymchacon commented 2 years ago

Sorry for the delay, had some other priorities. Here is a python notebook demonstrating a basic step-wise increase. Hope this works as a jumping point! Let me know if you have more questions. Sorry for the zip file, gitter won't let me upload ipynb directly for some reason.

chemostat with time varied dilution.zip .