SciML / Catalyst.jl

Chemical reaction network and systems biology interface for scientific machine learning (SciML). High performance, GPU-parallelized, and O(1) solvers in open source software.
https://docs.sciml.ai/Catalyst/stable/
Other
463 stars 78 forks source link

Interface for specifying what mathematical level to resolve a reaction at #1112

Open isaacsas opened 1 week ago

isaacsas commented 1 week ago

Given https://github.com/SciML/ModelingToolkit.jl/pull/3181/files we need to now add an interface here for hybrid models. It seems natural to allow a way for users to tag a mathematical representation that a reaction should be realized in (for the static models we will initially support -- later we can allow dynamic models).

This seems like something that could be added as Reaction metadata, and then overloaded with an appropriate input kwarg when generating a problem (so one can easily change up a given reaction's representation). We also need an appropriate problem workflow for people to call for hybrid systems -- we have JumpInputs already that could be reused, but perhaps a HybridInputs type makes sense that is basically the same but handles all types of mixing equations. For the kwarg we need a way to map a reaction to what representation to use (just a dict of Reactions as keys to an enum type for values? Or should we add integer tags to reactions for use as keys?)

isaacsas commented 1 week ago

Note: as part of this interface we need to make sure to update the jump classification code to resolve jumps at the right level (i.e. if an ODE/SDE modifies a variable any jumps that depend on that variable must be made VariableRateJump).

And the interface should also be fine-grained enough to allow a user to manually specify something as variable rate too.