44 lat_setp!(sim_struct, p, lrs::LatticeReactionSystem, p_val)
55
66For a problem or integrators, update its `p` vector with the input `p_val`. For non-lattice models,
7- this is can be done through direct interfacing (e.g. `prob[p] = 1.0`). However, for
7+ this is can be done through direct interfacing (e.g. `prob[p] = 1.0`). However, for
88`LatticeReactionSystem`-based problems and integrators, this function must be used instead.
99
1010Arguments:
8282 lat_getp(sim_struct, p, lrs::LatticeReactionSystem)
8383
8484For a problem or integrators, retrieves its `p` values. For non-lattice models,
85- this is can be done through direct interfacing (e.g. `prob[p]`). However, for
85+ this is can be done through direct interfacing (e.g. `prob[p]`). However, for
8686`LatticeReactionSystem`-based problems and integrators, this function must be used instead. The
8787output format depends on the lattice (a dense array for cartesian grid lattices, a sparse array for
8888masked grid lattices, and a vector for graph lattices). This format is similar to what is used to
@@ -95,7 +95,7 @@ Arguments:
9595- `lrs`: The `LatticeReactionSystem` which was used to generate the structure we wish to modify.
9696
9797Notes:
98- - Even if the parameter is spatially uniform, a full array with its values across all vertices will be retrieved.
98+ - Even if the parameter is spatially uniform, a full array with its values across all vertices will be retrieved.
9999
100100Example:
101101```julia
145145 lat_setu!(sim_struct, sp, lrs::LatticeReactionSystem, u)
146146
147147For a problem or integrators, update its `u` vector with the input `u`. For non-lattice models,
148- this is can be done through direct interfacing (e.g. `prob[X] = 1.0`). However, for
148+ this is can be done through direct interfacing (e.g. `prob[X] = 1.0`). However, for
149149`LatticeReactionSystem`-based problems and integrators, this function must be used instead.
150150
151151Arguments:
224224 lat_getu(sim_struct, sp, lrs::LatticeReactionSystem)
225225
226226For a problem or integrators, retrieves its `u` values. For non-lattice models,
227- this is can be done through direct interfacing (e.g. `prob[X]`). However, for
227+ this is can be done through direct interfacing (e.g. `prob[X]`). However, for
228228`LatticeReactionSystem`-based problems and integrators, this function must be used instead. The
229229output format depends on the lattice (a dense array for cartesian grid lattices, a sparse array for
230230masked grid lattices, and a vector for graph lattices). This format is similar to which is used to
@@ -236,7 +236,7 @@ Arguments:
236236- `lrs`: The `LatticeReactionSystem` which was used to generate the structure we wish to modify.
237237
238238Notes:
239- - Even if the species is spatially uniform, a full array with its values across all vertices will be retrieved.
239+ - Even if the species is spatially uniform, a full array with its values across all vertices will be retrieved.
240240
241241Example:
242242```julia
@@ -277,15 +277,15 @@ function lat_getu(jint::JumpProcesses.SSAIntegrator, sp_idx, sp_tot, lattice)
277277 return reshape_vals (jint. u[sp_idx, :], lattice)
278278end
279279
280- # A single function, `lat_getu`, which contains all interfacing functionality. However,
281- # long-term it should be replaced with a sleeker interface. Ideally as MTK-wide support for
280+ # A single function, `lat_getu`, which contains all interfacing functionality. However,
281+ # long-term it should be replaced with a sleeker interface. Ideally as MTK-wide support for
282282# lattice problems and solutions is introduced. Note that SciML considers jump simulation solutions
283283# as `ODESolution`, hence that type is specified.
284284"""
285285 lat_getu(sol, sp, lrs::LatticeReactionSystem; t = nothing)
286286
287287A function for retrieving the solution of a `LatticeReactionSystem`-based simulation on various
288- desired forms. Generally, for `LatticeReactionSystem`s, the values in `sol` is ordered in a
288+ desired forms. Generally, for `LatticeReactionSystem`s, the values in `sol` is ordered in a
289289way which is not directly interpretable by the user. Furthermore, the normal Catalyst interface
290290for solutions (e.g. `sol[:X]`) does not work for these solutions. Hence this function is used instead.
291291
@@ -307,13 +307,13 @@ Notes:
307307
308308Example:
309309```julia
310- using Catalyst, OrdinaryDiffEq
310+ using Catalyst, OrdinaryDiffEqDefault
311311
312312# Prepare `LatticeReactionSystem`s.
313313rs = @reaction_network begin
314314 (k1,k2), X1 <--> X2
315315end
316- tr = @transport_reaction D X1
316+ tr = @transport_reaction D X1
317317lrs = LatticeReactionSystem(rs, [tr], CartesianGrid((2,2)))
318318
319319# Create problems.
@@ -322,7 +322,7 @@ tspan = (0.0, 10.0)
322322ps = [:k1 => 1, :k2 => 2.0, :D => 0.1]
323323
324324oprob = ODEProblem(lrs1, u0, tspan, ps)
325- osol = solve(oprob1, Tsit5() )
325+ osol = solve(oprob )
326326lat_getu(osol, :X1, lrs) # Returns the value of X1 at each time step.
327327lat_getu(osol, :X1, lrs; t = 0.0:10.0) # Returns the value of X1 at times 0.0, 1.0, ..., 10.0
328328```
@@ -348,7 +348,7 @@ function lat_getu(sol::ODESolution, lattice, t::Nothing, sp_idx::Int64, sp_tot::
348348 end
349349end
350350
351- # Function which handles the input in the case where `t` is a range of values (i.e. return `sp`s
351+ # Function which handles the input in the case where `t` is a range of values (i.e. return `sp`s
352352# value at all designated time points.
353353function lat_getu (sol:: ODESolution , lattice, t:: AbstractVector{T} , sp_idx:: Int64 ,
354354 sp_tot:: Int64 ) where {T <: Number }
374374"""
375375 rebuild_lat_internals!(sciml_struct)
376376
377- Rebuilds the internal functions for simulating a LatticeReactionSystem. Whenever a problem or
378- integrator has had its parameter values updated, this function should be called for the update to
377+ Rebuilds the internal functions for simulating a LatticeReactionSystem. Whenever a problem or
378+ integrator has had its parameter values updated, this function should be called for the update to
379379be taken into account. For ODE simulations, `rebuild_lat_internals!` needs only to be called when
380380- An edge parameter has been updated.
381381- When a parameter with spatially homogeneous values has been given spatially heterogeneous values (or vice versa).
@@ -393,7 +393,7 @@ Example:
393393rs = @reaction_network begin
394394 (k1,k2), X1 <--> X2
395395end
396- tr = @transport_reaction D X1
396+ tr = @transport_reaction D X1
397397grid = CartesianGrid((2,2))
398398lrs = LatticeReactionSystem(rs, [tr], grid)
399399
0 commit comments