Skip to content

Commit 115b966

Browse files
committed
save progress
1 parent f0f4a09 commit 115b966

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/spatial_reaction_systems/spatial_ODE_systems.jl

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ struct LatticeTransportODEf{S,T}
1313
"""The indexes of the edge parameters in the parameter vector (`parameters(lrs)`)."""
1414
edge_p_idxs::Vector{Int64}
1515
"""
16+
Work in progress.
17+
"""
18+
mtk_ps
19+
"""
1620
The non-spatial `ReactionSystem` which was used to create the `LatticeReactionSystem` contain
1721
a set of parameters (either identical to, or a sub set of, `parameters(lrs)`). This vector
1822
contain the indexes of the non-spatial system's parameters in `parameters(lrs)`. These are
@@ -72,6 +76,9 @@ struct LatticeTransportODEf{S,T}
7276
edge_p_idxs = subset_indexes_of(edge_parameters(lrs), parameters(lrs))
7377
nonspatial_rs_p_idxs = subset_indexes_of(parameters(reactionsystem(lrs)), parameters(lrs))
7478

79+
# WIP.
80+
mtk_ps = ModelingToolkit.MTKParameters(complete(convert(ODESystem, reactionsystem(lrs))), [e[1] => e[2][1] for e in vert_ps])
81+
7582
# Computes the indexes of the vertex parameters in the vector of parameters.
7683
# Input `vert_ps` is a vector map taking each parameter symbolic to its value (potentially a
7784
# vector). This vector is already sorted according to the order of the parameters. Here, we extract
@@ -90,7 +97,7 @@ struct LatticeTransportODEf{S,T}
9097
# Declares `work_ps` (used as storage during computation) and the edge iterator.
9198
work_ps = zeros(length(parameters(lrs)))
9299
edge_iterator = Catalyst.edge_iterator(lrs)
93-
new{S,T}(ofunc, num_verts(lrs), num_species(lrs), vert_p_idxs, edge_p_idxs,
100+
new{S,T}(ofunc, num_verts(lrs), num_species(lrs), vert_p_idxs, edge_p_idxs, mtk_ps,
94101
nonspatial_rs_p_idxs, vert_ps, work_ps, v_ps_idx_types, transport_rates,
95102
t_rate_idx_types, leaving_rates, edge_iterator)
96103
end
@@ -109,6 +116,10 @@ struct LatticeTransportODEjac{R,S,T}
109116
"""The indexes of the edge parameters in the parameter vector (`parameters(lrs)`)."""
110117
edge_p_idxs::Vector{Int64}
111118
"""
119+
Work in progress.
120+
"""
121+
mtk_ps
122+
"""
112123
The non-spatial `ReactionSystem` which was used to create the `LatticeReactionSystem` contain
113124
a set of parameters (either identical to, or a sub set of, `parameters(lrs)`). This vector
114125
contain the indexes of the non-spatial system's parameters in `parameters(lrs)`. These are
@@ -145,6 +156,9 @@ struct LatticeTransportODEjac{R,S,T}
145156
edge_p_idxs = subset_indexes_of(edge_parameters(lrs), parameters(lrs))
146157
nonspatial_rs_p_idxs = subset_indexes_of(parameters(reactionsystem(lrs)), parameters(lrs))
147158

159+
# WIP.
160+
mtk_ps = ModelingToolkit.MTKParameters(complete(convert(ODESystem, reactionsystem(lrs))), [e[1] => e[2][1] for e in vert_ps])
161+
148162
# Input `vert_ps` is a vector map taking each parameter symbolic to its value (potentially a
149163
# vector). This vector is already sorted according to the order of the parameters. Here, we extract
150164
# its values only and put them into `vert_ps`.
@@ -153,7 +167,7 @@ struct LatticeTransportODEjac{R,S,T}
153167
work_ps = zeros(length(parameters(lrs)))
154168
v_ps_idx_types = map(vp -> length(vp) == 1, vert_ps)
155169
new{R,S,typeof(jac_transport)}(ofunc, num_verts(lrs), num_species(lrs) , vert_p_idxs,
156-
edge_p_idxs, nonspatial_rs_p_idxs, vert_ps,
170+
edge_p_idxs, mtk_ps, nonspatial_rs_p_idxs, vert_ps,
157171
work_ps, v_ps_idx_types, sparse, jac_transport)
158172
end
159173
end
@@ -321,9 +335,6 @@ end
321335

322336
# Defines the forcing functor's effect on the (spatial) ODE system.
323337
function (f_func::LatticeTransportODEf)(du, u, p, t)
324-
println(du)
325-
println(u)
326-
println(p)
327338
# Updates for non-spatial reactions.
328339
for vert_i in 1:(f_func.num_verts)
329340
# Gets the indices of all the species at vertex i.

0 commit comments

Comments
 (0)