Code: Select all
NEURON {
SUFFIX playtest
:RANGE xx : doesn't work
:NONSPECIFIC_CURRENT xx : doesn't work
:GLOBAL xx : works, but inflexible
:ELECTRODE_CURRENT xx : doesn't work
:POINTER xx : can't figure out proper usage
NONSPECIFIC_CURRENT ixi
}
UNITS {
(mV) = (millivolt)
(mA) = (milliamp)
(mS) = (millisiemens)
(S) = (siemens)
(nW) = (nanowatts)
(uA) = (microamp)
(uF) = (microfarads)
}
PARAMETER {
}
ASSIGNED {
celsius (degC)
v (mV)
xx (mA)
ixi (mA)
}
INITIAL { ixi = 0
}
BREAKPOINT {
ixi = xx*2
}
This Python script is how I am using vector.play()
Code: Select all
from neuron import h
from matplotlib import pyplot as plt
h.load_file("stdrun.hoc")
data = h.Vector([ 1,5,17,2,4,38,22,43,1, 1])
time = h.Vector([1,2,3,4,5,6,7,8,9,10])
cell = h.Section(name='neurite')
cell.nseg = 2 # arbitrary
cell.L = 40 # arbitrary
cell.diam = 5 # arbitrary
for sec in h.allsec():
sec.insert(h.playtest)
sec.insert(h.hh)
for seg in sec:
data.play(seg.playtest.xx, time, True)
t = h.Vector().record(h._ref_t)
v = h.Vector().record(cell(0.5)._ref_v)
xxp = h.Vector().record(cell(0.5).playtest._ref_xx)
# xxp = h.Vector().record(h._ref_xx_playtest) # for GLOBAL implementation
# data.play(h._ref_xx_playtest, time, True) # for GLOBAL implementation
h.finitialize(-65)
h.continuerun(10)
plt.plot(t,xxp)
plt.show()