tACS

Anything that doesn't fit elsewhere.
Post Reply
caiocaraujo
Posts: 1
Joined: Tue Oct 15, 2024 3:49 am

tACS

Post by caiocaraujo »

Dear Ted,

I am reusing a thalamocortical sleep model (Mushtaq et al, 2022)(https://doi.org/10.1371/journal.pone.0277772 ), and I would like to simulate the effects of tACS on this model's responses.

I am using the method based on the extracellular mechanism and the code that you have made available for this purpose on the date of May, 18, 2005 (http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip).

Apparently, I was able to stimulate the model. The problem is that it seems that the computer is not reading my parameters: the model shows the same responses, regardless of the stimulation parameters defined.

I change the stimulation values in DEL, DUR, AMP, in the following part of the code.

*/
// create basic stimulus waveform

// for this example use a simple rectangular pulse

// default values

DEL = 1 // ms

DUR = 1

AMP = - 0.05 // mA


Can you tell me what variables or values I should change to implement tACS as a stimulus waveform for this model?

Thank you, best regards,

Caio
ted
Site Admin
Posts: 6388
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: tACS

Post by ted »

I will assume that you are using the code in https://www.neuron.yale.edu/ftp/ted/neu ... nd_rec.zip. The amplitude and time course of the extracellular stimulus is calculated by the procedure stim_waveform() in the file stim.hoc. The functionality of that procedure is very limited: it can only set up a single rectangular pulse with a user-specified start time, duration, and amplitude. If you use NEURON to execute initxstim.hoc, you will see a "panel" (window) with a drag bar labeled "Extracellular Stimulus Current" that contains three buttons labeled del (ms), dur (ms), and amp (mA), each with its own corresponding numeric field. The values in these are 1, 1, and -0.05, which correspond to stimulus delay of 1 ms, duration of 1 ms, and amplitude of -0.05 mA. You can change any of these by clicking on the adjacent up/down arrow pairs or by clicking in the numeric field and entering whatever value you like (of course delay and duration should be nonnegative). If you examine stim.hoc you will find the code that makes this panel work: procedure setstim(), hints that are printed to the terminal, and the code that sets up the xpanel. If you execute an assignment statement at NEURON's oc> prompt, such as
DEL = 3
or
DUR = 0.1
you will also have to execute
setstim(DEL, DUR, AMP)
to make these new values take effect.

tACS uses more complex waveforms than a single rectangular pulse. For arbitrary waveforms, you'll need to construct a pair of vectors that contain the corresponding amplitude and time values, but if you're dealing with repetitive waveforms that can be specified by an algebraic equation (e.g. sine wave or zap function) or an algorithm (e.g. a sequence of ramps, steps, or whatever), you might be better off using a waveform generator specified with NMODL or maybe an event-based state machine, especially if simulation times are long or time steps are very short (e.g. sines with kilohertz frequencies).
Post Reply