@@ -13,6 +13,10 @@ struct LatticeTransportODEf{S,T}
13
13
""" The indexes of the edge parameters in the parameter vector (`parameters(lrs)`)."""
14
14
edge_p_idxs:: Vector{Int64}
15
15
"""
16
+ Work in progress.
17
+ """
18
+ mtk_ps
19
+ """
16
20
The non-spatial `ReactionSystem` which was used to create the `LatticeReactionSystem` contain
17
21
a set of parameters (either identical to, or a sub set of, `parameters(lrs)`). This vector
18
22
contain the indexes of the non-spatial system's parameters in `parameters(lrs)`. These are
@@ -72,6 +76,9 @@ struct LatticeTransportODEf{S,T}
72
76
edge_p_idxs = subset_indexes_of (edge_parameters (lrs), parameters (lrs))
73
77
nonspatial_rs_p_idxs = subset_indexes_of (parameters (reactionsystem (lrs)), parameters (lrs))
74
78
79
+ # WIP.
80
+ mtk_ps = ModelingToolkit. MTKParameters (complete (convert (ODESystem, reactionsystem (lrs))), [e[1 ] => e[2 ][1 ] for e in vert_ps])
81
+
75
82
# Computes the indexes of the vertex parameters in the vector of parameters.
76
83
# Input `vert_ps` is a vector map taking each parameter symbolic to its value (potentially a
77
84
# vector). This vector is already sorted according to the order of the parameters. Here, we extract
@@ -90,7 +97,7 @@ struct LatticeTransportODEf{S,T}
90
97
# Declares `work_ps` (used as storage during computation) and the edge iterator.
91
98
work_ps = zeros (length (parameters (lrs)))
92
99
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,
94
101
nonspatial_rs_p_idxs, vert_ps, work_ps, v_ps_idx_types, transport_rates,
95
102
t_rate_idx_types, leaving_rates, edge_iterator)
96
103
end
@@ -109,6 +116,10 @@ struct LatticeTransportODEjac{R,S,T}
109
116
""" The indexes of the edge parameters in the parameter vector (`parameters(lrs)`)."""
110
117
edge_p_idxs:: Vector{Int64}
111
118
"""
119
+ Work in progress.
120
+ """
121
+ mtk_ps
122
+ """
112
123
The non-spatial `ReactionSystem` which was used to create the `LatticeReactionSystem` contain
113
124
a set of parameters (either identical to, or a sub set of, `parameters(lrs)`). This vector
114
125
contain the indexes of the non-spatial system's parameters in `parameters(lrs)`. These are
@@ -145,6 +156,9 @@ struct LatticeTransportODEjac{R,S,T}
145
156
edge_p_idxs = subset_indexes_of (edge_parameters (lrs), parameters (lrs))
146
157
nonspatial_rs_p_idxs = subset_indexes_of (parameters (reactionsystem (lrs)), parameters (lrs))
147
158
159
+ # WIP.
160
+ mtk_ps = ModelingToolkit. MTKParameters (complete (convert (ODESystem, reactionsystem (lrs))), [e[1 ] => e[2 ][1 ] for e in vert_ps])
161
+
148
162
# Input `vert_ps` is a vector map taking each parameter symbolic to its value (potentially a
149
163
# vector). This vector is already sorted according to the order of the parameters. Here, we extract
150
164
# its values only and put them into `vert_ps`.
@@ -153,7 +167,7 @@ struct LatticeTransportODEjac{R,S,T}
153
167
work_ps = zeros (length (parameters (lrs)))
154
168
v_ps_idx_types = map (vp -> length (vp) == 1 , vert_ps)
155
169
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,
157
171
work_ps, v_ps_idx_types, sparse, jac_transport)
158
172
end
159
173
end
321
335
322
336
# Defines the forcing functor's effect on the (spatial) ODE system.
323
337
function (f_func:: LatticeTransportODEf )(du, u, p, t)
324
- println (du)
325
- println (u)
326
- println (p)
327
338
# Updates for non-spatial reactions.
328
339
for vert_i in 1 : (f_func. num_verts)
329
340
# Gets the indices of all the species at vertex i.
0 commit comments