Catalyst.jl icon indicating copy to clipboard operation
Catalyst.jl copied to clipboard

For conservation law parameters, add to their meta data that they are conservation law parameters

Open TorkelE opened this issue 2 years ago • 4 comments

Seems useful. Current example:

julia> rs = @reaction_network begin
           (k1,k2), X1 <--> X2
       end;

julia> osys = convert(ODESystem, rs; remove_conserved = true);

julia> parameters(osys)[end].metadata
Base.ImmutableDict{DataType, Any} with 3 entries:
  MTKVariableTypeCtx => PARAMETER
  VariableSource     => (:parameters, :Γ)
  ArrayShapeCtx      => (1:1,)

TorkelE avatar Nov 15 '23 17:11 TorkelE

We have conservationlaw_constants to get them.

isaacsas avatar Nov 15 '23 18:11 isaacsas

That said, attaching metadata to them is probably a good approach to propagate their meaning through to downstream system types and allow users to extract them from such systems.

isaacsas avatar Nov 15 '23 18:11 isaacsas

This would be where to inject the metadata I think:

https://github.com/SciML/Catalyst.jl/blob/fc13104034b74f720276d615318f079ec22925f7/src/networkapi.jl#L1225

isaacsas avatar Nov 15 '23 18:11 isaacsas

Yeah, I had some application in SI where you get lists of possible identifiable functions (find_identifiable_functions). Here it would be good to simply loop through the output and see whether any components are conservation law constants.

TorkelE avatar Nov 15 '23 19:11 TorkelE

now works on master

TorkelE avatar Jun 04 '24 19:06 TorkelE