CaMKII system simplification and sensitivity analysis

using ModelingToolkit
using OrdinaryDiffEq, SteadyStateDiffEq, DiffEqCallbacks
using Plots
using LsqFit
using CaMKIIModel
using CaMKIIModel: μM, hil, second, Hz
Plots.default(lw=1.5)
[ Info: Precompiling GRIJuliaExt [84369c5d-ffb2-5a92-8288-3470980d96d0] 



SYSTEM: caught exception of type :MethodError while trying to print a failed Task notice; giving up

[ Info: Precompiling IJuliaExt [2f4121a4-3b3a-5ce6-9c5e-1f2673ce168a] 



SYSTEM: caught exception of type :MethodError while trying to print a failed Task notice; giving up

CaMKII sensitivity to calcium

Modeling CaM-Cax binding to CaMKII only. No phosphorylation or oxidation reactions.

@parameters Ca = 0μM ROS = 0μM
sys = get_camkii_sys(; Ca, ROS, simplify=true)

\[ \begin{align} \frac{\mathrm{d} \mathtt{CaMKOX}\left( t \right)}{\mathrm{d}t} &= \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) - \mathtt{k\_OX\_B} \mathtt{CaMKOX}\left( t \right) + \mathtt{k\_dephospho} \mathtt{CaMKPOX}\left( t \right) - \mathtt{kCaM4\_on} \mathtt{CaMKOX}\left( t \right) \mathtt{Ca4CaM}\left( t \right) \\ \frac{\mathrm{d} \mathtt{CaMKPOX}\left( t \right)}{\mathrm{d}t} &= \mathtt{kCaM4P\_off} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) - \mathtt{k\_OXP\_P} \mathtt{CaMKPOX}\left( t \right) - \mathtt{k\_dephospho} \mathtt{CaMKPOX}\left( t \right) \\ \frac{\mathrm{d} \mathtt{CaMKP2}\left( t \right)}{\mathrm{d}t} &= \mathtt{k\_P1\_P2} \mathtt{CaMKP}\left( t \right) - \mathtt{k\_P2\_P1} \mathtt{CaMKP2}\left( t \right) \\ \frac{\mathrm{d} \mathtt{CaMKP}\left( t \right)}{\mathrm{d}t} &= \mathtt{kCaM0P\_off} \mathtt{CaM0\_CaMKP}\left( t \right) + \mathtt{kCaM2CP\_off} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) + \mathtt{kCaM2NP\_off} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) + \mathtt{kCaM4P\_off} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{k\_OXP\_P} \mathtt{CaMKPOX}\left( t \right) - \mathtt{k\_P1\_P2} \mathtt{CaMKP}\left( t \right) + \mathtt{k\_P2\_P1} \mathtt{CaMKP2}\left( t \right) - \mathtt{k\_dephospho} \mathtt{CaMKP}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right)}{\mathrm{d}t} &= - \mathtt{kCaM4P\_off} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) - \mathtt{k\_OXP\_P} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) - \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) + \mathtt{ROS} \mathtt{k\_P\_OXP} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{k\_phosCaM} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca4CaM\_CaMKOX}\left( t \right)}{\mathrm{d}t} &= - \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) - \mathtt{k\_OX\_B} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) + \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) + \mathtt{ROS} \mathtt{k\_B\_OX} \mathtt{Ca4CaM\_CaMK}\left( t \right) + \mathtt{kCaM4\_on} \mathtt{CaMKOX}\left( t \right) \mathtt{Ca4CaM}\left( t \right) - \mathtt{k\_phosCaM} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca4CaM\_CaMKP}\left( t \right)}{\mathrm{d}t} &= \frac{\mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} - \mathtt{kCaM4P\_off} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{k\_OXP\_P} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) - \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKP}\left( t \right) - \mathtt{ROS} \mathtt{k\_P\_OXP} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{k\_K2C\_off} \mathtt{Ca4CaM\_CaMKP}\left( t \right) \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) + \mathtt{k\_K2N\_off} \mathtt{Ca4CaM\_CaMKP}\left( t \right) \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) + \mathtt{k\_phosCaM} \mathtt{Ca4CaM\_CaMK}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{CaM0\_CaMKP}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} - \mathtt{kCaM2NP\_off} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) - \mathtt{k\_dephospho} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) + \mathtt{k\_K2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) \mathtt{Ca4CaM\_CaMKP}\left( t \right) - \mathtt{k\_K2N\_off} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) + \mathtt{k\_phosCaM} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right)}{\mathrm{d}t} &= \frac{\mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{CaM0\_CaMKP}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} + \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} - \mathtt{kCaM2CP\_off} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) - \mathtt{k\_dephospho} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) + \mathtt{k\_K2C\_off} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) + \mathtt{k\_K2N\_off} \mathtt{Ca4CaM\_CaMKP}\left( t \right) \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) + \mathtt{k\_phosCaM} \mathtt{CaMKAct}\left( t \right) \mathtt{Ca2CaM\_C\_CaMK}\left( t \right) \\ \frac{\mathrm{d} \mathtt{CaM0\_CaMKP}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{CaM0\_CaMKP}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} + \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{CaM0\_CaMKP}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} - \mathtt{kCaM0P\_off} \mathtt{CaM0\_CaMKP}\left( t \right) + \mathtt{k\_K2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) + \mathtt{k\_K2N\_off} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) \\ \frac{\mathrm{d} \mathtt{Ca4CaM\_CaMK}\left( t \right)}{\mathrm{d}t} &= \frac{\mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{Ca2CaM\_C\_CaMK}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} - \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMK}\left( t \right) + \mathtt{k\_OX\_B} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) + \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKP}\left( t \right) - \mathtt{ROS} \mathtt{k\_B\_OX} \mathtt{Ca4CaM\_CaMK}\left( t \right) + \mathtt{kCaM4\_on} \mathtt{CaMK}\left( t \right) \mathtt{Ca4CaM}\left( t \right) + \mathtt{k\_K2C\_off} \mathtt{Ca4CaM\_CaMK}\left( t \right) \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) + \mathtt{k\_K2N\_off} \mathtt{Ca4CaM\_CaMK}\left( t \right) \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) - \mathtt{k\_phosCaM} \mathtt{Ca4CaM\_CaMK}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{CaM0\_CaMK}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} - \mathtt{kCaM2N\_off} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right) + \mathtt{k\_dephospho} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) + \mathtt{kCaM2N\_on} \mathtt{CaMK}\left( t \right) \mathtt{Ca2CaM\_N}\left( t \right) + \mathtt{k\_K2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) \mathtt{Ca4CaM\_CaMK}\left( t \right) + \mathtt{k\_K2N\_off} \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) \mathtt{Ca2CaM\_N\_CaMK}\left( t \right) - \mathtt{k\_phosCaM} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca2CaM\_C\_CaMK}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{Ca2CaM\_C\_CaMK}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{CaM0\_CaMK}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} - \mathtt{kCaM2C\_off} \mathtt{Ca2CaM\_C\_CaMK}\left( t \right) + \mathtt{k\_dephospho} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) + \mathtt{kCaM2C\_on} \mathtt{Ca2CaM\_C}\left( t \right) \mathtt{CaMK}\left( t \right) + \mathtt{k\_K2C\_off} \left( -1 + \frac{\mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) \mathtt{Ca2CaM\_C\_CaMK}\left( t \right) + \mathtt{k\_K2N\_off} \mathtt{Ca4CaM\_CaMK}\left( t \right) \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) - \mathtt{k\_phosCaM} \mathtt{CaMKAct}\left( t \right) \mathtt{Ca2CaM\_C\_CaMK}\left( t \right) \\ \frac{\mathrm{d} \mathtt{CaM0\_CaMK}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1C\_on} \mathtt{k\_K2C\_on} \mathtt{CaM0\_CaMK}\left( t \right)}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} + \frac{ - \mathtt{Ca}^{2} \mathtt{k\_K1N\_on} \mathtt{k\_K2N\_on} \mathtt{CaM0\_CaMK}\left( t \right)}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} - \mathtt{kCaM0\_off} \mathtt{CaM0\_CaMK}\left( t \right) + \mathtt{kCaM0\_on} \mathtt{CaM0}\left( t \right) \mathtt{CaMK}\left( t \right) + \mathtt{k\_K2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2C\_on}}{\mathtt{k\_K1C\_off} + \mathtt{Ca} \mathtt{k\_K2C\_on}} \right) \mathtt{Ca2CaM\_C\_CaMK}\left( t \right) + \mathtt{k\_K2N\_off} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right) \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_K2N\_on}}{\mathtt{k\_K1N\_off} + \mathtt{Ca} \mathtt{k\_K2N\_on}} \right) \\ \frac{\mathrm{d} \mathtt{Ca4CaM}\left( t \right)}{\mathrm{d}t} &= \frac{\mathtt{Ca}^{2} \mathtt{k\_1C\_on} \mathtt{k\_2C\_on} \mathtt{Ca2CaM\_N}\left( t \right)}{\mathtt{k\_1C\_off} + \mathtt{Ca} \mathtt{k\_2C\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_1N\_on} \mathtt{k\_2N\_on} \mathtt{Ca2CaM\_C}\left( t \right)}{\mathtt{k\_1N\_off} + \mathtt{Ca} \mathtt{k\_2N\_on}} + \mathtt{kCaM4P\_off} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) + \mathtt{kCaM4P\_off} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) + \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMK}\left( t \right) - \mathtt{kCaM4\_on} \mathtt{CaMKOX}\left( t \right) \mathtt{Ca4CaM}\left( t \right) - \mathtt{kCaM4\_on} \mathtt{CaMK}\left( t \right) \mathtt{Ca4CaM}\left( t \right) - \mathtt{k\_2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_2C\_on}}{\mathtt{k\_1C\_off} + \mathtt{Ca} \mathtt{k\_2C\_on}} \right) \mathtt{Ca4CaM}\left( t \right) - \mathtt{k\_2N\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_2N\_on}}{\mathtt{k\_1N\_off} + \mathtt{Ca} \mathtt{k\_2N\_on}} \right) \mathtt{Ca4CaM}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca2CaM\_N}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_1C\_on} \mathtt{k\_2C\_on} \mathtt{Ca2CaM\_N}\left( t \right)}{\mathtt{k\_1C\_off} + \mathtt{Ca} \mathtt{k\_2C\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_1N\_on} \mathtt{k\_2N\_on} \mathtt{CaM0}\left( t \right)}{\mathtt{k\_1N\_off} + \mathtt{Ca} \mathtt{k\_2N\_on}} + \mathtt{kCaM2NP\_off} \mathtt{Ca2CaM\_N\_CaMKP}\left( t \right) + \mathtt{kCaM2N\_off} \mathtt{Ca2CaM\_N\_CaMK}\left( t \right) - \mathtt{kCaM2N\_on} \mathtt{CaMK}\left( t \right) \mathtt{Ca2CaM\_N}\left( t \right) + \mathtt{k\_2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_2C\_on}}{\mathtt{k\_1C\_off} + \mathtt{Ca} \mathtt{k\_2C\_on}} \right) \mathtt{Ca4CaM}\left( t \right) - \mathtt{k\_2N\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_2N\_on}}{\mathtt{k\_1N\_off} + \mathtt{Ca} \mathtt{k\_2N\_on}} \right) \mathtt{Ca2CaM\_N}\left( t \right) \\ \frac{\mathrm{d} \mathtt{Ca2CaM\_C}\left( t \right)}{\mathrm{d}t} &= \frac{ - \mathtt{Ca}^{2} \mathtt{k\_1N\_on} \mathtt{k\_2N\_on} \mathtt{Ca2CaM\_C}\left( t \right)}{\mathtt{k\_1N\_off} + \mathtt{Ca} \mathtt{k\_2N\_on}} + \frac{\mathtt{Ca}^{2} \mathtt{k\_1C\_on} \mathtt{k\_2C\_on} \mathtt{CaM0}\left( t \right)}{\mathtt{k\_1C\_off} + \mathtt{Ca} \mathtt{k\_2C\_on}} + \mathtt{kCaM2CP\_off} \mathtt{Ca2CaM\_C\_CaMKP}\left( t \right) + \mathtt{kCaM2C\_off} \mathtt{Ca2CaM\_C\_CaMK}\left( t \right) - \mathtt{kCaM2C\_on} \mathtt{Ca2CaM\_C}\left( t \right) \mathtt{CaMK}\left( t \right) - \mathtt{k\_2C\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_2C\_on}}{\mathtt{k\_1C\_off} + \mathtt{Ca} \mathtt{k\_2C\_on}} \right) \mathtt{Ca2CaM\_C}\left( t \right) + \mathtt{k\_2N\_off} \left( 1 + \frac{ - \mathtt{Ca} \mathtt{k\_2N\_on}}{\mathtt{k\_1N\_off} + \mathtt{Ca} \mathtt{k\_2N\_on}} \right) \mathtt{Ca4CaM}\left( t \right) \end{align} \]

prob = SteadyStateProblem(sys, [sys.k_phosCaM => 0])
SteadyStateProblem with uType Vector{Float64}. In-place: true
u0: 17-element Vector{Float64}:
 0.0
 0.0
 0.83143
 3.3
 0.0
 0.0
 0.01581
 0.010750000000000001
 1.01
 0.62372
 0.00666
 0.0166
 0.39868000000000003
 1.0
 2.0e-5
 0.008577999999999999
 0.08433

Physiological cytosolic calcium concentrations ranges from 30nM to 10μM.

ca = exp10.(range(log10(0.03μM), log10(10μM), 1001))
prob_func = (prob, i, repeat) -> begin
    remake(prob, p=[Ca => ca[i]])
end
trajectories = length(ca)
alg = DynamicSS(FBDF())
sol0 = solve(prob, alg; abstol=1e-10, reltol=1e-10) ## warmup
@time sim = solve(EnsembleProblem(prob; prob_func, safetycopy=false), alg; trajectories, abstol=1e-10, reltol=1e-10)
 18.976799 seconds (199.84 M allocations: 6.976 GiB, 12.72% gc time, 51.66% compilation time: 1% of which was recompilation)
EnsembleSolution Solution of length 1001 with uType:
SciMLBase.NonlinearSolution{Float64, 1, Vector{Float64}, Vector{Float64}, SteadyStateProblem{Vector{Float64}, true, MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x50104df4, 0x85eb0aa2, 0xeba29942, 0x667cb096, 0x4b21fcf2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x98503d20, 0x8327d813, 0x43b294fe, 0xa987ded2, 0x3b7a07ec), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}}, DynamicSS{FBDF{5, 0, ADTypes.AutoForwardDiff{nothing, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, NLNewton{Rational{Int64}, Rational{Int64}, Rational{Int64}, Nothing}, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Val{:forward}(), true, nothing, Nothing, Nothing, typeof(OrdinaryDiffEqCore.trivial_limiter!)}, Float64}, ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, Nothing, ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, ODEFunction{true, true, ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x50104df4, 0x85eb0aa2, 0xeba29942, 0x667cb096, 0x4b21fcf2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x98503d20, 0x8327d813, 0x43b294fe, 0xa987ded2, 0x3b7a07ec), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardODEProblem}, FBDF{5, 0, ADTypes.AutoForwardDiff{nothing, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, NLNewton{Rational{Int64}, Rational{Int64}, Rational{Int64}, Nothing}, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Val{:forward}(), true, nothing, Nothing, Nothing, typeof(OrdinaryDiffEqCore.trivial_limiter!)}, OrdinaryDiffEqCore.InterpolationData{ODEFunction{true, true, ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x50104df4, 0x85eb0aa2, 0xeba29942, 0x667cb096, 0x4b21fcf2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x98503d20, 0x8327d813, 0x43b294fe, 0xa987ded2, 0x3b7a07ec), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, Nothing, OrdinaryDiffEqBDF.FBDFCache{5, OrdinaryDiffEqNonlinearSolve.NLSolver{NLNewton{Rational{Int64}, Rational{Int64}, Rational{Int64}, Nothing}, true, Vector{Float64}, Float64, Nothing, Float64, OrdinaryDiffEqNonlinearSolve.NLNewtonCache{Vector{Float64}, Float64, Float64, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, SciMLBase.UJacobianWrapper{true, ODEFunction{true, true, ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x50104df4, 0x85eb0aa2, 0xeba29942, 0x667cb096, 0x4b21fcf2), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x98503d20, 0x8327d813, 0x43b294fe, 0xa987ded2, 0x3b7a07ec), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, SciMLBase.OverrideInitData{NonlinearProblem{Nothing, true, MTKParameters{Vector{Float64}, StaticArraysCore.SVector{0, Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9e75ff5c, 0x569e6946, 0xdf99c4d0, 0x991dfbdf, 0xc9726560), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x2d711344, 0x7a9ccb96, 0xfcb0d583, 0x804a5d5b, 0x2c777abf), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{System}, Nothing, System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Nothing, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem, Nothing, Nothing}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#973"{Tuple{ComposedFunction{ModelingToolkit.PConstructorApplicator{typeof(identity)}, ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xc7592625, 0x93b4cc42, 0x8e49fa09, 0xeb70d667, 0x7a9385ab), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0xba7c6839, 0x4ae1ec31, 0xa3dc40c1, 0x6a149f1d, 0xc3a938aa), Nothing}}}}, Returns{StaticArraysCore.SVector{0, Float64}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), ModelingToolkit.ObservedWrapper{true, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9da934f5, 0xde419185, 0x1c689c96, 0xdb85219a, 0xd2ebbc7c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0466ff4b, 0x18eddd04, 0x44549885, 0xd768fa8d, 0x13589431), Nothing}}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, Float64, MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}}, Tuple{DifferentiationInterfaceForwardDiffExt.ForwardDiffTwoArgJacobianPrep{Nothing, ForwardDiff.JacobianConfig{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9}}}}, Tuple{}}, DifferentiationInterfaceForwardDiffExt.ForwardDiffTwoArgJacobianPrep{Nothing, ForwardDiff.JacobianConfig{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9, Tuple{Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9}}}}, Tuple{}}}, LinearSolve.LinearCache{Matrix{Float64}, Vector{Float64}, Vector{Float64}, SciMLBase.NullParameters, LinearSolve.DefaultLinearSolver, LinearSolve.DefaultLinearSolverInit{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, LinearAlgebra.QRCompactWY{Float64, Matrix{Float64}, Matrix{Float64}}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Vector{Int64}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Vector{Int64}}, Nothing, Nothing, Nothing, LinearAlgebra.SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}, LinearAlgebra.Cholesky{Float64, Matrix{Float64}}, LinearAlgebra.Cholesky{Float64, Matrix{Float64}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int32}}, Base.RefValue{Int32}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Base.RefValue{Int64}}, LinearAlgebra.QRPivoted{Float64, Matrix{Float64}, Vector{Float64}, Vector{Int64}}, Nothing, Nothing, Nothing, Nothing, Nothing}, LinearSolve.InvPreconditioner{LinearAlgebra.Diagonal{Float64, Vector{Float64}}}, LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Float64, LinearSolve.LinearVerbosity{SciMLLogging.Silent, SciMLLogging.Silent, SciMLLogging.Silent, SciMLLogging.Silent, SciMLLogging.CustomLevel, SciMLLogging.Silent, SciMLLogging.InfoLevel, SciMLLogging.Silent, SciMLLogging.WarnLevel, SciMLLogging.WarnLevel, SciMLLogging.Silent, SciMLLogging.Silent, SciMLLogging.Silent, SciMLLogging.WarnLevel, SciMLLogging.WarnLevel, SciMLLogging.WarnLevel}, Bool, LinearSolve.LinearSolveAdjoint{Missing}}}, Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Matrix{Float64}, StaticArraysCore.SMatrix{5, 6, Rational{Int64}, 30}, Float64, Vector{Float64}, Vector{Float64}, typeof(OrdinaryDiffEqCore.trivial_limiter!)}, Nothing}, SciMLBase.DEStats, Nothing, Nothing, Nothing, Nothing}, Nothing, Nothing, Nothing}
"""Extract values from ensemble simulations by a symbol"""
extract(sim, k) = map(s -> s[k], sim)
"""Calculate Root Mean Square Error (RMSE)"""
rmse(fit) = sqrt(sum(abs2, fit.resid) / length(fit.resid))
rmse

Status of the CaMKII system across a range of calcium concentrations.

xopts = (xlabel="Ca (μM)", xscale=:log10, minorgrid=true, xlims=(ca[1], ca[end]))
plot(ca, extract(sim, sys.CaM0), lab="CaM0", ylabel="Conc. (μM)"; xopts...)
plot!(ca, extract(sim, sys.Ca2CaM_C), lab="Ca2CaM_C")
plot!(ca, extract(sim, sys.Ca2CaM_N), lab="Ca2CaM_N")
plot!(ca, extract(sim, sys.Ca4CaM), lab="Ca4CaM")
plot!(ca, extract(sim, sys.CaMK), lab="CaMK")
plot!(ca, extract(sim, sys.CaM0_CaMK), lab="CaM0_CaMK")
plot!(ca, extract(sim, sys.Ca2CaM_C_CaMK), lab="Ca2CaM_C_CaMK")
plot!(ca, extract(sim, sys.Ca2CaM_N_CaMK), lab="Ca2CaM_N_CaMK")
plot!(ca, extract(sim, sys.Ca4CaM_CaMK), lab="Ca4CaM_CaMK", legend=:topleft)

Active CaMKII is defined as CaMKII bound to CaM except CaM0 (apo CaM)

CaMKAct = 1 - (sys.CaMK + sys.CaM0_CaMK) / sys.CAMKII_T
println("Basal activity with 30nM Ca is ", sol0[CaMKAct][end])
xdata = ca
ydata = extract(sim, CaMKAct)
plot(xdata, ydata, label=false, title="Active CaMKII", ylims=(0, 0.5); xopts...)
Basal activity with 30nM Ca is 4.663864427989495e-8

Least-square fitting

Least-square fitting of steady state CaMKII activities against calcium concentrations.

Old model

Using a single Hill function to fit steady state CaMKII activities.

\[ \text{CaMKII}_{act} = p_1 \frac{c^n}{c^n + p_2^n}+ p_3 \]

@. model_camk_single_hill(x, p) = p[1] * hil(x, p[2], p[4]) + p[3]
p0 = [0.4, 1μM, 0.0, 2.0]
lb = [0.0, 0.001μM, 0.0, 1.0]
@time fit = curve_fit(model_camk_single_hill, xdata, ydata, p0; lower=lb, autodiff=:forwarddiff)
pestim = coef(fit)
  2.755750 seconds (8.36 M allocations: 405.337 MiB, 1.46% gc time, 99.86% compilation time)
4-element Vector{Float64}:
 0.4298587479560501
 0.9629482777630135
 0.005187226867637259
 2.2985813525750225
println("Basal activity: ", pestim[3])
println("Maximal activated activity: ", pestim[1])
println("Half-saturation Ca concentration: ", pestim[2], " μM")
println("Hill coefficient: ", pestim[4])
println("RMSE: ", rmse(fit))
Basal activity: 0.005187226867637259
Maximal activated activity: 0.4298587479560501
Half-saturation Ca concentration: 0.9629482777630135 μM
Hill coefficient: 2.2985813525750225
RMSE: 0.004825705351244192

Fit result and the original model

yestim = model_camk_single_hill.(xdata, Ref(pestim))
p1 = plot(xdata, [ydata yestim], lab=["Full model" "Fitted"], line=[:dash :dot], title="Single Hill function fit", legend=:topleft, ylabel="Bound CaMKII"; xopts...)

New model

Using two Hill functions to fit steady state CaMKII activities.

\[ \text{CaMKII}_{act} = p_1 \frac{c^2}{c^2 + p_2^2} + p_3 \frac{c^4}{c^4 + p_4^4} + p_5 \]

@. model_camk(x, p) = p[1] * hil(x, p[2], 2) + p[3] * hil(x, p[4], 4) + p[5]
p0 = [0.4, 1μM, 0.0, 1μM, 0.0]
lb = [0.0, 0.001μM, 0.0, 0.001μM, 0.0]
@time fit = curve_fit(model_camk, xdata, ydata, p0; lower=lb, autodiff=:forwarddiff)
pestim = coef(fit)
  1.025682 seconds (3.12 M allocations: 154.013 MiB, 99.73% compilation time)
5-element Vector{Float64}:
 0.26501203947157154
 0.738395929684222
 0.16357499301214423
 1.2512737227376416
 0.0010150126198372824
println("Basal activity: ", pestim[5])
println("Maximal activity by 2 Ca binding): ", pestim[1])
println("Half saturation concentration for 2 Ca binding: ", pestim[2], " μM")
println("Maximal activity by 4 Ca binding): ", pestim[3])
println("Half saturation concentration for 4 Ca binding: ", pestim[4], " μM")
println("RMSE: ", rmse(fit))
Basal activity: 0.0010150126198372824
Maximal activity by 2 Ca binding): 0.26501203947157154
Half saturation concentration for 2 Ca binding: 0.738395929684222 μM
Maximal activity by 4 Ca binding): 0.16357499301214423
Half saturation concentration for 4 Ca binding: 1.2512737227376416 μM
RMSE: 0.0009687123942774883

Visualize fitting

yestim = model_camk.(xdata, Ref(pestim))
p1 = plot(xdata, [ydata yestim], lab=["Full model" "Fitted"], line=[:dash :dot], title="Dual Hill function fit", legend=:topleft, ylabel="Bound CaMKII"; xopts...)

Back to top