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

Enable and document observables #689

Closed
TorkelE opened this issue Sep 25, 2023 · 2 comments
Closed

Enable and document observables #689

TorkelE opened this issue Sep 25, 2023 · 2 comments

Comments

@TorkelE
Copy link
Member

TorkelE commented Sep 25, 2023

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.

@isaacsas
Copy link
Member

observed = Equation[],

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.

@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