Search found 47 matches

by pfortier
Fri Mar 13, 2009 1:24 pm
Forum: Other questions
Topic: adding new template slows down
Replies: 7
Views: 2195

Re: adding new template slows down

A wonderful feature of NEURON is that it allows simulations to be coded in many different ways. Unfortunately, when I find one way that works, I often forget to look for a better way. I'll try and develop the reflex to look in the manuals for alternate ways. Thank you for offering to write a mod fil...
by pfortier
Fri Mar 13, 2009 9:47 am
Forum: Other questions
Topic: adding new template slows down
Replies: 7
Views: 2195

Re: adding new template slows down

Thanks for the design tips. The exponential slowing down of new instances was due to the multiple use of PointProcessManager. I used this because I was reproducing an example I found of VectorPlay. Replacing the PointProcessManager with IClamp eliminated the exponential slowing down. I didn't know t...
by pfortier
Tue Mar 10, 2009 10:30 pm
Forum: Other questions
Topic: adding new template slows down
Replies: 7
Views: 2195

adding new template slows down

I generated the following template (it works well): begintemplate tpTCN external newseed, grDur, stimulatortime public soma,vcell,gnoise,electrode,stimulator create soma objref vcell,gnoise,electrode,stimulator proc init() { access soma soma { nseg = 1 diam = 76.58 L = 100 cm = 1 insert hh2 ena = 50...
by pfortier
Tue Mar 10, 2009 10:05 pm
Forum: Other questions
Topic: pass Vector as argument to a function
Replies: 7
Views: 3741

Re: pass Vector as argument to a function

This is nice.
Thanks,
Pierre
by pfortier
Mon Mar 09, 2009 10:38 am
Forum: Other questions
Topic: pass Vector as argument to a function
Replies: 7
Views: 3741

Re: pass Vector as argument to a function

Because it doesn't work. Could you please indicate what is required to make it work?
Thanks,
Pierre
by pfortier
Mon Mar 09, 2009 10:23 am
Forum: Other questions
Topic: pass Vector as argument to a function
Replies: 7
Views: 3741

Re: pass Vector as argument to a function

Thank you, that worked well. Here is a related question. Can I pass an array of objects, as shown below for example? objref ab[2][3] ab[0][0]=new Vector(10,0) ab[0][1]=new Vector(10,01) ab[0][2]=new Vector(10,02) ab[1][0]=new Vector(10,10) ab[1][1]=new Vector(10,11) ab[1][2]=new Vector(10,12) proc s...
by pfortier
Sat Mar 07, 2009 3:23 pm
Forum: Other questions
Topic: pass Vector as argument to a function
Replies: 7
Views: 3741

pass Vector as argument to a function

Is it possible to pass a Vector() as an argument to a function? For example: objref src src=new Vector(5,99) func readvector() { return $&1.x[3] // I want to have access to all other methods and properties of Vector() } print readvector(&src) If not possible for a function, then is it possible for a...
by pfortier
Sat Aug 04, 2007 1:35 pm
Forum: Other questions
Topic: odd result
Replies: 3
Views: 2182

It's not a hidden character!!! It works in the first instance as rp.repick but not in the second instance because I wrote np.repick (note "n" instead of "r"). Sorry for the waste of time and space.
by pfortier
Sat Aug 04, 2007 12:47 pm
Forum: Other questions
Topic: odd result
Replies: 3
Views: 2182

The code now works fine. I deleted the line and rewrote exactly the same code and it works. I think this is the second time it happens to me. There must be some hidden character in the line. I use kate on linux.
by pfortier
Sat Aug 04, 2007 11:10 am
Forum: Other questions
Topic: odd result
Replies: 3
Views: 2182

odd result

The following for loop works perfectly: objref rp rp = new Random() rp.poisson(3) proc loadqueue() { local tm for (tm=rp.repick+1; tm<=20; tm=tm+rp.repick+1) print tm // for loop } loadqueue() But the same for loop in a different context does not work: objref rec soma rec = new ExpSyn(0.5) objref rp...
by pfortier
Fri Aug 03, 2007 3:40 pm
Forum: Other questions
Topic: Random NetCon
Replies: 5
Views: 3214

Does NetStim have a method to get the next value? Something like: objref ns ns = new NetStim() ns.noise=.9 for i=0,10 print ns.value() The only way I know how to get the values is to run() a simulation: create dend access dend objref ns ns = new NetStim(.5) objref vec, nc, nil vec = new Vector() nc ...
by pfortier
Fri Aug 03, 2007 12:08 pm
Forum: Other questions
Topic: Random NetCon
Replies: 5
Views: 3214

I need and successfully used the first version of code with NetStim.

The second version of code using Random was attempted only as a learning exercise. It seemed possible to play a random number into a variable and have this variable act as a source to a NetCon.
by pfortier
Thu Aug 02, 2007 5:21 pm
Forum: Other questions
Topic: Random NetCon
Replies: 5
Views: 3214

Random NetCon

To send random signals to NetCon I can successfuly use NetStim: create dend objref rec dend rec = new ExpSyn(0.5) objref ns dend ns = new NetStim(.5) ns.noise=.9 objref nc dend nc=new NetCon(ns, rec, 0, 0, 1.0) tstop=300 run() Is it possible to use Random? The closest I get is: create dend objref re...
by pfortier
Sat Mar 03, 2007 3:28 pm
Forum: Other questions
Topic: ACG amplitude
Replies: 6
Views: 4659

Thanks again for your help. I got it now! The random numbers returned by the function r.ACG() should NOT be rescaled. I suspect that is why the function does not provide the means for the returned values to be rescaled. I will use the Random class functions that allow rescaling (e.g. uniform). Thank...
by pfortier
Sat Mar 03, 2007 2:40 pm
Forum: Other questions
Topic: ACG amplitude
Replies: 6
Views: 4659

Thank you for your help. I have a copy of Numerical Recipies in C. I will look up the chapter on random numbers. If I understood correctly, I can't set r.ACG(7) to return random numbers scaled by a user defined factor. So I would have to do something like use ACG() to create a vector, scale the vect...