Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
TorkelE opened this issue Nov 15, 2023 · 5 comments

Comments

@TorkelE
Copy link
Member

TorkelE commented Nov 15, 2023

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,)
@isaacsas
Copy link
Member

We have conservationlaw_constants to get them.

@isaacsas
Copy link
Member

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
Copy link
Member

This would be where to inject the metadata I think:

constants = MT.unwrap.(MT.scalarize((@parameters Γ[1:nullity])[1]))

@TorkelE
Copy link
Member Author

TorkelE commented Nov 15, 2023

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
Copy link
Member Author

TorkelE commented Jun 4, 2024

now works on master

@TorkelE TorkelE closed this as completed Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants