Creates solvers for the Chemical Master Equation (CME).
Returns a solver for the Chemical Master Equation of the given model.
arguments:
model : the CME model to solve
- sink : If sink is True, the solver will include a ‘sink’ state used
- to accumulate any probability that may flow outside the domain. This can be used to measure the error in the solution due to truncation of the domain. If sink is False, the solver will not include a ‘sink’ state, and probability will be artificially prevented from flowing outside of the domain.
- p_0 : (optional) mapping from states in the domain to probabilities,
- for the initial probability distribution. If not specified, and the initial state of the state space is given by the model, defaults to all probability concentrated at the initial state, otherwise, a ValueError will be raised.
t_0 : (optional) initial time, defaults to 0.0
- sink_0 : (optional) initial sink probability, defaults to 0.0
- Only a valid argument if sink is set to True.
- time_dependencies : (optional) By default, reaction propensities are
time independent. If specified, time_dependencies must be of the form { s_1 : phi_1, ..., s_n : phi_n }, where each (s_j, phi_j) item satisifes :
s_j : set of reaction indices phi_j : phi_j(t) -> time dependent coefficientThe propensities of the reactions with indicies contained in s_j will all be multiplied by the coefficient phi_j(t), at time t. Reactions are indexed according to the ordering of the propensities in the model.
The reaction index sets s_j must be disjoint. It is not necessary for the union of the s_j to include all the reaction indices. If a reaction’s index is not contained in any s_j then the reaction is treated as time-independent.
- mapping of time dependent coefficient
- functions keyed by subsets of reaction indices, with respect to the ordering of reactions determined by the order of the propensity functions inside the model. The propensities of the reactions with indices included in each subset are multiplied by the time dependent coefficient function. By default, no time dependent coefficient functions are specified, that is, the CME has time-independent propensities.
- domain_states : (optional) array of states in the domain.
- By default, generate the rectangular lattice of states defined by the ‘shape’ entry of the model. A ValueError is raised if both domain_states and ‘shape’ are unspecified.
create_packing_functions(domain_enum) -> (pack, unpack)
where
pack((p, p_sink)) -> y unpack(y) -> (p, p_sink)