SciML / StructuralIdentifiability.jl

Fast and automatic structural identifiability software for ODE systems
https://docs.sciml.ai/StructuralIdentifiability/stable/
MIT License
109 stars 17 forks source link

Julia crashes when trying to perform identifiability analysis on mid-sized model #134

Closed TorkelE closed 1 year ago

TorkelE commented 1 year ago

Hello, I have a model for which I want to perform identifiability analysis. Unfortunately, running it simply crashes Julia, without any errors or other useful information to help figure out what is going on. I am not really sure how to deal with this.

Here's the code:

using Catalyst, DifferentialEquations, DelimitedFiles, StructuralIdentifiability

jakobs_network = @reaction_network begin
    k0, Rf3PPd + C6H5Br -->  Rf3PPdC6H5Br
    k1, Rf3PPdC6H5Br + Re3SiONa --> NaBr + Rf3PPdC6H5Re3SiO
    k2, Rf3PPdC6H5Re3SiO + Rg3SiH --> Rf3PPd + C6H6 + Re3Si2ORg3
    k3, Rf3PPdC6H5Br + RaP2CuC2H4Rh -->  Rf3PPdC8H9Rh + RaP2CuBr
    k4, RaP2CuBr + Re3SiONa --> NaBr + RaP2CuRe3SiO
    k5, RaP2CuRe3SiO + Rg3SiH --> RaP2CuH + Re3Si2ORg3
    k6, RaP2CuH + C2H3Rh --> RaP2CuC2H4Rh
    k7, Rf3PPdC8H9Rh --> Rf3PPd + C8H9Rh
    k8, Rf3PPd + Rg3SiH --> PdH + Rg3SiRf3P
    k9, PdH + PdH --> Pd2 + H2
    k10, RaP2CuC2H4Rh + H2O --> C2H5Rh + RaP2CuOH
    k11, RaP2CuOH + Rg3SiH --> RaP2CuRg3SiO + H2
    k12, RaP2CuRg3SiO + Rg3SiH --> RaP2CuH + Rg6Si2O
    k13, C2H3Rh --> C2H3 + Rh
end k0 k1 k2 k3 k4 k5 k6 k7 k8 k9 k10 k11 k12 k13;

osys = convert(ODESystem, jakobs_network)
meassured_species_idxs = [8,15,16,22]
meassured_species = map(s -> states(osys)[s], meassured_species_idxs)

@variables t y1(t) y2(t) y3(t) y4(t)
eq1 = y1 ~ meassured_species[1]
eq2 = y2 ~ meassured_species[2]
eq3 = y3 ~ meassured_species[3]
eq4 = y4 ~ meassured_species[4]

assess_identifiability(osys; measured_quantities=[eq1, eq2, eq3, eq4])

and here's the environment:

(Scripts) pkg> status
Status `~/Desktop/Research Projects/Jakobs-Problem/Scripts/Project.toml`
  [479239e8] Catalyst v12.3.1
  [1130ab10] DiffEqParamEstim v1.28.0
  [0c46a032] DifferentialEquations v7.6.0
  [86b6b26d] Evolutionary v0.11.1
  [7073ff75] IJulia v1.23.3
  [429524aa] Optim v1.7.4
⌃ [1dea7af3] OrdinaryDiffEq v6.35.0
⌃ [91a5bcdd] Plots v1.37.0
  [220ca800] StructuralIdentifiability v0.4.2
  [8bb1440f] DelimitedFiles
Info Packages marked with ⌃ have new versions available and may be upgradable.
pogudingleb commented 1 year ago

@TorkelE thanks for reporting! Global identifiability analysis is a heavy computation, so Julia just runs out of memory. You may try a machine with more memory but the system is really challenging for the current algorithm. On the other hand, you can always check local identifiability using assess_local_identifiability function, this will be fast.

TorkelE commented 1 year ago

Thank you, that is useful :)