@@ -26,8 +26,8 @@ observed(osys)
26
26
Let's solve the system and see how to index the solution using our symbolic
27
27
variables
28
28
``` @example faq1
29
- u0 = [rn .A => 1.0, rn .B => 2.0, rn .C => 0.0]
30
- ps = [rn .k₊ => 1.0, rn .k₋ => 1.0]
29
+ u0 = [osys .A => 1.0, osys .B => 2.0, osys .C => 0.0]
30
+ ps = [osys .k₊ => 1.0, osys .k₋ => 1.0]
31
31
oprob = ODEProblem(osys, u0, (0.0, 10.0), ps)
32
32
sol = solve(oprob, Tsit5())
33
33
```
44
44
```
45
45
To evaluate ` C ` at specific times and plot it we can just do
46
46
``` @example faq1
47
- t = range(0.0, 10.0, length= 101)
48
- plot(t, sol(t, idxs = C), label = "C(t)", xlabel = "t")
47
+ t = range(0.0, 10.0, length = 101)
48
+ plot(sol(t, idxs = C), label = "C(t)", xlabel = "t")
49
49
```
50
50
If we want to get multiple variables we can just do
51
51
``` @example faq1
@@ -87,6 +87,7 @@ rx1 = Reaction(k,[B,C],[B,D], [2.5,1],[3.5, 2.5])
87
87
rx2 = Reaction(2*k, [B], [D], [1], [2.5])
88
88
rx3 = Reaction(2*k, [B], [D], [2.5], [2])
89
89
@named mixedsys = ReactionSystem([rx1, rx2, rx3], t, [A, B, C, D], [k, b])
90
+ mixedsys = complete(mixedsys)
90
91
osys = convert(ODESystem, mixedsys; combinatoric_ratelaws = false)
91
92
osys = complete(osys)
92
93
```
0 commit comments