Open rveltz opened 4 years ago
I'd wait for a change to ModelingToolkit with this. With a proper IR this is a simple merge operation. In the current form it might be possible but it would be a little hacky.
I transferred your issue to DiffEqBio as it is more relevant here I think.
I'm not sure I completely understand what you want to do in general, so I'll give you a few answers to some of your questions:
jumps(sir_model1)
will return a tuple of ConstantRateJumps
for each reaction. When you call JumpProblem
passing in the sir_model
, however, we convert any reactions that are in mass action form to a MassActionJump
as this provides better performance. So the jump_prob
would in this case only have MassActionJump
s. Is there an issue for you with having MassActionJump
s? They are essentially a more restricted form of ConstantRateJump
.
Building a hybrid model is something we'd like to support, but would take some work at this point. It is on the TODO list, but probably won't materialize until we switch to a ModellingToolkit backend, or at least not for a little while.
As for combining networks, I think this is something we could add if you were using min_reaction_network
s and had not yet constructed the underlying jumps (i.e. called addjumps!
). You could do it manually by constructing a new min_reaction_network
, sir_model_merged
, looping through sir_model1
and sir_model2
and calling addspecies!
, addparam!
and addreaction!
on the sir_model_merged
network.
My issue is to build a jump problem (here a PDMP) from several reaction_networks choosing which one is used as an ODE or as a Jump part.
So we’re part way now on this issue as we now have merge!
on generated ReactionSystems
. Still working towards hybrid models.
With ModelingToolkit you have some decent flexibility with regards to this now. What do you think @isaacsas ?
We still need ModelingToolkit support for hybrid systems, and then an interface here for specifying which sub-components are represented in which model type.
Hi,
I know you can do this:
but I would like to do
which returns
Moreover, it would be good to have
sir_model
implemented asConstantRateJump
or provide a way to enforce this. Do you have a way to do this please?Lastly, it would be awesome to be able to use
sir_model1
for the ODE part (ODEProblem
) of the PDMP andsir_model2
for the jump part. But I am probably dreaming...