% # iK_PYso_JB12:
%
% Fast delayed rectifier potassium current, for generic pyramidal soma
% compartments used in the DynaSim implementation of (Benita et al., 2012). The
% paper claims this mechanism is derived from (Wang, 1998) with "slight
% variations".
%
% - 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
%     - Wang, X-J. (1998). Calcium coding and adaptive temporal computation in
%     cortical pyramidal neurons. J. Neurophysiol. 79, 1549–1566.
%
% - Tags: potassium, current, intrinsic, pyramidal, soma
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parameters
gK = 10.5 % mS/cm^2
EK = -100 % mV

phi = 4 % temperature factor

nKIC = 0.05
nKNoiseIC = 0.05

% Functions
alphaN(X) = 0.01.*(X+34)./(1 - exp(-(X+34)./10))
betaN(X) =  0.125.*exp(-(X+44)./25)

IK_PYso_JB12(X,nK) = -gK.*nK.^4.*(X-EK)

monitor IK_PYso_JB12

% ODEs and ICs
nK' = phi.*((alphaN(X).*(1-nK)) - (betaN(X).*nK))
nK(0)=nKIC+nKNoiseIC.*rand(1,Npop)

% Interface
@current += IK_PYso_JB12(X,nK)