diff --git a/Model.py b/Model.py index ca82f02..4eb6ced 100644 --- a/Model.py +++ b/Model.py @@ -362,7 +362,10 @@ class Model: ) r.set_initial_value(initial_values, times[0]) - states = np.array([[0.0] * times.size] * len(initial_values)) + #states = np.array([[0.0] * times.size] * len(initial_values)) + #states[:, 0] = initial_values + + states = np.zeros((len(initial_values), times.size)) states[:, 0] = initial_values for i, t in enumerate(times[1:]): @@ -414,6 +417,7 @@ class Model: ax4.set_ylabel(r"$\mu mol/3l$") plt.show() + return states, V if __name__ == "__main__": diff --git a/__pycache__/Model.cpython-311.pyc b/__pycache__/Model.cpython-311.pyc index 6b87e5c..51c2fda 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 f1634e6..7fd5a0b 100644 --- a/fitter.py +++ b/fitter.py @@ -149,7 +149,12 @@ class Fitter: model.K_pc_half = K_pc_half model.tau_xfer = tau_xfer - model.solve(times=self.time_points) + states, V = model.solve( + initial_values=self.initial_values, + tspan=self.tspan, + dt=self.dt, + times=self.time_points + ) _calc_curr = model.calculated_current() calculated_current = self.convolve_current(_calc_curr, tau=tau_RC) + offset