Using Chemostats.jl with DifferentialEquations.jl

The class DECell provides a convenient way to use models defined using DifferentialEquations.jl. This is includes models defined using the wider SciML ecosystem, e.g. using ModelingToolkit.jl and Catalyst.jl.

The DECell interface

To use this functionality we require:

  • An AbstractDEProblem describing how the cells behave
  • A DivideCallback provided to the AbstractDEProblem (to be implemented!)
  • A divide function

Chemostats.jl supports AbstractDEProblems with arbitrary parameters p and state vectors u. This problem should include a DivideCallback to determine when a cell has reached the end of its life, either due to division or death.

When a cell reaches the end of its life, the divide function is called to determine the parameters and initial state vectors of the daughter cells. This function takes a single argument int, the integrator of the cell. It should an array of daughter cells, or nothing if there are no offspring. Each daughter cell is determined by a NamedTuple with fields p containing the parameters and u0 containing the initial state of the daughter cell defined by the AbstractDEProblem.

Chemostats.DECellType
DECell([anc = missing, ]prob, divide; reset_t=false)

Creates a new cell around a SciMLBase.DEProblem. The function divide takes a single integrator argument int and returns a list of offspring as a vector of NamedTuples with fields u0 and p. The argument reset_t determines whether the integration time is started from 0 for every cell, which can avoid floating-point errors for long simulations (many generations). If reset_t is set to true, each cell should keep track of its starting time, e.g. via a parameter t0 in p.

Note: The problem should include a callback that calls terminate! when a cell reaches the end of its life.

source
Chemostats.DivideCallbackFunction
DivideCallback(condition; kwargs...)

Implements a differential equation callback to check whether a cell has reached the end of its lifetime. Internally, this returns a ContinuousCallback that calls terminate!.

source