neuron = SpatialNeuron(morphology=morpho, model=eqs, Cm=Cm, Ri=Ri)
taum = Cm/gL // membrane time constant
rm = 1/(gL * pi * diameter) // membrane resistance per unit length
ra = (4 * Ri)/(pi * diameter**2) // axial resistance per unit length
la = sqrt(rm/ra) // space length
// Monitors
mon=StateMonitor(neuron,"v",record=N/2-20)
After Change
v = mon[N//2-20].v
// Theory (incorrect near cable ends)
x = 20*morpho.length[0] * meter
la = neuron.space_constant[0]
taum = Cm/gL // membrane time constant
theory = 1./(la*Cm*pi*diameter)*sqrt(taum/(4*pi*(t+defaultclock.dt)))*\
exp(-(t+defaultclock.dt)/taum-taum/(4*(t+defaultclock.dt))*(x/la)**2)
theory = theory*1*nA*0.02*ms