47
47
# Checks that the correct steady state is found through ODEProblem.
48
48
oprob = ODEProblem (coupled_rs, u0, tspan, ps)
49
49
osol = solve (oprob, Vern7 (); abstol = 1e-8 , reltol = 1e-8 )
50
- @test osol. u [end ] ≈ [2.0 , 1.0 ]
50
+ @test osol[[X,A]] [end ] ≈ [2.0 , 1.0 ]
51
51
52
52
# Checks that the correct steady state is found through NonlinearProblem.
53
53
nlprob = NonlinearProblem (coupled_rs, u0, ps)
54
54
nlsol = solve (nlprob; abstol = 1e-8 , reltol = 1e-8 )
55
- @test nlsol ≈ [2.0 , 1.0 ]
55
+ @test nlsol[[X,A]] ≈ [2.0 , 1.0 ]
56
56
57
57
# Checks that the correct steady state is found through SteadyStateProblem.
58
58
ssprob = SteadyStateProblem (coupled_rs, u0, ps)
59
59
sssol = solve (ssprob, DynamicSS (Rosenbrock23 ()); abstol = 1e-8 , reltol = 1e-8 )
60
- @test sssol ≈ [2.0 , 1.0 ]
60
+ @test sssol[[X,A]] ≈ [2.0 , 1.0 ]
61
61
end
62
62
63
63
# Checks that coupled systems created via the DSL, extension, and programmatically are identical.
116
116
for coupled_rs in [coupled_rs_prog, coupled_rs_extended, coupled_rs_dsl]
117
117
oprob = ODEProblem (coupled_rs, u0, tspan, ps)
118
118
osol = solve (oprob, Vern7 (); abstol = 1e-8 , reltol = 1e-8 )
119
- osol. u [end ] ≈ [10.0 , 10.0 , 11.0 , 11.0 ]
119
+ osol[[A,B,X1,X2]] [end ] ≈ [10.0 , 10.0 , 11.0 , 11.0 ]
120
120
end
121
121
end
122
122
@@ -158,10 +158,10 @@ let
158
158
@test_throws Exception SteadyStateProblem (coupled_rs, u0, ps)
159
159
160
160
# Checks that the correct steady state is found through ODEProblem.
161
- oprob = ODEProblem (coupled_rs, u0, tspan, ps; structural_simplify = true ,
161
+ oprob = ODEProblem (coupled_rs, u0, tspan, ps; structural_simplify = true ,
162
162
guesses = [A => 1.0 ])
163
163
osol = solve (oprob, Rosenbrock23 (); abstol = 1e-8 , reltol = 1e-8 )
164
- @test osol. u [end ] ≈ [2.0 , 3.0 ]
164
+ @test osol[[X,A]] [end ] ≈ [2.0 , 3.0 ]
165
165
166
166
# Checks that the correct steady state is found through NonlinearProblem.
167
167
u0 = [X => 0.1 , A => 16.1 / 2 ]
@@ -171,10 +171,10 @@ let
171
171
172
172
# Checks that the correct steady state is found through SteadyStateProblem.
173
173
u0 = [X => 0.1 ]
174
- ssprob = SteadyStateProblem (coupled_rs, u0, ps; structural_simplify = true ,
174
+ ssprob = SteadyStateProblem (coupled_rs, u0, ps; structural_simplify = true ,
175
175
guesses = [A => 1.0 ])
176
176
sssol = solve (ssprob, DynamicSS (Rosenbrock23 ()); abstol = 1e-8 , reltol = 1e-8 )
177
- @test sssol ≈ [2.0 , 3.0 ]
177
+ @test sssol[[X,A]] ≈ [2.0 , 3.0 ]
178
178
end
179
179
180
180
206
206
207
207
# Creates and solves a ODE, SteadyState, and Nonlinear problems.
208
208
# Success is tested by checking that the same steady state solution is found.
209
- oprob = ODEProblem (coupled_rs, u0, (0.0 , 1000.0 ), ps; structural_simplify = true ,
209
+ oprob = ODEProblem (coupled_rs, u0, (0.0 , 1000.0 ), ps; structural_simplify = true ,
210
210
warn_initialize_determined = false )
211
- ssprob = SteadyStateProblem (coupled_rs, u0, ps; structural_simplify = true ,
211
+ ssprob = SteadyStateProblem (coupled_rs, u0, ps; structural_simplify = true ,
212
212
warn_initialize_determined = false )
213
213
nlprob = NonlinearProblem (coupled_rs, u0, ps)
214
214
osol = solve (oprob, Rosenbrock23 (); abstol = 1e-8 , reltol = 1e-8 )
@@ -286,15 +286,15 @@ let
286
286
@named coupled_rs = ReactionSystem (eqs, τ)
287
287
coupled_rs = complete (coupled_rs)
288
288
289
- # Checks that systems created from coupled reaction systems contain the correct content
289
+ # Checks that systems created from coupled reaction systems contain the correct content
290
290
osys = convert (ODESystem, coupled_rs)
291
291
ssys = convert (SDESystem, coupled_rs)
292
292
nlsys = convert (NonlinearSystem, coupled_rs)
293
293
initps = Initial .((X, X2, A, B))
294
294
fullps = union (initps, [k1, k2, k, b1, b2])
295
295
for sys in [coupled_rs, osys, ssys, nlsys]
296
296
@test issetequal (parameters (sys), [k1, k2, k, b1, b2])
297
- @test issetequal (unknowns (sys), [A, B, X, X2])
297
+ @test issetequal (unknowns (sys), [A, B, X, X2])
298
298
end
299
299
end
300
300
@@ -1011,7 +1011,7 @@ let
1011
1011
end
1012
1012
1013
1013
# Complicated differential.
1014
- @test_throws Exception @eval @reaction_network begin
1014
+ @test_throws Exception @eval @reaction_network begin
1015
1015
@equations V + X^ 2 ~ 1.0 - D (V + log (1 + X))
1016
1016
d, X --> 0
1017
1017
end
0 commit comments