CaMKII system analysis#
using ModelingToolkit
using OrdinaryDiffEq, SteadyStateDiffEq, DiffEqCallbacks
using Plots
using LsqFit
using CaMKIIModel
using CaMKIIModel: μM, hil, second, Hz
Plots.default(lw=1.5)
CaMKII sensitivity to calcium#
Model CaM/Calcium binding only. No phosphorylation or oxidation.
@parameters Ca = 0μM ROS = 0μM
sys = get_camkii_sys(Ca; ROS, simplify=true)
\[\begin{split} \begin{align}
\frac{\mathrm{d} \mathtt{CaMKOX}\left( t \right)}{\mathrm{d}t} &= \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) - \mathtt{k\_OXB} \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\_OXPP} \mathtt{CaMKPOX}\left( t \right) - \mathtt{k\_dephospho} \mathtt{CaMKPOX}\left( t \right) - \mathtt{kCaM4P\_on} \mathtt{CaMKPOX}\left( t \right) \mathtt{Ca4CaM}\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\_OXPP} \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) - \mathtt{kCaM0P\_on} \mathtt{CaM0}\left( t \right) \mathtt{CaMKP}\left( t \right) - \mathtt{kCaM2CP\_on} \mathtt{Ca2CaM\_C}\left( t \right) \mathtt{CaMKP}\left( t \right) - \mathtt{kCaM2NP\_on} \mathtt{CaMKP}\left( t \right) \mathtt{Ca2CaM\_N}\left( t \right) - \mathtt{kCaM4P\_on} \mathtt{CaMKP}\left( t \right) \mathtt{Ca4CaM}\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\_OXPP} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) - \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) + \mathtt{ROS} \mathtt{k\_POXP} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{kCaM4P\_on} \mathtt{CaMKPOX}\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\_CaMKOX}\left( t \right)}{\mathrm{d}t} &= - \mathtt{kCaM4\_off} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) - \mathtt{k\_OXB} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) + \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) + \mathtt{ROS} \mathtt{k\_BOX} \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\_OXPP} \mathtt{Ca4CaM\_CaMKPOX}\left( t \right) - \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKP}\left( t \right) - \mathtt{ROS} \mathtt{k\_POXP} \mathtt{Ca4CaM\_CaMKP}\left( t \right) + \mathtt{kCaM4P\_on} \mathtt{CaMKP}\left( t \right) \mathtt{Ca4CaM}\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{kCaM2NP\_on} \mathtt{CaMKP}\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\_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{kCaM2CP\_on} \mathtt{Ca2CaM\_C}\left( t \right) \mathtt{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{kCaM0P\_on} \mathtt{CaM0}\left( t \right) \mathtt{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\_OXB} \mathtt{Ca4CaM\_CaMKOX}\left( t \right) + \mathtt{k\_dephospho} \mathtt{Ca4CaM\_CaMKP}\left( t \right) - \mathtt{ROS} \mathtt{k\_BOX} \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{kCaM4P\_on} \mathtt{CaMKPOX}\left( t \right) \mathtt{Ca4CaM}\left( t \right) - \mathtt{kCaM4P\_on} \mathtt{CaMKP}\left( t \right) \mathtt{Ca4CaM}\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{kCaM2NP\_on} \mathtt{CaMKP}\left( t \right) \mathtt{Ca2CaM\_N}\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{kCaM2CP\_on} \mathtt{Ca2CaM\_C}\left( t \right) \mathtt{CaMKP}\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}
\end{split}\]
prob = SteadyStateProblem(sys, [sys.k_phosCaM => 0])
alg = DynamicSS(Rodas5P())
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)
sol0 = solve(prob, alg; abstol=1e-10, reltol=1e-10) ## warmup
sim = solve(EnsembleProblem(prob; prob_func, safetycopy=false), alg; trajectories, abstol=1e-10, reltol=1e-10)
EnsembleSolution Solution of length 1001 with uType:
SciMLBase.NonlinearSolution{Float64, 1, Vector{Float64}, Vector{Float64}, SciMLBase.SteadyStateProblem{Vector{Float64}, true, ModelingToolkit.MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x310c5437, 0xe0af5f1d, 0xe5cbc53e, 0x1ff9631a, 0x03be2055), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8c7ad720, 0x3c14fd1d, 0xf64ccc89, 0x49c564ce, 0xff17296e), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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{}, Tuple{}, @NamedTuple{}}}, SteadyStateDiffEq.DynamicSS{OrdinaryDiffEqRosenbrock.Rodas5P{0, ADTypes.AutoForwardDiff{nothing, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Val{:forward}(), true, nothing, typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!)}, Float64}, SciMLBase.ODESolution{Float64, 2, Vector{Vector{Float64}}, Nothing, Nothing, Vector{Float64}, Vector{Vector{Vector{Float64}}}, Nothing, SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, ModelingToolkit.MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x310c5437, 0xe0af5f1d, 0xe5cbc53e, 0x1ff9631a, 0x03be2055), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8c7ad720, 0x3c14fd1d, 0xf64ccc89, 0x49c564ce, 0xff17296e), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardODEProblem}, OrdinaryDiffEqRosenbrock.Rodas5P{0, ADTypes.AutoForwardDiff{nothing, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Val{:forward}(), true, nothing, typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!)}, OrdinaryDiffEqCore.InterpolationData{SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x310c5437, 0xe0af5f1d, 0xe5cbc53e, 0x1ff9631a, 0x03be2055), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8c7ad720, 0x3c14fd1d, 0xf64ccc89, 0x49c564ce, 0xff17296e), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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, OrdinaryDiffEqRosenbrock.RosenbrockCache{Vector{Float64}, Vector{Float64}, Float64, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEqRosenbrock.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{true, SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x310c5437, 0xe0af5f1d, 0xe5cbc53e, 0x1ff9631a, 0x03be2055), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8c7ad720, 0x3c14fd1d, 0xf64ccc89, 0x49c564ce, 0xff17296e), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, Vector{Float64}, ModelingToolkit.MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}}, SciMLBase.UJacobianWrapper{true, SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 3, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x310c5437, 0xe0af5f1d, 0xe5cbc53e, 0x1ff9631a, 0x03be2055), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8c7ad720, 0x3c14fd1d, 0xf64ccc89, 0x49c564ce, 0xff17296e), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, 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{ModelingToolkit.System}, Nothing, ModelingToolkit.System, SciMLBase.OverrideInitData{SciMLBase.NonlinearProblem{Nothing, true, ModelingToolkit.MTKParameters{Vector{Float64}, StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.NonlinearFunction{true, SciMLBase.FullSpecialize, ModelingToolkit.GeneratedFunctionWrapper{(2, 2, true), RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x9a1dc1ad, 0x71defabe, 0x857c130d, 0xdfc20b1f, 0x2cf6f9a1), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x00797acb, 0x0db5e856, 0xa0aff6bc, 0xf6b12faf, 0xd9a97c31), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.System}, Nothing, ModelingToolkit.System, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardNonlinearProblem}, Nothing, Nothing, Nothing, ModelingToolkit.InitializationMetadata{ModelingToolkit.ReconstructInitializeprob{ModelingToolkit.var"#_getter#896"{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", (0x88b9242a, 0xffb9e79b, 0xc4abdaf4, 0x0c605279, 0x732f542c), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :__mtk_arg_1, :___mtkparameters___, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x8825fca1, 0x7cee282b, 0x8c390d30, 0x81cb56ee, 0x24173a82), Nothing}}}}, Returns{StaticArraysCore.SizedVector{0, Float64, Vector{Float64}}}, Returns{Tuple{}}, Returns{Tuple{}}, Returns{Tuple{}}}}, ComposedFunction{typeof(identity), SymbolicIndexingInterface.MultipleGetters{SymbolicIndexingInterface.ContinuousTimeseries, Vector{Any}}}}, Nothing, ModelingToolkit.SetInitialUnknowns{SymbolicIndexingInterface.MultipleSetters{Vector{SymbolicIndexingInterface.ParameterHookWrapper{SymbolicIndexingInterface.SetParameterIndex{ModelingToolkit.ParameterIndex{SciMLStructures.Initials, Int64}}, SymbolicUtils.BasicSymbolic{Real}}}}}}, Val{true}}, Nothing}, Float64, ModelingToolkit.MTKParameters{Vector{Float64}, Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, 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}, LinearSolve.InvPreconditioner{LinearAlgebra.Diagonal{Float64, Vector{Float64}}}, LinearAlgebra.Diagonal{Float64, Vector{Float64}}, Float64, Bool, LinearSolve.LinearSolveAdjoint{Missing}}, 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{}}}, Tuple{DifferentiationInterfaceForwardDiffExt.ForwardDiffTwoArgDerivativePrep{Nothing, ForwardDiff.DerivativeConfig{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 1}}}, Tuple{}}, DifferentiationInterfaceForwardDiffExt.ForwardDiffTwoArgDerivativePrep{Nothing, ForwardDiff.DerivativeConfig{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 1}}}, Tuple{}}}, Float64, OrdinaryDiffEqRosenbrock.Rodas5P{0, ADTypes.AutoForwardDiff{nothing, ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}}, Nothing, typeof(OrdinaryDiffEqCore.DEFAULT_PRECS), Val{:forward}(), true, nothing, typeof(OrdinaryDiffEqCore.trivial_limiter!), typeof(OrdinaryDiffEqCore.trivial_limiter!)}, typeof(OrdinaryDiffEqCore.trivial_limiter!), 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))
Main.var"##230".rmse
Components
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)

We excluded CaM0_CaMK (bound but lost all calcium) from the active CaMKII fraction
CaMKAct = 1 - (sys.CaMK + sys.CaM0_CaMK) / sys.CAMKII_T
println("Basal activity without 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 without ca is 4.718888801935606e-8

Least-square fitting of steady state CaMKII activity#
@. model_camk(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]
fit = curve_fit(model_camk, xdata, ydata, p0; lower=lb, autodiff=:forwarddiff)
LsqFit.LsqFitResult{Vector{Float64}, Vector{Float64}, Matrix{Float64}, Vector{Float64}, Vector{LsqFit.LMState{LsqFit.LevenbergMarquardt}}}([0.42985863934163043, 0.9629481700564632, 0.0051872219070948945, 2.2985816472198652], [0.004766881166784302, 0.004762307016042575, 0.00475768443171887, 0.004753012761169545, 0.004748291676299387, 0.004743520674695864, 0.004738699052197237, 0.004733826555142742, 0.004728902557996219, 0.004723926506115513 … 0.006155576850501221, 0.006173855855995003, 0.006192205229389902, 0.006210311395849544, 0.00622818174679135, 0.0062455334412058194, 0.006262980153035613, 0.006280196366701463, 0.006297167213905774, 0.006313699525584693], [0.0003444128193598059 -0.00035327457926524763 1.0 -0.000513375220159896; 0.0003490409162682141 -0.0003580200998195745 1.0 -0.000519400075532692; … ; 0.9953494647807332 -0.004749645619238069 1.0 0.004645194989636607; 0.9954108665692682 -0.004687224390459563 1.0 0.004595553464372023], true, Iter Function value Gradient norm
------ -------------- --------------
, Float64[])
Parameters
pestim = coef(fit)
4-element Vector{Float64}:
0.42985863934163043
0.9629481700564632
0.0051872219070948945
2.2985816472198652
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.0051872219070948945
Maximal activated activity: 0.42985863934163043
Half-saturation Ca concentration: 0.9629481700564632 μM
Hill coefficient: 2.2985816472198652
RMSE: 0.0048257069522980684
Fit result and the original model
yestim = model_camk.(xdata, Ref(pestim))
p1 = plot(xdata, [ydata yestim], lab=["Full model" "Fitted"], line=[:dash :dot], title="CaMKII activity", legend=:topleft; xopts...)

The simplified CaMKII system#
simpsys = CaMKIIModel.get_camkii_simp_sys(Ca; ROS, simplify=true)
\[\begin{split} \begin{align}
\frac{\mathrm{d} \mathtt{CaMKOX}\left( t \right)}{\mathrm{d}t} &= \mathtt{kdeph\_CaMK} \mathtt{CaMKAOX}\left( t \right) - \mathtt{krd\_CaMK} \mathtt{CaMKOX}\left( t \right) + \left( 1 - \mathtt{kfb\_CaMK} + \frac{ - \mathtt{kfa\_CaMK} pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)}{pow\left( \mathtt{kmCa\_CaMK}, \mathtt{nCa\_CaMK} \right) + pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)} \right) \mathtt{r\_CaMK} \mathtt{CaMKBOX}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKAOX}\left( t \right)}{\mathrm{d}t} &= \mathtt{kb\_CaMKP} \mathtt{CaMKPOX}\left( t \right) - \mathtt{kdeph\_CaMK} \mathtt{CaMKAOX}\left( t \right) - \mathtt{krd\_CaMK} \mathtt{CaMKAOX}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKA2}\left( t \right)}{\mathrm{d}t} &= \mathtt{k\_P1\_P2} \mathtt{CaMKA}\left( t \right) - \mathtt{k\_P2\_P1} \mathtt{CaMKA2}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKA}\left( t \right)}{\mathrm{d}t} &= - \mathtt{k\_P1\_P2} \mathtt{CaMKA}\left( t \right) + \mathtt{k\_P2\_P1} \mathtt{CaMKA2}\left( t \right) + \mathtt{kb\_CaMKP} \mathtt{CaMKP}\left( t \right) - \mathtt{kdeph\_CaMK} \mathtt{CaMKA}\left( t \right) + \mathtt{krd\_CaMK} \mathtt{CaMKAOX}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKPOX}\left( t \right)}{\mathrm{d}t} &= - \mathtt{kb\_CaMKP} \mathtt{CaMKPOX}\left( t \right) - \mathtt{kdeph\_CaMK} \mathtt{CaMKPOX}\left( t \right) - \mathtt{krd\_CaMK} \mathtt{CaMKPOX}\left( t \right) + \mathtt{ROS} \mathtt{kox\_CaMK} \mathtt{CaMKP}\left( t \right) + \mathtt{kphos\_CaMK} \mathtt{CaMKBOX}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKP}\left( t \right)}{\mathrm{d}t} &= - \mathtt{kb\_CaMKP} \mathtt{CaMKP}\left( t \right) - \mathtt{kdeph\_CaMK} \mathtt{CaMKP}\left( t \right) + \mathtt{krd\_CaMK} \mathtt{CaMKPOX}\left( t \right) - \mathtt{ROS} \mathtt{kox\_CaMK} \mathtt{CaMKP}\left( t \right) + \mathtt{kphos\_CaMK} \mathtt{CaMKAct}\left( t \right) \mathtt{CaMKB}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKBOX}\left( t \right)}{\mathrm{d}t} &= \mathtt{kdeph\_CaMK} \mathtt{CaMKPOX}\left( t \right) - \mathtt{krd\_CaMK} \mathtt{CaMKBOX}\left( t \right) + \mathtt{ROS} \mathtt{kox\_CaMK} \mathtt{CaMKB}\left( t \right) + \left( -1 + \mathtt{kfb\_CaMK} + \frac{\mathtt{kfa\_CaMK} pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)}{pow\left( \mathtt{kmCa\_CaMK}, \mathtt{nCa\_CaMK} \right) + pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)} \right) \mathtt{r\_CaMK} \mathtt{CaMKBOX}\left( t \right) - \mathtt{kphos\_CaMK} \mathtt{CaMKBOX}\left( t \right) \mathtt{CaMKAct}\left( t \right) \\
\frac{\mathrm{d} \mathtt{CaMKB}\left( t \right)}{\mathrm{d}t} &= \mathtt{kdeph\_CaMK} \mathtt{CaMKP}\left( t \right) + \mathtt{krd\_CaMK} \mathtt{CaMKBOX}\left( t \right) - \mathtt{ROS} \mathtt{kox\_CaMK} \mathtt{CaMKB}\left( t \right) + \left( \mathtt{kfb\_CaMK} + \frac{\mathtt{kfa\_CaMK} pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)}{pow\left( \mathtt{kmCa\_CaMK}, \mathtt{nCa\_CaMK} \right) + pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)} \right) \mathtt{r\_CaMK} \mathtt{CaMK}\left( t \right) + \left( -1 + \mathtt{kfb\_CaMK} + \frac{\mathtt{kfa\_CaMK} pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)}{pow\left( \mathtt{kmCa\_CaMK}, \mathtt{nCa\_CaMK} \right) + pow\left( \mathtt{Ca}, \mathtt{nCa\_CaMK} \right)} \right) \mathtt{r\_CaMK} \mathtt{CaMKB}\left( t \right) - \mathtt{kphos\_CaMK} \mathtt{CaMKAct}\left( t \right) \mathtt{CaMKB}\left( t \right)
\end{align}
\end{split}\]
Comparing original and simplified model#
sys = build_neonatal_ecc_sys(simplify=true, reduce_iso=true)
sys_simp = build_neonatal_ecc_sys(simplify=true, reduce_iso=true, reduce_camk=true)
println("# of state variable in the original model: ", length(unknowns(sys)))
println("# of state variable in the simplified model: ", length(unknowns(sys_simp)))
# of state variable in the original model: 84
# of state variable in the simplified model: 75
tend = 500.0second
stimstart = 100.0second
stimend = 300.0second
alg = KenCarp47()
@unpack Istim = sys
callback = build_stim_callbacks(Istim, stimend; period=1second, starttime=stimstart)
prob = ODEProblem(sys, [], tend);
prob_simp = ODEProblem(sys_simp, [sys_simp.kphos_CaMK => 5Hz], tend);
@time sol = solve(prob, alg; callback)
@time sol_simp = solve(prob_simp, alg; callback)
plot(sol, idxs=sys.CaMKAct, label="Full model", title="Active CaMKII")
plot!(sol_simp, idxs=sys_simp.CaMKAct, label="Simplified model", xlabel="Time (ms)")
8.291487 seconds (16.69 M allocations: 799.708 MiB, 2.58% gc time, 81.16% compilation time)
7.261099 seconds (13.61 M allocations: 652.973 MiB, 9.24% gc time, 82.18% compilation time)

@unpack CaMKB, CaMKP, CaMKA, CaMKA2, CaMK = sys_simp
plot(sol_simp, idxs=[CaMKB, CaMKP, CaMKA, CaMKA2, CaMK], legend=:right)

plot(sol, idxs=sys.CaMKAct, label="Full model", title="Active CaMKII")
plot!(sol_simp, idxs=sys_simp.CaMKAct, label="Simplified model", xlabel="Time (ms)", tspan=(295second, 300.0second))

This notebook was generated using Literate.jl.