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
@@ -86,7 +86,7 @@ ReactionSystem
86
86
```
87
87
88
88
## [Options for the `@reaction_network` DSL](@id api_dsl_options)
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
89
+
We have [previously described](@ref dsl_advanced_options) how options permit 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
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.
Copy file name to clipboardExpand all lines: docs/src/network_analysis/crn_theory.md
+32-6Lines changed: 32 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -262,8 +262,11 @@ which we see is mass action and has deficiency zero, but is not weakly
262
262
reversible. As such, we can conclude that for any choice of rate constants the
263
263
RRE ODEs cannot have a positive equilibrium solution.
264
264
265
-
```@docs; canonical=false
266
-
satisfiesdeficiencyzero
265
+
There is an API function [`satisfiesdeficiencyzero`](@ref) that will let us check
266
+
all these conditions easily:
267
+
268
+
```@example s1
269
+
satisfiesdeficiencyzero(def0_rn)
267
270
```
268
271
269
272
## Deficiency One Theorem
@@ -282,8 +285,31 @@ stoichiometric compatibility class for any choice of rate constants and paramete
282
285
the deficiency zero theorem, networks obeying the deficiency one theorem are not guaranteed
283
286
to have stable solutions.
284
287
285
-
```@docs; canonical=false
286
-
satisfiesdeficiencyone
288
+
Let's look at an example network.
289
+
290
+
```@example s1
291
+
def1_network = @reaction_network begin
292
+
(k1, k2), A <--> 2B
293
+
k3, C --> 2D
294
+
k4, 2D --> C + E
295
+
(k5, k6), C + E <--> E + 2D
296
+
end
297
+
plot_complexes(def1_network)
298
+
```
299
+
300
+
We can see from the complex graph that there are two linkage classes, the deficiency of the bottom one is zero and the deficiency of the top one is one.
301
+
The total deficiency is one:
302
+
303
+
```@example s1
304
+
deficiency(def1_network)
305
+
```
306
+
307
+
And there is only one terminal linkage class in each, so our network satisfies all three conditions.
308
+
As in the deficiency zero case, there is the API function [`satisfiesdeficiencyone`](@ref)
309
+
for quickly checking these conditions:
310
+
311
+
```@example s1
312
+
satisfiesdeficiencyone(def1_network)
287
313
```
288
314
289
315
## [Complex and Detailed Balance](@id network_analysis_complex_and_detailed_balance)
@@ -296,7 +322,7 @@ Note that detailed balance at a given steady state implies complex balance for t
296
322
i.e. detailed balance is a stronger property than complex balance.
297
323
298
324
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
325
+
complex (detailed) balance holds for*every* positive steady state, so we say that a network
300
326
is complex (detailed) balanced if any one of its steady states are complex (detailed) balanced.
301
327
Additionally, there will be exactly one steady state in every positive stoichiometric
302
328
compatibility class, and this steady state is asymptotically stable. (For proofs of these results,
We also showed in the [Introduction to Catalyst](@ref introduction_to_catalyst) tutorial that
43
43
the reaction rate equation (RRE) ODE model for the repressilator is
@@ -197,7 +197,7 @@ plot_complexes(rn)
197
197
```
198
198
199
199
while for the repressilator we find
200
-
```julia
200
+
```@example s1
201
201
plot_complexes(repressilator)
202
202
```
203
203
@@ -211,15 +211,15 @@ So far we have covered two equivalent descriptions of the chemical reaction netw
211
211
```math
212
212
\begin{align}
213
213
\frac{d\mathbf{x}}{dt} &= N \mathbf{v}(\mathbf{x}(t),t) \\
214
-
&= Z B \mathbf{v}(\mathbf{x}(t),t)
214
+
&= Z B \mathbf{v}(\mathbf{x}(t),t).
215
215
\end{align}
216
216
```
217
217
218
-
In this section we discuss a further decomposition of the ODEs. Recall that the reaction rate vector $\mathbf{v}$, which is a vector of length $R$ whose elements are the rate expressions for each reaction. Its elements can be written as
218
+
In this section we discuss a further decomposition of the ODEs. Recall the reaction rate vector $\mathbf{v}$, which is a vector of length $R$ whose elements are the rate expressions for each reaction. Its elements can be written as
where $\mathbf{x}^y = \prod_s x_s^{y_s}$, the mass-action product of the complex $y$, where $y$ is the substrate complex of the reaction $y \rightarrow y'$. We can define a new vector called the mass action vector $\Phi(\mathbf{x}(t))$, a vector of length $C$ whose elements are the mass action products of each complex:
222
+
where $\mathbf{x}^y = \prod_s x_s^{y_s}$ denotes the mass-action product of the substrate complex $y$ from the $y \rightarrow y'$ reaction. We can define a new vector called the mass action vector $\Phi(\mathbf{x}(t))$, a vector of length $C$ whose elements are the mass action products of each complex:
223
223
```@example s1
224
224
Φ = massactionvector(rn)
225
225
```
@@ -262,24 +262,24 @@ returns a `Matrix{Num}`, since some of its entries are symbolic rate constants
262
262
(symbolic variables and `Num`s cannot be compared using `==`, since `a == b`
263
263
is interpreted as a symbolic expression).
264
264
265
-
In sum, we have that
265
+
In summary, we have that
266
266
```math
267
267
\begin{align}
268
268
\frac{d\mathbf{x}}{dt} &= N \mathbf{v}(\mathbf{x}(t),t) \\
269
269
&= N K \Phi(\mathbf{x}(t),t) \\
270
-
&= Z B K \Phi(\mathbf{x}(t),t).
270
+
&= Z B K \Phi(\mathbf{x}(t),t) \\
271
271
&= Z A_k \Phi(\mathbf{x}(t),t).
272
272
\end{align}
273
273
```
274
274
275
-
All three of the objects introduced in this section (the flux matrix, mass-action vector, Laplacian matrix) will return symbolic outputs by default, but can be made to return numerical outputs if values are specified.
275
+
All three of the objects introduced in this section (the flux matrix, mass-action vector, and Laplacian matrix) will return symbolic outputs by default, but can be made to return numerical outputs if values are specified.
276
276
For example, `massactionvector` will return a numerical output if a set of species concentrations is supplied using a dictionary, tuple, or vector of Symbol-value pairs.
`fluxmat` and `laplacianmat` will return numeric matrices if a set of rate constants and other aprameters are supplied the same way.
282
+
`fluxmat` and `laplacianmat` will return numeric matrices if a set of rate constants and other parameters are supplied the same way.
283
283
```@example s1
284
284
parammap = Dict([:k => 12., :b => 8.])
285
285
fluxmat(rn, parammap)
@@ -303,7 +303,7 @@ f = eval(f_oop_expr)
303
303
c = [3., 5., 2., 6.]
304
304
f(c)
305
305
```
306
-
The generated `f` now corresponds to the $f(\mathbf{x}(t))$ on the right-hand side of $\frac{d\mathbf{x}(t)}{dt} = f(\mathbf{x}(t))$. Given a vector of species concentrations $c$, `ode_func` will return the rate of change of each species. Steady state concentration vectors `c_ss` will satisfy `f(c_ss) = zeros(length(species(rn)))`.
306
+
The generated `f` now corresponds to the $f(\mathbf{x}(t))$ on the right-hand side of $\frac{d\mathbf{x}(t)}{dt} = f(\mathbf{x}(t))$. Given a vector of species concentrations $c$, `f` will return the rate of change of each species. Steady state concentration vectors `c_ss` will satisfy `f(c_ss) = zeros(length(species(rn)))`.
307
307
308
308
Above we have generated a numeric rate matrix to substitute the rate constants into the symbolic expressions. We could have used a symbolic rate matrix, but then we would need to define the parameters `k, b`, so that the function `f` knows what `k` and `b` in its output refer to.
309
309
```@example s1
@@ -333,7 +333,7 @@ Note also that `f` can take any vector with the right dimension (i.e. the number
333
333
## Properties of matrix null spaces
334
334
The null spaces of the matrices discussed in this section often have special meaning. Below we will discuss some of these properties.
335
335
336
-
Recall that we may write the net stoichiometry matrix ``N = YB``.
336
+
Recall that we may write the net stoichiometry matrix ``N = ZB``, where `Z` is the complex stoichiometry matrix and `B` is the incidence matrix of the graph.
337
337
338
338
[Conservation laws](@ref conservation_laws) arise as left null eigenvectors of the net stoichiometry matrix ``N``, and cycles arise as right null eigenvectors of the stoichiometry matrix. A cycle may be understood as a sequence of reactions that leaves the overall species composition unchanged. These do not necessarily have to correspond to actual cycles in the graph.
0 commit comments