You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/api/core_api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,7 +88,7 @@ ReactionSystem
88
88
## [Options for the `@reaction_network` DSL](@id api_dsl_options)
89
89
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
90
90
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.
92
92
-[`species`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system species.
93
93
-[`variables`](@ref dsl_advanced_options_declaring_species_and_parameters): Allows the designation of a set of symbols as system non-species variables.
94
94
-[`ivs`](@ref dsl_advanced_options_ivs): Allows the designation of a set of symbols as system independent variables.
The systems of ODEs or stochastic chemical kinetics models that arise from chemical
@@ -15,8 +12,8 @@ section
15
12
[Network Analysis and Representations](@ref api_network_analysis).
16
13
17
14
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)
20
17
of the network, where the nodes represent the reaction complexes and the edges represent reactions.
21
18
Let us illustrate some of the types of network properties that
22
19
Catalyst can determine.
@@ -75,13 +72,13 @@ and,
75
72
76
73
## [Deficiency of the network](@id network_analysis_structural_aspects_deficiency)
77
74
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
79
76
linkage classes of a *mass action*[RRE ODE system](@ref network_analysis_matrix_vector_representation) to draw conclusions about the
80
77
system's possible steady states. In this section we'll see how Catalyst can
81
78
calculate a network's deficiency.
82
79
83
80
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],
85
82
i.e. the span of the columns of the net stoichiometry matrix `N`. It corresponds
86
83
to the number of independent species in a chemical reaction network. That is, if
87
84
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
275
272
2. The sum of the linkage class deficiencies is the total deficiency of the network, and
276
273
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.
277
274
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.
279
279
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.
282
284
283
285
```@docs; canonical=false
284
286
satisfiesdeficiencyone
285
287
```
286
288
287
289
## [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.
293
305
294
306
Let's check whether the deficiency 0 reaction network that we defined above is complex balanced by providing a set of rates:
295
307
```@example s1
@@ -302,7 +314,12 @@ We can do a similar check for detailed balance.
302
314
isdetailedbalanced(rn, rates)
303
315
```
304
316
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
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
43
43
```math
44
44
\begin{aligned}
45
45
\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
109
109
reaction system like
110
110
```@example s1
111
111
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
114
114
end
115
115
```
116
116
We can think of the first reaction as converting the *reaction complex*,
@@ -257,7 +257,9 @@ isequal(A_k, B * K)
257
257
```
258
258
259
259
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).
261
263
262
264
In sum, we have that
263
265
```math
@@ -286,7 +288,7 @@ fluxmat(rn, parammap)
286
288
laplacianmat(rn, parammap)
287
289
```
288
290
289
-
# Symbolic ODE functions
291
+
##Symbolic ODE functions
290
292
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.
291
293
292
294
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)
327
329
328
330
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.
329
331
330
-
# Properties of matrix null spaces
332
+
##Properties of matrix null spaces
331
333
The null spaces of the matrices discussed in this section often have special meaning. Below we will discuss some of these properties.
332
334
333
335
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``.
336
338
337
339
[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``.
0 commit comments