I am trying to apply a sinusoidal voltage to vary the membrane potential over time of a single axon model and I am would like some help figuring out the best way to do it. I am considering a VClamp in hoc, but I also saw the sinusoidal IClamp (viewtopic.php?p=19872&hilit=SEClamp#p19872) and have been looking through how to apply that. I have also been exploring the extracellular time varying input thread (viewtopic.php?p=8318&hilit=pulse+amplitude#p8318). I am very much a novice in this field, so I may have missed the easiest application!
I am using the Gaines et al (2018) paper (https://modeldb.science/243841?tab=2) as inspiration and for the .hoc and mod files. Based on my understanding of the codes, the extracellular values of every nodal, paranodal, and internodal segment is initialized as zero until the time equals the delay. During the length of time equal to the pulse width, the extracellular values are set to the values that were determined by ANSYS MAXWELL. I used a COMSOL multiphysics model to find the extracellular values and changed the .dat files to what I calculated. The overall syntax of the .hoc file is largely the same.
I tried to loop the extracellular values for the duration of the pulse width, but with my new understanding of the code, I do not think that is the correct way to do it. I also tried using the vector.sin function to generate a sinusoidal function within the extracellular voltage vectors, but I believe this varied the values over space and not time. Below is the part of the code that I am working with the most.
Code: Select all
//the following procedure only gets called at t=0, t=delay, t=delay+pulsewidth//
// changes extracellular stimulation values at the beginning of of the test and at the beginning and end of the stimulation pulse
proc set_e_ext() {
// beginning of the test
// extracellular voltage is zero, wait for t = delay to start pulse
/*
This first conditional sets all the extracellular values to 0 and waits until the simulation time reaches the defined
delay time. I have the "no pulse" print to see what stage its at when running
*/
if ($1 == 0) {
forall e_extracellular = 0//set extracellular voltage source to ground
cvode.event(delay, "set_e_ext(1)") // when to turn on
print "no pulse"
// during the stimulation pulse
// set extracellular voltage to values determined by COMSOL
// wait for the end of the pulse (t = delay + pw)
}else if ($1 == 1) {
print "pulse now!"
for t=delay,delay+pw { // I added this loop condition to see what would happen ~ dchu713
for i=0,axonnodes-1 {
node[i]{
e_extracellular = node_volt.x[i]
}
}
for i=0, paranodes1-1 {
MYSA[i]{
e_extracellular = mysa_volt.x[i]
}
}
for i=0, paranodes2-1 {
FLUT[i]{
e_extracellular = flut_volt.x[i]
}
}
for i=0, axoninter-1 {
STIN[i]{
e_extracellular = stin_volt.x[i]
}
}
}
//This cvode.even resets the extracellular voltages to zero after the pulse width
cvode.event(delay + pw, "set_e_ext(2)")
// end of the stimulation pulse
// reset extracellular stimulation to zero
// wait for the beginning of a new test
}else if ($1 == 2) {
print "Other case?"
forall e_extracellular = 0
cvode.event(0, "set_e_ext(0)")
}
}