% # iA_PYso_JB12:
%
% Fast A-type potassium current, for generic pyramidal soma compartments used
% in the DynaSim implementation of (Benita et al., 2012). The original paper
% cites this mechanism from (Golomb and Amitai, 1997).
%
% - References:
%     - Benita, J. M., Guillamon, A., Deco, G., & Sanchez-Vives, M. V. (2012).
%     Synaptic depression and slow oscillatory activity in a biophysical
%     network model of the cerebral cortex. Frontiers in Computational
%     Neuroscience, 6. https://doi.org/10.3389/fncom.2012.00064
%     - Golomb, D., & Amitai, Y. (1997). Propagating neuronal discharges in
%     neocortical slices: computational and experimental study. Journal of
%     Neurophysiology, 78(3), 1199–1211.
%     https://doi.org/10.1152/jn.1997.78.3.1199
%
% - Tags: potassium, current, intrinsic, pyramidal, soma
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parameters
gA = 1 % mS/cm^2
EA = -100 % mV, same as potassium reversal potential

tauH = 15 % ms
phi = 1 % temperature factor
hAIC = 0.1
hANoiseIC = 0.1

% Functions
Minf(X) = 1./(1 + exp(-(X+50)./20))
Hinf(X) = 1./(1 + exp((X+80)./6))

IA_PYso_JB12(X,hA) = -gA.*Minf(X).^3.*hA.*(X-EA)

monitor IA_PYso_JB12

% ODEs and ICs
hA' = phi.*(Hinf(X) - hA)./tauH
hA(0)=hAIC+hANoiseIC.*rand(1, Npop)

% Interface
@current += IA_PYso_JB12(X,hA)