CaMKII system analysis#
using ModelingToolkit
using OrdinaryDiffEq
using SteadyStateDiffEq
using 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{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) \\
\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{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{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{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{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{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{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{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{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{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{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\_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{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{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{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{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)
\end{align}
\end{split}\]
prob = SteadyStateProblem(sys, [sys.k_phosCaM => 0])
alg = DynamicSS(Rodas5P())
ca = logrange(0.03μM, 10μM, length=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}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#1023"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x3c558629, 0x8b8968ce, 0x2f361f91, 0x7d6d2ee5, 0x45852910), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0dc136ce, 0x6161a537, 0xb84ce11f, 0x11edf59d, 0x5551ee06), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}}, SteadyStateDiffEq.DynamicSS{OrdinaryDiffEqRosenbrock.Rodas5P{0, ADTypes.AutoForwardDiff{9, Nothing}, 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}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}, SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#1023"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x3c558629, 0x8b8968ce, 0x2f361f91, 0x7d6d2ee5, 0x45852910), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0dc136ce, 0x6161a537, 0xb84ce11f, 0x11edf59d, 0x5551ee06), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, Base.Pairs{Symbol, Union{}, Tuple{}, @NamedTuple{}}, SciMLBase.StandardODEProblem}, OrdinaryDiffEqRosenbrock.Rodas5P{0, ADTypes.AutoForwardDiff{9, Nothing}, 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.AutoSpecialize, ModelingToolkit.var"#f#1023"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x3c558629, 0x8b8968ce, 0x2f361f91, 0x7d6d2ee5, 0x45852910), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0dc136ce, 0x6161a537, 0xb84ce11f, 0x11edf59d, 0x5551ee06), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Vector{Vector{Float64}}}, Nothing, OrdinaryDiffEqRosenbrock.RosenbrockCache{Vector{Float64}, Vector{Float64}, Vector{Float64}, Matrix{Float64}, Matrix{Float64}, OrdinaryDiffEqRosenbrock.RodasTableau{Float64, Float64}, SciMLBase.TimeGradientWrapper{true, SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#1023"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x3c558629, 0x8b8968ce, 0x2f361f91, 0x7d6d2ee5, 0x45852910), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0dc136ce, 0x6161a537, 0xb84ce11f, 0x11edf59d, 0x5551ee06), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, Vector{Float64}, ModelingToolkit.MTKParameters{Vector{Float64}, Tuple{}, Tuple{}, Tuple{}, Tuple{}}}, SciMLBase.UJacobianWrapper{true, SciMLBase.ODEFunction{true, true, SciMLBase.ODEFunction{true, SciMLBase.AutoSpecialize, ModelingToolkit.var"#f#1023"{RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x3c558629, 0x8b8968ce, 0x2f361f91, 0x7d6d2ee5, 0x45852910), Nothing}, RuntimeGeneratedFunctions.RuntimeGeneratedFunction{(:ˍ₋out, :ˍ₋arg1, :ˍ₋arg2, :t), ModelingToolkit.var"#_RGF_ModTag", ModelingToolkit.var"#_RGF_ModTag", (0x0dc136ce, 0x6161a537, 0xb84ce11f, 0x11edf59d, 0x5551ee06), Nothing}}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, ModelingToolkit.ObservedFunctionCache{ModelingToolkit.ODESystem}, Nothing, ModelingToolkit.ODESystem, Nothing, Nothing}, Float64, ModelingToolkit.MTKParameters{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, LinearAlgebra.LU{Float64, Matrix{Float64}, 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}}, SparseDiffTools.ForwardColorJacCache{Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9}}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 9}}, Vector{Float64}, Vector{Vector{NTuple{9, Float64}}}, UnitRange{Int64}, Nothing}, Vector{ForwardDiff.Dual{ForwardDiff.Tag{DiffEqBase.OrdinaryDiffEqTag, Float64}, Float64, 1}}, Float64, OrdinaryDiffEqRosenbrock.Rodas5P{0, ADTypes.AutoForwardDiff{9, Nothing}, 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, size=(600, 600))
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.7190264362839685e-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.42985864578066807, 0.962948175716529, 0.005187220988015051, 2.2985815732376373], [0.004766880298358606, 0.004762306110170087, 0.004757683534689944, 0.004753011863478671, 0.004748290836277292, 0.004743519793931492, 0.00473869819245602, 0.004733825687175531, 0.00472890171727138, 0.004723925639757031 … 0.0061555861352246555, 0.006174154405299281, 0.006192218504692759, 0.006210314714702347, 0.006228215844057972, 0.006245510256971842, 0.006262960333958512, 0.006280198571436246, 0.006297175009291944, 0.006313692872837395], [0.0003444129030642761 -0.0003532746569387042 1.0 -0.0005133753534451857; 0.0003490410009471264 -0.00035802017838184935 1.0 -0.0005194002101594269; … ; 0.9953494639187168 -0.004749646385869066 1.0 0.004645195904527165; 0.9954108657166175 -0.0046872251491184205 1.0 0.004595554371576107], true, Iter Function value Gradient norm
------ -------------- --------------
, Float64[])
Parameters
pestim = coef(fit)
4-element Vector{Float64}:
0.42985864578066807
0.962948175716529
0.005187220988015051
2.2985815732376373
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.005187220988015051
Maximal activated activity: 0.42985864578066807
Half-saturation Ca concentration: 0.962948175716529 μM
Hill coefficient: 2.2985815732376373
RMSE: 0.004825705522024998
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{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) \\
\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{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{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{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{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{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{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)
\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 = FBDF()
@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)
ODEProblem with uType Vector{Float64} and tType Float64. In-place: true
timespan: (0.0, 500000.0)
u0: 75-element Vector{Float64}:
0.0026
830.0
830.0
0.00702
0.966
0.22156
0.09243
0.00188
0.00977
0.26081
⋮
0.12113
0.12113
0.12113
0.12113
0.12113
0.12113
-68.79268
13838.37602
150952.75035000002
@time sol = solve(prob, alg; callback)
@time sol_simp = solve(prob_simp, alg; callback)
9.200504 seconds (22.49 M allocations: 1.100 GiB, 4.34% gc time, 79.06% compilation time)
5.378168 seconds (12.31 M allocations: 601.277 MiB, 4.29% gc time, 65.35% compilation time)
retcode: Success
Interpolation: 3rd order Hermite
t: 42230-element Vector{Float64}:
0.0
1.397037556582821e-7
9.238890872600831e-6
8.268743701533588e-5
0.0002916748356969014
0.0017327691557383657
0.0051472024471516595
0.009381914366487651
0.01412353770711788
0.02222607464446686
⋮
397723.82057004934
406750.01662236196
417776.8861123902
430066.5613446226
442356.23657685495
454645.9118090873
466935.5870413197
481624.081564708
500000.0
u: 42230-element Vector{Vector{Float64}}:
[0.0026, 830.0, 830.0, 0.00702, 0.966, 0.22156, 0.09243, 0.00188, 0.00977, 0.26081 … 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, -68.79268, 13838.37602, 150952.75035000002]
[0.002599999989610171, 829.9999999963668, 829.9999999997507, 0.00702000000187161, 0.9660000000132074, 0.2215600000288606, 0.09242999998313912, 0.0018799999988577344, 0.009769999999149391, 0.2608099999679793 … 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113000000000025, -68.792680031212, 13838.376019997859, 150952.75035000042]
[0.0025999993129013988, 829.9999997597266, 829.9999999835165, 0.007020000123751709, 0.9660000008734305, 0.22156000190860708, 0.09242999888495673, 0.0018799999244530623, 0.0097699999437479, 0.26080999788241477 … 0.12113, 0.12113, 0.12113, 0.12113, 0.12113, 0.12113000000000011, 0.12113000000107575, -68.79268206433063, 13838.37601985832, 150952.75035002758]
[0.002599993850627452, 829.9999978495805, 829.9999998524714, 0.007020001106159536, 0.9660000078171413, 0.22156001708190093, 0.09242999002044003, 0.001879999323427684, 0.009769999496562808, 0.2608099810480636 … 0.12112999999999999, 0.12112999999999999, 0.12112999999999999, 0.12112999999999999, 0.12113000000000006, 0.1211300000000705, 0.12113000007858916, -68.79269848982487, 13838.376018731431, 150952.7503502467]
[0.002599978309412304, 829.99999241462, 829.9999994795787, 0.007020003890050046, 0.9660000275744648, 0.2215600602553445, 0.0924299647977211, 0.0018799976097917204, 0.009769998224284315, 0.26080993315078366 … 0.12113, 0.12113, 0.12113, 0.12113000000000002, 0.12113000000000573, 0.12113000000223506, 0.12113000085222306, -68.79274533954259, 13838.376015520906, 150952.75035087016]
[0.002599871162947703, 829.999954939211, 829.9999969077578, 0.007020022837591129, 0.9660001638127189, 0.2215603579621454, 0.09242979087191724, 0.0018799857164702662, 0.00976998945385246, 0.26080960292427763 … 0.12112999999999963, 0.12112999999999963, 0.12112999999999992, 0.12113000000002447, 0.12113000000216309, 0.12113000019165274, 0.1211300177701839, -68.79307067198472, 13838.375993299594, 150952.75035516967]
[0.0025996174748732608, 829.9998661650853, 829.9999908095836, 0.0070200654253410434, 0.9660004866027675, 0.22156106332737519, 0.09242937878432113, 0.0018799568224818174, 0.009769968698884416, 0.2608088210117678 … 0.12112999999999995, 0.12113000000000203, 0.12113000000008108, 0.12113000000306771, 0.12113000011552955, 0.12113000431268568, 0.12113015716639643, -68.79385990721185, 13838.375939979858, 150952.7503653587]
[0.0025993031657965938, 829.9997560966385, 829.9999832373728, 0.0070201139112652826, 0.9660008869322472, 0.22156193814569292, 0.09242886769859192, 0.0018799196342845043, 0.009769943005367777, 0.26080785220947394 … 0.12113000000000115, 0.12113000000003545, 0.12113000000104877, 0.12113000003007134, 0.1211300008269648, 0.12113002136146211, 0.12113049658039582, -68.79486714535786, 13838.375872817282, 150952.7503779991]
[0.0025989516541351427, 829.9996328957267, 829.9999747462283, 0.007020162390972403, 0.9660013351731129, 0.22156291767931, 0.0924282954354744, 0.00187987616913609, 0.00976991430071388, 0.260806768733147 … 0.12113000000001191, 0.12113000000029102, 0.12113000000687738, 0.12113000015542189, 0.12113000330022919, 0.12113006391159924, 0.12113106803503901, -68.79602399791224, 13838.37579655817, 150952.75039215756]
[0.002598351996846418, 829.9994224741081, 829.9999602043756, 0.007020230894952259, 0.9660021011082484, 0.22156459150735788, 0.09242731754980789, 0.0018797973748458157, 0.00976986541069697, 0.2608049205114165 … 0.12113000000017275, 0.12113000000318644, 0.12113000005662715, 0.12113000095596296, 0.12113001498070429, 0.12113020965879463, 0.12113244244516855, -68.79805585623365, 13838.37566424357, 150952.75041636403]
⋮
[0.0017691571235301752, 780.8845553357165, 781.1956225436073, 0.0065666691549758245, 0.9997101093168996, 0.9997097380275453, 0.0016571646777076108, 0.0025451901000503, 0.0016442608739364593, 0.0012326914050706048 … 0.1335244869755397, 0.13352421178336585, 0.1335239376947598, 0.13352366463155582, 0.13352339251868417, 0.1335231212840192, 0.13352285085823662, -69.78777473426786, 13302.254839420926, 151490.74256777242]
[0.0017278279108429932, 780.1476857800582, 780.4512079623712, 0.006604725353562183, 0.9997047286905307, 0.9997059774854803, 0.0016774999731242102, 0.002561312449466276, 0.0016546790687834835, 0.0012488669461555837 … 0.13302825622059927, 0.1330279916431888, 0.1330277281684187, 0.13302746572051694, 0.13302720422671405, 0.13302694361709616, 0.13302668382446628, -69.70277109899679, 13260.15491214832, 151532.96285729864]
[0.0016809791107489378, 779.2737189489267, 779.568680454979, 0.006650030622010405, 0.9996982776187291, 0.9997023361432149, 0.0017018743472942174, 0.002580512945269609, 0.0016670798481221128, 0.0012685069061285914 … 0.13245813677949278, 0.1324578848132116, 0.13245763398494564, 0.13245738422067954, 0.13245713544933355, 0.13245688760261973, 0.1324566406149063, -69.60221020710964, 13211.001515960756, 151582.25688823868]
[0.001633278411385766, 778.3298835074537, 778.616117528361, 0.006699039445284846, 0.999691151279263, 0.9996945936195963, 0.0017284387012037185, 0.002601299463397633, 0.001680518562174873, 0.0012898297907629217 … 0.1318673735597051, 0.13186713069636777, 0.13186688906159938, 0.13186664858138858, 0.13186640918465514, 0.1318661708031063, 0.13186593337110153, -69.49418910108264, 13159.030122732724, 151634.3775191856]
[0.0015891935947440342, 777.41712857165, 777.6953279070068, 0.006746426593152183, 0.9996841468678584, 0.9996852912194515, 0.001754327978200472, 0.0026214102611835607, 0.0016935111372772345, 0.0013104550082928565 … 0.13131798035628992, 0.13131774882383593, 0.1313175185025841, 0.13131728932150377, 0.13131706121238323, 0.13131683410969167, 0.13131660795044883, -69.3904870474938, 13109.866534693907, 151683.68339839563]
[0.001548512769166835, 776.5417896832364, 776.8125926611503, 0.006792200668849568, 0.9996773280058365, 0.9996784476495602, 0.0017795180559115015, 0.0026408438068344082, 0.0017060669859075357, 0.0013309967440761792 … 0.1308067711556835, 0.1308065533470699, 0.13080633673815056, 0.13080612126069557, 0.13080590684917906, 0.1308056934406466, 0.13080548097459052, -69.2910016037026, 13063.358074938942, 151730.3267085077]
[0.0015111468876820653, 775.7060365430631, 775.9700456191828, 0.006836419639028768, 0.9996706282188222, 0.9996723689555193, 0.0018040229658716222, 0.002659628934031718, 0.0017182083930345488, 0.0013509615071133345 … 0.13033190324046273, 0.13033169785781185, 0.13033149366058963, 0.13033129058331194, 0.13033108856308814, 0.1303308875394937, 0.1303306874544507, -69.19552544712815, 13019.359268152655, 151774.45273855102]
[0.001470458466316511, 774.7561341614464, 775.0127500995218, 0.006887264089410047, 0.999662782589439, 0.9996647475774426, 0.0018324101878647568, 0.00268124372428502, 0.0017321766700635628, 0.0013738493695098118 … 0.12980850929084117, 0.12980831672443607, 0.12980812532328978, 0.12980793502499574, 0.12980774576962098, 0.12980755749958456, 0.12980737015954352, -69.08649804843239, 12969.874959870273, 151824.07982271194]
[0.0014250041206318638, 773.637459619941, 773.8858226962102, 0.006947832127742476, 0.9996532820208346, 0.9996551175085745, 0.001866519984639896, 0.0027070086913491592, 0.0017488249698313983, 0.0014014584557166929 … 0.12921498079712332, 0.12921480272857294, 0.129214625805581, 0.1292144499690869, 0.1292142751623708, 0.1292141013309387, 0.1292139284224145, -68.95765901024866, 12912.411562781457, 151881.70900618233]
plot(sol, idxs=sys.CaMKAct, label= "Full model", title="Active CaMKII")
plot!(sol_simp, idxs=sys_simp.CaMKAct, label= "Simplified model", xlabel="Time (ms)")
@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.