Pyramidal Neuron Deep: attenuation in dendrites (Stuart, Spruston 1998)

 Download zip file   Auto-launch 
Help downloading and running models
Accession:3677
Stuart, G. and Spruston, N. Determinants of voltage attenuation in neocortical pyramidal neuron dendrites. Journal of Neuroscience 18:3501-3510, 1998.
Reference:
1 . Stuart G, Spruston N (1998) Determinants of voltage attenuation in neocortical pyramidal neuron dendrites. J Neurosci 18:3501-10 [PubMed]
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Neuron or other electrically excitable cell;
Brain Region(s)/Organism:
Cell Type(s): Neocortex L5/6 pyramidal GLU cell;
Channel(s): I h;
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: NEURON;
Model Concept(s): Parameter Fitting;
Implementer(s): Spruston, Nelson [Spruston at Northwestern.edu];
Search NeuronDB for information about:  Neocortex L5/6 pyramidal GLU cell; I h;
proc init_params() {
	strdef somareadfile, dendreadfile
/*	somareadfile="ri21scs.asc" */ /* "ri21scs.asc" */
/*	dendreadfile="ri21dcs.asc" */ /* "ri21dcs.asc" */
	somav="dend1[13].v(0.5)"    /* somatic recording site */
	dendv="dend1[232].v(0.99)"  /* dendritic recording site */
	/* initialize user-defined membrane parameters */
	celsius = 35
	/* fit long pulse attenuation before dendritic sag kicks in */
	/* attenuation = 0.634 */
	global_ra=147    /* internal resistivity in ohm-cm */
	Cm=1.0          /* specific membrane capacitance in uF/cm^2 */
	Rm=19263        /* specific membrane resistivity in ohm-cm^2 */
	Vleak=-75
	Vrest=-75       /* resting potential in mV */
	maxq=0.0025      /* gqbar value */
	maxq=0.000013	/* for nu sag, init5, qscale=10 */
	maxq=0.0017	/* for nu sag, init5, qscale=0.01 */
	qblock=0         /* fraction of q current blocked by Cs */
	nablock=1        /* fraction of na current blocked by TTX */
	kblock=1         /* fraction of k current blocked */
	spinescale=2.0  /* scale total area to account for spines */
	areascale=0.882216  /* scale total area by an additional factor */
	target=54.5    /* input resistance target */
  /* parameters for low Ri, nonuniform Rm simulation (init_nurm3) */
  /* short pulse fit not too bad */
	if (nurm==3) {
		global_ra=75
		rmsoma = 32000
		rmend = 4000
		rmhalfdis=400
		rmsteep=150
		areascale=0.882216
	}
  /* parameters for low Ri, nonuniform Rm simulation (init_nurm4) */
	if (nurm==4) {
		global_ra=91.7
		rmsoma = 29767
		rmend = 1018.5
		rmhalfdis=730
		rmsteep=50
		Cm=1.1035
		areascale=1.0
		/* from best fit with 5 free parameters */
	}
  /* initq1 with init_pass (uniform Rm and sag) */
	if ((initq==1) && (nurm==1) && (qblock<1)) {
		Vleak=-75
		maxq=0.00011
		a0_q=0.0004
		b0_q=a0_q
		zeta_q=6
	}
  /* initq1 with nurm3 */
	if ((initq==1) && (nurm==3) && (qblock<1)) {
		Vleak=-75
		maxq=0.000115
		lowv=-67
		highv=-64
		a0_q=0.00057
		b0_q=a0_q
	}
  /* initq8 with init_pass */
	if ((initq==8) && (nurm==1) && (qblock<1)) {
		Vleak=-75
		qscale=0.02
		maxq=0.02
		qhalfdis=600
		qsteep=75
		a0_q=0.0002
		b0_q=a0_q
		zeta_q=6
	}
  /* initq8 with init_nurm3 */
	if ((initq==8) && (nurm==3) && (qblock<1)) {
		qscale=0.002
		maxq=0.016
		qhalfdis=600
		qsteep=75
		Vleak=-84
		lowv=-66
		highv=-56
	}
  /* initq10 with init_nurm4 */
	if ((initq==10) && (nurm==4) && (qblock<1)) {
		qscale=0.002
		maxq=0.016
		qhalfdis=600
		qsteep=75
		Vleak=-84
		lowv=-66
		highv=-56
	}
}

proc init() { local dtsav
	finitialize(Vrest)
	fcurrent()
	if (writeout>0) {
		somasimvec.record(&dend1[13].v(0.5))
		dendsimvec.record(&dend1[232].v(0.99))
	}
	if (qblock<1) {
		dtsav=dt
		dt=10
		t=1e6
		printf("initializing")
		for i=0,40 {
			printf(".")
			fadvance()
		}
		printf("\n")
		dt=dtsav
		finitialize()
	}
	t=0
	ss_save()
}

proc advance() {
	fadvance()
	ss_subtract()
}

proc ss_save() {
	Vrestsoma=somaticv()
	Vrestdend=dendriticv()
	ss_subtract()
}

proc ss_subtract() {
	vsoma=somaticv()-Vrestsoma-75
	vdend=dendriticv()-Vrestdend-75
}

proc insert_pass() {
	print "Inserting passive membrane properties\n"
	forall {insert pas Ra=global_ra e_pas=Vleak}
}

proc insertq() {
	printf("Inserting sag conductance in all segments: %d pecent blocked\n",qblock*100)
	forall { insert qq gqbar_qq=0 }
}

proc init_pass() {
	global_ra=$1*100
	dendscale=spinescale*areascale
	somascale=areascale*1.0
	print "init_pass: Initializing uniform passive membrane properties"
	forall { g_pas=1/(Rm/dendscale) cm=Cm*dendscale Ra=global_ra e_pas=Vleak}
	/* the following segments are NOT scaled for spines *
	/* these include the axon, soma, 1st 100 um of apical trunk, */
	/*  and the 1st 20 um of basals */
	/* the reconstructed axon */
	axon { g_pas=1/(Rm/somascale) cm=Cm*somascale Ra=global_ra e_pas=Vleak}
	soma { g_pas=1/(Rm/somascale) cm=Cm*somascale Ra=global_ra e_pas=Vleak}
	for i=0,7 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=31,34 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=49,51 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=762,764 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=881,885 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=858,860 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=886,889 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=959,960 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=991,992 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=1027,1029 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=1031,1032 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	for i=1046,1047 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale}
	}
	forall{v=Vleak}
}

proc init_nurm() {
	dendscale=spinescale*areascale
	somascale=areascale*1.0
	/* rmscale is set in init_params */
	/* decrease rmscale to steepen decrease in Rm */
	/* as a function of distance (decreases to zero at 600 or so) */
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	print "Initializing nonuniform passive membrane properties\n"
	forall { g_pas=1/(Rm/dendscale) cm=Cm*dendscale Ra=global_ra e_pas=Vleak}
	for i=14,749 {
		access dend1[i]
		dis=distance(0)
		dend1[i] {g_pas=1/((Rm/dendscale)*(1-dis/rmscale)) }
	}
	/* the following segments are NOT scaled for spines */
	/* these include the axon, soma, 1st 100 um of apical trunk, */
	/*  and the 1st 20 um of basals */
	/* the reconstructed axon */
	axon { g_pas=1/(Rm/somascale) cm=Cm*somascale }
	soma { g_pas=1/(Rm/somascale) cm=Cm*somascale }
	for i=0,7 {
		access dend1[i]
		dis=distance(0)
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] {g_pas=1/((Rm/somascale)*(1-dis/rmscale)) cm=Cm*somascale }
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] {g_pas=1/((Rm/somascale)*(1-dis/rmscale)) cm=Cm*somascale }
	}
	for i=31,34 {
		dend1[i] {g_pas=1/((Rm/somascale)*(1-dis/rmscale)) cm=Cm*somascale }
	}
	for i=49,51 {
		dend1[i] {g_pas=1/((Rm/somascale)*(1-dis/rmscale)) cm=Cm*somascale }
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=762,764 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=881,885 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=858,860 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=886,889 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=959,960 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=991,992 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=1027,1029 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=1031,1032 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
	for i=1046,1047 {
		dend1[i] {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	}
}

proc init_nurm2() {
	dendscale=spinescale*areascale
	somascale=areascale*1.0
	/* nonlinear decrease in Rm from rmsoma to rmend */
	/* rmsoma and rmend are set in init_params */
	maxdis=1220
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	print "Initializing nonuniform passive membrane properties\n"
	forall { g_pas=1/(rmsoma/dendscale) cm=Cm*dendscale Ra=global_ra e_pas=Vleak}
	for i=14,749 {
		access dend1[i]
		dis=distance(0)
		rmpoint=(rmsoma-rmend)*exp(-dis/lambdadis)+rmend
		dend1[i] {g_pas=1/(rmpoint/dendscale) }
	}
	/* the following segments are NOT scaled for spines */
	/* these include the axon, soma, 1st 100 um of apical trunk, */
	/*  and the 1st 20 um of basals */
	/* the reconstructed axon */
	axon { g_pas=1/(Rm/somascale) cm=Cm*somascale }
	soma { g_pas=1/(Rm/somascale) cm=Cm*somascale }
	for i=0,7 {
		access dend1[i]
		dis=distance(0)
		dend1[i] {g_pas=1/(rmsoma/somascale) cm=Cm*somascale }
	}
	/* the real soma */
	for i=8,17 {
		access dend1[i]
		dis=distance(0)
		rmpoint=(rmsoma-rmend)*(1-(-dis/maxdis))+rmend
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		access dend1[i]
		dis=distance(0)
		rmpoint=(rmsoma-rmend)*exp(-dis/lambdadis)+rmend
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	for i=31,34 {
		access dend1[i]
		dis=distance(0)
		rmpoint=(rmsoma-rmend)*exp(-dis/lambdadis)+rmend
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	for i=49,51 {
		access dend1[i]
		dis=distance(0)
		rmpoint=(rmsoma-rmend)*exp(-dis/lambdadis)+rmend
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=762,764 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=881,885 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=858,860 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=886,889 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=959,960 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=991,992 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=1027,1029 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=1031,1032 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=1046,1047 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
}

proc init_nurm3() {
	global_ra=$1*100
	dendscale=spinescale*areascale
	somascale=areascale*1.0
	/* sigmoidal decrease in Rm from rmsoma to rmend */
	/* rmsoma and rmend, and rmhalfdis and rmsteep are set in init_params */
	maxdis=1220
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	print "init_nurm3: Initializing nonuniform passive membrane properties\n"
	forall {g_pas=1/(rmsoma/dendscale) cm=Cm*dendscale Ra=global_ra e_pas=Vleak}
	for i=14,749 {
		access dend1[i]
		dis=distance(0)
		rmpoint=rmend+(rmsoma-rmend)/(1+exp((dis-rmhalfdis)/rmsteep))
		dend1[i] {g_pas=1/(rmpoint/dendscale) }
	}
	/* the following segments are NOT scaled for spines */
	/* these include the axon, soma, 1st 100 um of apical trunk, */
	/*  and the 1st 20 um of basals */
	/* the reconstructed axon */
	axon {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	soma {g_pas=1/(Rm/somascale) cm=Cm*somascale }
	for i=0,7 {
		access dend1[i]
		dis=distance(0)
		dend1[i] {g_pas=1/(rmsoma/somascale) cm=Cm*somascale }
	}
	/* the real soma */
	for i=8,17 {
		access dend1[i]
		dis=distance(0)
		rmpoint=rmend+(rmsoma-rmend)/(1+exp((dis-rmhalfdis)/rmsteep))
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		access dend1[i]
		dis=distance(0)
		rmpoint=rmend+(rmsoma-rmend)/(1+exp((dis-rmhalfdis)/rmsteep))
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	for i=31,34 {
		access dend1[i]
		dis=distance(0)
		rmpoint=rmend+(rmsoma-rmend)/(1+exp((dis-rmhalfdis)/rmsteep))
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	for i=49,51 {
		access dend1[i]
		dis=distance(0)
		rmpoint=rmend+(rmsoma-rmend)/(1+exp((dis-rmhalfdis)/rmsteep))
		dend1[i] {g_pas=1/(rmpoint/somascale) }
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=762,764 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=881,885 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=858,860 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=886,889 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=959,960 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=991,992 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=1027,1029 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=1031,1032 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
	for i=1046,1047 {
		dend1[i] { g_pas=1/(rmsoma/somascale) }
	}
}

proc init_nurm4() {
	Cm=$1
	dendscale=spinescale*areascale
	somascale=areascale*1.0
	/* sigmoidal decrease in Rm from rmsoma to rmend */
	/* rmsoma and rmend, and rmhalfdis and rmsteep are set in init_params */
	/* differs from nurm3 in that function applies to basal dendrites also */
	maxdis=1220
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	print "Initializing nonuniform passive membrane properties with nurm4\n"
	forall {g_pas=1/(rmsoma/dendscale) cm=Cm*dendscale Ra=global_ra e_pas=Vleak}
	if (nuri>0) {
		init_nuri()	/* initialize nonuniform Ri */
	}
	for i=0,1103 {
		access dend1[i]
		dis=distance(0)
		rmpoint=rmend+(rmsoma-rmend)/(1+exp((dis-rmhalfdis)/rmsteep))
		dend1[i] {g_pas=1/(rmpoint/dendscale) }
	}
	/* the following segments are NOT scaled for spines */
	/* these include the axon, soma, 1st 100 um of apical trunk, */
	/*  and the 1st 20 um of basals */
	/* the reconstructed axon */
	axon { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	soma { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	for i=0,7 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=31,34 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=49,51 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=762,764 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=881,885 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=858,860 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=886,889 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=959,960 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=991,992 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=1027,1029 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=1031,1032 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
	for i=1046,1047 {
		dend1[i] { g_pas=g_pas*somascale/dendscale cm=Cm*somascale/dendscale }
	}
}

proc initq1() {
	/* uniform sag in all compartments */
/*	Vleak=-69 */
/*	maxq=0.00015 */
/*	a0_q=0.00057 */
/*	b0_q=a0_q */
	forall { gqbar_q=maxq*dendscale*(1-qblock)}
	printf("Initializing sag conductance in all segments - %d pecent blocked\n",qblock*100)
	/* the reconstructed axon */
	axon { gqbar_q=0}
	soma { gqbar_q=maxq*somascale*(1-qblock)}
	for i=0,7 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock) }
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=31,34 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=49,51 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=762,764 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=881,885 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=858,860 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=886,889 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=959,960 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=991,992 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=1027,1029 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=1031,1032 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=1046,1047 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
}

proc initq2() {
	/* sag scaled by a factor of qscale in nonspiny compartments */
	qscale=0
	Vleak=-70
	maxq=0.00018
	a0_q=0.00057
	b0_q=a0_q
	if (qblock<1) {
		forall { gqbar_q=maxq*dendscale*(1-qblock)}
		printf("Initializing sag conductance in all segments - %d pecent blocked\n",qblock*100)
	}
	/* the reconstructed axon */
	axon { gqbar_q=0 }
	soma { gqbar_q=0 }
	for i=0,7 {
		dend1[i] { gqbar_q=0 }
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=31,34 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=49,51 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=762,764 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=881,885 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=858,860 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=886,889 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=959,960 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=991,992 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=1027,1029 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=1031,1032 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
	for i=1046,1047 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)*qscale}
	}
}

proc initq3() {
	/* sag scaled by a factor of qscale */
	/* in all compartments beyond last oblique */
	qscale=20
	Vleak=-76
	maxq=0.00009
	a0_q=0.00057
	b0_q=a0_q
	forall { gqbar_q=maxq*dendscale*(1-qblock)}
	printf("Initializing sag conductance in all segments\n %d pecent blocked\n",qblock*100)
	/* the reconstructed axon */
	axon { gqbar_q=0 }
	soma { gqbar_q=0 }
	for i=0,7 {
		dend1[i] { gqbar_q=0 }
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=31,34 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=49,51 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=762,764 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=881,885 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=858,860 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=886,889 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=959,960 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=991,992 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=1027,1029 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=1031,1032 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	for i=1046,1047 {
		dend1[i] { gqbar_q=maxq*somascale*(1-qblock)}
	}
	/* now scale up sag in all compartments distal to last oblique */
	for i=204,749 {
		dend1[i] { gqbar_q=maxq*dendscale*(1-qblock)*qscale}
	}
}

proc initq4() {
	/* scale up sag as a function of distance from the soma */
	/* global linear function of distance doesn't seem to work, */
	/* even for ridiculously steep gradients */
	qscale=0.1
	Vleak=-74
	maxq=0.0000001
	a0_q=0.00041
	b0_q=a0_q
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	printf("Initializing sag conductance in all segments\n %d pecent blocked\n",qblock*100)
	forall { gqbar_q=maxq*dendscale*(1-qblock)}
	for i=0,1103 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*dendscale*(1-qblock)*dis/qscale)
	}
	/* the reconstructed axon */
	axon { gqbar_q=0 }
	soma { gqbar_q=0 }
	for i=0,7 {
		dend1[i] { gqbar_q=0 }
	}
	/* the real soma */
	for i=8,17 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=31,34 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=49,51 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=762,764 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=881,885 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=858,860 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=886,889 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=959,960 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=991,992 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=1027,1029 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=1031,1032 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
	for i=1046,47 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq+(maxq*somascale*(1-qblock)*dis/qscale)
	}
}

proc initq5() {
	/* scale up sag as a function of distance from the soma */
	/* try linear gradient restricted to apical dendrites */
	/* q=maxq(qscale+(dis/maxdis)) */
	/* qscale is fraction of maxq at soma, must be between 0 and 1 */
	/* smaller qscale values give steeper gradients */
	/* maxq set in init_params */
	maxdis=1220
	qscale=0.01
	a0_q=0.00041
	b0_q=a0_q
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	printf("Initializing nonuniform sag conductance in all segments\n %d pecent blocked\n",qblock*100)
	forall { gqbar_q=maxq*qscale*(1-qblock)}
	for i=14,749 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*dendscale*(1-qblock)
	}
	/* the reconstructed axon */
	axon { gqbar_q=0 }
	soma { gqbar_q=0 }
	for i=0,7 {
		dend1[i] { gqbar_q=0 }
	}
	/* the real soma */
	for i=8,17 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=31,34 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=49,51 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=762,764 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=881,885 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=858,860 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=886,889 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=959,960 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=991,992 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=1027,1029 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=1031,1032 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
	for i=1046,1047 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=maxq*(qscale+(dis/maxdis))*somascale*(1-qblock)
	}
}

proc initq8() {
	/* scale up sag as a sigmoidal function of distance from the soma */
	/* q=minq+(maxq-minq)/(1+exp((-dis-qhalfdis)/qsteep)) */
	/* minq=qscale*maxq */
	/* set maxq, qscale, and qhalfdis and qsteep in init_params */
	maxdis=1220
	minq=qscale*maxq
/*	a0_q=0.00041 */
/*	b0_q=a0_q */
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	printf("Initializing sag conductance in all segments\n %d pecent blocked\n",qblock*100)
/*	forall { gqbar_q=qscale*maxq*dendscale*(1-qblock) } */
/*	this method (next line) makes gqbar_q=0 in the basal dendrites */
	forall { gqbar_q=0 }
	for i=14,749 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*dendscale*(1-qblock)
	}
	/* the reconstructed axon */
	axon { gqbar_q=0 }
	soma { gqbar_q=0 }
	for i=0,7 {
		dend1[i] { gqbar_q=0 }
	}
	/* the real soma */
	for i=8,17 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=31,34 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=49,51 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=762,764 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=881,885 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=858,860 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=886,889 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=959,960 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=991,992 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=1027,1029 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=1031,1032 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
	for i=1046,1047 {
		access dend1[i]
		dis=distance(0)
		gqbar_q=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_q=gqbar_q*somascale*(1-qblock)
	}
}

proc initq10() {
	qten_qq=$1*10
	/* scale up sag as a sigmoidal function of distance from the soma */
	/* q=minq+(maxq-minq)/(1+exp((-dis-qhalfdis)/qsteep)) */
	/* minq=qscale*maxq */
	/* set maxq, qscale, and qhalfdis and qsteep in init_params */
	/* differs from initq9 in that function applies to basals as well */
	maxdis=1220
	minq=qscale*maxq
	dis=0
	access dend1[13]
	area(0.5)
	distance()
	printf("Initializing sag conductance in all segments with initq10\n")
	forall { gqbar_qq=0 }
	for i=0,1103 {
		access dend1[i]
		dis=distance(0)
		gqbar_qq=minq+(maxq-minq)/(1+exp(-(dis-qhalfdis)/qsteep))
		gqbar_qq=gqbar_qq*dendscale*(1-qblock)
	}
	/* the reconstructed axon */
	axon { gqbar_qq=0 }
	soma { gqbar_qq=0 }
	for i=0,7 {
		dend1[i] { gqbar_qq=0 }
	}
	/* the real soma */
	for i=8,17 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	/* the 1st 100 um of the apical trunk */
	for i=18,22 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=31,34 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=49,51 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	/* the 1st 20 um of the basals */
	for i=750,755 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=762,764 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=881,885 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=858,860 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=886,889 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=959,960 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=991,992 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=1027,1029 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=1031,1032 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
	for i=1046,1047 {
		dend1[i] { gqbar_qq=gqbar_qq*somascale/dendscale }
	}
}