CellmlToolkit.jl: A model not readable

Hi,

Trying to read in the Smith et al 2004 model Minimal haemodynamic system model including ventricular interaction and valve dynamics. — Physiome Model Repository

using the code

ml = CellModel("/home/harry/Desktop/PhD/Year 1/Sem 2/CellML project/smith_chase_nokes_shaw_wake_2004/smith_chase_nokes_shaw_wake_2004-f7b732c9707a/smith_chase_nokes_shaw_wake_2004.cellml")

prob = ODEProblem(ml, (0.0,5000.0))

sol = solve(prob, CVODE_BDF(), dtmax = 0.5)

Returns the following error

ERROR: MethodError: no method matching operation(::Float64)
Closest candidates are:
  operation(::SymbolicUtils.Code.MakeSparseArray) at ~/.julia/packages/Metatheory/XcKKW/src/utils.jl:154
  operation(::Symbolics.CallWithMetadata) at ~/.julia/packages/Symbolics/hgePJ/src/variable.jl:202
  operation(::Symbolics.ComplexTerm{T}) where T at ~/.julia/packages/Symbolics/hgePJ/src/complex.jl:22
  ...
Stacktrace:
  [1] (::CellMLToolkit.var"#24#26")(eq::Equation)
    @ CellMLToolkit ./none:0
  [2] iterate
    @ ./iterators.jl:447 [inlined]
  [3] iterate
    @ ./generator.jl:44 [inlined]
  [4] grow_to!(dest::Vector{Any}, itr::Base.Generator{Base.Iterators.Filter{CellMLToolkit.var"#24#26", Vector{Equation}}, CellMLToolkit.var"#23#25"})
    @ Base ./array.jl:797
  [5] collect
    @ ./array.jl:721 [inlined]
  [6] remove_rhs_diff(eqs::Vector{Equation})
    @ CellMLToolkit ~/.julia/packages/CellMLToolkit/Pnsff/src/components.jl:191
  [7] process_component(doc::CellMLToolkit.Document, comp::CellMLToolkit.Component, class::Dict{CellMLToolkit.Var, Bool})
    @ CellMLToolkit ~/.julia/packages/CellMLToolkit/Pnsff/src/components.jl:269
  [8] #32
    @ ./none:0 [inlined]
  [9] iterate
    @ ./generator.jl:47 [inlined]
 [10] Dict{Symbol, ODESystem}(kv::Base.Generator{Vector{CellMLToolkit.Component}, CellMLToolkit.var"#32#33"{CellMLToolkit.Document, Dict{CellMLToolkit.Var, Bool}}})
    @ Base ./dict.jl:104
 [11] subsystems(doc::CellMLToolkit.Document, class::Dict{CellMLToolkit.Var, Bool})
    @ CellMLToolkit ~/.julia/packages/CellMLToolkit/Pnsff/src/components.jl:248
 [12] process_components(doc::CellMLToolkit.Document; simplify::Bool)
    @ CellMLToolkit ~/.julia/packages/CellMLToolkit/Pnsff/src/components.jl:224
 [13] process_components
    @ ~/.julia/packages/CellMLToolkit/Pnsff/src/components.jl:220 [inlined]
 [14] CellModel(path::String)
    @ CellMLToolkit ~/.julia/packages/CellMLToolkit/Pnsff/src/CellMLToolkit.jl:36
 [15] top-level scope
    @ ~/Desktop/PhD/Year 1/Sem 2/CellML project/Cell_ML.jl:77

Not sure if this is a CellML error or a Julia one if so I will try to correct the CellML file

Cheers :slight_smile:

Open an issue on the repository. My guess is that an equation equal to a constant is the issue.

Will do Chris thanks! :slight_smile:

Thanks Chris, have opened the issue you can find it at

https://github.com/SciML/CellMLToolkit.jl/issues/89

Adding for anyone interested in this thread :slight_smile:

Cheers,
Harry