load_file("nrngui.hoc")

load_file("Starfishtrunc.hoc")
celsius=24

for i=0,8 soma[i] {
	insert passsd
	g_passsd=1.273e-05
	erev_passsd=-59.419
	insert Kleaksd
	gkl_Kleaksd=3.1262e-06
	Ra=300
	cm=0.9
	ek=-95
	insert IM
	gbar_IM=0.000012
        insert Ikdrf
        gbar_Ikdrf = 0.0006
        insert Ikdrs
        gbar_Ikdrs = 0.00023
        insert Ika
        gbar_Ika = 0.00025
	insert Nasoma
	gna_Nasoma = 0.0107
	ena=90
	insert Ih
	//gkhbar_Ih=0.00005
	//eh=-32
}

for i=0,43 dendrite[i] {
	insert passsd
	g_passsd=1.273e-05
	erev_passsd=-59.419
	insert Kleaksd
	gkl_Kleaksd=3.1262e-06
	insert IM
        gbar_IM = 0.000012
        insert Ikdrf
        gbar_Ikdrf = 0.0006
        insert Ikdrs
        gbar_Ikdrs = 0.00023
        insert Ika
        gbar_Ika = 0.00025
	Ra=300
	cm=0.9
	ek=-95
        insert cal
        gcalbar_cal = 0.0025
        insert cad
        insert cat
        gbar_cat = 0.00025
        insert kca
        gkbar_kca = 0.00055
        insert Nadend
        gna_Nadend = 0.0117
        ena=90
        if (hD == 1) {
          insert Ih
        }
}

for i=0,7 axon[i] {insert passaxon
	g_passaxon=4.3282e-05
	erev_passaxon=-59.419
	insert Kleakaxon
	gkl_Kleakaxon=1.0629e-05
	insert Ikdrfaxon
        gbar_Ikdrfaxon = 0.0006
        insert Ikdrsaxon
        gbar_Ikdrsaxon = 0.00023
	Ra=300
	cm=0.9
	ek=-95
	insert Nadend
	gna_Nadend = 0.0117
	ena=90
} 

/* 
 * Need to call this again, because we have changed Ra and cm,
 * which affects the number of compartments since lambda_f
 * is calculated using these two parameters in each section.
 */
geom_nseg()