% iGABAaScaled: scaled synaptic current, fast threshold modulation with inhibitory GABAa-ergic parameters
% parameters
gGABAa = [5]
EGABAa = [-80]
tauD = [10]
tauR = [0.2]
IC = [0.1]
IC_noise = [0]
prob_cxn = [1]

% fixed variables
netcon = rand(N_pre,N_post)<=prob_cxn
scalingFactor = max(sum(netcon), 1)

% functions
IGABAa(X,s) = -gGABAa./scaleFactor.*(s*netcon).*(X-EGABAa)
 
% ODEs and ICs
s' = -s./tauD + 1/2*(1+tanh(X_pre/10)).*((1-s)/tauR)
s(0) = IC+IC_noise.*rand(1,N_pre)

monitor functions % always record the synaptic current
 
% linkers
@current += IGABAa(X_post,s)