From 30289b5744a9f720d9518ea033e5277aecc741d4 Mon Sep 17 00:00:00 2001 From: ralf Date: Fri, 12 Jul 2024 15:17:55 +0300 Subject: [PATCH] TypeError replaced with IndexError --- Model.py | 4 ++-- __pycache__/Data.cpython-311.pyc | Bin 0 -> 1840 bytes __pycache__/Model.cpython-311.pyc | Bin 0 -> 14548 bytes fitter.py | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 __pycache__/Data.cpython-311.pyc create mode 100644 __pycache__/Model.cpython-311.pyc diff --git a/Model.py b/Model.py index b076230..d14e346 100644 --- a/Model.py +++ b/Model.py @@ -332,7 +332,7 @@ class Model: n = (t // self.period) * self.period return v1 if t0 + n <= t < t1 + n else self.V_mem_rest - def solve(self, initial_values, tspan, dt): + def solve(self, initial_values, tspan, dt, times): times = np.arange(*tspan, dt) r = ode(self.ode_system) @@ -425,4 +425,4 @@ if __name__ == "__main__": Cai_0, # Cai FCa_0, # FCa ] - model.solve(initial_values=initial_values, tspan=[0, 1000], dt=1.0) + model.solve(initial_values=initial_values, tspan=[0, 1000], dt=1.0, times=None) diff --git a/__pycache__/Data.cpython-311.pyc b/__pycache__/Data.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..571dfd5a8a1f2e4b6ad1e58cb5d0364fb069ca1f GIT binary patch literal 1840 zcmZ`(&1)M+6o0cH*29n8p-B4^~B&&F)HBcUMwp zcm0J7KIGs-pgtHJXbU<7H^DvRP-qW5l>7xY=pY6Hg^)vTGWNmv)Hf?@RWvf-O2yMj{}=n#($cu0pIQW;rv2e4vfE$=f5AVHhma8s!IT!{ zrg=`l|45k*L*jm!bW`&*9U~7%2U46rTqoRDnUp~dm3cr8<&EKmUI7+DA7xl*8eqol z`Aoo?7zHmH8erCC;U~=d7jXyu?uNbzlu>gbG+dL)k|DQvqoYNa|C65)X~|b(z~ki^ z1p_@OEp3|zP$Mm?R<(?1%N{)`@3iS`vk7x63%DZa4!$bN_aA3_JqSwf!DSc+S6UL5 z#d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h&?M~C3+Z@NP0r6>O(P>a^k@aWX7MrCo4Re4vB>0kDKwo(UZV zxTaC5RB6VMlxHf%neIbkLs4EA-umb z{hhCn<^f{52vi_VPqgY+&b)T!_8Ewe87yhmm1dpvhJ{XUQEjO+EGSZ1QJt^{a3)Q9J>Gj literal 0 HcmV?d00001 diff --git a/fitter.py b/fitter.py index 7c82ca3..3b1f4c7 100644 --- a/fitter.py +++ b/fitter.py @@ -23,6 +23,7 @@ class Fitter: self.fit_results = {} self.tspan = [0, 1000] + self.initial_values=[] self.dt = 1 # 1.0 self.time_points = np.arange(*self.tspan, self.dt) @@ -58,7 +59,7 @@ class Fitter: model.K_pc_half = K_pc_half model.tau_xfer = tau_xfer - model.solve(times=self.time_points) + model.solve(times=self.time_points, tspan=self.tspan, dt=self.dt, initial_values=self.initial_values) _calc_curr = model.calculated_current() calculated_current = (