diff --git a/Model.py b/Model.py index 7988459..f99227f 100644 --- a/Model.py +++ b/Model.py @@ -348,8 +348,9 @@ class Model: FCa_0, # FCa ] - def calculated_current(self): - return + def calculated_current(self, states, t, V): + ICaL = self.gCaL * states[1, :] * (V - self.ECaL) + return ICaL 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 b9c7d0c..e77852e 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 e527ec5..ffbd7a0 100644 --- a/fitter.py +++ b/fitter.py @@ -42,7 +42,7 @@ class Fitter: return current k = np.zeros(current.size) - k[k.size // 2 :] = np.exp(-np.arange(k.size // 2) / np.abs(tau)) + k[k.size // 2:] = np.exp(-np.arange(k.size // 2) / np.abs(tau)) k /= k.sum() if tau > 0: @@ -68,7 +68,10 @@ class Fitter: initial_values=self.initial_values ) - _calc_curr = model.calculated_current() + states = self.initial_values + V = model.mem_potential(t) + t = self.tspan + _calc_curr = model.calculated_current(states, t, V) calculated_current = ( self.convolve_current(_calc_curr, tau=tau_RC)[self.current_time_indecies] + offset