Keep Lines in Space Plot: Only two lines plotted

The basics of how to develop, test, and use models.
Post Reply
Eric Thomson
Posts: 15
Joined: Thu Mar 02, 2006 11:18 am
Contact:

Keep Lines in Space Plot: Only two lines plotted

Post by Eric Thomson »

I have recently begun working through The Neuron Book. Great stuff!

I am having a problem getting the space plot to show multiple lines. I am following the example given in Figure 1.36, but instead of multiple lines it is ploting only two lines: the initial state (resting potential along the neuraxis), and the final state (in this case, the voltage along the neuraxis at the final simulation time).

I am using version 5.8, with the run control parameters as follows:
Continue til: 5 ms
Continue for: 5 ms
Tstop: 6 ms
dt: .025
Points plotted/ms: 5
Scrn update: .05 s

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

Use Movie Run if you have space or shape plots

Post by ted »

I'm glad you like the book.

The problem you encountered occurred because of improvements that were made
to NEURON while the book was in press. The fix is to use
Tools / Movie Run
to bring up a Movie Run panel. Launch simulations by clicking on Init & Run in that
panel and your space plots (and shape plots) will work fine.

I will add a note about this to the book's "errata and discussion" thread
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=316

Explanation

Solutions are generated at intervals specified by dt, but graphs whose x axis is time
show plots of variables sampled at intervals ("steps") that are integer multiples of
1/steps_per_ms (you'll see the value of steps_per_ms in the field next to the
Points plotted/ms button).

When we were writing chapter 1, steps_per_ms also controlled updates of space
plots. However, while the book was "in press" at an advanced stage, a new version
of NEURON was released that contained several improvements. These included
changes that sped up the most commonly encountered screen updates. A side-effect
of these changes was that space plots were not refreshed at every "step." To help
users deal with this problem, proc movierun() was added to the standard run system.
The Movie Run tool was added to the GUI for the convenience of those who use
the GUI for simulation control.

Eric Thomson
Posts: 15
Joined: Thu Mar 02, 2006 11:18 am
Contact:

Post by Eric Thomson »

Beautiful. Many thanks.

eacheon
Posts: 97
Joined: Wed Jan 18, 2006 2:20 pm

Post by eacheon »

Is it also fine to do

Code: Select all

g.addobject(rvp) // rvp is a RangeVarPlot
flush_list.append(g) // g is a Graph
?

It seems working fine for me.

My question is, what would be the time interval these curves got drawn? my "Points plotted/ms" is 40 (default), "Scrn update invl(s)" is 0.05.

It is supposed to be "integer multiples of 1/steps_per_ms", so "integer multiples of 0.025ms" according to your post.

However I still do not know what is the multiple, is it 0.05*1000/0.025 = 2000? (thus the "step" you mentioned is actually controlled by "Scrn update invl(s)") or something else?

My space plot seems to get 1/5 = 0.2(ms) intervals between two consecutive curves, so I am very confused. Where is this multiple defined? and what does the "Scrn update invl(s)" mean?

hines
Site Admin
Posts: 1598
Joined: Wed May 18, 2005 3:32 pm

Post by hines »

MovieRun does a single 1/(Points plotted/ms) step every (Seconds per step) seconds (assuming the fadvance is not the rate limiting step). See nrn/lib/hoc/movierun.hoc . For a MovieRun, everything computed comes out on the time and space plots.

When one presses the Init&Run button on the RunControl, the simulation is supposed to go as fast as possible and instead of plotting every point to a time plot as it is generated, they are saved and plotted as a group every (Scrn update invl) seconds. For small models, 5 ms of points at 0.025 ms per point (200 points) often comes out in just one or two bursts. But this has the effect that for space plots, the curves are saved and erased many times before a buffer to screen flush takes place. Hence the space plot curves that actually make it to the screen buffer are at somewhat random times depending on the value of t when the (Scrn update invl)comes around. The implementation is in the
proc continuerun() procedure in nrn/lib/hoc/stdrun.hoc

Post Reply