-
-
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
Structural identifiability analysis fails for composed MTK model #162
Comments
@jonasmac16 |
Thanks for looking into this. I am using |
@jonasmac16 4-element Vector{Equation}:
rabbits₊z(t) ~ -β*rabbits₊x(t)*wolves₊y(t)
wolves₊q(t) ~ γ*rabbits₊x(t)*wolves₊y(t)
Differential(t)(wolves₊y(t)) ~ wolves₊q(t) - wolves₊δ*wolves₊y(t)
Differential(t)(rabbits₊x(t)) ~ rabbits₊α*rabbits₊x(t) + rabbits₊z(t) but then 2-element Vector{Equation}:
Differential(t)(wolves₊y(t)) ~ wolves₊q(t) - wolves₊δ*wolves₊y(t)
Differential(t)(rabbits₊x(t)) ~ rabbits₊α*rabbits₊x(t) + rabbits₊z(t) so it looks like the first two equations in the former model are just deleted and not used for any substitution. This is not what you expected, right? |
@pogudingleb I think since 2-element Vector{Equation}:
wolves₊q(t) ~ γ*rabbits₊x(t)*wolves₊y(t)
rabbits₊z(t) ~ -β*rabbits₊x(t)*wolves₊y(t) and running assess_identifiability(ltk_mtk, measured_quantities = measured_quantities)
[ Info: Preproccessing `ModelingToolkit.ODESystem` object
ERROR: BoundsError: attempt to access 2-element Vector{Any} at index [3] |
@jonasmac16 |
@jonasmac16 |
Just updated to the github version and it works. Thank you so much for looking at this so quickly and solving it. I have more complicated models which have a similar logic to them and I will see if I encounter more edge cases and report back. |
Then I close the issue for the time being. Feel free to reopen if you encounter something. |
Hi, I had the same issue with observed variables throwing errors and the latest tagged version of StructuralIdentifiability.jl does not appear to have fixed it. If you run the following example from the root directory of Conductor.jl you will hit the error: using Conductor, StructuralIdentifiability, ModelingToolkit
import Unitful: mV
# Run from root of Conductor.jl
include(joinpath("demo", "prinz_kinetics.jl"));
@variables y(t) [unit=mV]
channels = [NaV(100mS / cm^2),
CaT(0mS / cm^2),
CaS(4mS / cm^2),
KA(0mS / cm^2),
KCa(15mS / cm^2),
Kdr(50mS / cm^2),
H(0.02mS / cm^2),
leak(0.03mS / cm^2)];
dynamics = HodgkinHuxley(channels, gradients);
@named neuron = CompartmentSystem(Vₘ, dynamics;
geometry = geo,
extensions = [calcium_conversion]);
odesys = ODESystem(neuron) # converts to ODESystem and runs structural_simplify
measured_quantities = [y ~ Vₘ]
# Errors because of a variable moved to observed on latest v0.4.9
global_id = assess_identifiability(odesys, measured_quantities = measured_quantities) |
@wsphillips |
Thank you for taking another look at this issue. Regarding exponential functions, they are common in the specification of these models, but could certainly be substituted (and often are for performance reasons). I would indeed need some help to understand what specifically needs to happen. Could you ping me on JuliaLang Slack or email [email protected] ? |
I have fixed the issue in the current GitHub version, it will be a part of |
Hi,
First, thank for this cool package.
I am trying to compose model based on several submodels written in
MTK
. To do I haveinput
variable in each submodel which allows me to define input and output from other states variables in the composed model.However, this seems to interfere with the identifiability analysis. I have written a MWE with a Lotka-Volterra model exemplifying the issue. The non-composed models works fine but the composed version fails (see error below). Is this expected? There seem to similar issues posted here.
This works
but this fails with
ERROR: MethodError: no method matching +(::Nemo.fmpq_mpoly, ::Term{Real, Base.ImmutableDict{DataType, Any}})
The text was updated successfully, but these errors were encountered: