"Why can't I change dt?"

A collection of noteworthy items selected by our moderators from discussions about making and using models with NEURON.

Moderators: ted, wwlytton, tom_morse

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

"Why can't I change dt?"

Post 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()
tonyclick
Posts: 4
Joined: Sun Apr 09, 2023 2:03 am

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

Post 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
ted
Site Admin
Posts: 6287
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

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

Post 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.
Post Reply