# CellmlToolkit.jl: A model not readable

**URL:** <https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918>\
**Category:** Modelling & Simulations\
**Created:** [May 11, 2022, 9:59pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918 "2022-05-11T21:59:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xztt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xztt/32/33843_2.png) [@xztt](https://discourse.julialang.org/u/xztt)\
**Post date:** [May 11, 2022, 9:59pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918/1 "2022-05-11T21:59:52Z")

</div>

Hi,

Trying to read in the Smith et al 2004 model [Minimal haemodynamic system model including ventricular interaction and valve dynamics. — Physiome Model Repository](https://models.physiomeproject.org/exposure/9d046663ba5cac5c8a61ac146183614b/smith_chase_nokes_shaw_wake_2004.cellml/view)

using the code

```julia
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

```julia
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 🙂

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 12, 2022, 8:24am UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918/2 "2022-05-12T08:24:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xztt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xztt/32/33843_2.png) [@xztt](https://discourse.julialang.org/u/xztt)\
**Post date:** [May 12, 2022, 9:48pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918/3 "2022-05-12T21:48:04Z")

</div>

Will do Chris thanks! 🙂

---

<div class="post-metadata">

**Author:** ![xztt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xztt/32/33843_2.png) [@xztt](https://discourse.julialang.org/u/xztt)\
**Post date:** [May 13, 2022, 5:58pm UTC](https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918/4 "2022-05-13T17:58:11Z")

</div>

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

[https://github.com/SciML/CellMLToolkit.jl/issues/89](https://github.com/SciML/CellMLToolkit.jl/issues/89)

Adding for anyone interested in this thread 🙂

Cheers,  
Harry
