;;
;; Reference:
;;             Sergio M. Solinas, Lia Forti, Elisabetta Cesana, 
;;             Jonathan Mapelli, Erik De Schutter and Egidio D`Angelo (2008)
;;             Computational reconstruction of pacemaking and intrinsic 
;;             electroresponsiveness in cerebellar golgi cells
;;             Frontiers in Cellular Neuroscience 2:2
;; Author:Sergio Solinas, Lia Forti, Egidio DAngelo
;; Data from: Santoro et al. J Neurosci. 2000
;;

(nemo-model Golgi_SK2

  (
   (input v celsius
    (cai from ion-pools)
    (ica from ion-currents))


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

                         (Q10 = (pow (3 ((celsius - 23) / 10))))

                         (const diff = 3) ;; Diffusion factor

                         ;; rates ca-independent
                         (const invc1 = 80e-3)
                         (const invc2 = 80e-3)
                         (const invc3 = 200e-3)

                         (const invo1 = 1)
                         (const invo2 = 100e-3)
                         (const diro1 = 160e-3)
                         (const diro2 = 1.2)

                         ;; rates ca-dependent
                         (const dirc2 = 200)
                         (const dirc3 = 160)
                         (const dirc4 = 80)

                         (invc1_t = (invc1 * Q10  ))
                         (invc2_t = (invc2 * Q10 ))
                         (invc3_t = (invc3 * Q10 ))
                         (invo1_t = (invo1 * Q10 ))
                         (invo2_t = (invo2 * Q10 ))
                         (diro1_t = (diro1 * Q10 ))
                         (diro2_t = (diro2 * Q10 ))
                         (dirc2_t = (dirc2 * Q10 ))
                         (dirc3_t = (dirc3 * Q10 ))
                         (dirc4_t = (dirc4 * Q10 ))


                         (dirc2_t_ca = (dirc2_t * (cai / diff) ))
                         (dirc3_t_ca = (dirc3_t * (cai / diff) ))
                         (dirc4_t_ca = (dirc4_t * (cai / diff) ))


                         (reaction
			  (SK2_z
			   (transitions 
                            (<-> c1 c2 dirc2_t_ca invc1_t)
                            (<-> c2 c3 dirc3_t_ca invc2_t) 
                            (<-> c3 c4 dirc4_t_ca invc3_t) 
                            (<-> c3 o1 diro1_t invo1_t) 
                            (<-> c4 o2 diro2_t invo2_t) 
                            )
                           (conserve  (1 = (c1 + c2 + c3 + c4 + o2 + o1)))
			   (open o1 o2) 
                           (power 1)))

                         (output SK2_z)
 			 
			 )

	      (component (type pore)
			 (const  gbar  = 0.038)
			 (output gbar ))

	      
	      (component (type permeating-ion) (name k)
			 (const e = -84.69)
			 (output e ))

	      (component (type modulating-ion) (name ca) )
	      
	      ) ;; end SK2 current

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

))