// Author: Etay Hay, 2011
//    Models of Neocortical Layer 5b Pyramidal Cells Capturing a Wide Range of
//    Dendritic and Perisomatic Active Properties
//    (Hay et al., PLoS Computational Biology, 2011) 
//
// Model of L5 Pyramidal Cell, constrained for BAC Firing

begintemplate L5PCbiophys
public biophys

proc biophys() {
	forsec $o1.all {
	  insert pas
		cm = 1
		Ra = 100
		e_pas = -90
	}

  forsec $o1.somatic {
	  insert Ca_LVAst 
	  insert Ca_HVA 
	  insert SKv3_1 
	  insert SK_E2 
	  insert K_Tst 
	  insert K_Pst 
	  insert Nap_Et2 
	  insert NaTa_t
		insert CaDynamics_E2
		insert Ih
		ek = -85
		ena = 50
		gIhbar_Ih = 0.0002
    g_pas = 0.0000344 
  	decay_CaDynamics_E2 = 486.0 
  	gamma_CaDynamics_E2 = 0.000549 
  	gCa_LVAstbar_Ca_LVAst = 0.00432 
  	gCa_HVAbar_Ca_HVA = 0.000567 
  	gSKv3_1bar_SKv3_1 = 0.766 
  	gSK_E2bar_SK_E2 = 0.0556 
  	gK_Tstbar_K_Tst = 0.0326 
  	gK_Pstbar_K_Pst = 0.000547 
  	gNap_Et2bar_Nap_Et2 = 0.00496 
  	gNaTa_tbar_NaTa_t = 1.71 
  }

	forsec $o1.apical {
		cm = 2
		insert Ih
  	insert SK_E2 
  	insert Ca_LVAst 
  	insert Ca_HVA 
  	insert SKv3_1 
  	insert NaTa_t 
  	insert Im 
  	insert CaDynamics_E2
		ek = -85
		ena = 50
    decay_CaDynamics_E2 = 88.9 
    gamma_CaDynamics_E2 = 0.0005 
    gSK_E2bar_SK_E2 = 0.00186 
  	gSKv3_1bar_SKv3_1 = 0.000298 
  	gNaTa_tbar_NaTa_t = 0.0211 
  	gImbar_Im = 0.00006 
  	g_pas = 0.0000447 
	}
	$o1.distribute_channels("apic","gIhbar_Ih",2,-0.8696,3.6161,0.0,2.0870,0.00020000000) 
	$o1.distribute_channels("apic","gCa_LVAstbar_Ca_LVAst",3,1.000000,0.010000,685.000000,885.000000,0.0198000000) 
	$o1.distribute_channels("apic","gCa_HVAbar_Ca_HVA",3,1.000000,0.100000,685.000000,885.000000,0.0004370000) 
	
  forsec $o1.basal {
		cm = 2
		insert Ih
		gIhbar_Ih = 0.0002
  	g_pas = 0.0000535 
	}

  forsec $o1.axonal {
  	g_pas = 0.000045 
	}
}

endtemplate L5PCbiophys