using ModelingToolkit
using OrdinaryDiffEq, SteadyStateDiffEq, DiffEqCallbacks
using Plots
using CSV
using DataFrames
using Dates
using CaMKIIModel
using CaMKIIModel: ms
Plots.default(lw=1.5)Caffeine Effects
Caffeine increase RyR opening sensitivity to luminal and subspace calcium.
In this model, we decrease the mid saturation sub-SR calcium concentration for the opening rate.
@mtkcompile sys = build_neonatal_ecc_sys()
tend = 500* 1000ms
prob = ODEProblem(sys, [], tend)
stimstart = 100* 1000ms
stimend = 300* 1000ms
alg = KenCarp47()
function add_coffee_affect!(integrator)
integrator.ps[sys.RyRsensitivity] = 10
endInternal error: stack overflow in type inference of remake(SciMLBase.ODEProblem{Array{Float64, 1}, Tuple{Int64, Int64}, true, ModelingToolkitBase.MTKParameters{Array{Float64, 1}, Array{Float64, 1}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x9286608c, 0xbd422303, 0x5105814a, 0xb02a1516, 0xa7001fd3), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x2e5e0cc9, 0x8e977946, 0x85221830, 0xe7d7fc02, 0x170cee2f), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkitBase.MTKParameters{Array{Float64, 1}, StaticArraysCore.SArray{Tuple{0}, Float64, 1, 0}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xea2adeae, 0xdd074767, 0x3d747877, 0x201a9f0c, 0x0aa4b45c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x3d86c3f8, 0x8cb34fec, 0xe037f03b, 0xf83be1ef, 0xde7515e1), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, typeof(ModelingToolkitBase.update_initializeprob!), Base.ComposedFunction{Base.ComposedFunction{typeof(Base.identity), typeof(ModelingToolkitBase.safe_float)}, SymbolicIndexingInterface.TimeIndependentObservedFunction{ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xee8d4739, 0x1ca06c92, 0x85e813d6, 0x8a4a39d1, 0x4151a370), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc7e3524e, 0xba2eb296, 0x5a2249fe, 0x4aa94222, 0x59c2d215), Nothing}}}}, ModelingToolkitBase.var"#initprobpmap_split#724"{ModelingToolkitBase.var"#_getter#720"{Tuple{Base.ComposedFunction{ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xb4d5953c, 0x14b4fe81, 0x865f6123, 0xcdae70a1, 0x8a920745), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x5a0161f5, 0x0f1d38ae, 0x61e3cb5a, 0xcc8bd82d, 0xd2e6676d), Nothing}}}}, Base.ComposedFunction{ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x22566f93, 0xab23bab3, 0x38ef30c8, 0xcf441c87, 0xcb86ec35), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xf515ee68, 0x9b29b354, 0xe5f11990, 0xaecc6ec8, 0x2f59ebe5), Nothing}}}}, Base.Returns{Tuple{}}, Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x48e1dbff, 0x79659666, 0x247b7c0c, 0x74a21739, 0x061a95cf), Nothing}, Nothing}}}, Base.ComposedFunction{Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), typeof(Base.identity)}, Base.Fix1{Base.Broadcast.BroadcastFunction{typeof(ModelingToolkitBase.call)}, Tuple{}}}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x48e1dbff, 0x79659666, 0x247b7c0c, 0x74a21739, 0x061a95cf), Nothing}, Nothing}}}}}}, ModelingToolkitBase.InitializationMetadata{ModelingToolkitBase.ReconstructInitializeprob{ModelingToolkitBase.var"#_getter#720"{Tuple{Base.ComposedFunction{ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}, ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xb80930bc, 0x4260a78a, 0x379dc65c, 0x36796f11, 0xc57bcd0e), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x84e2a49f, 0x3f634732, 0x3e3c8d10, 0x8c840230, 0x1dce5821), Nothing}}}}, Base.Returns{StaticArraysCore.SArray{Tuple{0}, Float64, 1, 0}}, Base.Returns{Tuple{}}, Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}}, ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc0224667, 0x9004e642, 0x7c32774c, 0xb06209e5, 0x97152e08), Nothing}, Nothing}}}, Base.ComposedFunction{Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), typeof(Base.identity)}, Base.Fix1{Base.Broadcast.BroadcastFunction{typeof(ModelingToolkitBase.call)}, Tuple{}}}, ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc0224667, 0x9004e642, 0x7c32774c, 0xb06209e5, 0x97152e08), Nothing}, Nothing}}}}}, Base.ComposedFunction{typeof(Base.identity), ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x890c50cf, 0xf615c474, 0xf66b0b5a, 0xbd4f7816, 0x011c2e85), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xa9c78342, 0x78ca9315, 0xb8f9f851, 0x2ad3286d, 0x7e34e5e3), Nothing}}}}}, ModelingToolkitBase.GetUpdatedU0{SymbolicIndexingInterface.TimeIndependentObservedFunction{ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xe870e9b2, 0x5a3750d2, 0xc70838d3, 0x8d743208, 0x48aeb939), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x3e1c1569, 0xcfa9999e, 0x320c1624, 0xa9932029, 0x17f66ade), Nothing}}}, SymbolicIndexingInterface.MultipleParametersGetter{SymbolicIndexingInterface.IndexerNotTimeseries, Array{SymbolicIndexingInterface.GetParameterIndex{ModelingToolkitBase.ParameterIndex{SciMLStructures.Initials, Int64}}, 1}, Nothing}}, ModelingToolkitBase.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Array{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkitBase.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}}, 1}}}}, Base.Val{true}}, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}).
This might be caused by recursion over very long tuples or argument lists.
add_coffee_affect! (generic function with 1 method)
@unpack Istim = sys
callback = build_stim_callbacks(Istim, stimend; period=1* 1000ms, starttime=stimstart)SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}, SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}}}((), (SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}(100000:1000:300000, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim)), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim), DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}(100000:1000:300000, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ()), SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}(100000.5:1000.0:300000.5, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim)), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim), DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}(100000.5:1000.0:300000.5, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ())))
Add caffeine at t = 200 econd
callback_caf = CallbackSet(build_stim_callbacks(Istim, stimend; period=1* 1000ms, starttime=stimstart), PresetTimeCallback(200.0* 1000ms, add_coffee_affect!))SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}, SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}, SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{Vector{Float64}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(Main.var"##225".add_coffee_affect!)}, typeof(Main.var"##225".add_coffee_affect!), DiffEqCallbacks.PresetTimeFunction{Vector{Float64}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(Main.var"##225".add_coffee_affect!)}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}}}((), (SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}(100000:1000:300000, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim)), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim), DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}(100000:1000:300000, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ()), SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}(100000.5:1000.0:300000.5, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim)), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim), DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}(100000.5:1000.0:300000.5, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ()), SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{Vector{Float64}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(Main.var"##225".add_coffee_affect!)}, typeof(Main.var"##225".add_coffee_affect!), DiffEqCallbacks.PresetTimeFunction{Vector{Float64}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(Main.var"##225".add_coffee_affect!)}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{Vector{Float64}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(Main.var"##225".add_coffee_affect!)}([200000.0], true, SciMLBase.INITIALIZE_DEFAULT, Main.var"##225".add_coffee_affect!), Main.var"##225".add_coffee_affect!, DiffEqCallbacks.PresetTimeFunction{Vector{Float64}, typeof(SciMLBase.INITIALIZE_DEFAULT), typeof(Main.var"##225".add_coffee_affect!)}([200000.0], true, SciMLBase.INITIALIZE_DEFAULT, Main.var"##225".add_coffee_affect!), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ())))
Single-dose caffeine
@time sol = solve(prob, alg; callback)
@time sol_caf = solve(prob, alg; callback=callback_caf)Internal error: stack overflow in type inference of kwcall(NamedTuple{(:callback,), Tuple{SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{Base.StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{Base.StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}, SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{Base.StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}}}}}, typeof(CommonSolve.solve), SciMLBase.ODEProblem{Array{Float64, 1}, Tuple{Int64, Int64}, true, ModelingToolkitBase.MTKParameters{Array{Float64, 1}, Array{Float64, 1}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x9286608c, 0xbd422303, 0x5105814a, 0xb02a1516, 0xa7001fd3), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x2e5e0cc9, 0x8e977946, 0x85221830, 0xe7d7fc02, 0x170cee2f), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkitBase.MTKParameters{Array{Float64, 1}, StaticArraysCore.SArray{Tuple{0}, Float64, 1, 0}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xea2adeae, 0xdd074767, 0x3d747877, 0x201a9f0c, 0x0aa4b45c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x3d86c3f8, 0x8cb34fec, 0xe037f03b, 0xf83be1ef, 0xde7515e1), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkitBase.ObservedFunctionCache{ModelingToolkitBase.System, Nothing}, Nothing, ModelingToolkitBase.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, typeof(ModelingToolkitBase.update_initializeprob!), Base.ComposedFunction{Base.ComposedFunction{typeof(Base.identity), typeof(ModelingToolkitBase.safe_float)}, SymbolicIndexingInterface.TimeIndependentObservedFunction{ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xee8d4739, 0x1ca06c92, 0x85e813d6, 0x8a4a39d1, 0x4151a370), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc7e3524e, 0xba2eb296, 0x5a2249fe, 0x4aa94222, 0x59c2d215), Nothing}}}}, ModelingToolkitBase.var"#initprobpmap_split#724"{ModelingToolkitBase.var"#_getter#720"{Tuple{Base.ComposedFunction{ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xb4d5953c, 0x14b4fe81, 0x865f6123, 0xcdae70a1, 0x8a920745), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x5a0161f5, 0x0f1d38ae, 0x61e3cb5a, 0xcc8bd82d, 0xd2e6676d), Nothing}}}}, Base.ComposedFunction{ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x22566f93, 0xab23bab3, 0x38ef30c8, 0xcf441c87, 0xcb86ec35), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xf515ee68, 0x9b29b354, 0xe5f11990, 0xaecc6ec8, 0x2f59ebe5), Nothing}}}}, Base.Returns{Tuple{}}, Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x48e1dbff, 0x79659666, 0x247b7c0c, 0x74a21739, 0x061a95cf), Nothing}, Nothing}}}, Base.ComposedFunction{Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), typeof(Base.identity)}, Base.Fix1{Base.Broadcast.BroadcastFunction{typeof(ModelingToolkitBase.call)}, Tuple{}}}, ModelingToolkitBase.ObservedWrapper{false, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x48e1dbff, 0x79659666, 0x247b7c0c, 0x74a21739, 0x061a95cf), Nothing}, Nothing}}}}}}, ModelingToolkitBase.InitializationMetadata{ModelingToolkitBase.ReconstructInitializeprob{ModelingToolkitBase.var"#_getter#720"{Tuple{Base.ComposedFunction{ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}, ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xb80930bc, 0x4260a78a, 0x379dc65c, 0x36796f11, 0xc57bcd0e), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x84e2a49f, 0x3f634732, 0x3e3c8d10, 0x8c840230, 0x1dce5821), Nothing}}}}, Base.Returns{StaticArraysCore.SArray{Tuple{0}, Float64, 1, 0}}, Base.Returns{Tuple{}}, Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), ModelingToolkitBase.PConstructorApplicator{typeof(Base.identity)}}, ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc0224667, 0x9004e642, 0x7c32774c, 0xb06209e5, 0x97152e08), Nothing}, Nothing}}}, Base.ComposedFunction{Base.ComposedFunction{Base.Fix1{typeof(Base.Broadcast.broadcast), typeof(Base.identity)}, Base.Fix1{Base.Broadcast.BroadcastFunction{typeof(ModelingToolkitBase.call)}, Tuple{}}}, ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xc0224667, 0x9004e642, 0x7c32774c, 0xb06209e5, 0x97152e08), Nothing}, Nothing}}}}}, Base.ComposedFunction{typeof(Base.identity), ModelingToolkitBase.ObservedWrapper{true, ModelingToolkitBase.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x890c50cf, 0xf615c474, 0xf66b0b5a, 0xbd4f7816, 0x011c2e85), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xa9c78342, 0x78ca9315, 0xb8f9f851, 0x2ad3286d, 0x7e34e5e3), Nothing}}}}}, ModelingToolkitBase.GetUpdatedU0{SymbolicIndexingInterface.TimeIndependentObservedFunction{ModelingToolkitBase.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0xe870e9b2, 0x5a3750d2, 0xc70838d3, 0x8d743208, 0x48aeb939), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkitBase.var"#_RGF_ModTag", ModelingToolkitBase.var"#_RGF_ModTag", (0x3e1c1569, 0xcfa9999e, 0x320c1624, 0xa9932029, 0x17f66ade), Nothing}}}, SymbolicIndexingInterface.MultipleParametersGetter{SymbolicIndexingInterface.IndexerNotTimeseries, Array{SymbolicIndexingInterface.GetParameterIndex{ModelingToolkitBase.ParameterIndex{SciMLStructures.Initials, Int64}}, 1}, Nothing}}, ModelingToolkitBase.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Array{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkitBase.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}}, 1}}}}, Base.Val{true}}, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, SciMLBase.StandardODEProblem}, OrdinaryDiffEqSDIRK.KenCarp47{0, ADTypes.AutoForwardDiff{nothing, Nothing}, Nothing, OrdinaryDiffEqNonlinearSolve.NLNewton{Base.Rational{Int64}, Base.Rational{Int64}, Base.Rational{Int64}, Nothing}, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Base.Val{:forward}(), true, nothing}).
This might be caused by recursion over very long tuples or argument lists.
6.965580 seconds (16.97 M allocations: 1.058 GiB, 3.35% gc time, 89.13% compilation time)
2.296596 seconds (3.65 M allocations: 260.325 MiB, 14.38% gc time, 67.60% compilation time)
retcode: Success
Interpolation: 3rd order Hermite
t: 8775-element Vector{Float64}:
0.0
0.019333125036189135
0.09098129266634847
0.2073558192440938
0.45611905918185225
1.0472561699066012
2.034266647380669
3.451776427609829
6.733791989961038
12.450116263175316
⋮
400587.17244288063
410672.0368411475
421716.443324556
434008.4864986264
450151.06172503775
462974.2378146922
480604.5598697531
498234.88192481396
500000.0
u: 8775-element Vector{Vector{Float64}}:
[830.0, 830.0, 0.0026, 0.07192, 0.07831, 0.26081, 0.00977, 0.00188, 0.09243, 0.22156 … 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 150952.75035000002, 13838.37602, -68.79268]
[829.9999654017552, 829.9994975880237, 0.002598565958899963, 0.07192100954861869, 0.0783084540750169, 0.2608055799108062, 0.009769882842059355, 0.001879826176063952, 0.09242766669597557, 0.22156399388113623 … 0.12113000000933162, 0.12113000025734089, 0.1211300057338325, 0.12113010297093836, 0.12113142530654214, 0.12114821590793043, 0.121143876225781, 150952.7504077194, 13838.375711519522, -68.79732946230298]
[829.9998348635114, 829.9976422525888, 0.0025933105248854755, 0.07192476229550161, 0.07830250341047809, 0.26078941009444856, 0.009769459049748559, 0.0018789042446954408, 0.09241901973935228, 0.22157879451042628 … 0.12113003148419571, 0.12113019157425117, 0.1211310080003016, 0.12113449709234102, 0.12114659468704474, 0.12119534717224295, 0.12117935237210484, 150952.75062244057, 13838.374513299239, -68.81607005191516]
[829.9996133960518, 829.994650615981, 0.0025849478342343003, 0.07193089713739982, 0.07829207699960301, 0.26076387070239837, 0.009768805322611648, 0.0018766436939500898, 0.0924049756352414, 0.2216028323583001 … 0.12113087741239345, 0.12113274990086023, 0.1211377421114302, 0.12114946366929272, 0.1211735129279145, 0.12124561066298667, 0.12121643174100435, 150952.75097402377, 13838.372555328504, -68.84681913016406]
[829.9990964775621, 829.988344553044, 0.0025677078039993283, 0.07194417536046811, 0.0782666763083778, 0.26071223836757207, 0.009767542947102269, 0.0018699196276109342, 0.09237495783324366, 0.22165420751509649 … 0.12113852905071927, 0.121146799702154, 0.12116114282208083, 0.12118436554344811, 0.12121949726910079, 0.12131904071172774, 0.12126925045394375, 150952.75173733698, 13838.368384399799, -68.91207315641022]
[829.9976227532394, 829.9738229183572, 0.0025298083788575705, 0.0719766279718259, 0.07818995396102801, 0.2606050783338445, 0.009765228548992247, 0.0018505337735948656, 0.09230364341434424, 0.22177624782601593 … 0.12117136690641132, 0.12119087791259216, 0.12121719028561129, 0.1212516246654559, 0.1212953927432663, 0.1214343677642216, 0.12134948181642351, 150952.7536153353, 13838.35855929409, -69.06429957869561]
[829.9944193672545, 829.9509077882478, 0.002474807984255052, 0.072033638008222, 0.07801428142318334, 0.2604711491247151, 0.00976340307695454, 0.0018178174457210696, 0.09218462778413179, 0.2219798988931877 … 0.12122865031168673, 0.12125703401370141, 0.1212913694284102, 0.1213322850700112, 0.1213803350357127, 0.12156232336183946, 0.12143597118898398, 150952.75694915676, 13838.342403295292, -69.31024282857501]
[829.988353326151, 829.9205247588947, 0.002410689405003595, 0.07212165176212566, 0.07767036984052175, 0.260364872984163, 0.009765046552185823, 0.0017738156970858972, 0.09201383582103524, 0.22227216393618593 … 0.12129804817708402, 0.12133199175373688, 0.12137090293434043, 0.12141512691323042, 0.12146497038338351, 0.12168788172546924, 0.12152069323436775, 150952.7621562011, 13838.31972312405, -69.6463744385697]
[829.9689941847354, 829.8589858081657, 0.0023106557375668943, 0.07235305493823077, 0.07655353014019994, 0.2604150766477604, 0.009786689195736801, 0.0016855899200154505, 0.09161908334733312, 0.22294828820039625 … 0.12141764334924618, 0.12145589096484646, 0.12149798567106192, 0.12154409799298801, 0.12159439029040946, 0.12186357098200122, 0.12164901526001325, 150952.775988694, 13838.26949390594, -70.35063780004249]
[829.9235249884752, 829.7704141511887, 0.00222899504688523, 0.07284451721380114, 0.07399206775662617, 0.2610441779341529, 0.009873892897153878, 0.0015688569001333992, 0.0909342247513693, 0.22412560286423527 … 0.12157705626285502, 0.12161553145602244, 0.12165742958644533, 0.1217028608453571, 0.1217519421678341, 0.12200883559098283, 0.12180479776442218, 150952.805292636, 13838.188823477813, -71.35304497334121]
⋮
[51.35035762828243, 50.04435262025954, 0.11540775193510547, 0.1983491235594026, 0.00034393888565453307, 0.001231842361877744, 0.0016437181686256694, 0.0025443428535454463, 0.00165620307179359, 0.9997122890233476 … 0.1325185419371144, 0.13251828475246635, 0.13251801505030816, 0.13251773230471364, 0.13251743595582827, 0.1325221873134678, 0.13251712540708832, 151617.67215356563, 13261.110667479234, -69.79225167053117]
[51.6434398920348, 50.347466362692444, 0.11383518468011808, 0.19610710078262775, 0.00035046312433410917, 0.001248952388511064, 0.0016546381403699975, 0.002561242077210944, 0.001677523592794752, 0.9997066413958408 … 0.1319798426235454, 0.13197959675779386, 0.13197933898038608, 0.13197906879031987, 0.13197878565427307, 0.13198335765945945, 0.13197848900395406, 151662.98797525672, 13215.804925046245, -69.70312180949692]
[51.94960107757948, 50.663923054107215, 0.11222930295043672, 0.1937581090701312, 0.00035749364094608344, 0.0012672914658825153, 0.0016662609452579797, 0.002579229091468716, 0.0017003492498436955, 0.9997005534803244 … 0.13142530620154222, 0.13142507247941107, 0.13142482748183737, 0.13142457073404326, 0.13142430173062186, 0.13142867421034796, 0.13142401993302655, 151710.31081566476, 13168.49190323453, -69.6089131746115]
[52.272679440558626, 50.99767463343963, 0.11057337573344476, 0.19126955794886583, 0.0003651686944377742, 0.0012872064236731646, 0.0016787770030372517, 0.002598597671906995, 0.0017250963262109978, 0.9996939005837541 … 0.13084865816708247, 0.13084843724818412, 0.1308482057232104, 0.13084796314504835, 0.1308477090377403, 0.1308518700616758, 0.13084744289412012, 151760.2806879004, 13118.531647179909, -69.50817373093665]
[52.670007147822204, 51.40786423733116, 0.10858998141655284, 0.18819276316255043, 0.0003749937918051584, 0.00131253867077917, 0.0016945524394975451, 0.002623010194770705, 0.001756522353551539, 0.9996853749370718 … 0.1301513090357665, 0.13015110408631173, 0.13015088935378277, 0.13015066442519774, 0.13015042886093203, 0.13015431965674104, 0.13015018219253502, 151821.82646278208, 13056.99667292356, -69.38224811312382]
[52.96499421827767, 51.71221835892456, 0.10715391457357473, 0.18589488664406384, 0.00038258721463541284, 0.0013319964539846595, 0.0017065593056829085, 0.002641590635316285, 0.0017806193126605162, 0.99967877983969 … 0.129641742853096, 0.12964154991957605, 0.12964134781394235, 0.12964113614862596, 0.12964091451105494, 0.12964459748181076, 0.1296406824616046, 151867.62501813218, 13011.205430628643, -69.28717908308124]
[53.342535370529006, 52.101529747185594, 0.1053596348652756, 0.18293409021564944, 0.00039270980496877234, 0.0013577749540222663, 0.0017223261622836222, 0.002665989542097377, 0.0018124910486038161, 0.9996699797349619 … 0.1289993857724481, 0.128999208332132, 0.1289990224984571, 0.12899882791632866, 0.12899862420774372, 0.1290020343474723, 0.12899841096991338, 151926.42873137913, 12952.41023349393, -69.16334984784324]
[53.68969895555704, 52.45930821096362, 0.10375134702788089, 0.18018857979913805, 0.0004024511106289713, 0.0013824173214120861, 0.0017372505736557853, 0.0026890845193416053, 0.00184290284221071, 0.9996615022336891 … 0.12841809401114215, 0.12841793090933964, 0.1284177601271423, 0.12841758133926034, 0.12841739419941872, 0.12842054763459895, 0.12841719833863668, 151980.7498696428, 12898.096139985279, -69.04715408513664]
[53.7228534864071, 52.49346753551008, 0.10359963780734836, 0.17992503947216199, 0.0004034063940669663, 0.001384826394391491, 0.001738699352269962, 0.0026913263755975404, 0.0018458735227865617, 0.9996606716431387 … 0.1283629878941416, 0.12836282605798935, 0.12836265660763016, 0.1283624792206589, 0.1283622935538738, 0.12836542528210823, 0.12836209924157202, 151985.95509768065, 12892.891550033319, -69.03592818364274]
i = (sys.t / 1000, sys.vm)
plot(sol, idxs=i, title="Action potential", lab="Ctl", tspan=(198* 1000ms, 205* 1000ms))
plot!(sol_caf, idxs=i, lab="Caf", tspan=(198* 1000ms, 205* 1000ms), ylabel="Voltage (mV)", xlabel="Time (s)")
i = (sys.t / 1000, sys.Cai_sub_SR * 1000)
plot(sol, idxs=i, title="Calcium transient (During caffeine addition)", lab="Ctl", tspan=(198* 1000ms, 205* 1000ms))
plot!(sol_caf, idxs=i, tspan=(198* 1000ms, 205* 1000ms), lab="Caf", ylabel="Subspace calcium (nM)", xlabel="Time (s)")
i = (sys.t / 1000, sys.PO1RyR)
plot(sol, idxs=i, title="RyR open (During caffeine addition)", lab="Ctl", tspan=(198* 1000ms, 205* 1000ms))
plot!(sol_caf, idxs=i, tspan=(198* 1000ms, 205* 1000ms), lab="Caf", ylabel="Open probability", ylims=(0, 1), xlabel="Time (s)")
i = (sys.t / 1000, sys.Cai_sub_SR * 1000)
plot(sol, idxs=i, title="Calcium transient (After caffeine addition)", lab="Ctl", ylabel="Subspace calcium (nM)", tspan=(198* 1000ms, 205* 1000ms))
plot!(sol_caf, idxs=i, lab="Caf", xlabel="Time (s)", tspan=(198* 1000ms, 205* 1000ms))
i = (sys.t / 1000, sys.CaJSR)
plot(sol, idxs=i, title="SR Calcium (During caffeine addition)", lab="Ctl", ylabel="SR calcium (μM)", tspan=(198* 1000ms, 205* 1000ms))
plot!(sol_caf, idxs=i, tspan=(198* 1000ms, 205* 1000ms), lab="Caf", ylims=(0, 850), xlabel="Time (s)")
i = (sys.t / 1000, sys.Jrel)
plot(sol, idxs=sys.Jrel, title="Ca flux", lab="Ctl (Jrel)", tspan=(198* 1000ms, 205* 1000ms))
plot!(sol_caf, idxs=sys.Jrel, lab="Caf (Jrel)", tspan=(198* 1000ms, 205* 1000ms), ylabel="μM/ms", xlabel="Time (s)")
i = (sys.t / 1000, sys.CaMKAct * 100)
plot(sol, idxs=i, title="Active CaMKII", lab="Ctl")
plot!(sol_caf, idxs=i, lab="Caf", ylabel="CaMKII activity (%)", xlabel="Time (s)")
Caffeine and electrophysiology
- Add caffeine in the beginning of the simulation.
- Add caffeine and nifedipine in the beginning of the simulation (nifedipine blocks 90% of L-type calcium channel).
@mtkcompile sys = build_neonatal_ecc_sys()
tend = 205* 1000ms
stimstart = 30* 1000ms
stimend = 120* 1000ms
alg = KenCarp47()
@unpack Istim = sys
callback = build_stim_callbacks(Istim, stimend; period=1* 1000ms, starttime=stimstart)SciMLBase.CallbackSet{Tuple{}, Tuple{SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}, SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}}}((), (SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}(30000:1000:120000, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim)), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim), DiffEqCallbacks.PresetTimeFunction{StepRange{Int64, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}}(30000:1000:120000, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#15#17"{Float64, Float64, Symbolics.Num}(-80.0, 0.5, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ()), SciMLBase.DiscreteCallback{DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}, DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}, typeof(SciMLBase.FINALIZE_DEFAULT), Nothing, Tuple{}}(DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}(30000.5:1000.0:120000.5, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim)), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim), DiffEqCallbacks.PresetTimeFunction{StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}, Int64}, typeof(SciMLBase.INITIALIZE_DEFAULT), CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}}(30000.5:1000.0:120000.5, true, SciMLBase.INITIALIZE_DEFAULT, CaMKIIModel.var"#16#18"{Float64, Float64, Symbolics.Num}(0.0, 0.5, Istim)), SciMLBase.FINALIZE_DEFAULT, Bool[1, 1], nothing, ())))
prob = ODEProblem(sys, [], tend)
prob_caf = ODEProblem(sys, [sys.RyRsensitivity => 10], tend)
gCaL = prob.ps[sys.GCaL]
prob_nif_caf = ODEProblem(sys, [sys.RyRsensitivity => 10, sys.GCaL => 0.1 * gCaL], tend)ODEProblem with uType Vector{Float64} and tType Int64. In-place: true Initialization status: FULLY_DETERMINED Non-trivial mass matrix: false timespan: (0, 205000) u0: 75-element Vector{Float64}: 830.0 830.0 0.0026 0.07192 0.07831 0.26081 0.00977 0.00188 0.09243 0.22156 ⋮ 0.12113 0.12113 0.12113 0.12113 0.12113 0.12113 150952.75035000002 13838.37602 -68.79268
ssalg = DynamicSS(alg)
sprob_caf = SteadyStateProblem(prob_caf)
sssol = solve(sprob_caf, ssalg; abstol=1e-10, reltol=1e-10)
@time sol = solve(prob, alg; callback)
@time sol_caf = solve(remake(prob_caf, u0=sssol.u), alg; callback)
@time sol_nif_caf = solve(remake(prob_nif_caf, u0=sssol.u), alg; callback) 0.403478 seconds (102.47 k allocations: 14.016 MiB, 15.85% compilation time)
0.381286 seconds (141.83 k allocations: 16.395 MiB, 11.80% compilation time)
0.202758 seconds (20.06 k allocations: 6.065 MiB)
retcode: Success
Interpolation: 3rd order Hermite
t: 2780-element Vector{Float64}:
0.0
0.18425349204908287
0.9882055440931703
4.071300209939429
11.46900363127737
25.163391754727833
49.58670648890126
83.36471305617223
137.50492821590353
206.18532698897792
⋮
144181.39523015163
149368.97852564527
154556.56182113892
161066.57434647472
169004.00812550154
178027.60932908955
187359.8633948591
196692.11746062865
205000.0
u: 2780-element Vector{Vector{Float64}}:
[57.618777388454895, 56.49644192239733, 0.08793893392655225, 0.14609625273663496, 0.0005608497572583467, 0.0017638178923786922, 0.001952324284451103, 0.003021867942239143, 0.0023071179389667178, 0.9995225713580512 … 0.12238816920442885, 0.12238816850764403, 0.12238816777947442, 0.12238816701857597, 0.1223881662235179, 0.12238818047047396, 0.12238816539277567, 152639.94664399358, 12238.9437256598, -67.47396690550634]
[57.61877740333747, 56.496441937652634, 0.08793893387384906, 0.14609625469037302, 0.0005608493532994162, 0.0017638182634618796, 0.001952324114028786, 0.0030217324002461024, 0.0023071178455987664, 0.9995225713632945 … 0.12238816918326383, 0.12238816848647958, 0.12238816775831056, 0.12238816699741271, 0.1223881662023553, 0.12237616110918408, 0.12238816537161376, 152639.94664688862, 12238.943722843722, -67.47634749782318]
[57.61877746827438, 56.49644200421583, 0.08793893364389005, 0.14609631202759302, 0.00056083842531514, 0.0017638282091560107, 0.0019523063977754244, 0.0030198548493300336, 0.0023071152165322238, 0.9995225715257664 … 0.12238816909092051, 0.12238816839413594, 0.12238816766596805, 0.12238816690507223, 0.12238816611001732, 0.12235418019259257, 0.12238816527927861, 152639.94666177314, 12238.9437136449, -67.48660532028133]
[57.618777717341146, 56.49644225945827, 0.08793893276944181, 0.14609724451292794, 0.0005606761240643642, 0.001763973854140499, 0.00195188554835715, 0.0030114560521248964, 0.002307072914098849, 0.9995225741733282 … 0.12238816434326313, 0.12238816515283107, 0.12238816542699336, 0.12238816531053094, 0.12238816489870563, 0.12231030123174053, 0.12238816424781547, 152639.94675301973, 12238.943745664994, -67.52401964678774]
[57.61877620081261, 56.49644310744856, 0.08793799588573543, 0.14610370785432641, 0.0005597589794945528, 0.0017647644444420524, 0.001949034074709481, 0.0029937441080779715, 0.0023067836133336367, 0.9995225923330359 … 0.12238601235600448, 0.12238625655225205, 0.12238644892663932, 0.12238659202466935, 0.12238668744022282, 0.12223941379842311, 0.12238673577400197, 152639.94717546157, 12238.944264393487, -67.60292744527437]
[57.618678848720506, 56.49647133800722, 0.08790311308489594, 0.14612871991915985, 0.0005573132983761139, 0.0017666522528192704, 0.0019399371956283623, 0.0029686898276710537, 0.002305687487944075, 0.9995226613348113 … 0.12235984506586896, 0.12236092476421824, 0.12236179577672834, 0.12236245530999346, 0.1223628994558248, 0.12213233967443225, 0.12236312310464144, 152639.9485819224, 12238.946611454543, -67.71513526367445]
[57.617922639495525, 56.496887305702955, 0.08768669813238218, 0.1462022438765348, 0.0005533431870750632, 0.001768731874351446, 0.0019217031042405154, 0.0029416337294481056, 0.002302558982949415, 0.9995228598477616 … 0.12225906634652653, 0.12226084333589658, 0.12226225987146769, 0.12226330604375522, 0.1222639709442543, 0.12196533965540476, 0.12226424258483765, 152639.95246591794, 12238.95375510015, -67.83705291108576]
[57.61637165104209, 56.49863060070004, 0.0872229136334266, 0.1463363480725024, 0.0005498662810307825, 0.001768360688259101, 0.001903568224353119, 0.002924472334438665, 0.0022970387267103685, 0.9995232165417219 … 0.12207192404915698, 0.12207377811184357, 0.12207519649096284, 0.1220761656693964, 0.12207667117042414, 0.12175533190103574, 0.12207669747921929, 152639.9593860722, 12238.96652572896, -67.91477834585092]
[57.6152935693644, 56.50425641333213, 0.08638564264342871, 0.1465796710452761, 0.0005466777415151073, 0.0017641266469406282, 0.0018905542505776396, 0.0029146198109186983, 0.0022874146260824873, 0.9995238612620077 … 0.12174570438831185, 0.12174709334931855, 0.12174801848829155, 0.12174846474791351, 0.12174841611203917, 0.1214404404322544, 0.12174785552678653, 152639.9718974481, 12238.98817904568, -67.9596718937026]
[57.6183675849662, 56.515999221746625, 0.08533788302524507, 0.14690182858038858, 0.0005436577969599425, 0.0017572312334396265, 0.0018848556557308626, 0.0029090189408789687, 0.0022753028081561348, 0.9995247197921024 … 0.12133823511590476, 0.12133887954724662, 0.12133905632895413, 0.12133874991465882, 0.12133794378236806, 0.12106210899295555, 0.12133662035412547, 152639.98859269003, 12239.013597497958, -67.98548412830179]
⋮
[62.652573045605266, 61.646171958384635, 0.07224454834331336, 0.15847385742655354, 0.0004936479815544933, 0.001606262283470731, 0.0018663816076682628, 0.0028888395760127785, 0.0021163700003030616, 0.9989428072816653 … 0.11569574858502678, 0.11569574195593747, 0.11569573525040072, 0.1156957284617803, 0.11569572158295599, 0.11569598071491531, 0.11569571460628214, 152693.20692832794, 12185.542686077613, -68.08133078557987]
[62.652026053739874, 61.645497932351745, 0.07225823163212733, 0.15848429880312256, 0.00049357276549257, 0.0016062007594112434, 0.0018662891886993692, 0.0028886876271675883, 0.0021161867256119958, 0.9994207212230524 … 0.11570167396211267, 0.11570167792047077, 0.11570168200664581, 0.11570168622380085, 0.11570169057518881, 0.11570159328054563, 0.11570169506415774, 152692.88964452266, 12185.859357540194, -68.08199155051913]
[62.650571390509526, 61.644004408323845, 0.07226371295440556, 0.1584996327445595, 0.0004935092013158956, 0.0016059398591847754, 0.0018661851862416103, 0.00288853677748981, 0.0021159467509962817, 0.9995408847038849 … 0.1157040690997419, 0.11570407295085863, 0.11570407700540308, 0.1157040812721107, 0.11570408576029917, 0.11570402209171622, 0.11570409047991685, 152692.5794051068, 12186.16961162689, -68.08274146099022]
[62.64725169044916, 61.640611758894046, 0.07227308389144373, 0.15851676544308105, 0.0004934070392277976, 0.0016056614763505657, 0.0018660706763621976, 0.0028883604230413714, 0.002115692401091527, 0.9995739077751089 … 0.11570831518315262, 0.11570831952271897, 0.1157083240458691, 0.11570832876055391, 0.11570833367523754, 0.11570823874696001, 0.11570833879893964, 152692.19978695372, 12186.549279787254, -68.08356930926975]
[62.64357777180478, 61.636865645289625, 0.07228264570402333, 0.158538732899126, 0.0004933160284007041, 0.0016054706712633018, 0.0018659303887693546, 0.0028881405514758593, 0.0021153915001962766, 0.9995804494949742 … 0.11571259763548829, 0.11571260151387738, 0.11571260557307288, 0.11571260982083162, 0.11571261426541268, 0.11571253794393295, 0.11571261891561871, 152691.75031274336, 12186.998878132012, -68.08459222495891]
[62.63935369975769, 61.63255468963983, 0.07229430277537911, 0.1585621747716218, 0.0004932531455123794, 0.0016051987378701302, 0.0018657789600968128, 0.002887912506723134, 0.0021150685069392214, 0.9995813979272802 … 0.1157176209122203, 0.11571762485176564, 0.11571762896133128, 0.11571763324830073, 0.11571763772054025, 0.11571755339895218, 0.11571764238643832, 152691.2590197215, 12187.490290484182, -68.08568810833474]
[62.63538993988801, 61.62850209298028, 0.07230519863015906, 0.1585853894819076, 0.0004931055597387262, 0.0016049718240104393, 0.001865631394566626, 0.002887676403196989, 0.002114744611765609, 0.9995816509387273 … 0.11572290385089412, 0.11572290836469049, 0.11572291304205835, 0.11572291789019275, 0.11572292291675317, 0.11572281050672811, 0.11572292812990155, 152690.77037774093, 12187.978994630002, -68.08676043202512]
[62.631397196703354, 61.62443799411353, 0.07231461568720514, 0.15860772507669016, 0.000492977389810494, 0.0016046603015617905, 0.0018654810507465036, 0.002887445736046455, 0.0021144115514490887, 0.999581609813376 … 0.11572721782012226, 0.11572722147481317, 0.11572722528537199, 0.1157272292585563, 0.1157272334015592, 0.11572715394258852, 0.11572723772204498, 152690.30174582274, 12188.44778457397, -68.08783649044501]
[62.62807363842393, 61.62104717582852, 0.07232337778004111, 0.15862690685627776, 0.0004928828936758953, 0.0016044338678553882, 0.001865357080040347, 0.0028872544708061104, 0.002114138526294777, 0.9995817067155186 … 0.11573121099327205, 0.11573121442581198, 0.11573121800939021, 0.11573122175045313, 0.11573122565586122, 0.11573115377610446, 0.11573122973292282, 152689.9007672646, 12188.848851665687, -68.08873136379842]
i = (sys.t / 1000, sys.vm)
tspan = (100* 1000ms, 102* 1000ms)
plot(sol, idxs=i, title="Action potential", lab="Ctl"; tspan)
plot!(sol_caf, idxs=i, lab="Caf"; tspan)
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", tspan=tspan, ylabel="Voltage (mV)", xlabel="Time (s)")
savefig("caf-ap.pdf")"/home/github/actions-runner-1/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/caf-ap.pdf"
i = (sys.t / 1000, sys.Cai_sub_SR * 1000)
tspan = (100* 1000ms, 102* 1000ms)
plot(sol, idxs=i, title="Calcium transient", lab="Ctl"; tspan)
plot!(sol_caf, idxs=i, lab="Caf"; tspan)
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", ylabel="Subspace calcium (nM)", xlabel="Time (s)"; tspan)
savefig("caf-cat.pdf")"/home/github/actions-runner-1/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/caf-cat.pdf"
i = (sys.t / 1000, sys.CaJSR)
tspan = (100* 1000ms, 102* 1000ms)
plot(sol, idxs=i, title="SR Calcium", lab="Ctl", ylabel="SR calcium (μM)"; tspan)
plot!(sol_caf, idxs=i, lab="Caf"; tspan)
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", ylims=(0, 850), xlabel="Time (s)"; tspan)
CaMKII activities
Simulations
i = (sys.t / 1000, sys.CaMKAct * 100)
plot(sol, idxs=i, title="Simulation", lab="Ctl")
plot!(sol_caf, idxs=i, lab="Caf")
plot!(sol_nif_caf, idxs=i, lab="Caf + Nif", ylabel="CaMKII active fraction (%)", xlabel="Time (s)")
savefig("caf-camkact.pdf")"/home/github/actions-runner-1/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/caf-camkact.pdf"
Experiments
chemicaldf = CSV.read(joinpath(@__DIR__, "data/CaMKAR-chemical.csv"), DataFrame)
ts = Dates.value.(chemicaldf[!, "Time"]) ./ 10^9
ctl = chemicaldf[!, "Ctrl Mean"]
ctl_error = chemicaldf[!, "Ctrl SD"] ./ sqrt.(chemicaldf[!, "Ctrl N"])
caf = chemicaldf[!, "caffeine 20mM Mean"]
caf_error = chemicaldf[!, "caffeine 20mM SD"] ./ sqrt.(chemicaldf[!, "caffeine 20mM N"])
plot(ts, ctl, yerr=ctl_error, lab="Control", color=:blue, markerstrokecolor=:blue)
plot!(ts, caf, yerr=caf_error, lab="Caffeine 20mM", color=:red, markerstrokecolor=:red)
plot!(xlabel="Time (s)", ylabel="CaMKII activity (A.U.)", title= "Experiment")
savefig("caf-exp.pdf")"/home/github/actions-runner-1/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/docs/caf-exp.pdf"
Runtime information
using InteractiveUtils
InteractiveUtils.versioninfo()Julia Version 1.10.10
Commit 95f30e51f41 (2025-06-27 09:51 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 32 × Intel(R) Core(TM) i9-14900K
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, goldmont)
Threads: 2 default, 0 interactive, 1 GC (on 32 virtual cores)
Environment:
JULIA_CONDAPKG_OFFLINE = true
LD_LIBRARY_PATH = /home/github/actions-runner-1/_work/_tool/Python/3.14.3/x64/lib
JULIA_PROJECT = /home/github/actions-runner-1/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/Project.toml
JULIA_CONDAPKG_BACKEND = Null
JULIA_NUM_THREADS = 2
JULIA_CI = true
JULIA_DEPOT_PATH = /home/github/.julia:/home/github/actions-runner-1/_work/_tool/julia/1.10.10/x64/local/share/julia:/home/github/actions-runner-1/_work/_tool/julia/1.10.10/x64/share/julia
JULIA_LOAD_PATH = @:@v#.#:@stdlib
using Pkg
Pkg.status()Project CaMKIIModel v0.7.0
Status `~/actions-runner-1/_work/camkii-cardiomyocyte-model/camkii-cardiomyocyte-model/Project.toml`
[336ed68f] CSV v0.10.16
⌃ [5a033b19] CurveFit v1.4.0
[a93c6f00] DataFrames v1.8.1
[459566f4] DiffEqCallbacks v4.12.0
[f6369f11] ForwardDiff v1.3.2
[682c06a0] JSON v1.4.0
[23fbe1c1] Latexify v0.16.10
[98b081ad] Literate v2.21.0
[2fda8390] LsqFit v0.15.1
[1862ce21] MarkdownTables v1.1.0
[961ee093] ModelingToolkit v11.11.0
[77ba4419] NaNMath v1.1.3
[1dea7af3] OrdinaryDiffEq v6.108.0
[91a5bcdd] Plots v1.41.6
[0d7ed370] StaticArrayInterface v1.9.0
[2913bbd2] StatsBase v0.34.10
[9672c7b4] SteadyStateDiffEq v2.9.0
[bd369af6] Tables v1.12.1
[ea8e919c] SHA v0.7.0
Info Packages marked with ⌃ have new versions available and may be upgradable.
This notebook was generated using Literate.jl.