I am trying to make a very simple simulation where I have two sections which are connected. I put in constant DC current in the end of one of the sections, and I want to look at the steady state membrane potential distribution across both sections. I am using neuron in python. I have made a simple function which looks like this (the funtion make_section() is a very basic one I made housed in simpleNrnLib):
Code: Select all
from simpleNrnLib import *
def simpleComputational():
dend = make_section("dend")
dend.L = 1000
dend.diam = 10
dend.nseg = 21
dend.insert('pas')
soma = make_section("soma")
soma.L = 1000
soma.diam = 10
soma.nseg = 21
soma.insert('pas')
soma.connect(dend,1,0) # connect dend(1) to soma(0)
for sec in h.allsec():
sec.Ra = 200
sec.cm = 5.001
for seg in sec:
seg.pas.g = 5e-5
seg.pas.e = 0
iClamp = make_iClamp(dend(0))
iClamp.delay = 10
iClamp.amp = 1.2
iClamp.dur = 500000
voltage = h.RangeVarPlot("v")
voltage.begin(0)
voltage.end(1)
tstop = 5000
v_init = -60
h.dt = 0.025
h.finitialize(v_init)
h.fcurrent()
run(tstop)
vVec = h.Vector()
pVec = h.Vector()
voltage.to_vector(vVec,pVec)
return pVec,vVec
Thanks