Cannot use continuous play with Dt?

Anything that doesn't fit elsewhere.
Post Reply
patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Cannot use continuous play with Dt?

Post by patoorio » Thu Jun 27, 2013 11:49 am

Hi,

The following simple code is giving me a Segmentation fault at init():

Code: Select all

load_file("nrngui.hoc")

create soma
access soma
insert hh

objref celsiusvec,timevec
celsiusvec=new Vector(10)
celsiusvec.fill(20)
for (i=0;i<=8;i=i+2) {celsiusvec.x[i]=18}

tstop = celsiusvec.size()*1000
celsiusvec.play(&celsius, 1000,1)
init()
However if I add/replace the following lines, there is no problem:

Code: Select all

timevec=new Vector(10)
timevec.indgen(1000)

celsiusvec.play(&celsius, timevec,1)
Why can't I do continuous play with a Dt? Oh, and the code gives no problem using celsiusvec.play(&celsius, 1000,0)
I'm using Neuron 7.3 on Ubuntu 13.04

Regards.

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

Re: Cannot use continuous play with Dt?

Post by hines » Sat Jun 29, 2013 9:00 am

That's correct. One must use a time vector as the second arg in continuous mode. There is a great deal of shared logic involved due to the possibility of a discontinuity vector which does require a tvec and it seems not too onerous to do as you show in your second fragment.
Use of Dt as the second arg of Vector.play in continuous mode now generates the explicit error message:
Second argument of Vector.play in continuous mode must be a time vector
http://www.neuron.yale.edu/hg/neuron/nr ... 36db45853d
And I've updated the documentation line
vsrc.play(&var or stmt, Dt or Tvec, continuous)
to read
vsrc.play(&var or stmt, Tvec, continuous)

patoorio
Posts: 81
Joined: Wed Jan 30, 2008 12:46 pm

Re: Cannot use continuous play with Dt?

Post by patoorio » Sun Jun 30, 2013 3:26 pm

Thanks for the answer!
Yes, it's easy to make a vector; I just wanted to know if the behavior was 'bug or feature'.

Regards

Post Reply