I’d like to connect a model defined via explicit ODEs using ModelingToolkit.jl with a model defined using the reaction DSL provided by Catalyst.jl. Specifically, I’d like to use an output of my ODE model as a forcing function input for my reaction DSL system. It seems that, since both systems create an ODESystem object, this should be possible using formalisms in ModelingToolkit (pins, observers, connections). A highly contrived examples follows… see comments for the gist of what I need to do.
# This model generates a signal A(t) which
# will be used as input for a reaction network below
@parameters t k1
@variables A(t)
@derivatives D' ~ t
eqns = [
D(A) ~ -k1*A
]
mdl1 = ODESystem(eqns, name=:mdl1)
# In the reaction network, the species A should
# actually use the output of the ODE model above
rxns = @reaction_network begin
k2, A --> B
#k2*A, 0 -> B ### Also tried making A a parameter
end k2 # A
mdl2 = convert(ODESystem, rxns)
### How do we combine mdl1 and mdl2 into a single
### "connected" model?
Thanks for any insight you can provide!