Defined new func in Model to import variables into fitter.py yet the issue of correct importing still presists

This commit is contained in:
ralf 2024-07-15 13:55:55 +03:00
parent 30289b5744
commit df8c89c8e3
3 changed files with 25 additions and 1 deletions

View File

@ -332,6 +332,30 @@ class Model:
n = (t // self.period) * self.period n = (t // self.period) * self.period
return v1 if t0 + n <= t < t1 + n else self.V_mem_rest 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): def solve(self, initial_values, tspan, dt, times):
times = np.arange(*tspan, dt) times = np.arange(*tspan, dt)

Binary file not shown.

View File

@ -23,7 +23,7 @@ class Fitter:
self.fit_results = {} self.fit_results = {}
self.tspan = [0, 1000] self.tspan = [0, 1000]
self.initial_values=[] self.initial_values = self.model.get_initial_values(self)
self.dt = 1 # 1.0 self.dt = 1 # 1.0
self.time_points = np.arange(*self.tspan, self.dt) self.time_points = np.arange(*self.tspan, self.dt)