sciml / cellmltoolkit.jl Goto Github PK
View Code? Open in Web Editor NEWCellMLToolkit.jl is a Julia library that connects CellML models to the Scientific Julia ecosystem.
Home Page: https://docs.sciml.ai/CellMLToolkit/stable/
License: Other
CellMLToolkit.jl is a Julia library that connects CellML models to the Scientific Julia ecosystem.
Home Page: https://docs.sciml.ai/CellMLToolkit/stable/
License: Other
@JuliaRegistrator register
julia> collect(ModelingToolkit.vars(equations(ss)[1].rhs))[1] |> dump
Sym{Real, Nothing}
name: Symbol C
metadata: Nothing nothing
julia> collect(ModelingToolkit.vars(equations(ss)[1].rhs))[1] |> ModelingToolkit.isparameter
false
julia> parameters(ss)
1-element Vector{Sym{Real, Nothing}}:
C
Hello!
Using Beeler-Reuter model from the README I can list observables:
julia> ml = CellModel("models/beeler_reuter_1977.cellml.xml")
julia> observed(ml.sys)
39-element Vector{Equation}:
slow_inward_current_f_gate₊V(time) ~ membrane₊V(time)
slow_inward_current₊f(time) ~ slow_inward_current_f_gate₊f(time)
⋮
time_dependent_outward_current₊i_x1(time) ~ membrane₊i_x1(time)
slow_inward_current₊i_s(time) ~ membrane₊i_s(time)
julia> ml.sys.membrane₊i_Na
var"##ODESystem#257₊membrane₊i_Na"(time)
But I do not understand how to get them calculated over time after I solve the model.
Could you help me?
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
@JuliaRegistrator register()
julia> sim = CellMLSimulation(joinpath(@__DIR__, "../corrias.cellml"), tspan)
ERROR: KeyError: key CellMLToolkit.Var(:ImportedEformation, :t) not found
Stacktrace:
[1] getindex
@ .\dict.jl:482 [inlined]
[2] find_equivalence_groups(xml::EzXML.Document)
@ CellMLToolkit ~\.julia\packages\CellMLToolkit\4j9fg\src\components.jl:93
[3] classify_variables(xml::EzXML.Document)
@ CellMLToolkit ~\.julia\packages\CellMLToolkit\4j9fg\src\components.jl:111
[4] process_components(xml::EzXML.Document; simplify::Bool)
@ CellMLToolkit ~\.julia\packages\CellMLToolkit\4j9fg\src\components.jl:181
pointing to s = groups[u1] ∪ groups[u2]
This issue will track our progress in testing CellMLToolkit.jl on the CellML Model Repository.
I have a branch that I've added some functions to query the Model Repo for all of the "exposures" and then curl them here. Additionally I added some functions to create a DataFrame to see which models work and which don't, here.
This work is incomplete and since the model repository is quite large, it takes a while to download.
We are planning to do something similar for SBML.jl and their test-suite so it'd be nice to have some consistency in testing.
I don't have the entire library, but from my sample of ~1000 models, I found that we can call solve
on about 10% of these models and get back a Solution
.
@shahriariravanian you've mentioned some of the issues that could be contributing to this 10% number. It would be good to mention them, so that as they get fixed we can see how this percentage changes.
Hi,
I am trying to calculate the local sensitivities for a large circulation model [(Shi 2006)]
I am Importing the model using CellML.jl when I define an ODEproblem and simulate the solution appears fine and also when performing GSA the results are also sound.
Using the code
using ForwardDiff
savetime = LinRange(18, 19, 100)
p = prob.p
function circ_local(x)
newprob = remake(prob; p=x[1:end])
sol = solve(newprob, Tsit5(); reltol=1e-6, abstol=1e-12,saveat = savetime)
[mean(sol[@nonamespace sys.LV₊V]), mean(sol[@nonamespace sys.Pat₊Pi])]
end
S = ForwardDiff.jacobian(circ_local,p)
Note: all the solver opts I use are the same for both simulation and performing GSA.
The above returns the following warnings with the NAN’s
Warning: First function call produced NaNs. Exiting.
└ @ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/ZBye7/src/initdt.jl:121
┌ Warning: dt <= dtmin. Aborting. There is either an error in your model specification or the true solution is unstable.
└ @ SciMLBase ~/.julia/packages/SciMLBase/Vg9hW/src/integrator_interface.jl:345
2×154 Matrix{Float64}:
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN … NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
I have tried with a range of stiff solvers and low tolerance however nothing is working. I am cautious to claim model error due to the GSA and simulation running fine. This issue is also present in models Heldt 2002 and the Systemic loop as checked by me. I guess this would also be the same for the model I opened an issue about recently Smith 2004.
This issue has been opened as a result of discussion on the discourse please see here
Cheers
Hello @shahriariravanian, I'm working with @paulflang on SbmlInterface and he sent me the following to open here below:
Similar to the CellML to MTK conversion done by CellMLToolkit.jl, we have been trying to convert SBML to MTK with SbmlInterface.jl . Unfortunately, SbmlInterface.jl has a Python dependency. @anandijain and I are now thinking to write SbmlToolkit.jl
and are reaching out to ask for advice on this project. Are you aware of any efforts in that direction where we could contribute to? If not, is there a particular reason why there are interfaces to CellML and BioNetGen but not to SBML as probably most common standard? Are there particular challenges with SBML compared to CellML for instance?
I think we can reuse a lot of the code from CellMLToolkit.jl. But from looking at a CellML file in your example, it seems that CellML specifies the ODEs of the system, whereas SBML specifies the reactions. If we were to go forward with this, we would create an SbmlModel
type that is very similar to CellModel
, except that it contains the rxs::Array{ModelingToolkit.Reaction}
. We can then use ModelingToolkit.ReactionSystem()
and convert()
to populate the eqs
field. But it would be good to have the rxs
field to interface with Julia's stochastic simulation algorithms.
In addition, SBML is clear in what is an initial condition u0
and parameter p
. So we can add the additional field pars
to SbmlModel
.
My thoughts are that something like BioMLParsers.jl
that abstracts away dealing with the AST and whatnot and gives us process_doc
or read
for .xml
, .sbml', and
.cellml` and checks the headers of the file to see how to handle it.
Since I am not that familiar with the structure of the markup languages for each, this really comes down to determining if they are similar enough to generalize to both. If you have expertise here it would be greatly appreciated.
Please let us know your thoughts.
There is little reason to have a CellModel
type. Especially since it does not subtype MTK.AbstractSystem
making usage clunky.
It would be much better if we could do something like read(ODESystem, "mymodel.cellml")
.
The result should match the components form of the acausal modeling tutorial
Thoughts?
https://mtk.sciml.ai/stable/tutorials/ode_modeling/#Defaults
We should automatically set the defaults. This is in line with how SBMLToolkit is doing it, and it makes usage much nicer.
Running into a modelingtoolkitize error with this cellml model
using CellMLToolkit, DifferentialEquations, ModelingToolkit
ml = CellModel("bertram_satin_pedersen_luciani_sherman_2007.cellml")
tspan = (0, 100.0)
prob = ODEProblem(ml, tspan)
# both of these error
sol = solve(prob)
modelingtoolkitize(prob)
I don't know if this is error in the cellml file or the code. I also noted that both errors reference RuntimeGeneratedFunctions
julia> sol = solve(prob)
ERROR: UndefVarError: bottomo not defined
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/SymbolicUtils/KfAAB/src/code.jl:306 [inlined]
[2] macro expansion
@ ~/.julia/packages/ModelingToolkit/pr3qG/src/build_function.jl:302 [inlined]
[3] macro expansion
@ ~/.julia/packages/SymbolicUtils/KfAAB/src/code.jl:264 [inlined]
[4] macro expansion
@ ~/.julia/packages/RuntimeGeneratedFunctions/tJEmP/src/RuntimeGeneratedFunctions.jl:104 [inlined]
[5] macro expansion
@ ./none:0 [inlined]
[6] generated_callfunc
@ ./none:0 [inlined]
[7] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)})(::Vector{Float64}, ::Vector{Float64}, ::Vector{Float64}, ::Float64)
@ RuntimeGeneratedFunctions ~/.julia/packages/RuntimeGeneratedFunctions/tJEmP/src/RuntimeGeneratedFunctions.jl:92
[8] f
@ ~/.julia/packages/ModelingToolkit/pr3qG/src/systems/diffeqs/abstractodesystem.jl:132 [inlined]
[9] ODEFunction
@ ~/.julia/packages/SciMLBase/eghDQ/src/scimlfunctions.jl:324 [inlined]
[10] initialize!(integrator::OrdinaryDiffEq.ODEIntegrator{CompositeAlgorithm{Tuple{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, true, Vector{Float64}, Nothing, Float64, Vector{Float64}, Float64, Float64, Float64, Vector{Vector{Float64}}, OrdinaryDiffEq.ODECompositeSolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem}, CompositeAlgorithm{Tuple{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, OrdinaryDiffEq.CompositeInterpolationData{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.Rosenbrock23Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Rosenbrock23Tableau{Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}}, SciMLBase.UJacobianWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, Vector{Float64}}, DefaultLinSolve, FiniteDiff.JacobianCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, UnitRange{Int64}, Nothing, Val{:forward}(), Float64}, FiniteDiff.GradientCache{Nothing, Vector{Float64}, Vector{Float64}, Float64, Val{:forward}(), Float64, Val{true}()}}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}}, DiffEqBase.DEStats}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.Rosenbrock23Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Rosenbrock23Tableau{Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}}, SciMLBase.UJacobianWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, Vector{Float64}}, DefaultLinSolve, FiniteDiff.JacobianCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, UnitRange{Int64}, Nothing, Val{:forward}(), Float64}, FiniteDiff.GradientCache{Nothing, Vector{Float64}, Vector{Float64}, Float64, Val{:forward}(), Float64, Val{true}()}}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Iu97h/src/perform_step/low_order_rk_perform_step.jl:623
[11] initialize!(integrator::OrdinaryDiffEq.ODEIntegrator{CompositeAlgorithm{Tuple{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, true, Vector{Float64}, Nothing, Float64, Vector{Float64}, Float64, Float64, Float64, Vector{Vector{Float64}}, OrdinaryDiffEq.ODECompositeSolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem}, CompositeAlgorithm{Tuple{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, OrdinaryDiffEq.CompositeInterpolationData{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.Rosenbrock23Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Rosenbrock23Tableau{Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}}, SciMLBase.UJacobianWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, Vector{Float64}}, DefaultLinSolve, FiniteDiff.JacobianCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, UnitRange{Int64}, Nothing, Val{:forward}(), Float64}, FiniteDiff.GradientCache{Nothing, Vector{Float64}, Vector{Float64}, Float64, Val{:forward}(), Float64, Val{true}()}}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}}, DiffEqBase.DEStats}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.Rosenbrock23Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Rosenbrock23Tableau{Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}}, SciMLBase.UJacobianWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, Vector{Float64}}, DefaultLinSolve, FiniteDiff.JacobianCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, UnitRange{Int64}, Nothing, Val{:forward}(), Float64}, FiniteDiff.GradientCache{Nothing, Vector{Float64}, Vector{Float64}, Float64, Val{:forward}(), Float64, Val{true}()}}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, OrdinaryDiffEq.DEOptions{Float64, Float64, Float64, Float64, typeof(DiffEqBase.ODE_DEFAULT_NORM), typeof(LinearAlgebra.opnorm), Nothing, CallbackSet{Tuple{}, Tuple{}}, typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), DataStructures.BinaryMinHeap{Float64}, DataStructures.BinaryMinHeap{Float64}, Nothing, Nothing, Int64, Tuple{}, Tuple{}, Tuple{}}, Vector{Float64}, Float64, Nothing, OrdinaryDiffEq.DefaultInit}, cache::OrdinaryDiffEq.CompositeCache{Tuple{OrdinaryDiffEq.Tsit5Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, OrdinaryDiffEq.Tsit5ConstantCache{Float64, Float64}}, OrdinaryDiffEq.Rosenbrock23Cache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEq.Rosenbrock23Tableau{Float64}, SciMLBase.TimeGradientWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Vector{Float64}, Vector{Float64}}, SciMLBase.UJacobianWrapper{ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Float64, Vector{Float64}}, DefaultLinSolve, FiniteDiff.JacobianCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, UnitRange{Int64}, Nothing, Val{:forward}(), Float64}, FiniteDiff.GradientCache{Nothing, Vector{Float64}, Vector{Float64}, Float64, Val{:forward}(), Float64, Val{true}()}}}, OrdinaryDiffEq.AutoSwitchCache{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Iu97h/src/perform_step/composite_perform_step.jl:39
[12] __init(prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem}, alg::CompositeAlgorithm{Tuple{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}}, AutoSwitch{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}, timeseries_init::Tuple{}, ts_init::Tuple{}, ks_init::Tuple{}, recompile::Type{Val{true}}; saveat::Tuple{}, tstops::Tuple{}, d_discontinuities::Tuple{}, save_idxs::Nothing, save_everystep::Bool, save_on::Bool, save_start::Bool, save_end::Nothing, callback::Nothing, dense::Bool, calck::Bool, dt::Float64, dtmin::Nothing, dtmax::Float64, force_dtmin::Bool, adaptive::Bool, gamma::Rational{Int64}, abstol::Nothing, reltol::Nothing, qmin::Rational{Int64}, qmax::Int64, qsteady_min::Int64, qsteady_max::Int64, qoldinit::Rational{Int64}, fullnormalize::Bool, failfactor::Int64, beta1::Nothing, beta2::Nothing, maxiters::Int64, internalnorm::typeof(DiffEqBase.ODE_DEFAULT_NORM), internalopnorm::typeof(LinearAlgebra.opnorm), isoutofdomain::typeof(DiffEqBase.ODE_DEFAULT_ISOUTOFDOMAIN), unstable_check::typeof(DiffEqBase.ODE_DEFAULT_UNSTABLE_CHECK), verbose::Bool, timeseries_errors::Bool, dense_errors::Bool, advance_to_tstop::Bool, stop_at_next_tstop::Bool, initialize_save::Bool, progress::Bool, progress_steps::Int64, progress_name::String, progress_message::typeof(DiffEqBase.ODE_DEFAULT_PROG_MESSAGE), userdata::Nothing, allow_extrapolation::Bool, initialize_integrator::Bool, alias_u0::Bool, alias_du0::Bool, initializealg::OrdinaryDiffEq.DefaultInit, kwargs::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:default_set, :second_time, :jac), Tuple{Bool, Bool, Bool}}})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Iu97h/src/solve.jl:431
[13] __solve(::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem}, ::CompositeAlgorithm{Tuple{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}}, AutoSwitch{Tsit5, Rosenbrock23{0, false, DefaultLinSolve, DataType}, Rational{Int64}, Int64}}; kwargs::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:default_set, :second_time, :jac), Tuple{Bool, Bool, Bool}}})
@ OrdinaryDiffEq ~/.julia/packages/OrdinaryDiffEq/Iu97h/src/solve.jl:4
[14] __solve(::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem}, ::Nothing; default_set::Bool, kwargs::Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:second_time, :jac), Tuple{Bool, Bool}}})
@ DifferentialEquations ~/.julia/packages/DifferentialEquations/HSWeG/src/default_solve.jl:7
[15] #__solve#70
@ ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:235 [inlined]
[16] #solve_call#56
@ ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:61 [inlined]
[17] solve_call
@ ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:48 [inlined]
[18] #solve_up#58
@ ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:85 [inlined]
[19] solve_up
@ ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:75 [inlined]
[20] #solve#57
@ ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:70 [inlined]
[21] solve(::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem})
@ DiffEqBase ~/.julia/packages/DiffEqBase/gtaOc/src/solve.jl:68
[22] top-level scope
@ REPL[9]:1
julia> modelingtoolkitize(prob)
ERROR: UndefVarError: bottomo not defined
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/SymbolicUtils/KfAAB/src/code.jl:306 [inlined]
[2] macro expansion
@ ~/.julia/packages/ModelingToolkit/pr3qG/src/build_function.jl:302 [inlined]
[3] macro expansion
@ ~/.julia/packages/SymbolicUtils/KfAAB/src/code.jl:264 [inlined]
[4] macro expansion
@ ~/.julia/packages/RuntimeGeneratedFunctions/tJEmP/src/RuntimeGeneratedFunctions.jl:104 [inlined]
[5] macro expansion
@ ./none:0 [inlined]
[6] generated_callfunc
@ ./none:0 [inlined]
[7] (::RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)})(::Vector{Num}, ::Vector{Num}, ::Vector{Num}, ::Num)
@ RuntimeGeneratedFunctions ~/.julia/packages/RuntimeGeneratedFunctions/tJEmP/src/RuntimeGeneratedFunctions.jl:92
[8] (::ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}})(du::Vector{Num}, u::Vector{Num}, p::Vector{Num}, t::Num)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/pr3qG/src/systems/diffeqs/abstractodesystem.jl:132
[9] (::ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing})(::Vector{Num}, ::Vararg{Any, N} where N)
@ SciMLBase ~/.julia/packages/SciMLBase/eghDQ/src/scimlfunctions.jl:324
[10] modelingtoolkitize(prob::ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, ODEFunction{true, ModelingToolkit.var"#f#240"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xe95eadb4, 0x7549851d, 0xe4f6e13d, 0xd24b7c0c, 0x2d3091d1)}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(Symbol("##out#260"), Symbol("##arg#258"), Symbol("##arg#259"), :time), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x84832a8f, 0xdf565945, 0x4d31072d, 0xa0ab47c8, 0xa1e6bfe9)}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Vector{Symbol}, Symbol, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing}, Base.Iterators.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}}, SciMLBase.StandardODEProblem})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/pr3qG/src/systems/diffeqs/modelingtoolkitize.jl:28
[11] top-level scope
@ REPL[10]:1
I am trying to change the parameter in a cellML model, but the method in the Readme/Tutorial does not work anymore.
Steps to reproduce:
ml = CellModel("models/beeler_reuter_1977.cellml.xml")
p = list_params(ml)
update_list!(p, :stimulus_protocol₊IstimPeriod, 250.0)
prob = ODEProblem(ml, (0, 10000); p=p)
Error occurs:
ERROR: MethodError: no method matching float(::Type{Any})
Closest candidates are:
float(::Type{Union{Missing, T}}) where T at missing.jl:112
float(::Any) at float.jl:269
float(::Union{StatsBase.PValue, StatsBase.TestStat}) at ~/.julia/packages/StatsBase/XgjIN/src/statmodels.jl:86
...
Stacktrace:
[1] float(#unused#::Type{Any})
@ Base ./missing.jl:113
[2] promote_to_concrete(vs::Vector{Any}; tofloat::Bool, use_union::Bool)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/5qzZn/src/utils.jl:601
[3] varmap_to_vars(varmap::Vector{Any}, varlist::Vector{Sym{Real, Base.ImmutableDict{DataType, Any}}}; defaults::Dict{Any, Any}, check::Bool, toterm::Function, promotetoconcrete::Nothing, tofloat::Bool, use_union::Bool)
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/5qzZn/src/variables.jl:69
[4] process_DEProblem(constructor::Type, sys::ODESystem, u0map::Vector{Float64}, parammap::Vector{Any}; implicit_dae::Bool, du0map::Nothing, version::Nothing, tgrad::Bool, jac::Bool, checkbounds::Bool, sparse::Bool, simplify::Bool, linenumbers::Bool, parallel::Symbolics.SerialForm, eval_expression::Bool, use_union::Bool, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol, Symbol}, NamedTuple{(:has_difference, :check_length), Tuple{Bool, Bool}}})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/5qzZn/src/systems/diffeqs/abstractodesystem.jl:544
[5] (ODEProblem{true})(sys::ODESystem, u0map::Vector{Float64}, tspan::Tuple{Int64, Float64}, parammap::Vector{Any}; callback::Nothing, check_length::Bool, kwargs::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:jac,), Tuple{Bool}}})
@ ModelingToolkit ~/.julia/packages/ModelingToolkit/5qzZn/src/systems/diffeqs/abstractodesystem.jl:637
[6] #ODEProblem#487
@ ~/.julia/packages/ModelingToolkit/5qzZn/src/systems/diffeqs/abstractodesystem.jl:629 [inlined]
[7] ODEProblem(ml::CellModel, tspan::Tuple{Int64, Float64}; jac::Bool, level::Int64, p::Vector{Any}, u0::Vector{Float64})
@ CellMLToolkit ~/.julia/packages/CellMLToolkit/Pnsff/src/CellMLToolkit.jl:49
[8] top-level scope
@ ~/.julia/dev/CirculationModels/cases/ShiModel/Shi.jl:147
Note: That top-level scope is just the actual model I am working on. But the error occurs on the model from the tutorial as well.
Versions:
Julia 1.8.0
[03cb29e0] CellMLToolkit v2.7.1
We should do some regression testing to make sure that things don't get slower.
I haven't confirmed but 2.3 may be doing something slower than 2.2.
https://models.cellml.org/workspace/iyer_hajjar_armoundas_2007/@@file
ERROR: LoadError: DomainError with -0.14962747399673745:
--
Exponentiation yielding a complex result requires a complex argument.
Replace x^y with (x+0im)^y, Complex(x)^y, or similar.
I figured it would be good to have a tracker issue on this one, since it's come up before but only discussed on slack.
@shahriariravanian I forget, this issue would be quite difficult to resolve, right?
First, thanks for the great ecosystem! ModelingToolkit really looks promising.
I think I run into a limitation with the current design of CellMLToolkit. From my understanding it simply parses the cellml document and directly parses and simplifies everything, followed by constructing the ODESystem. This fails if the cellml description is incomplete. However, I think it is a valid use case to connect the missing variables manually. To give a very simple example, let us consider a forced van der Pol oscillator.
<?xml version='1.0' encoding='UTF-8'?>
<model name="forced_oscillator" xmlns="http://www.cellml.org/cellml/1.1#" xmlns:cellml="http://www.cellml.org/cellml/1.1#">
<units name="m_per_s">
<unit units="meter"/>
<unit exponent="-1" units="second"/>
</units>
<component name="system">
<variable initial_value="0.0" name="time" units="second"/>
<variable initial_value="1.0" name="mu" units="dimensionless"/>
<variable name="f" public_interface="in" units="meter"/>
<variable initial_value="0.0" name="x" public_interface="out" units="meter"/>
<variable initial_value="0.0" name="v" public_interface="out" units="m_per_s"/>
<math xmlns="http://www.w3.org/1998/Math/MathML">
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>time</ci>
</bvar>
<ci>x</ci>
</apply>
<ci>v</ci>
</apply>
<apply>
<eq/>
<apply>
<diff/>
<bvar>
<ci>time</ci>
</bvar>
<ci>v</ci>
</apply>
<apply>
<plus/>
<apply>
<minus/>
<apply>
<times/>
<ci>mu</ci>
<apply>
<minus/>
<cn cellml:units="dimensionless">1</cn>
<apply>
<times/>
<ci>x</ci>
<ci>x</ci>
</apply>
</apply>
<ci>v</ci>
</apply>
<ci>x</ci>
</apply>
<ci>f</ci>
</apply>
</apply>
</math>
</component>
</model>
Parsing this model fails, because f is not connected to anything:
using CellMLToolkit
ml = CellModel("forced_oscillator.cellml")
ERROR: value of system₊f is not found
However, it would be nice to have access to a partially parsed model, such that one could connect the missing components via ModelingToolkit.jl either directly by connecting the partial model with other partial models from other CellML files. To give a rough sketch on what I have in mind:
using ModelingToolkit, CellMLToolkit
mlc = CellModelComponent("forced_oscillator.cellml")
eqs = [
0 ~ mlcsys.system₊f - sin(mlc.sys.system₊xˍtimetime)
]
ml = finalize(mlc, eqs)
Hi,
Trying to read in the Smith et al 2004 model Minimal haemodynamic system model including ventricular interaction and valve dynamics. — Physiome Model Repository 1
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
I had asked the question on the discourse to which a conjectured answer has been given
https://discourse.julialang.org/t/cellmltoolkit-jl-a-model-not-readable/80918
Not sure how I would go about trying to fix this issue or if anyone could help this would be appreciated :)
Also a test on component model will be great to have
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.