Skip to content

Commit 384b2e8

Browse files
committed
switch to parameter set where CLE won't risk going negative
1 parent 9d26f19 commit 384b2e8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/miscellaneous_tests/symbolic_stoichiometry.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ let
218218
end
219219

220220
u0 = [:X => 8, :Y => 8]
221-
ps_int = (:p => 1.0, :k => 2.0, :n1 => 3, :n2 => 4, :d => 0.1)
222-
ps_dec = [:p => 1.0, :k => 2.0, :n1 => 0.5, :n2 => 2.5, :d => 0.1]
221+
ps_int = (:p => 2.0, :k => 0.01, :n1 => 3, :n2 => 4, :d => 0.2)
222+
ps_dec = [:p => 2.0, :k => 0.01, :n1 => 0.5, :n2 => 2.5, :d => 0.2]
223223
tspan = (0.0, 10.0)
224224

225225
# Test ODE simulations with integer coefficients.
@@ -243,11 +243,13 @@ let
243243
@test solve(sprob_dec, ImplicitEM(); seed) solve(sprob_dec_ref, ImplicitEM(); seed)
244244

245245
# Tests jump simulations with integer coefficients.
246-
dprob_int = DiscreteProblem(rs_int, u0, tspan, ps_int)
247-
dprob_int_ref = DiscreteProblem(rs_ref_int, u0, tspan, ps_int)
246+
dprob_int = DiscreteProblem(rs_int, u0, (0.0, 100000.0), ps_int)
247+
dprob_int_ref = DiscreteProblem(rs_ref_int, u0, (0.0, 100000.0), ps_int)
248248
jprob_int = JumpProblem(rs_int, dprob_int, Direct(); rng)
249249
jprob_int_ref = JumpProblem(rs_ref_int, dprob_int_ref, Direct(); rng)
250-
@test solve(jprob_int, SSAStepper(); seed) solve(jprob_int_ref, SSAStepper(); seed)
250+
sol_int = solve(jprob_int, SSAStepper(); seed)
251+
sol_int_ref = solve(jprob_int_ref, SSAStepper(); seed)
252+
@test mean(sol_int[:Y]) mean(sol_int_ref[:Y]) atol = 1e-2 rtol = 1e-2
251253
end
252254

253255
# Check that jump simulations (implemented with and without symbolic stoichiometries) yield simulations

0 commit comments

Comments
 (0)