Page 1 of 1

"Why can't I change dt?"

Posted: Mon Jul 30, 2012 9:47 pm
by ted
"I'm trying to use the RunControl panel to change dt, but it isn't working. What's going on?"

dt specifies the integration step size. NEURON's standard run system also has a parameter called steps_per_ms that controls the intervals at which points are plotted to graphs; its numerical value is shown in the field next to the "Points plotted/ms" button. Clearly these two parameters must be compatible, i.e. the interval between two points on a graph must contain a whole number of time steps. The design decision was that steps_per_ms would govern dt. It does this by means of a standard run system procedure called setdt() that adjusts dt as necessary to ensure that dt = 1/(steps_per_ms * i) where i is a positive integer. setdt() is executed in response to any of the following:
--changing the contents of the numerical field next to the "dt" or "Points plotted/ms" button
--calling stdinit()
--calling run()

Re: "Why can't I change dt?"

Posted: Sun Apr 23, 2023 9:50 am
by tonyclick
when I changed Pointed plotted(dt), I got different results.
I wonder if the results with more points(less dt) are more credible

Re: "Why can't I change dt?"

Posted: Sun Apr 23, 2023 2:57 pm
by ted
First, before we even get started, realize that all models are wrong, because all are based on simplifications and approximations.

Second note that credibilty has nothing to do with dt. Credibility is all about whether the simplifications and approximations that the modeler made are justifiable.

Third, dt does affect the numerical results generated by the simulation, but whether those effects are important depend on many factors. The numerical error of NEURON's fixed time step methods is proportional to dt, but deciding what dt to use always involves a tradeoff. Reducing dt might reduce error, but it definitely increases the time required to grind out a solution. And there is a point at which making dt smaller actually increases the error, because all calculations involve finite precision arithmetic, and finite precision arithmetic is susceptible to cumulative roundoff error.

As a rule, dt should be just small enough to produce useful results, and the definition of "useful results" depends on one's goal. If the aim is to produce a simulation that is qualitatively similar to some natural phenomenon--and that's the best that can reasonably be achieved, given the limitations of most experimental measurements on living systems--then there isn't much to be gained by chasing numerical precison. Just make dt small enough that further reduction of dt does not have a qualitative effect on simulation results.