Page **1** of **1**

### Maximum frequency of current stimulation

Posted: **Thu Jun 18, 2020 4:56 am**

by **jaehoonlee13**

Hi,

I am trying to simulate current injection stimulation with high frequency( ~MHz).

However, when I plot the Curren injection profile, it looks like NEURON cannot follow MHz speed due to the fixed time step(dt) value.

What is the maximum frequency that I can apply and is there any way to simulate MHz sinusoidal current injection stimulation?

Regards,

Jaehoon

### Re: Maximum frequency of current stimulation

Posted: **Thu Jun 18, 2020 11:28 am**

by **ted**

jaehoonlee13 wrote: ↑Thu Jun 18, 2020 4:56 amHowever, when I plot the Curren injection profile, it looks like NEURON cannot follow MHz speed due to the fixed time step(dt) value.

So make dt smaller. If you only want to satisfy the Nyquist criterion, 5e-4 ms would be sufficient. If you really want the sampled current to approximate a sine wave, dt will have to be significantly smaller (1/10 of the period, i.e. 1e-4 ms).

### Re: Maximum frequency of current stimulation

Posted: **Thu Jun 18, 2020 9:02 pm**

by **jaehoonlee13**

Hi Ted,

How can I make dt smaller? I have read NEURON NMODL instruction manuel and it said that "neither t nor the time step dt should be changed in NMODL".

What is the default dt value and how I can change it?

### Re: Maximum frequency of current stimulation

Posted: **Mon Jun 22, 2020 10:45 am**

by **ted**

Where did you get the idea that NMODL controls t or dt? Did you read that somewhere? I ask because there's all kinds of nonsense in print and online, and if there's rubbish somewhere about NEURON, we need to know about it in order to be able to deal with it effectively.

t and dt are built-in variables that are managed by NEURON's computational engine. Their values are known to hoc as t and dt, and to Python as h.t and h.dt (assuming that Python has imported h from the neuron library). An ordinary assignment statement is sufficient to specify the value of dt. You can assign any value you like to dt as long as it is >0. However, if NEURON's gui has been loaded, during initialization dt will automatically be checked and, if necessary, forced to be consistent with the parameter steps_per_ms (in Python it's h.steps_per_ms) which controls how many points are plotted per ms. "Consistent with steps_per_ms" means that dt must equal 1/(N*steps_per_ms) where N is a whole number 1, 2, 3 . . .. This ensures that, between plotted points, the solution advances by a whole number of dt time steps.