// Author: Etay Hay, 2013
// Preserving axosomatic spiking features despite diverse dendritic morphology (Hay et al., 2013, J.Neurophysiology)
//
// Model of L5 Pyramidal Cell, age p14, constrained for Step Firing, with passive dendrites
// optimized with the exemplar morphology

begintemplate L5PCbiophys
public biophys

proc biophys() {
	$o1.delete_axon2(3,1.75,1,1)
	
	$o1.myelin{
		insert pas
		cm = 0.02
		Ra = 100
		e_pas = -75
		g_pas = 4e-5
	}
	
	forsec $o1.all {
		insert pas
		cm = 1
		Ra = 100
		e_pas = -75
		g_pas = 4e-5
	}

	forsec $o1.axonal {
		insert Ca_LVAst 
		insert Ca_HVA 
		insert CaDynamics_E2 
		insert SK_E2 
		insert SKv3_1 
		insert K_Tst 
		insert K_Pst 
		insert Nap_Et2 
		insert NaTg
		insert Ih
		ek = -85
		ena = 50
		gIhbar_Ih = 0.00008

		vshifth_NaTg = 10 
		slopem_NaTg = 9 
		gamma_CaDynamics_E2 = 0.0005

		gNaTgbar_NaTg = 0.604170 
		gNap_Et2bar_Nap_Et2 = 0.000212 
		gK_Pstbar_K_Pst = 0.274692 
		gK_Tstbar_K_Tst = 0.083169 
		gSKv3_1bar_SKv3_1 = 0.532552 
		gSK_E2bar_SK_E2 = 0.012630 
		gCa_HVAbar_Ca_HVA = 0.001362 
		gCa_LVAstbar_Ca_LVAst = 0.000158 
		decay_CaDynamics_E2 = 21.335402 
	}
        
	forsec $o1.somatic {
		insert Ca_LVAst 
		insert Ca_HVA 
		insert CaDynamics_E2 
		insert SK_E2 
		insert SKv3_1 
		insert K_Tst 
		insert K_Pst 
		insert NaTg 
		insert Ih
		ek = -85
		ena = 50
		gIhbar_Ih = 0.00008
		gamma_CaDynamics_E2 = 0.0005

		vshiftm_NaTg = 13 
		vshifth_NaTg = 15 
		slopem_NaTg = 7 

		gNaTgbar_NaTg = 0.235647 
		gK_Pstbar_K_Pst = 0.003795 
		gK_Tstbar_K_Tst = 0.040220 
		gSKv3_1bar_SKv3_1 = 0.121245 
		gSK_E2bar_SK_E2 = 0.191181 
		gCa_HVAbar_Ca_HVA = 0.000148 
		gCa_LVAstbar_Ca_LVAst = 0.007651 
		decay_CaDynamics_E2 = 402.789052 
	}
	
	forsec $o1.apical {
		cm = 2
		insert Ih
		g_pas = g_pas*cm 
	}
	$o1.distribute_channels("apic","gIhbar_Ih",2,-0.8696,3.6161,0.0,2.0870,0.00008) 
	
	forsec $o1.basal {
		cm = 2
		insert Ih
		gIhbar_Ih = 0.00008
		g_pas = g_pas*cm 
	}
}
  

endtemplate L5PCbiophys