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

Problem createing StructuralIdentifiability ODE from certain system #227

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

Comments

@TorkelE
Copy link
Member

TorkelE commented Nov 1, 2023

I wish to create a StructuralIdentifaibiltiy ODE from a ModelingToolkit model. However, it fails if the measured quantities are a combination of known parameters and measured quantities:

# Fetch packages.
using ModelingToolkit, StructuralIdentifiability

# Create model
@parameters p1 p2
@variables t x1(t) x2(t) y(t)
D = Differential(t)
eqs = [D(x1) ~ p1* x2 - x1,
       D(x2) ~ p2 - p1* x2]
@named osys = ODESystem(eqs)

# Create StructuralIdentifiability ODE.
known_parameter = [p1]
measured_quantities = [y ~ x1]
known_stuff = [Num.(measured_quantities);]
si_ode = preprocess_ode(osys, known_stuff)

# This, providing either only known parameters or equations work:
si_ode = preprocess_ode(osys, known_parameter)
si_ode = preprocess_ode(osys, measured_quantities)

Is there a way to create a system with this kind of information?

@pogudingleb
Copy link
Collaborator

One can have two output variables y1(t), y2(t) and measured_quantities = [y1 ~ x1, y2 ~ p1]. Would this be appropriate for you?

Thanks again for working on this connection to Catalyst! If you think it would be easier for you, we could have a call about this at some point.

@TorkelE
Copy link
Member Author

TorkelE commented Nov 2, 2023

Yeah, that seems like a way to do it.

Actually, would you be available for a call tomorrow (or Friday, but tomorrow, Thursday, I am available all week). I have gotten a decent stretch on the implementation, but it would be good to go through everything with you, so that I do not miss any features.

@pogudingleb
Copy link
Collaborator

Another option, of course, is to have preprocess_ode(osys, [x1, p1]), that is, you are not obliged to give names to measured_quantities (I should have made it more explicit in the docs...).

For the call, I should be available on Friday but I will know the exact details tomorrow.

@TorkelE
Copy link
Member Author

TorkelE commented Nov 2, 2023

That sounds good, I will hold off on doing more until we are able to meet. On Friday I am available before 10 am, and after 4 pm (US EST time).

@pogudingleb
Copy link
Collaborator

Followed-up by email about the meeting

@TorkelE TorkelE closed this as completed Nov 2, 2023
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