From 6633e99003599f963cfcc5a8fc7c04ce77fae0fd Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 8 Aug 2024 13:45:53 +0300 Subject: [PATCH] model clarity improvement --- Model.py | 28 +++++++++++++++------------- __pycache__/Model.cpython-311.pyc | Bin 15350 -> 15798 bytes 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Model.py b/Model.py index 40b34bd..dbc93af 100644 --- a/Model.py +++ b/Model.py @@ -2,10 +2,10 @@ import numpy as np import matplotlib.pyplot as plt from scipy.integrate import ode -R = 8.314 # ideal gas constant (J/(mol*K)) -F = 96.485 # coulomb_per_millimole, Faraday constant -T = 298 # room temperature (K) -RT = R * T +R: float = 8.314 # ideal gas constant (J/(mol*K)) +F: float = 96.485 # coulomb_per_millimole, Faraday constant +T: float = 298 # room temperature (K) +RT: float = R * T # J/mol class Model: @@ -22,13 +22,13 @@ class Model: self.Nai: float = 11000 # uM, Myoplasmic Na+ concentration self.Nao: float = 150000 # uM, Extracellular Na+ concentration - self.eta: float = 0.35 # Controls voltage dependance of Na/Ca2+ exchange + self.eta: float = 0.35 # Controls voltage dependance of Na/Ca2+ excng self.km_Na: float = ( 87500 # uM, Na+ half-saturation constant for Na+/Ca2+ exchange ) self.k_sat: float = ( - 0.1 # Na+/Ca2+ exchange saturation factor at very negative potentials + 0.1 # Na+/Ca2+ exchange saturation factor at very neg potentials ) self.km_Ca: float = ( 1380 # uM, Ca2+ half-saturation constant for Na+/Ca2+ exchange @@ -132,7 +132,7 @@ class Model: ) self.V_JSR: float = 0.12e-6 # ul, Junctional SR volume - def ode_system(self, t, states): + def ode_system(self, t, states: list[float]) -> list[float]: ( Cass, @@ -331,7 +331,7 @@ class Model: dFCadt, ] - def mem_potential(self, t): + def mem_potential(self, t: np.ndarray) -> np.ndarray: t = np.asarray(t) v1 = 0 t0 = 100 @@ -339,7 +339,7 @@ class Model: n = (t // self.period) * self.period return np.where((t0 + n <= t) & (t < t1 + n), v1, self.V_mem_rest) - def get_initial_values(self): + def get_initial_values(self) -> list[float]: Cai_0: float = 0.11712 # Cai FCa_0: float = (self.k_on * self.F_tot * Cai_0) / ( self.k_on * Cai_0 + self.k_off @@ -365,11 +365,13 @@ class Model: FCa_0, # FCa ] - def calculated_current(self, states, V): - ICaL = self.gCaL * states[1, :] * (V - self.ECaL) - return ICaL + def calculated_current(self, states: list[float], V: np.ndarray) -> np.ndarray: + Os = states[1] - def solve(self, initial_values, tspan, dt, times): + I_CaL = self.gCaL * Os * (V - self.ECaL) + return I_CaL + + def solve(self, initial_values: list[float], tspan, dt, times): times = np.arange(*tspan, dt) r = ode(self.ode_system) diff --git a/__pycache__/Model.cpython-311.pyc b/__pycache__/Model.cpython-311.pyc index b83e4405540e9b8d55edcbc3cc6ddf2dc2f28e25..284df043c237d293043263ac08219255778985ca 100644 GIT binary patch delta 2250 zcmZ{kTWpj?6vt=2+qQe__Ohkh(u-h$t!*i7K`0lCZ2_rm1d76jxcOkF%ffcs%x<~V z%B~3}ka&T72{qA}CJHtI6j@?;fcQcp4?Yx)vH6VfV4{+!S%UcB19;AC3$)<0^ZU;E z&zbw#`RCwQZ+JiRc$@^vPp2;Rr`MhImN{Obgp85xC!ecL@jRZ-v^CJo^pI0}hV&dE zm-O<`;|}f`(FqB;rIwGHLN*fSJW81Bj6%p+sJRmIa4&Q3m%iAo5bikx4QFSXNvME% zLOx!wuMng`DT7lq(~i?{pJXm17crw0Ka2xo#05(#;XdYN1F^6 z$atjhm(w3!8?R}%>DI`PpA4;aR__3NL$nS~)24m4vbAr|^dRzMOgne4fiXrn2~kEu z3QN(WB&0HhYg`XJ?7-C7e!s@Fqgu#dI(O{Ln+b!c$2^EJASVBbz6x`I?tEg7JnW5^ zC(E3{43-a_T+BIVAqsPW?q=?7BjtwSiYAO04og1NB;)0t-{v*;e91w#p9;iDlT_jA%gw5p{?r#A3uk z#1cd;;#tHZL<6D`u@+H}n1{eUikA@U5HBFA5c3I15mAHYazr(v65&8pAf7=iKrBV9 zKs=AwglI=>K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