diff --git a/Model.py b/Model.py index cc5f129..ca82f02 100644 --- a/Model.py +++ b/Model.py @@ -318,11 +318,12 @@ class Model: ] def mem_potential(self, t): + t = np.asarray(t) v1 = 0 t0 = 100 t1 = 350 n = (t // self.period) * self.period - return v1 if t0 + n <= t < t1 + n else self.V_mem_rest + return np.where((t0 + n <= t) & (t < t1 + n), v1, self.V_mem_rest) def get_initial_values(self): Cai_0 = 0.11712 # Cai diff --git a/__pycache__/Model.cpython-311.pyc b/__pycache__/Model.cpython-311.pyc index a9b4952..6b87e5c 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 bdb2852..f1634e6 100644 --- a/fitter.py +++ b/fitter.py @@ -69,7 +69,7 @@ class Fitter: ) states = self.initial_values - t = model.tspan + t = [0, 1000] V = model.mem_potential(t) _calc_curr = model.calculated_current(states, t, V) calculated_current = (