Skip to content

Commit 4164400

Browse files
committed
up
1 parent 245b12d commit 4164400

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/network_analysis.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ conservation laws, each represented as a row in the output.
692692
function conservationlaws(nsm::T; col_order = nothing) where {T <: AbstractMatrix}
693693

694694
# compute the left nullspace over the integers
695+
# The `nullspace` function updates the `col_order`.
695696
N = MT.nullspace(nsm'; col_order)
696697

697698
# if all coefficients for a conservation law are negative, make positive

src/reactionsystem.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,28 @@ Base.Sort.defalg(::ReactionComplex) = Base.DEFAULT_UNSTABLE
8181
Base.@kwdef mutable struct NetworkProperties{I <: Integer, V <: BasicSymbolic{Real}}
8282
"""Flag which is switched to `true` once any field is updated."""
8383
isempty::Bool = true
84+
"""
85+
The reaction network's net stoichiometry matrix. It is a MxN matrix where M is its number of
86+
species and N its number of reaction. Element i,j is net stoichiometric change to the i'th
87+
species as a result of the j'th reaction.
88+
"""
8489
netstoichmat::Union{Matrix{Int}, SparseMatrixCSC{Int, Int}} = Matrix{Int}(undef, 0, 0)
90+
"""
91+
The reaction network's conservation law matrix. It is a MxN matrix where M is its number of
92+
conservation laws and N its number of species. Element i,j is the coefficient of species
93+
j in the i'th conservation law.
94+
"""
8595
conservationmat::Matrix{I} = Matrix{I}(undef, 0, 0)
8696
col_order::Vector{Int} = Int[]
8797
"""
8898
The reaction networks *rank* (i.e. the span of the columns of its net stoichiometry matrix,
8999
or its number of independent species).
90100
"""
91101
rank::Int = 0
102+
"""
103+
The reaction network's *nullity* is its number of species - its rank. This is equal to its
104+
number of conservation laws.
105+
"""
92106
nullity::Int = 0
93107
"""
94108
The set of *independent species* of the reaction system (i.e. species that will not be
@@ -112,6 +126,9 @@ Base.@kwdef mutable struct NetworkProperties{I <: Integer, V <: BasicSymbolic{Re
112126
system (`X1 <--> X2`) there is one conserved quantity with the equation `Γ[1] ~ X1 + X2`.
113127
"""
114128
constantdefs::Vector{Equation} = Equation[]
129+
"""
130+
A map from each species (as a symbolic variable) to its index in the species vector.
131+
"""
115132
speciesmap::Dict{V, Int} = Dict{V, Int}()
116133
"""
117134
A dictionary from each reaction complex to the reactions they participate it. The value

0 commit comments

Comments
 (0)