Search found 194 matches

by ramcdougal
Wed Jul 23, 2014 5:44 pm
Forum: NEURON + Python
Topic: Section stack overflow
Replies: 7
Views: 4386

Re: Section stack overflow

Your problem doesn't lie in creating the sections; it lies in "i.push()". You're pushing "i" onto the section stack without ever popping anything from the section stack, so the stack grows and grows. In my opinion, one should never use Section.push. In your specific case, none of your code accesses ...
by ramcdougal
Wed Jul 09, 2014 5:32 pm
Forum: Reaction-diffusion in NEURON
Topic: Overriding _w_currents() in rxd.py
Replies: 4
Views: 7656

Re: Overriding _w_currents() in rxd.py

You are correct; when _currents(rhs) is invoked, rhs already contains the collected currents (ica + ina + ik + etc...), so the current and the voltage derivative (contained in rhs) both must be changed separately. This is because nrn_nonvint_block_current is invoked after nrn_rhs in src/nrnoc/treese...
by ramcdougal
Mon Jul 07, 2014 6:52 pm
Forum: NEURON + Python
Topic: A Python interface for NEURON using ctypes
Replies: 2
Views: 1707

Re: A Python interface for NEURON using ctypes

If you're using NEURON 7.3 or higher, neuron.nrn_dll() returns a ctypes object corresponding to the NEURON library. The main difficulty here is that the C API exists only informally; there is no documentation or promise of what functions will have a stable interface, but you are encouraged to poke a...
by ramcdougal
Thu Jun 26, 2014 4:29 pm
Forum: NEURON + Python
Topic: Segfault when running long simulation with many neurons
Replies: 3
Views: 2807

Re: Segfault when running long simulation with many neurons

There is a subtle and unfortunate distinction between h.run and neuron.run. The full code of neuron.run (defined here ) is: def run(tstop): """ function run(tstop) Run the simulation (advance the solver) until tstop [ms] """ h('tstop = %g' % tstop) h('while (t < tstop) { fadvance() }') You'll notice...
by ramcdougal
Thu Jun 26, 2014 12:35 am
Forum: Adding new mechanisms and functions to NEURON
Topic: add/omit a synapse for different iterations
Replies: 3
Views: 2843

Re: add/omit a synapse for different iterations

The safest way to avoid any risk of cross-contamination from multiple experiments is to run them independently in separate processes. Obviously, doing this manually is not a good use of your time. You could write a shell script that launches NEURON repeatedly with arguments indicating what simulatio...
by ramcdougal
Wed Jun 04, 2014 1:52 pm
Forum: Reaction-diffusion in NEURON
Topic: Basic modelling question
Replies: 7
Views: 14527

Re: Basic modelling question

As long as a species has a "name" and lives on an rxd.Region with nrn_region = 'i' (or 'o'), then its concentrations will respond to currents. You have a minor syntactic error: rxd.Region takes a list of sections; it does not accept a string. For example, you could do something like: from neuron imp...
by ramcdougal
Tue Dec 17, 2013 7:47 pm
Forum: NEURON + Python
Topic: nrnpython+matplotlib gui thread hangs
Replies: 1
Views: 4006

Re: nrnpython+matplotlib gui thread hangs

As of 7.4 (978), Python threads do not execute when the HOC interpreter is waiting for input. To do interactive matplotlib and interviews graphics simultaneously from HOC, simply run a two-line python wrapper. For example, test.hoc, below plots y = x ^ 2 in both Interviews and matplotlib windows: nr...
by ramcdougal
Sun Dec 23, 2012 11:31 pm
Forum: Other questions
Topic: NEURON distribution license
Replies: 3
Views: 3378

Re: NEURON distribution license

I was asked to share my thoughts. The grant guidelines are long, so here's a little more context: "There is no prescribed single license... however... reviewers will be instructed to evaluate dissemination plans relative to these goals," which includes providing a license that "permit[s] the commerc...
by ramcdougal
Fri Jun 01, 2012 11:19 pm
Forum: NEURON + Python
Topic: reset NEURON
Replies: 10
Views: 6766

Re: reset NEURON

This is an issue for me since every time I run my program in the same python interpreter, the hoc interpreter is not cleared and new sections are added to the previous ones. The workaround that always works is to create a class based on your model cell. An alternative strategy for non-interactive p...
by ramcdougal
Fri Mar 09, 2012 1:13 pm
Forum: NEURON + Python
Topic: passing strdef from python and List.browser
Replies: 1
Views: 1419

Re: passing strdef from python and List.browser

Pure Python version, thanks to mctavish:

Code: Select all

from neuron import h, gui

listbox = h.List()
for i in xrange(3):
    listbox.append(h.Random())
listbox.browser('title', lambda: 'obj %d' % h.hoc_ac_)
by ramcdougal
Wed Mar 07, 2012 5:39 pm
Forum: NEURON + Python
Topic: passing strdef from python and List.browser
Replies: 1
Views: 1419

passing strdef from python and List.browser

Is there a way to work with strdefs in the abstract in python without them being evaluated to a particular value? For example, the List object's browser method takes a strdef and a function that is called repeatedly which is supposed to change the strdef to define list labels. In the following code,...
by ramcdougal
Fri Nov 04, 2011 1:33 pm
Forum: Other questions
Topic: arc3d distance
Replies: 1
Views: 1348

arc3d distance

According to The NEURON Book page 109, arc3d(i) is the anatomical distance of the ith 3-D point from the 0 end of the section. I think the following code constructs two sections s1 and s2, makes s2 a child of s1 whose 1 end is connected to s1's 1 end, and then prints their x, y, z, and arc length va...
by ramcdougal
Wed Sep 07, 2011 1:00 pm
Forum: UNIX/Linux
Topic: building interviews
Replies: 1
Views: 3700

building interviews

I tried building interviews from scratch on a mostly standard Ubuntu system. I had to install libx11-dev, but otherwise I basically just cloned the hg repository, ran build.sh, configure, then make. Make fails at the step: /bin/bash ../../../libtool --mode=link g++ -g -O2 -o idraw idarrow.o idarrowh...
by ramcdougal
Tue Oct 06, 2009 2:01 am
Forum: Other questions
Topic: overlaid range variable plots
Replies: 5
Views: 2145

Re: overlaid range variable plots

RangeVarPlots will respect Keep Lines if you add them to the flush_list and display them using h.flushPlot() (but not w.flush()). My final working code is w=h.Graph() # create graph window w.size(-totalLength*.05, totalLength, -.0001, .002) # set axes stick.push() cai_rvp=h.RangeVarPlot('cai') cai_r...
by ramcdougal
Mon Oct 05, 2009 3:56 pm
Forum: Other questions
Topic: overlaid range variable plots
Replies: 5
Views: 2145

Re: overlaid range variable plots

I do not want smooth updates of RangeVarPlots. I want to see (effectively) RangeVarPlots for different time values overlapping each other, as in the first two code examples. The problem is that RangeVarPlot seems to ignore the keeplines property; even if you call .family(1), the previous lines disap...