TypeError replaced with IndexError

This commit is contained in:
ralf 2024-07-12 15:17:55 +03:00
parent 0824b0c4fe
commit 30289b5744
4 changed files with 4 additions and 3 deletions

View File

@ -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)

Binary file not shown.

Binary file not shown.

View File

@ -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 = (