Arbitrary waveform

NMODL and the Channel Builder.
Post Reply
Posts: 1
Joined: Thu Jun 25, 2020 7:38 am

Arbitrary waveform

Post by Andela »

Hello there,

I was getting acquainted with NEURON lately. Although my programming skills are subpar, I did some models through GUI and later edited their respective hoc or ses files successfully or edited others models I found online and used finished NMODL files in my models. I found this forum extremely helpful so thank you for that.

However, I think I have stumbled upon a wall. I was trying to create a model (cell geometry and biophysics are not as important, as long as it has hh) in which I can enter arbitrary extracellular stimulus waveform (I was thinking something like class) and find threshold for AP firing so that I can obtain SD curves for the specific waveform.

For now, I have investigated thresh.hoc file in nrn folder, which is basically a binary search, but I am not sure how to implement it with arbitrary waveform. It is relatively easy with just finding the threshold for, say, IClamp[0].amp where the stimulus is always some variation of square signal, but since I’m looking to implement arbitrary waveform I’m not sure how would I go about that. Specifically, this model ... did not work when I tried to use arbitrary IClamp[0].amp through Threshold variation probably clashes with the strict fixed nature of setting a variable through

One of the similar models I found was Extracellular stimulation of myelinated axon (Reilly 2016) available here: ... 006#tabs-1

Unfortunately, I’m not sure how to even begin to create my model for arbitrary waveform since in this example they practically created new mod file for each waveform which seems quite arduous when trying to fit in many different waveforms some of which only differ slightly.

It would be helpful if you could provide me with similar models or give me some general guidelines of how I would go about implementing this. I am guessing that using only GUI is not an option and that it should be done with NMODL hence why I am posting here. I am also not familiar with Python so it would be nice if I could avoid it altogether if possible.

Sorry to bother you and thank you in advance for your help.
Site Admin
Posts: 5918
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine

Re: Arbitrary waveform

Post by ted »

I used NMODL to generate the sine and biphasic square wave stimulus waveforms for three reasons:
1. properly written NMODL code "plays well" with adaptive integration
2. by exposing parameters but hiding implementational details, an NMODL-specified waveform generator offers the greatest convenience and security to general users
3. it is easy to write NMODL code that specifies a waveform generator whose stimulus amplitude can be conveniently varied

Since you want to use a wider variety of waveforms, my suggestion is to find a programmer who is familiar with NEURON and can collaborate with you. Whoever that is will probably ask you to define, in advance, the "space" of waveforms that you want to explore, and which parameters you want to vary.
Post Reply