Sometimes when setting up a reaction network in Catalyst it is useful to have a matrix of species of which only some participate in reactions. In this case when setting up the ODEProblem I run into an ‘initialization incomplete’ error. Is there a proper way of doing this?
Minimum (not) working example:
using Catalyst
using DifferentialEquations
function network(N=2)
t=default_t()
@parameters k
@species (W(t))[1:N, 1:N]
rxs = [
vec([Reaction(k, [W[i,j]], []) for (i,j) in [(1,2)]]);
]
@named rs = ReactionSystem(rxs, t)
return complete(rs)
end
example=network()
params=[:k=>1.0]
u_initial=[example.W=>ones(2,2)]
tspan=(0.0,1.0)
problem=ODEProblem(example, u_initial, tspan, params)