Skip to content

Commit 6970d7d

Browse files
committed
add some suggestions
1 parent 32cb860 commit 6970d7d

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed

docs/src/api/core_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ ReactionSystem
8888
## [Options for the `@reaction_network` DSL](@id api_dsl_options)
8989
We have [previously described](@ref dsl_advanced_options) how options permits the user to supply non-reaction information to [`ReactionSystem`](@ref) created through the DSL. Here follows a list
9090
of all options currently available.
91-
- [`parameters`]:(@ref dsl_advanced_options_declaring_species_and_parameters) Allows the designation of a set of symbols as system parameter.
91+
- [`parameters`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system parameters.
9292
- [`species`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system species.
9393
- [`variables`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system non-species variables.
9494
- [`ivs`](@ref dsl_advanced_options_ivs): Allows the designation of a set of symbols as system independent variables.

docs/src/network_analysis/crn_theory.md

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
> Note, currently API functions for network analysis and conservation law analysis
2-
> do not work with constant species (currently only generated by SBMLToolkit).
3-
41
# [Chemical Reaction Network Theory](@id network_analysis_structural_aspects)
52

63
The systems of ODEs or stochastic chemical kinetics models that arise from chemical
@@ -15,8 +12,8 @@ section
1512
[Network Analysis and Representations](@ref api_network_analysis).
1613

1714
Broadly, results from chemical reaction network theory relate a purely
18-
graph-structural property (e.g. deficiency) to dynamical properties of the reaction system
19-
(e.g. complex balance). The relevant graph here is the one corresponding to the [reaction complex representation](@ref network_analysis_reaction_complexes)
15+
graph-structural property (e.g. [deficiency](@ref network_analysis_structural_aspects_deficiency)) to dynamical properties of the reaction system
16+
(e.g. [complex balance](@ref network_analysis_complex_and_detailed_balance)). The relevant graph here is the one corresponding to the [reaction complex representation](@ref network_analysis_reaction_complexes)
2017
of the network, where the nodes represent the reaction complexes and the edges represent reactions.
2118
Let us illustrate some of the types of network properties that
2219
Catalyst can determine.
@@ -75,13 +72,13 @@ and,
7572

7673
## [Deficiency of the network](@id network_analysis_structural_aspects_deficiency)
7774
A famous theorem in Chemical Reaction Network Theory, the Deficiency Zero
78-
Theorem [^1], allows us to use knowledge of the net stoichiometry matrix and the
75+
Theorem[^1], allows us to use knowledge of the net stoichiometry matrix and the
7976
linkage classes of a *mass action* [RRE ODE system](@ref network_analysis_matrix_vector_representation) to draw conclusions about the
8077
system's possible steady states. In this section we'll see how Catalyst can
8178
calculate a network's deficiency.
8279

8380
The rank, ``r``, of a reaction network is defined as the dimension of the
84-
subspace spanned by the net stoichiometry vectors of the reaction-network [^1],
81+
subspace spanned by the net stoichiometry vectors of the reaction-network[^1],
8582
i.e. the span of the columns of the net stoichiometry matrix `N`. It corresponds
8683
to the number of independent species in a chemical reaction network. That is, if
8784
we calculate the linear conservation laws of a network, and use them to
@@ -275,21 +272,36 @@ Very analogous to the deficiency zero theorem is the deficiency one theorem. The
275272
2. The sum of the linkage class deficiencies is the total deficiency of the network, and
276273
3. Each linkage class has at most one terminal linkage class, which is a linkage class that is 1) strongly connected, and 2) has no outgoing reactions.
277274

278-
For the set of reactions $A \to B, B \to A, B \to C$, $\{A, B, C\}$ is a linkage class, and $\{A, B\}$ is a strong linkage class (since A is reachable from B and vice versa). However, $\{A, B\}$ is not a terminal linkage class, because the reaction $B \to C$ goes to a complex outside the linkage class.
275+
For the set of reactions $A \to B, B \to A, B \to C$, $\{A, B, C\}$ is a linkage class,
276+
and $\{A, B\}$ is a strong linkage class (since A is reachable from B and vice versa).
277+
However, $\{A, B\}$ is not a terminal linkage class, because the reaction $B \to C$ goes
278+
to a complex outside the linkage class.
279279

280-
If these conditions are met, then the network will have at most one steady state in each stoichiometric compatibility class for any choice of rate constants and parameters.
281-
Unlike the deficiency zero theorem, networks obeying the deficiency one theorem are not guaranteed to have stable solutions.
280+
If these conditions are met, then the network will have at most one steady state in each
281+
stoichiometric compatibility class for any choice of rate constants and parameters. Unlike
282+
the deficiency zero theorem, networks obeying the deficiency one theorem are not guaranteed
283+
to have stable solutions.
282284

283285
```@docs; canonical=false
284286
satisfiesdeficiencyone
285287
```
286288

287289
## [Complex and Detailed Balance](@id network_analysis_complex_and_detailed_balance)
288-
A reaction network's steady state is **complex-balanced** if the total production of each *complex* is zero at the steady state. A reaction network's steady state is **detailed balanced** if every reaction is balanced by its reverse reaction at the steady-state (this corresponds to the usual notion of chemical equilibrium; note that this requires every reaction be reversible).
289-
290-
Note that detailed balance at a given steady state implies complex balance for that steady state, i.e. detailed balance is a stronger property than complex balance.
291-
292-
Remarkably, having just one positive steady state that is complex (detailed) balance implies that complex (detailed) balance obtains at *every* positive steady state, so we say that a network is complex (detailed) balanced if any one of its steady states are complex (detailed) balanced. Additionally, there will be exactly one steady state in every positive stoichiometric compatibility class, and this steady state is asymptotically stable. (For proofs of these results, please consult Martin Feinberg's *Foundations of Chemical Reaction Network Theory*[^1]). So knowing that a network is complex balanced is really quite powerful.
290+
A reaction network's steady state is **complex-balanced** if the total production of each
291+
*complex* is zero at the steady state. A reaction network's steady state is **detailed balanced**
292+
if every reaction is balanced by its reverse reaction at the steady-state (this corresponds to
293+
the usual notion of chemical equilibrium; note that this requires every reaction be reversible).
294+
295+
Note that detailed balance at a given steady state implies complex balance for that steady state,
296+
i.e. detailed balance is a stronger property than complex balance.
297+
298+
Remarkably, having just one positive steady state that is complex (detailed) balance implies that
299+
complex (detailed) balance obtains at *every* positive steady state, so we say that a network
300+
is complex (detailed) balanced if any one of its steady states are complex (detailed) balanced.
301+
Additionally, there will be exactly one steady state in every positive stoichiometric
302+
compatibility class, and this steady state is asymptotically stable. (For proofs of these results,
303+
please consult Martin Feinberg's *Foundations of Chemical Reaction Network Theory*[^1]). So
304+
knowing that a network is complex balanced is really quite powerful.
293305

294306
Let's check whether the deficiency 0 reaction network that we defined above is complex balanced by providing a set of rates:
295307
```@example s1
@@ -302,7 +314,12 @@ We can do a similar check for detailed balance.
302314
isdetailedbalanced(rn, rates)
303315
```
304316

305-
The reason that the deficiency zero theorem puts such strong restrictions on the steady state properties of the reaction network is because it implies that the reaction network will be complex balanced for any set of rate constants and parameters. The fact that this holds from a purely structural property of the graph, regardless of kinetics, is what makes it so useful. But in some cases it might be desirable to check complex balance on its own, as for higher deficiency networks.
317+
The reason that the deficiency zero theorem puts such strong restrictions on the steady state
318+
properties of the reaction network is because it implies that the reaction network will be
319+
complex balanced for any set of rate constants and parameters. The fact that this holds
320+
from a purely structural property of the graph, regardless of kinetics, is what makes it so
321+
useful. But in some cases it might be desirable to check complex balance on its own, as for
322+
higher deficiency networks.
306323

307324
```@docs; canonical=false
308325
iscomplexbalanced

docs/src/network_analysis/odes.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ g = Graph(repressilator)
3939
![Repressilator solution](../assets/repressilator.svg)
4040

4141
We also showed in the [Introduction to Catalyst](@ref introduction_to_catalyst) tutorial that
42-
the reaction rate equation ODE model for the repressilator is
42+
the reaction rate equation (RRE) ODE model for the repressilator is
4343
```math
4444
\begin{aligned}
4545
\frac{dm_1(t)}{dt} =& \frac{\alpha K^{n}}{K^{n} + \left( {P_3}\left( t \right) \right)^{n}} - \delta {m_1}\left( t \right) + \gamma \\
@@ -109,8 +109,8 @@ facilitate analysis of a variety of reaction network properties. Consider a simp
109109
reaction system like
110110
```@example s1
111111
rn = @reaction_network begin
112-
k, 2*A + 3*B --> A + 2*C + D
113-
b, C + D --> 2*A + 3*B
112+
k, 2A + 3B --> A + 2C + D
113+
b, C + D --> 2A + 3B
114114
end
115115
```
116116
We can think of the first reaction as converting the *reaction complex*,
@@ -257,7 +257,9 @@ isequal(A_k, B * K)
257257
```
258258

259259
Note that we have used `isequal` instead of `==` here because `laplacianmat`
260-
returns a `Matrix{Num}`, since some of its entries are symbolic rate constants.
260+
returns a `Matrix{Num}`, since some of its entries are symbolic rate constants
261+
(symbolic variables and `Num`s cannot be compared using `==`, since `a == b`
262+
is interpreted as a symbolic expression).
261263

262264
In sum, we have that
263265
```math
@@ -286,7 +288,7 @@ fluxmat(rn, parammap)
286288
laplacianmat(rn, parammap)
287289
```
288290

289-
# Symbolic ODE functions
291+
## Symbolic ODE functions
290292
In some cases it might be useful to generate the function defining the system of ODEs as a symbolic Julia function that can be used for further analysis. This can be done using Symbolics' [`build_function`](https://docs.sciml.ai/Symbolics/stable/getting_started/#Building-Functions), which takes a symbolic expression and a set of desired arguments, and converts it into a Julia function taking those arguments.
291293

292294
Let's build the full symbolic function corresponding to our ODE system. `build_function` will return two expressions, one for a function that outputs a new vector for the result, and one for a function that modifies the input in-place. Either expression can then be evaluated to return a Julia function.
@@ -327,7 +329,7 @@ f(c, ks)
327329

328330
Note also that `f` can take any vector with the right dimension (i.e. the number of species), not just a vector of `Number`, so it can be used to build, e.g. a vector of polynomials in Nemo for commutative algebraic methods.
329331

330-
# Properties of matrix null spaces
332+
## Properties of matrix null spaces
331333
The null spaces of the matrices discussed in this section often have special meaning. Below we will discuss some of these properties.
332334

333335
Recall that we may write the net stoichiometry matrix ``N = YB``.
@@ -336,7 +338,7 @@ Recall that we may write the net stoichiometry matrix ``N = YB``.
336338

337339
[Complex balance](@ref network_analysis_complex_and_detailed_balance) can be compactly formulated as the following: a set of steady state reaction fluxes is complex-balanced if it is in the nullspace of the incidence matrix ``B``.
338340

339-
# API Section for matrices and vectors
341+
## API Section for matrices and vectors
340342
We have that:
341343
- ``N`` is the `netstoichmat`
342344
- ``Z`` is the `complexstoichmat`

0 commit comments

Comments
 (0)