Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
116 lines (103 sloc) 2.8 KB

DiffEqBiological.jl API

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 addodes!, addsdes!, and addjumps!.

@empty_reaction_network constructs an empty network. Both min_reaction_networks and empty_reaction_networks can be enlarged using addspecies!, addparam!, and addreaction!. Once the final chemistry for the network is set, addodes!, addsdes!, and addjumps! can be called to build corresponding mathematical models.

It is important to note for @reaction_network and @min_reaction_network that 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

as here 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 addspecies!.

@reaction_network
@min_reaction_network
@empty_reaction_network

Basic properties

species
speciesmap
params
paramsmap 
numspecies 
numparams
numreactions

Reaction Properties

substrates
products
dependents
dependants
ismassaction
substratestoich
productstoich
netstoich

Functions to Add Species, Parameters and Reactions to a Network

Both @min_reaction_network and @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

Generated Expressions

odeexprs
jacobianexprs
noiseexprs
jumpexprs
rateexpr
oderatelawexpr
ssaratelawexpr

Dependency Graphs

rxtospecies_depgraph
speciestorx_depgraph
rxtorx_depgraph
You can’t perform that action at this time.