From 48bd4ffaf203c3c2abb1dc3a4a777ddd265c7938 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 16 Jul 2024 15:06:50 +0300 Subject: [PATCH] minor adjustments after trial and error --- Model.py | 16 ++++------------ fitter.py | 13 +++++++++---- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/Model.py b/Model.py index 83cf8a2..0e31841 100644 --- a/Model.py +++ b/Model.py @@ -197,13 +197,9 @@ class Model: # Bi = (1 + (self.CMDN_tot * self.Km_CMDN)/(self.Km_CMDN+(Cai))**2)**(-1) # Bss = 1 / ((self.CMDN_tot * self.Km_CMDN) / (self.Km_CMDN + Cass) ** 2) - Bi = 1 / ( - 1 + (self.CMDN_tot * self.Km_CMDN) / (self.Km_CMDN + Cai) ** 2 - ) + Bi = 1 / (1 + (self.CMDN_tot * self.Km_CMDN) / (self.Km_CMDN + Cai) ** 2) - Bss = 1 / ( - 1 + (self.CMDN_tot * self.Km_CMDN) / (self.Km_CMDN + Cass) ** 2 - ) + Bss = 1 / (1 + (self.CMDN_tot * self.Km_CMDN) / (self.Km_CMDN + Cass) ** 2) J_xfer = (Cass - Cai) / self.tau_xfer @@ -216,9 +212,7 @@ class Model: J_trpn = ( self.k_htrpn_positive * Cai * (self.HTRPN_tot - HTRPNCa) - self.k_htrpn_negative * HTRPNCa - + self.k_ltrpn_positive - * Cai - * (self.LTRPN_tot - LTRPNCa) + + self.k_ltrpn_positive * Cai * (self.LTRPN_tot - LTRPNCa) - self.k_ltrpn_negative * LTRPNCa ) @@ -258,9 +252,7 @@ class Model: P_C1 = 1 - (P_C2 + P_O1 + P_O2) - dP_O1dt = ( - self.k_a_positive * (Cass) ** self.n_ryr * P_C1 - ) + dP_O1dt = self.k_a_positive * (Cass) ** self.n_ryr * P_C1 -self.k_a_negative * P_O1 - self.k_a_positive * (Cass) ** self.m_ryr * P_O1 +self.k_b_negative * P_O2 - self.k_c_positive * P_O1 + self.k_c_negative * P_C2 diff --git a/fitter.py b/fitter.py index 5e1cdcc..84307cd 100644 --- a/fitter.py +++ b/fitter.py @@ -25,8 +25,8 @@ class Fitter: self.tspan = [0, 1000] self.dt = 1 # 1.0 self.time_points = np.arange(*self.tspan, self.dt) - - model=Model() + + model = Model() self.initial_values = model.get_initial_values() self.iteration = 0 # least squares iteration counter @@ -61,7 +61,12 @@ class Fitter: model.K_pc_half = K_pc_half model.tau_xfer = tau_xfer - model.solve(times=self.time_points, tspan=self.tspan, dt=self.dt, initial_values=self.initial_values) + model.solve( + times=self.time_points, + tspan=self.tspan, + dt=self.dt, + initial_values=self.initial_values, + ) _calc_curr = model.calculated_current() calculated_current = ( @@ -207,7 +212,7 @@ if __name__ == "__main__": eid_cleaned = re.sub( r"[^\w.-]", "", eid - ) # Eemalda kõik eritähed ja jääb alles alphanumbrilised tähed, sidekriipsud ja punktid + ) # Eemaldab eritahed fig.savefig(f"plot_{eid_cleaned}.png") fig.savefig(f"plot_{eid_cleaned}.pdf")