From 7d6124752b540e14e0a7cf1211fa44514d0f8a03 Mon Sep 17 00:00:00 2001 From: ralf Date: Mon, 22 Jul 2024 13:28:48 +0300 Subject: [PATCH] Added current, failed to make it work, new error to be fixed found --- Model.py | 5 +++-- __pycache__/Model.cpython-311.pyc | Bin 15141 -> 15278 bytes fitter.py | 7 +++++-- 3 files changed, 8 insertions(+), 4 deletions(-) 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 b9c7d0cb782b9b976e3752b43153a90c9b525386..e77852e9a079407801c049214991e5109f317b90 100644 GIT binary patch delta 390 zcmZ2lwyvCaIWI340}w3KotGB7k(Woao(05(0#+c+48)&ZfW&l$8ip*W1Or12V+vym zLkdGHQyP;bT(kG67OWrXV(Jkq3w! z0V2XBKx8(MxW(e>oaj>wa)JT~Om^3_(9;6)8W?Wy3-?scFk7IwAP@{y=Ga{1S6^Yc zqGV0wO52P4mK`iWB^}(GyEHjC7*|f7W*Ed+w)v%@91~;mW)2fJ7PhA#TXs(tu_)kY zViozo04F#mPqt_lxCN5F4I=J3EOi+#O%Aa%W_&ie!%~|YtN?1rK1&J450kH3 aMjM2%F$#ZRz)pSyi+@3u&6}KLbr=B1S6mAK delta 271 zcmZ2izO;;YIWI340}yCVot`GJk(WnP55$83Mj(S3h(EIdiRla}48aVVjD9N_iZ%fG zMczPS@&-){ZgwD}f#C+fa7W2zF)a=b7Lfd8d7~i4(#=Iia!ia#n>Dn-P zu0;VqBdf><1~|bsS;n$i;3i1=7KpeFBJNCHZ>h_8aq?YDW5%bG1+BDIzzQISfE0l2 tFY*Kuzc_4i^HWN5QtgV~PfoCkHV9^86#l?~o%{$E|AH)=Gx@dEVF0>ZL?8eF 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