Code: Select all
NEURON {
POINT_PROCESS SpikeOut
RANGE thresh, refrac, vrefrac, grefrac
NONSPECIFIC_CURRENT i
}
PARAMETER {
thresh = -55 (millivolt)
refrac = 1 (ms)
vrefrac = -65 (millivolt)
grefrac = 100 (microsiemens) : clamp to vrefrac
}
ASSIGNED {
i (nanoamp)
v (millivolt)
g (microsiemens)
}
INITIAL {
net_send(0, 3)
g = 0
}
: up to here, executed once
BREAKPOINT {
i = g*(v - vrefrac)
}
NET_RECEIVE(w) {
if (flag == 1) {
v = vrefrac
g = grefrac
net_event (t) : tells that an event, spike, occured at time t to other neurons.
net_send(refrac, 2)
}else if (flag == 2) {
g = 0
}else if (flag == 3) {
WATCH (v > thresh) 1 : if v >= thresh -> net_send(0,1) -> NET_RECEIVE(w=1) watch is being
: executed in each time step, you :dont have to call it.
}
}
Code: Select all
begintemplate purkinjecell
public soma, threshold, undershootpotential, spikegenerator
create soma
objref spikegenerator
proc init() {
// note the NEURON units
diameter = 25.5 // micrometer
//soma.cm = 0.64 // microfarad / cm^2
//soma.cm = 5 // microfarad / cm^2. for 1980 paper
soma.cm = 0.69 // microfarad / cm^2
// specificmembraneresistance = 120.2 * 10 ^ 3 // ohm . cm^2
//specificmembraneresistance = 40 * 10 ^ 3 // ohm . cm^2. for 1980 paper
specificmembraneresistance = 10 * 10 ^ 3 // ohm . cm^2
surfacearea = 40821 // micrometer ^ 2
length = surfacearea / (PI * diameter) // micrometer
membraneresistance = specificmembraneresistance / (surfacearea * 10 ^ -8)
soma {
diam = diameter
L = length
// leakage mechanism
insert pas
g_pas = (1 / membraneresistance) / (surfacearea * 10 ^ -8) // S/cm^2
//e_pas = -25 // adjust to get 40 hz
//e_pas = 25 // adjust to get 40 hz. for 1980 paper
e_pas = -54.9 // adjust to get 30 hz
Ra = 141.9 // ohm.cm
}
spikegenerator = new SpikeOut(0.5)
// as thresh is local variable, spikegenerator has the attribute thresh.
threshold = spikegenerator.thresh
undershootpotential = spikegenerator.vrefrac
}
endtemplate purkinjecell
However, when I generate 2 cells and stimulate the second cell, it doesn't fire. I checked that it has the nmodl mechanism, but somehow it doesn't work properly. Here's the script:
Code: Select all
from neuron import h
import numpy
from pylab import plot, show
h.load_file ("purkinje cell.hoc")
purkinjecellx = h.purkinjecell ()
purkinjecelly = h.purkinjecell ()
stimulus = h.IClamp (0.5, sec = purkinjecelly.soma)
stimulus.delay = 100
stimulus.dur = 300
stimulus.amp = 0.1
time = h.Vector()
membranepotential = h.Vector()
time.record(h._ref_t)
membranepotential.record (purkinjecelly.soma(0.5)._ref_v)
h.load_file("stdrun.hoc")
h.init()
h.v_init = purkinjecelly.undershootpotential
h.tstop = 500
h.run()
time = numpy.array(time)
membranepotential = numpy.array(membranepotential)
plot(time, membranepotential)
show()
Thanks in advance