Stimulating a Cell
Posted: Tue Jan 03, 2023 9:30 pm
Can anyone help me understand why this code elicits no response in the cell? I've confirmed it's excitable with h.IClamp(), and this code is an adaptation of Ted's from another post. I don't understand the problem.
Appreciate it!
Appreciate it!
Code: Select all
# plays a waveform into xtra's is
from neuron import h, gui
from matplotlib import pyplot as plt
import numpy as np
dend = h.Section(name='dend') # name='dend' for nice section names in NEURON's graphs
dend.insert('pas')
dend.insert('hh')
dend.insert('extracellular') # this mechanism's defaults are OK
dend.insert('xtra')
dend.nseg = 5 # so we can see variation over distance
for seg in dend:
seg.xraxial[0] = 1e9
seg.xraxial[1] = 1e9
seg.xg[0] = 1e9
seg.xg[1] = 1e9
seg.xc[0] = 0
seg.xc[1] = 0
seg.xtra._ref_im = seg._ref_i_membrane
seg.xtra._ref_ex = seg._ref_e_extracellular
seg.xtra.x = 0
seg.xtra.y = 0
seg.xtra.z = 0
# Vector.play with interpolation needs 6 points to define a rectangular pulse
# successive elements of tsvec and isvec specify the x,y coordinates
# of the pulse waveform's "breakpoints"
time = np.arange(6)
t = np.insert(time, 3,2)
t = np.insert(t,5,4)
mag = [0,0,0,1e4,1e4,1e4,0,0]
tsvec = h.Vector().from_python(t)
isvec = h.Vector().from_python(mag)
# now drive h.is_xtra
isvec.play(h._ref_is_xtra, tsvec, 1)
ti = h.Vector().record(h._ref_t)
v = h.Vector().record(dend(0.5)._ref_v)
h.finitialize(-65)
h.continuerun(5)
plt.plot(tsvec,isvec)
plt.show()
plt.plot(ti, v)
plt.show()