Skip to content

Commit 366a96c

Browse files
vyduvyudu
authored andcommitted
added documentation
1 parent 2d36ed2 commit 366a96c

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ uuid = "479239e8-5488-4da2-87a7-35f2df7eef83"
33
version = "13.5.1"
44

55
[deps]
6+
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
67
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
78
DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e"
89
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
@@ -14,10 +15,12 @@ LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1415
Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
1516
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1617
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
18+
MetaGraphs = "626554b9-1ddb-594c-aa3c-2596fe9399a5"
1719
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1820
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
1921
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
2022
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
23+
Revise = "295af30f-e4ad-537b-8983-00126c2a3abe"
2124
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
2225
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
2326
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

src/networkapi.jl

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1653,28 +1653,11 @@ function validate(rs::ReactionSystem, info::String = "")
16531653
validated
16541654
end
16551655

1656-
function iscomplexbalanced(rs::ReactionSystem, conc::Vector)
1657-
sm = speciesmap(rs)
1658-
cm = reactioncomplexmap(rs)
1659-
complexes, incidencemat = reactioncomplexes(rs)
1660-
complexbalanced = true
1661-
1662-
for c in complexes
1663-
if (sum([massactionrate(rs, rxn..., conc) for rxn in cm[c]]) != 0)
1664-
return false
1665-
end
1666-
end
1667-
complexbalanced
1668-
end
1669-
16701656
"""
16711657
complexbalanced(rs::ReactionSystem, rates::Vector)
16721658
16731659
Constructively compute whether a network will have complex-balanced equilibrium
1674-
solutions, following the method in this paper.
1675-
1676-
Notes:
1677-
- Does not check subsystems, constraint equations, or non-species variables.
1660+
solutions, following the method in [this paper](https://link.springer.com/article/10.1007/s10910-015-0498-2#Sec3).
16781661
"""
16791662

16801663
using MetaGraphs, Combinatorics, LinearAlgebra
@@ -1729,6 +1712,11 @@ function complexbalanced(rs::ReactionSystem, rates::Vector)
17291712
end
17301713
end
17311714

1715+
"""
1716+
rateweightedgraph(rs::ReactionSystem, rates::Vector)
1717+
1718+
Generate an annotated reaction complex graph of a reaction system, where the nodes are annotated with the reaction complex they correspond to and the edges are annotated with the reaction they correspond to and the rate of the reaction.
1719+
"""
17321720
function rateweightedgraph(rs::ReactionSystem, rates::Vector)
17331721
if length(rates) != numparams(rs)
17341722
error("The number of reaction rates must be equal to the number of parameters")

0 commit comments

Comments
 (0)