From f333d5b3b642ae407dfb0564cecb0ef9c69ac44d Mon Sep 17 00:00:00 2001 From: sNaze Date: Thu, 14 Mar 2024 03:19:58 +1000 Subject: [PATCH] BOLD initialization : avoid divide by zero with default params --- neurolib/models/bold/timeIntegration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neurolib/models/bold/timeIntegration.py b/neurolib/models/bold/timeIntegration.py index 7b3b82d6..0bad7c9c 100644 --- a/neurolib/models/bold/timeIntegration.py +++ b/neurolib/models/bold/timeIntegration.py @@ -99,12 +99,12 @@ def integrateBOLD_numba(BOLD, X, Q, F, V, Z, dt, N, rho, alpha, V0, k1, k2, k3, for i in range(len(Z[0, :])): # loop over all timesteps # component-wise loop for compatibilty with numba for j in range(N): # loop over all areas + F[j] = max(F[j], EPS) + X[j] = X[j] + dt * (Z[j, i] - K[j] * X[j] - Gamma[j] * (F[j] - 1)) Q[j] = Q[j] + dt / Tau[j] * (F[j] / rho * (1 - (1 - rho) ** (1 / F[j])) - Q[j] * V[j] ** (1 / alpha - 1)) V[j] = V[j] + dt / Tau[j] * (F[j] - V[j] ** (1 / alpha)) F[j] = F[j] + dt * X[j] - F[j] = max(F[j], EPS) - BOLD[j, i] = V0 * (k1 * (1 - Q[j]) + k2 * (1 - Q[j] / V[j]) + k3 * (1 - V[j])) return BOLD, X, F, Q, V