## Low Frequency Stimulation model

SpasikDan1
Posts: 3
Joined: Mon Oct 25, 2021 9:02 pm

### Low Frequency Stimulation model

Hello NEURON community,

I am still very new to NEURON (I have only ever created two models with it), so I am very open to criticism and being pointed in any direction with a project I am working on.
I am attempting to replicate a study done in the link provided below:

https://pubmed.ncbi.nlm.nih.gov/23981713/

In short, I am opting to replicate the suppression of of epileptic activity through extracellular Low Frequency Stimulation (LFS). My hypothesis was that by utilizing an existing model (like shown below), I can use extracellular electrodes that output LFS to inhibit the epileptic activity in the program.

https://senselab.med.yale.edu/ModelDB/S ... 20/#tabs-1

My question pertains mostly with how to make extracellular AC electrodes. In the past I simple made a vectors in MATLAB with time and DC values that I input into NEURON with the following code:

objref pfile, pvector
pfile=new File("potentials.txt") //Voltage vector generated in MATLAB
pfile.ropen()
pvector=new Vector(51)
pvector.scanf(pfile)
pfile.close()

objref Ifile, Ivec
Ifile=new File("squarepulse.txt") //time vector generated in MATLAB
Ifile.ropen()
Ivec=new Vector()
Ivec.scanf(Ifile)
Ifile.close()

objref stimvec
fract_dist_of_first_segment=(axon.L/nseg/2)/axon.L
inter_segment_fract_length=1/nsegobjref pfile, pvector
for i=0,50{
stimvec=Ivec.c.mul(pvector.x)
stimvec.play(&axon.e_extracellular(fract_dist_of_first_segment+i*inter_segment_fract_length),dt)}
run()

Would this still be practical using an existing model?
ted
Posts: 5981
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

### Re: Low Frequency Stimulation model

You've got the general idea. However

1. Every pass through the
for i=0,50
loop overwrites the same objref (stimvec, which is synonymous with stimvec). Consequently e_extracelluar will have the same value in all segments.

2. Code that uses whole numbers to iterate over segments doesn't scale well. Instead of
for i=0,50 { do something to the ith segment }
it is better to use the iterator syntax
for (x,0) { do something to the currently accessed segment }

Example:

Code: Select all

``````create axon
axon.nseg = 5
axon {
print "normalized locations of all segment centers in ", secname()
for (x, 0) print x
print " "
print "normalized locations of all nodes in ", secname()
print "(includes the nodes at 0 and 1)"
for (x) print x
}``````
3. Code that uses subscripted variable names (names of the form foo[x] where x is a whole number) doesn't scale well. Lists are a far better way to manage collections of variables. Example:

Code: Select all

``````objref stimvecs, tmpobj
stimvecs = new List()
// assumes axon is the currently accessed section
i = 0
for (x,0) {
tmpobj = Ivec.c.mul(pvector.x[i])
tmpobj.play(e_extracellular(x), dt)
stimvecs.append(tmpobj) // now the stim data for this segment
// is referenced by an objref in the stimvecs list
// so it's OK to overwrite tmpobj with new values
i += 1
}``````
Notice that this code uses no "magic numbers" and will work properly regardless of the value of nseg.

4. Using a different stimulus vector for each segment in a model is OK if there aren't many segments and tstop is small. More efficient would be to use a density mechanism that is inserted into all sections and has a GLOBAL parameter whose value can be driven by a single Vector.play() statement. "How do I make each segment have a different value for e_extracelluar?" Use a segment-specific scale factor implemented as a RANGE variable. "How do I couple this mechanism to each segment's e_extracellular?" Do that with a RANGE variable that is a POINTER. Search the NEURON Forum for mention of xtra.mod or xtra.zip.

About that model entry in ModelDB--

1. those cells have rather arbitrary shapes which might be analogous to the shapes of real cells, but they're definitely not morphometric reconstructions.

2. in order to calculate the extracellular potential at the location of each segment center, you're going to have to decide how you calculate those locations. But before that, you'll have to decide where you want the cells to be placed in space, and what their orientations should be.
SpasikDan1
Posts: 3
Joined: Mon Oct 25, 2021 9:02 pm

### Re: Low Frequency Stimulation model

Ted,

Thank you for your reply! I'm still new to a lot of this so I'm trying my hardest to interpret a lot of the response. I've chosen to go with a more simplistic model of building my own neuron rather than an existing model. My follow up question to you is whether the methods you prescribed would function for an AC electrode rather than a single direct current?
ted