;
;   Ca++ current responsible for low threshold spikes (LTS)
;   RETICULAR THALAMUS
;
;   Model of Huguenard & McCormick, J Neurophysiol 68: 1373-1383, 1992.
;   The kinetics is described by standard equations (NOT GHK)
;   using a m2h format, according to the voltage-clamp data
;   (whole cell patch clamp) of Huguenard & Prince, J Neurosci.
;   12: 3804-3817, 1992.  The model was introduced in Destexhe et al.
;   J. Neurophysiology 72: 803-818, 1994.
;   See http://www.cnl.salk.edu/~alain , http://cns.fmed.ulaval.ca
;
;    - Kinetics adapted to fit the T-channel of reticular neuron
;    - Q10 changed to 5 and 3
;    - Time constant tau_h fitted from experimental data
;    - shift parameter for screening charge
;
;   ACTIVATION FUNCTIONS FROM EXPERIMENTS (NO CORRECTION)
;
;   Reversal potential taken from Nernst Equation
;
;   Written by Alain Destexhe, Salk Institute, Sept 18, 1992
;

(nemo-model Golgi_CaLVA

  (
   (input v celsius
          (ca2i from ion-pools)
          (ca2o from ion-pools)
          (ica2 from ion-currents))


   (component (type ionic-current) (name CaLVA )
	      
	      (component (type gate)

                         (const shift   = 2) ; screening charge for Ca_o = 2 mM

                         (const v0_m_inf = -50)
                         (const v0_h_inf = -78)
                         (const k_m_inf  = -7.4)
                         (const k_h_inf  = 5.0)
	
                         (const C_tau_m   = 3)
                         (const A_tau_m   = 1.0)
                         (const v0_tau_m1 = -25)
                         (const v0_tau_m2 = -100)
                         (const k_tau_m1  = 10)
                         (const k_tau_m2 = -15)
	
                         (const C_tau_h   = 85)
                         (const A_tau_h   = 1.0)
                         (const v0_tau_h1 = -46)
                         (const v0_tau_h2 = -405)
                         (const k_tau_h1  = 4)
                         (const k_tau_h2  = -50)

			 
			 ;; rate functions

                         (phi_m = (pow (5.0 ((celsius - 24) / 10))))
                         (phi_h = (pow (3.0 ((celsius - 24) / 10))))
	
                         (m_inf = (1.0 / ( 1 + exp ((v + shift - v0_m_inf) / k_m_inf)) ))
                         (h_inf = (1.0 / ( 1 + exp ((v + shift - v0_h_inf) / k_h_inf)) ))
	
                         (tau_m = ( (C_tau_m + A_tau_m / ( exp ((v + shift - v0_tau_m1) / k_tau_m1) + 
                                                          exp ((v + shift - v0_tau_m2) / k_tau_m2) ) ) / phi_m) )

                         (tau_h = ( (C_tau_h + A_tau_h / ( exp ((v + shift - v0_tau_h1 ) / k_tau_h1) + 
                                                          exp ((v + shift - v0_tau_h2) / k_tau_h2) ) ) / phi_h) )


			 (hh-ionic-gate 
			  (CaLVA  ;; ion name: exported variables will be of the form {ion}_{id}
			   (initial-m  m_inf)
			   (initial-h  h_inf)
			   (m-power    2)
			   (h-power    1)
			   (m-inf      m_inf)
			   (m-tau      tau_m)
			   (h-inf      h_inf)
			   (h-tau      tau_h)
			   ))
			 )
	      

	      (component (type pore)
			 (const  gbar  = 2.5e-4)
			 (output gbar ))

	      
	      (component (type permeating-ion) (name ca2)
                         (const F = 96485.0)
                         (const R = 8.3145)
			 (e = ((1e3) * (R * (celsius + 273.15)) / (2 * F) * log10 (ca2o / ca2i)))
			 (output e ))

	      
	      ) ;; end CaLVA current

	      (component (type voltage-clamp) (name CaLVA)
           
			 (const vchold   = -71)
			 (const vcbase   = -69)
			 (const vcinc    = 10)
			 (const vcsteps  = 8)
			 (const vchdur   = 200)
			 (const vcbdur   = 30)
           
			 (output vchold vcbase vcinc vcsteps vchdur vcbdur)
			 )


))