Skip to content

Commit 18bc7ea

Browse files
committed
test update.
1 parent 68465d8 commit 18bc7ea

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

test/model_simulation/simulate_SDEs.jl

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,21 @@ let
158158
end
159159

160160
# Tests using default values for noise scaling.
161-
let
162-
noise_scaling_network = @reaction_network begin
161+
# Tests when reaction system is created programmatically.
162+
# Tests @noise_scaling_parameters macro.
163+
let
164+
@variables t
165+
@species X1(t) X2(t)
163166
@noise_scaling_parameters η=0.0
164-
(k1, k2), X1 X2
167+
@parameters k1 k2
168+
r1 = Reaction(k1,[X1],[X2],[1],[1])
169+
r2 = Reaction(k2,[X2],[X1],[1],[1])
170+
@named noise_scaling_network = ReactionSystem([r1, r2], t, [X1, X2], [k1, k2, η])
171+
172+
u0 = [:X1 => 1100.0, :X2 => 3900.0]
173+
p = [:k1 => 2.0, :k2 => 0.5, =>0.0]
174+
@test SDEProblem(noise_scaling_network, u0, (0.0, 1000.0), p)[] == 0.0
165175
end
166-
u0 = [:X1 => 1100.0, :X2 => 3900.0]
167-
p = [:k1 => 2.0, :k2 => 0.5, =>0.0]
168-
@test SDEProblem(noise_scaling_network, u0, (0.0, 1000.0), p)[] == 0.0
169-
end
170176

171177
# Complicated test with many combinations of options.
172178
let

0 commit comments

Comments
 (0)