//Dorea Vierling-Claassen, 2010

//take average voltage at center of middle compartment of apical dendrite, 
//over all pyramids (this is the modeled LFP in Vierling-Claassen et al 2010)

Vavg_d=0
func LFP_d(){local Vsum
Vsum=0
for i=0,XD{
for j=0,YD{ 
Vsum += PL2[i][j].dend[2].v(0.5) 
//Vsum += PL2[i][j].dend[3].v(0.75) 
} }
Vavg_d=Vsum/(X_DIM*Y_DIM)
return Vavg_d
}