Well thanks for the replies. I've already tried the solutions mentioned above. I don't get a stack overflow, but the voltage traces are far from what I expected. I'll share the piece of code that creates the neuron and gives the right voltage traces.
Code: Select all
Generacion de la SAC
#Soma
soma = h.Section()
soma.push()
h.pt3dclear()
h.pt3dadd(-5,0,0,10, sec=soma)
h.pt3dadd(5,0,0,10, sec=soma)
soma.nseg = 1
soma.Ra = 200
soma.insert('pas')
#Dendritas
dend = [h.Section() for i in range(ndend)]
Isyn = []
for i in dend:
i.push()
i.connect(soma, 0, 0)
i.nseg = npoints
i.Ra = 200
i.insert('pas')
i.insert('ds')
i.e_pas = -70
i.g_pas = 0.00004
Isyn=[h.ContSynapse(ra, sec=dend[nd]) for (nd,ra) in zip(numdend,raux)]
#Orden espacial de las dendritas
for i in range(ndend):
h.pt3dclear()
theta = 2*np.pi*i/float(ndend)
h.pt3dadd(0,0,0,diam_max,sec=dend[i])
h.pt3dadd(ldend*np.cos(theta),ldend*np.sin(theta),0,diam_min,sec=dend[i])
#Agregar las conexiones postsinápticas
syn = [h.Section() for i in range(2)]
GABAsyn = []
for i in syn:
i.push()
i.nseg = 1
i.Ra = 200
i.insert('pas')
i.e_pas = -60
i.g_pas = 0.00004
GABAsyn = [h.GABAsyn(0.9, sec=dend[i]) for i in [0,2]]
h.setpointer(dend[0](0.9)._ref_v, 'vpre', GABAsyn[0])
h.setpointer(dend[2](0.9)._ref_v, 'vpre', GABAsyn[1])
Ok this code works perfectly but has the stack overflow issue. So I tried:
First, add h.pop_section() after creating the section. Result, no stack overflow, wrong voltage traces.
Then I avoided completely the section.push() and used the keyword sec=secname in h.pt3dadd. Same results.
So, I'm open to suggestions. Does anybody know where can I read about how does the section stack works? The documentation I've found so far doesn't really explains how the thing is working.
Thanks :)