@@ -28,8 +28,8 @@ rn = @reaction_network begin
28
28
end
29
29
reactions(rn)
30
30
```
31
- we see three species, ` (A, B,C) ` , however, ` A ` is treated as the stoichiometric
32
- coefficient of ` C ` , i.e.
31
+ we see two species, ` (B,C) ` , with ` A ` treated as a parameter representing the
32
+ stoichiometric coefficient of ` C ` , i.e.
33
33
``` @example s1
34
34
rx = reactions(rn)[1]
35
35
rx.substrates[1],rx.substoich[1]
@@ -52,10 +52,10 @@ rxs2 = [(@reaction k₊, m*A --> (m*n)*B),
52
52
revsys3 = ReactionSystem(rxs2,t; name=:revsys)
53
53
revsys3 == revsys
54
54
```
55
- Note, the ` @reaction ` macro assumes all symbols are parameters except the right
56
- most symbols in the reaction line (i.e. ` A ` and ` B ` ). For example, in `@reaction
57
- k, F* A + 2(H* G+B) --> D` , the substrates are ` (A,G,B)` with stoichiometries
58
- ` (F,2*H,2) ` .
55
+ Note, the ` @reaction ` macro again assumes all symbols are parameters except the
56
+ substrates or reactants (i.e. ` A ` and ` B ` ). For example, in
57
+ ` @reaction k, F*A + 2(H*G+B) --> D` , the substrates are ` (A,G,B) ` with
58
+ stoichiometries ` (F,2*H,2) ` .
59
59
60
60
Let's now convert ` revsys ` to ODEs and look at the resulting equations:
61
61
``` @example s1
@@ -70,7 +70,7 @@ coefficients. For this reason we must specify `m` and `n` as integers, and hence
70
70
``` @example s1
71
71
p = (k₊ => 1.0, k₋ => 1.0, m => 2, n => 2)
72
72
u₀ = [A => 1.0, B => 1.0]
73
- oprob = ODEProblem(osys, u₀, (0.0,1.0), p)
73
+ oprob = ODEProblem(osys, u₀, (0.0, 1.0), p)
74
74
nothing # hide
75
75
```
76
76
We can now solve and plot the system
@@ -97,7 +97,7 @@ Since we no longer have factorial functions appearing, our example will now run
97
97
even with floating point values for ` m ` and ` n ` :
98
98
``` @example s1
99
99
p = (k₊ => 1.0, k₋ => 1.0, m => 2.0, n => 2.0)
100
- oprob = ODEProblem(osys, u₀, (0.0,1.0), p)
100
+ oprob = ODEProblem(osys, u₀, (0.0, 1.0), p)
101
101
sol = solve(oprob, Tsit5())
102
102
plot(sol)
103
103
```
0 commit comments