CurrentModule = DiffEqBiological
Reaction Network Generation Macros
DiffEqBiological has three macros for generating reaction networks.
@reaction_network generates a complete network, including everything needed to
construct ODE, SDE and Jump problems directly from the network. For small
systems it is the recommended form to use.
@min_reaction_network constructs a network that just stores the basic
information needed to represent the species, parameters and chemical reactions.
This is sufficient for network analysis, such as calculating dependency graphs,
but means the network must be extended to build mathematical models, see
@empty_reaction_network constructs an empty network. Both
empty_reaction_networks can be enlarged using
addreaction!. Once the
final chemistry for the network is set,
addjumps! can be called to build corresponding mathematical
It is important to note for
species which are used within the macro as part of a rate expression, but not
as a substrate or product of some reaction, are not recognized as either a
species or parameter. i.e. avoid
rn = @reaction_network begin k*X, Y --> W end k
X is never defined as either a species or parameter. This leads to
internal problems in the representation of reactions that can not be corrected
by subsequently calling
@reaction_network @min_reaction_network @empty_reaction_network
species speciesmap params paramsmap numspecies numparams numreactions
substrates products dependents dependants ismassaction substratestoich productstoich netstoich
Functions to Add Species, Parameters and Reactions to a Network
@empty_reaction_network can be extended
with additional species, parameters, and reactions.
Note, always add all species and parameter definitions before adding any reaction definitions. Other orderings may result in incorrect information stored within the generated network.
addspecies! addparam! addreaction! add_scale_noise_param!
Functions to Add ODEs, SDEs or Jumps to a Network
addodes! addsdes! addjumps!
Generated Functions for Models
oderhsfun jacfun paramjacfun odefun noisefun sdefun jumps regularjumps
odeexprs jacobianexprs noiseexprs jumpexprs rateexpr oderatelawexpr ssaratelawexpr
rxtospecies_depgraph speciestorx_depgraph rxtorx_depgraph