augustinas1 / MomentClosure.jl

Tools to generate and study moment equations for any chemical reaction network using various moment closure approximations
https://augustinas1.github.io/MomentClosure.jl/dev/
MIT License
44 stars 6 forks source link

Support Catalyst named parameter/initial state vectors #60

Open kaandocal opened 4 months ago

kaandocal commented 4 months ago

Parameters in ModelingToolkit can be passed as (name, value) pairs or dictionaries. Example:

rn = @reaction_network begin
    s, 0 -> A
    d, A -> 0
end

dprob = DiscreteProblem(rn, [ :A => 5 ], (0, 10.), [ :s => 10, :d => 1])

This seems to work via ModelingToolkit.varmap_to_vars and should probably be added to MomentClosure

isaacsas commented 1 month ago

Note that with MTK9, and hence Catalyst 14, using named mappings is a requirement as under the hood parameter and species orders can now change.

isaacsas commented 1 month ago

And a different parameter object is now generated for use in solvers: https://docs.sciml.ai/ModelingToolkit/stable/basics/FAQ/#Why-are-my-parameters-some-obscure-object?

(wrong link initially)