@@ -102,17 +102,19 @@ let
102
102
end
103
103
end
104
104
105
- # ## ABC Model Test (from JumpProcesses) ###
105
+ # ## Tests taken from JumpProcesses ###
106
+
107
+ # ABC Model Test
106
108
let
107
109
# Preparations (stuff used in JumpProcesses examples ported over here, could be written directly into code).
108
110
Nsims = 100
109
111
reltol = 0.05
110
- non_spatial_mean = [65.7395 , 65.7395 , 434.2605 ] # mean of 10,000 simulations
112
+ non_spatial_mean = [65.7395 , 65.7395 , 434.2605 ] # Mean of 10,000 simulations.
111
113
dim = 1
112
114
linear_size = 5
113
115
num_nodes = linear_size^ dim
114
116
dims = Tuple (repeat ([linear_size], dim))
115
- domain_size = 1.0 # μ-meter
117
+ domain_size = 1.0 # μ-meter.
116
118
mesh_size = domain_size / linear_size
117
119
rates = [0.1 / mesh_size, 1.0 ]
118
120
diffusivity = 1.0
@@ -128,15 +130,16 @@ let
128
130
lattice = Graphs. grid (dims)
129
131
lrs = LatticeReactionSystem (rn, [tr_1, tr_2, tr_3], lattice)
130
132
131
- # Set simulation parameters and create problems
133
+ # Set simulation parameters and create problems.
132
134
u0 = [:A => [0 ,0 ,500 ,0 ,0 ], :B => [0 ,0 ,500 ,0 ,0 ], :C => 0 ]
133
135
tspan = (0.0 , 10.0 )
134
136
pV = [:kB => rates[1 ], :kD => rates[2 ]]
135
137
pE = [:D => diffusivity]
136
138
dprob = DiscreteProblem (lrs, u0, tspan, (pV, pE))
137
- jump_problems = [JumpProblem (lrs, dprob, alg (); save_positions = (false , false )) for alg in [NSM, DirectCRDirect]] # NRM doesn't work. Might need Cartesian grid.
139
+ # NRM could be added, but doesn't work. Might need Cartesian grid.
140
+ jump_problems = [JumpProblem (lrs, dprob, alg (); save_positions = (false , false )) for alg in [NSM, DirectCRDirect]]
138
141
139
- # Tests .
142
+ # Run tests .
140
143
function get_mean_end_state (jump_prob, Nsims)
141
144
end_state = zeros (size (jump_prob. prob. u0))
142
145
for i in 1 : Nsims
0 commit comments