Skip to content

Commit 1980fed

Browse files
less randomness in test
1 parent b6b229b commit 1980fed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/variable_rate_reactions.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ using DiffEqBiological, DiffEqJump, DiffEqBase, OrdinaryDiffEq, StochasticDiffEq
33
r1 = VariableRateReaction(1e-4,(1,2),((1,-1),(2,1)))
44
r2 = VariableRateReaction(0.01,[2],[(2,-1),(3,1)])
55

6-
prob = DiscreteProblem([999.0,1.0,0],(0.0,250.0))
6+
prob = DiscreteProblem([999.0,3.0,0],(0.0,250.0))
77
jump_prob = GillespieProblem(prob,Direct(),r1,r2)
88

99
jump_prob = JumpProblem(prob,Direct(),build_jumps_from_reaction(r1),build_jumps_from_reaction(r2))
@@ -31,7 +31,7 @@ f = function (t,u,du)
3131
du[4] = u[2]*u[3]/100000 - u[1]*u[2]/100000
3232
end
3333

34-
prob = ODEProblem(f,[999.0,1.0,0.0,100.0],(0.0,250.0))
34+
prob = ODEProblem(f,[999.0,3.0,0.0,100.0],(0.0,250.0))
3535
jump_prob = GillespieProblem(prob,Direct(),r1,r2)
3636

3737
srand(230)
@@ -40,7 +40,7 @@ sol = solve(jump_prob,Tsit5())
4040
@test 650 <= sol[end][3] <= 900
4141

4242
r3 = VariableRateReaction(1e-2,[4],[(2,-1),(3,1)])
43-
prob = ODEProblem(f,[999.0,1.0,0.0,1.0],(0.0,250.0))
43+
prob = ODEProblem(f,[999.0,3.0,0.0,1.0],(0.0,250.0))
4444
jump_prob = GillespieProblem(prob,Direct(),r1,r2,r3)
4545
sol = solve(jump_prob,Tsit5())
4646

@@ -50,7 +50,7 @@ end
5050

5151
srand(330)
5252
println("Turn Gillespie Problem into SDE")
53-
prob = SDEProblem(f,g,[999.0,1.0,0.0,1.0],(0.0,250.0))
53+
prob = SDEProblem(f,g,[999.0,3.0,0.0,1.0],(0.0,250.0))
5454
jump_prob = GillespieProblem(prob,Direct(),r1,r2,r3)
5555
sol = solve(jump_prob,SRIW1())
5656
@test 650 <= sol[end][3] <= 1500

0 commit comments

Comments
 (0)