Search found 160 matches

by ramcdougal
Tue Nov 12, 2019 12:28 pm
Forum: Reaction-diffusion in NEURON
Topic: The equilibrium between the FS and external
Replies: 15
Views: 323

Re: The equilibrium between the FS and external

Similarly, NEURON automatically updates Nernst potentials for species defined using rxd. For more on the math governing Nernst Potentials, see this entry on Wikipedia. Ion current through a channel is typically proportional to the difference between the membrane potential and the corresponding Nerns...
by ramcdougal
Tue Nov 12, 2019 11:17 am
Forum: Reaction-diffusion in NEURON
Topic: length scales and SparseEfficiencyWarning
Replies: 2
Views: 90

Re: length scales and SparseEfficiencyWarning

The first issue should go away when you upgrade to 7.7. As far as tolerance goes: if you're using variable step, you can specify an atolscale when you declare the Species... I don't know that that's related, but I'm mentioning it just in case. As of this time, we have no automatic advice for automat...
by ramcdougal
Tue Oct 29, 2019 9:41 am
Forum: Reaction-diffusion in NEURON
Topic: Node.d (Diffusion) for Node3D objects
Replies: 1
Views: 159

Re: Node.d (Diffusion) for Node3D objects

It looks like when going from 7.6.x to 7.7.x we lost the ability to have non-uniform diffusion constants in 3D. Sorry about that; we're working on a fix. I'm not sure I fully understand your other observations; could you explain more? With 7.7.x, crxd and rxd are now the same thing... that is, rxd g...
by ramcdougal
Tue Oct 29, 2019 9:21 am
Forum: NEURON + Python
Topic: Parallel NMODL array assignment
Replies: 8
Views: 308

Re: Parallel NMODL array assignment

The above code requires NEURON 7.7.2 or newer.

Older versions won't recognize _ref_foo, and instead need to have the pointer set using h.setpointer; i.e. replace the for loop in the above with:

Code: Select all

# tell each pp about the pointer
for pp in pps:
    h.setpointer(ptr, 'foo', pp)
by ramcdougal
Mon Oct 28, 2019 6:05 pm
Forum: NEURON + Python
Topic: Parallel NMODL array assignment
Replies: 8
Views: 308

Re: Parallel NMODL array assignment

You can assign your data to a numpy array, get a pointer to the numpy array using neuron.numpy_element_ref, send that pointer to all point processes (this is fast... there's no copying of data), and then have the point process read from the array using a single VERBATIM line. Our driving Python prog...
by ramcdougal
Mon Oct 21, 2019 1:02 am
Forum: OS X
Topic: Problem importing NEURON in python
Replies: 2
Views: 289

Re: Problem importing NEURON in python

Sounds like the PATH and PYTHONPATH environment variables didn't get set correctly somehow. Please try reinstalling to see if this fixes the problem. During installation, it should prompt you for permission to let it modify your paths. Be sure to agree to this. Changes won't be effective in existing...
by ramcdougal
Thu Sep 19, 2019 1:41 pm
Forum: NEURON + Python
Topic: Filter Mechanism params by NMODL PARAMETER
Replies: 8
Views: 501

Re: Filter Mechanism params by NMODL PARAMETER

As long as you're using NEURON 7.7+, mod file code is available for introspection from Python, so it can be parsed manually with a handful of lines of Python. Here's a function that seems to work to get parameters: from neuron import h import re def get_parameters(mech_name): mech = h.MechanismType(...
by ramcdougal
Thu Aug 29, 2019 10:45 am
Forum: Other ways of using NEURON in neuroscience education
Topic: Running NEURON tutorials on webpage
Replies: 5
Views: 21093

Re: Running NEURON tutorials on webpage

We've started a process of redoing those tutorials, which are pretty old. The new versions use more modern idioms and come as Jupyter notebooks. We haven't moved these to the website because we don't have a full replacement, but here's a few: https://neuron.yale.edu/ftp/ramcdougal/pythontutorial.ipy...
by ramcdougal
Thu Aug 29, 2019 10:15 am
Forum: Other questions
Topic: debugging/profiling NEURON execution
Replies: 3
Views: 473

Re: debugging/profiling NEURON execution

Are you trying to debug NEURON itself or a NEURON simulation? For debugging NEURON simulations written in Python, you can use pdb as with any other Python code. A quick search will lead you to many pdb tutorials. For debugging NEURON simulations written in HOC... there's no equivalent. Going forward...
by ramcdougal
Thu Aug 29, 2019 9:50 am
Forum: NEURON + Python
Topic: Control a simulation step by step
Replies: 2
Views: 401

Re: Control a simulation step by step

Calling h.fadvance() advances the simulation by one timestep. When using fixed-step integration, the time step size is controllable by setting h.dt ; by default it is 1/40 ms. When controlling a simulation in this way, before beginning your advances, you must explicitly initialize the simulation wit...
by ramcdougal
Wed Aug 21, 2019 3:21 pm
Forum: NEURON + Python
Topic: Does Section have something like `id` attribute?
Replies: 2
Views: 403

Re: Does Section have something like `id` attribute?

Internally, the Sections are stored in a linked list. There is thus no direct, consistent-across-runs section indexing scheme... but as you've observed, there's no advantage for NEURON storing such a list since you can create it quickly in the non-parallel case : seclist = list(h.allsec()) Once you ...
by ramcdougal
Mon Jul 01, 2019 11:12 am
Forum: OS X
Topic: Can't load from neuron.rxd.morphology
Replies: 1
Views: 609

Re: Can't load from neuron.rxd.morphology

Unfortunately, this isn't in 7.7; we considered it an internal class and didn't realize people were using it otherwise. The general workaround is to use the corresponding section method trueparentseg (there's also a parentseg); e.g. >>> from neuron import h >>> soma = h.Section(name='soma') >>> dend...
by ramcdougal
Thu Jun 06, 2019 10:25 am
Forum: Getting started
Topic: Accessing the current between extracellular layers
Replies: 6
Views: 925

Re: Accessing the current between extracellular layers

Are you trying to simulate ephaptic coupling or extracellular diffusion of ion concentrations in the extracellular space? There are currently at least two models in ModelDB that use NEURON for ephaptic coupling: http://identifiers.org/modeldb/3676 and http://identifiers.org/modeldb/240957 (The rxd m...
by ramcdougal
Sat May 18, 2019 2:38 pm
Forum: NEURON + Python
Topic: Adex neuron in neuron python
Replies: 5
Views: 973

Re: Adex neuron in neuron python

The literal translation is adapex=h.ADEX(0.5) Since this is technically a point process, the 0.5 means it gets associated with the middle of some section, the so called currently accessed section. This is fine, but in Python we can be more explicit about which section, here mysec: adapex=h.ADEX(myse...
by ramcdougal
Tue May 07, 2019 1:55 pm
Forum: Reaction-diffusion in NEURON
Topic: Questions about Calcium Waves in RxD
Replies: 2
Views: 881

Re: Questions about Calcium Waves in RxD

I've added a full working code (and the associated image output) to the calcium wave rxd tutorial page: https://neuron.yale.edu/neuron/docs/reaction-diffusion-calcium-wave There's not much in the way of explanation yet, but hopefully after working through the rest of the existing tutorials ( https:/...