diff --git a/Model.py b/Model.py index d14e346..83cf8a2 100644 --- a/Model.py +++ b/Model.py @@ -332,6 +332,30 @@ class Model: n = (t // self.period) * self.period return v1 if t0 + n <= t < t1 + n else self.V_mem_rest + def get_initial_values(self): + Cai_0 = 0.11712 # Cai + FCa_0 = (self.k_on * self.F_tot * Cai_0) / (self.k_on * Cai_0 + self.k_off) + return [ + Cai_0, # Cass + 0.930308e-18, # Os, + 0.124216e-3, # C2, + 0.578679e-8, # C3, + 0.119816e-12, # C4, + 0.497923e-18, # I1, + 0.345847e-13, # I2, + 0.185106e-13, # I3, + 11.2684, # LTRPNCa, + 125.290, # HTRPNCa + 1299.50, # Ca_NSR + 1299.50, # Ca_JSR + 0.0, # P_RyR + 0.149102e-4, # P_O1 + 0.951726e-10, # P_02 + 0.167740e-3, # P_C2 + Cai_0, # Cai + FCa_0, # FCa + ] + def solve(self, initial_values, tspan, dt, times): times = np.arange(*tspan, dt) diff --git a/__pycache__/Model.cpython-311.pyc b/__pycache__/Model.cpython-311.pyc index 36fb931..39086a8 100644 Binary files a/__pycache__/Model.cpython-311.pyc and b/__pycache__/Model.cpython-311.pyc differ diff --git a/fitter.py b/fitter.py index 3b1f4c7..61a7da6 100644 --- a/fitter.py +++ b/fitter.py @@ -23,7 +23,7 @@ class Fitter: self.fit_results = {} self.tspan = [0, 1000] - self.initial_values=[] + self.initial_values = self.model.get_initial_values(self) self.dt = 1 # 1.0 self.time_points = np.arange(*self.tspan, self.dt)