I am trying to work with Neuron software for my thesis to simulate the stimulation of neuron with extracellular electrodes. But I came across some difficulties while programming with Neuron. Could somebody kindly share their knowledge with me and help? Actually, I am trying to use ‘extracellular mechanism’ to make Neuron software understand that there is an extracellular stimulation coming from the electrodes to the neuron. However, in my case, I do not have to calculate the e_extracellular using Neuron software itself because I already have the data from the matlab. I just want the Neuron to understand that there is an extracellular potential just next to the neuron and I want the Neuron software to change the e_extracellular in response to the biphasic stimulation waveform that I am planning to fed. So, I tried programming accordingly so that the value of e_extracellular would change in response to the biphasic stimulation but every time I try running the program using ‘init&run’ in ‘runcontrol’ it says ‘changed dt’ and I see no result. I was expecting the graph of e_extracellular to change with time (in response to biphasic stimulation) but I see a blank graph with no results. I tried a lot but with no luck. Now I doubt if I am in the right tract. I would be very grateful if somebody could kindly suggest something. The program looks as following for a single neuron with one soma and dendrite. Thanks in advance.
Code: Select all
load_file("nrngui.hoc")
create soma, dend
access soma
soma {
nseg = 1
diam = 18.8
L = 18.8
insert hh
gnabar_hh = 0.24
gkbar_hh = 0.036
}
dend {
nseg = 5
diam = 3.18
L = 701.9
insert hh
gnabar_hh = 0
gkbar_hh = 0
}
//connect things together
connect dend(0), soma(1)
// passive & active membrane properties
v_init = -69
forall {
Ra = 100 //Ohm.cm
cm = 1 // µF/cm2
gl_hh = 3*1e-5 // Ohm/cm2
insert extracellular
}
// Extracellular potential
proc insert_extracellular() {local inte
inte = $1
insert_extracellular_soma(inte)
insert_extracellular_dendrite(inte)
}
proc insert_extracellular_soma() {
inte = $1
soma e_extracellular(0.5) = inte*0.303904097136 //value from matlab
}
proc insert_extracellular_dendrite() {
inte = $1
dend e_extracellular(0.5) = inte*0.303809370157 //from matlab
}
// biphasic stimulation initial parameters//
intensity0_def = 0
intensity1_def = -1 // -1 for a cathodic stimulation, ...
intensity2_def = 0
intensity3_def = 1 // ... +1 for an anodic stimulation
intensity4_def = 0
length0 = 1 //time length of delay at 0 intensity
length1 = 1 //time length of duration of cathodic stimulation (-1)
length2 = 0 //time length for intensity 0
length3 = 1 //time length for anodic stimulation (1)
length4 = 45 //time length for stimulus to end at 0 intensity
time0 = 0
time1 = time0 + length0
time2 = time1 + length1
time3 = time2 + length2
time4 = time3 + length3
time5 = time4 + length4
dt0 = 0.05
intensity = 1
// Procedures //
//initialisation
proc init() {
t=0
tstart = 0
tstop = 0
dt = dt0
finitialize(v_init) // set all state variables
fcurrent()
forall{el_hh = (ina + ik + gl_hh*v_init)/gl_hh}
}
proc run2() {
// (-2) Initialisation
init()
// (-1) Insert extracellular
intensity0 = intensity0_def*intensity
intensity1 = intensity1_def*intensity
intensity2 = intensity2_def*intensity
intensity3 = intensity3_def*intensity
intensity4 = intensity4_def*intensity
// (0) Phase 0 : delay
tstart=tstop
tstop=tstop+length0
if(tstop>tstart) {run3(intensity0,tstart,tstop)}
// (1) Phase 1
tstart=tstop
tstop=tstop+length1
if(tstop>tstart) {run3(intensity1,tstart,tstop)}
// (2) Phase 2
tstart=tstop
tstop=tstop+length2
if(tstop=tstart) {run3(intensity2,tstart,tstop)}
// (3) Phase 3
tstart=tstop
tstop=tstop+length3
if(tstop>tstart) {run3(intensity3,tstart,tstop)}
// (4) Phase 4 : end of stimulation
tstart=tstop
tstop=tstop+length4
if(tstop>tstart) {run3(intensity4,tstart,tstop)}
}
proc run3() {local inte, tstart, tstop
inte = $1
tstart = $2
tstop = $3
insert_extracellular(inte)
advance(tstart,tstop)
}
proc advance() {local tstart, tstop
tstop = $2
tstart=$1
t=tstart
dt=0.05
secondorder=0
while (t < tstop) {
fadvance()
V_soma = soma.v(0.5)
print V_soma
}
}
run2()