Random play()

Anything that doesn't fit elsewhere.
Post Reply
porio

Random play()

Post by porio »

First, a question about this example on the play-Random command:

Code: Select all

// run the single script
// use the PointProcessManager to select IClamp
// set dur of IClamp[0] to 100
// open a new Voltage Graph
objref r
r = new Random()
r.poisson(.01)
r.play(&IClamp[0].amp)
//open a RunControl
// press Init&Run several times
I'm sorry but I can not see why it works, being the result of r.poisson always an integer!! In fact, I see the IClamp.amp value almost all the simulation as 0!!

Second: I changed the previous code using r.normal(0,0.01) instead, and it works fine. Then, I tried to make it as a density mechanism in order to forget about the size of the compartment where it is inserted. I did a .mod file simply consisting on

Code: Select all

NEURON {
	SUFFIX curr
	RANGE amp, i, gain}

PARAMETER {
	amp = 0
	gain = 1e-5 (mA/cm2)}

ASSIGNED { i (mA/cm2) }
BREAKPOINT {i = amp * gain}
And then in the hoc file I wrote (after inserting the curr mechanism)

Code: Select all

r = new Random()
r.normal(0,0.01)
r.play(&amp_curr(0.5))
but it doesn't work! Even if there only this mechanism (or together with a passive leak) no noise is seen. Of course I incremented the gain value up to 1, and nothing. In the Distributed Mechanism Viewer, under Assigned, I can see the value of i_curr and it moves randomly according to the amp and gain values, but in the voltage trace there is no noise at all. What am I doing wrong?

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

Re: Random play()

Post by ted »

Two good questions, porio.
porio wrote:a question about this example on the play-Random command:

Code: Select all

// run the single script
// use the PointProcessManager to select IClamp
// set dur of IClamp[0] to 100
// open a new Voltage Graph
objref r
r = new Random()
r.poisson(.01)
r.play(&IClamp[0].amp)
//open a RunControl
// press Init&Run several times
I'm sorry but I can not see why it works, being the result of r.poisson always an integer!!
The argument p to r.poisson(p) is 1/(the average number of trials between occurrences of
nonzero values of r.repick()). In this case p is 0.01, so the mean number of trials
between nonzero values of r.repick() is 100.

Since IClamp.amp is the variable into which r is played, there are two other important
parameters: the IClamp's own del and dur. IClamp.amp will be 0 for t<del and t>del+dur.
Only in the interval [del, del+dur] is IClamp.amp allowed to follow the fluctuations of the
random variable.

So the bottom line is that IClamp.amp will be 0 for most of the simulation, and it will only
be nonzero at brief moments in a time window that depends on the values of del and dur.

I don't know the answer to your second question.
Raj
Posts: 220
Joined: Thu Jun 09, 2005 1:09 pm
Location: Groningen, The Netherlands
Contact:

Post by Raj »

Regarding Porio's second point: It seems to me that you have to indicate that your variable 'i' is a current. Depending on what your trying to model or your preference for the sign the current should have, you have the option of using the NONSPECIFIC_CURRENT or the ELECTRODE_CURRENT keyword to do that. If your mechanism is supposed to rely on specific ions you can also use USEION. You will have to have a look at the NMODL documentation for their precise usage.
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Absolutely right, Raj. I was so focussed on hoc level issues (Random class usage) that I
completely ignored the NEURON block's contents.
porio

Post by porio »

Ooooops..... you were right.
The NONSPECIFIC_CURRENT statement did it!

Thanks a lot.
Post Reply