-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Including initial conditions in equations #236
Comments
But you can just express |
Yes, ish. The problem is that then in the output you get identifiability for |
I think that one can use the ode = @ODEmodel(
x1'(t) = x1(t)^2 + x2(t)^2,
x2'(t) = -x1(t)^2 - x2(t)^2,
y(t) = x1(t) - x2(t)
) Here you can set ode2 = @ODEmodel(
x1'(t) = x1(t)^2 + (c - x1(t))^2,
y(t) = 2 * x1(t) - c
) If you wanted to assess identifiability of |
That's a good point, would it be possible to name the output of these things (so that it looks like |
Indeed, there should be a code for renaming. Does the function you have for reducing wrt first integrals return you the correspondence between old and new variables? Sorry to hear about the issue with using StructuralIdentifiability, ModelingToolkit
@parameters r1, r2, c1, c2, beta1, beta2, chi1, chi2
@variables t, x1(t), x2(t), y(t), u(t)
D = Differential(t)
eqs = [
D(x1) ~ r1 * x1 * (1 - c1 * x1) + beta1 * x1 * x2 / (chi1 + x2) + u,
D(x2) ~ r2 * x2 * (1 - c2 * x2) + beta2 * x1 * x2 / (chi2 + x1),
]
measured_quantities = [y ~ x1]
ode_mtk = ODESystem(eqs, t, name = :mutualist)
assess_identifiability(ode_mtk, measured_quantities = measured_quantities, funcs_to_check = [c1 + c2]) |
I think it might also be related to going through Catalyst. I've forgotten the exact detailed but remembered that I looked at options and decided supporting it was not going to be with the coding mess it'd produce. I will have a look again and message you if I can narrow it down properly. |
So, I think I remember now. Basically, internally we run a The obvious answer is to not do the |
What is the reason to not just use the MTK system? |
See above. I meant to implement it that was, however, there were some issues and I decided it would be a really big mess. That was last week, forgotten what it was. Might make a try to move back to MTK (which would be preferably, but also depends on MTK keeping up to date with SI). |
Can you point me to the comment that states why you can't go via MTK? |
Sorry, not sure I fully understand. The input to If we used MTK-type systems internally, |
You said:
and
I'm still missing why we can't use the MTK internally. |
"The obvious answer is to not do the preprocess_ode conversion but instead use the MTK system. I think I had some good reason for this as well (which currently eludes me, but when tell you when I recall)." As in:
Sorry, I realise this was not directly obvious from my previous comment. I am working on again trying to use MTK internally, hoping that I will remember the problems when/if I encounter them. This PR depends on SciML/Catalyst.jl#713 in any case, and we won't have to worry about merging this one until that one gets merged. |
No worries, I was just trying to understand what the limitation in using MTK is. As for the other PR, we need to settle the issue I raised about where to do (optional) expansion. I still prefer doing it as a system transformation at the |
Yeah, me and Gleb had discussions at like 3 different places, didn't realise first that it was pretty impossible to follow that from an outsider. For the other point, my general feeling is that I fully agree. I think that PR is better than what we currently got, but if you'd rather go directly to something else, I am happy to skip it. Since that issue is not a big hurry, I think next time we meet we just quickly go through so that we are on the same page, I am certain I know what you mean, and I know how we want it implemented. Then I can make a new PR to implement that. |
Is it possible to include initial conditions in the equations (in some sense, these are essentially parameters, right?). E.g something like:
The reason I specifically am wondering about this is that, when reaction system have conservation laws (such as
X1 + X2 = C
), this can be used to eliminate a variable, e.g. X2. However, this introduces a new parameterC
, which can be expressedX1(0) + X2(0) = C
. Also, ifX2
(which is eliminated) happens to be a measured quantity, this would need to be replaced with something likeX1(0) + X2(0) - X1(t)
.The text was updated successfully, but these errors were encountered: