Added current, failed to make it work, new error to be fixed found

This commit is contained in:
ralf 2024-07-22 13:28:48 +03:00
parent d825cdc811
commit 7d6124752b
3 changed files with 8 additions and 4 deletions

View File

@ -348,8 +348,9 @@ class Model:
FCa_0, # FCa FCa_0, # FCa
] ]
def calculated_current(self): def calculated_current(self, states, t, V):
return ICaL = self.gCaL * states[1, :] * (V - self.ECaL)
return ICaL
def solve(self, initial_values, tspan, dt, times): def solve(self, initial_values, tspan, dt, times):
times = np.arange(*tspan, dt) times = np.arange(*tspan, dt)

Binary file not shown.

View File

@ -42,7 +42,7 @@ class Fitter:
return current return current
k = np.zeros(current.size) 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() k /= k.sum()
if tau > 0: if tau > 0:
@ -68,7 +68,10 @@ class Fitter:
initial_values=self.initial_values 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 = ( calculated_current = (
self.convolve_current(_calc_curr, tau=tau_RC)[self.current_time_indecies] self.convolve_current(_calc_curr, tau=tau_RC)[self.current_time_indecies]
+ offset + offset