Catalyst.jl
Catalyst.jl copied to clipboard
Enable and document observables
The observable
field exists for storing observables, but I don't think there are ways to populate it (except for when loading models that already have them).
I think ModelingToolkit partially supports creating and adding observables to a system, so if we can use this when creating models programmatically, we should document how.
For the DSL it is currently not possible, but adding an option like
@reaction_network begin
@observable Xtot = X1 + X2
(k1,k2), X1 <--> X2
end
seems like it would be a good idea.
https://github.com/SciML/Catalyst.jl/blob/bc8ebf0ade4713bd09e16e805193e5f69d640bc6/src/reactionsystem.jl#L568
It is just a kwarg to ReactionSystem
, so a user is free to put equations in it. I think SBMLToolkit uses it, for example.
I don't remember, however, if issues could arise should say Xtot
in your example be used within an equation. ModelingToolkit uses that field to store variables that have been removed by structural_simplify
, and hence won't be in the final equations.
now works on master