% # iHVA_PYdr_JB12:
%
% High-threshold Calcium current, Hodgkin-Huxley-style, for generic pyramidal
% dendrite compartments used in the DynaSim implementation of (Benita et al.,
% 2012). Note that this is called "iCa" in the original paper.
%
% - 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
%
% - Exposes: @IHVA_PYdr_JB12 calcium current as required by "CaBuffer_PYdr_JB12"
%
% - Tags: calcium, current, intrinsic, pyramidal, dendrite
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Parameters
gHVA = 0.43 % mS/cm^2
EHVA = 120  % mV

% Functions
Minf(X) = 1./(1 + exp(-(X+20)./9))

% Note: For why the current term was not made negative, see below.
% AES
% IHVA_PYdr_JB12(X) = gHVA.*Minf(X).^2.*(X-EHVA)
IHVA_PYdr_JB12(X) = -gHVA.*Minf(X).^2.*(X-EHVA)

monitor IHVA_PYdr_JB12

% Interface
% Note: Usually in DynaSim, the current is made negative
% before being assigned to a linker, but in this case, the
% below is less confusing since exposing IHVA_PYdr_JB12 for the
% CaBuffer_PYdr_JB12 mechanism requires a not-made-negative
% version of IHVA_PYdr_JB12.
% AES
% @current += -IHVA_PYdr_JB12(X)
@current += IHVA_PYdr_JB12(X)
@IHVA_PYdr_JB12 += IHVA_PYdr_JB12(X)