@reaction_network macro generates a
ReactionSystem object, which has a number of fields that can be accessed directly or via the Catalyst.jl API (the recommended route). Below we list these components, with the recommended API method listed first:
rn.statesis a vector of all the chemical species within the system, each represented as a
rn.psis a vector of all the parameters within the system, each represented as a
rn.eqsis a vector of all the
Reactions within the system.
rn.ivare the independent variable of the system , usually
tfor time, represented as a
reactions(rn) has a number of subfields. For
Reaction we have
rx.substrates, a vector of
ModelingToolkit.Operations storing each substrate variable.
rx.products, a vector of
ModelingToolkit.Operations storing each product variable.
rx.substoich, a vector storing the corresponding integer stoichiometry of each substrate species in
rx.prodstoich, a vector storing the corresponding integer stoichiometry of each product species in
ModelingToolkit.Operationrepresenting the reaction rate. e.g. for a reaction like
k*X, Y --> X+Ywe'd have
rate = k*X.
rx.netstoich, a vector of pairs mapping the
ModelingToolkit.Variablefor each species that changes numbers by the reaction to how much it changes. E.g. for
k, X + 2Y --> X + Wwe'd have
rx.netstoich = [Y => -2, W => 1].
rx.only_use_rate, a boolean that is
trueif the reaction was made with non-filled arrows and should ignore mass action kinetics.
ReactionSystems can be generated via
@reaction_network with no arguments.
ReactionSystems can be programmatically extended using
@add_reactions, or composed using