Search found 154 matches

by ramcdougal
Mon Nov 26, 2018 6:01 pm
Forum: NEURON + Python
Topic: Accessing inf_hh and tau_hh in the hh mechanism
Replies: 6
Views: 1682

Re: Accessing inf_hh and tau_hh in the hh mechanism

Globals are accessed globally; i.e. through the h object:

Code: Select all

from neuron import h
soma = h.Section(name='soma')
soma.insert('hh')
print(h.htau_hh)
print(h.hinf_hh)
by ramcdougal
Wed Nov 14, 2018 5:05 pm
Forum: Reaction-diffusion in NEURON
Topic: maximum length for the name of a species?
Replies: 2
Views: 1067

Re: maximum length for the name of a species?

What's happening is that NEURON currently assumes a limit on ion name lengths. You can see this without rxd in that the following two lines will crash NEURON: from neuron import h h.ion_register('x'*50, 0) If, as in your example code, you have a pure reaction-diffusion model (no ion channels) you ca...
by ramcdougal
Wed Oct 24, 2018 7:07 am
Forum: NEURON + Python
Topic: More NEURON + Python documentation
Replies: 6
Views: 22549

Re: More NEURON + Python documentation

Since this discussion, there had been a lot of work on the Python interface to make things cleaner, especially in NEURON 7.5 and 7.6. We're in the process of reworking the main NEURON Python tutorial: https://neuron.yale.edu/neuron/static/docs/neuronpython/index.html The draft revised pages (only th...
by ramcdougal
Thu Oct 11, 2018 3:01 pm
Forum: HNN: Human Neocortical Neurosolver
Topic: Installation Issues
Replies: 4
Views: 2677

Re: Installation Issues

I suggest trying the following to get NEURON to work:

Download and install the .deb from http://neuron.yale.edu

Then (to allow both Anaconda and your system Python to find NEURON) add the following to your ~/.bashrc:

Code: Select all

export PYTHONPATH=/usr/local/nrn/lib/python/:$PYTHONPATH
by ramcdougal
Tue Sep 18, 2018 10:16 pm
Forum: HNN: Human Neocortical Neurosolver
Topic: Installation Issues
Replies: 4
Views: 2677

Re: Installation Issues

Strictly speaking, the command on the installer's line 13 sudo apt install -y python3-pyqt5 python3-pip python3-pyqtgraph python3-opengl zlib1g-dev zlib1g zlibc libx11-dev mercurial bison flex automake libtool libxext-dev libncurses-dev python3-dev xfonts-100dpi cython libopenmpi-dev python3-scipy p...
by ramcdougal
Fri Sep 14, 2018 10:59 am
Forum: Reaction-diffusion in NEURON
Topic: Add term to RxD solution.
Replies: 2
Views: 1899

Re: Add term to RxD solution.

The bad news: The reaction-diffusion module rxd currently only directly supports reactions and diffusions. So you could add arbitrary local kinetics, but you'd have to modify the source to add the type of dynamics you describe. The good news: besides storing parameters, all of the changes would be c...
by ramcdougal
Mon Aug 27, 2018 9:24 pm
Forum: Anatomically detailed models
Topic: area() function -- stylized method -- 3d-method
Replies: 4
Views: 1565

Re: area() function -- stylized method -- 3d-method

There is some discussion about how segment areas and volumes are calculated at: https://www.neuron.yale.edu/neuron/static/py_doc/modelspec/programmatic/topology/geometry.html#d-specification-of-geometry To say what hines said another way: in your first case, you're defining a tapered shape while the...
by ramcdougal
Mon Aug 27, 2018 8:07 pm
Forum: Reaction-diffusion in NEURON
Topic: Reaction-Diffusion in HOC
Replies: 5
Views: 17599

Re: Reaction-Diffusion in HOC

Most likely that means that either Python is not installed, or it is installed but NEURON can't connect to it (likely a path issue). You're free to program NEURON models in HOC or Python, but to use the rxd module, Python must be installed and loadable by NEURON To check for this, check the return v...
by ramcdougal
Fri Aug 24, 2018 12:38 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Ineffective simulation with small duration current injection
Replies: 2
Views: 1158

Re: Ineffective simulation with small duration current injection

Are you using a fixed time step or variable? I assume variable step will choose time points at the beginning and end of each current change... And thus you would see the current injection having an effect. If fixed, what is dt? Note that for fixed step, the default timestep (0.025 ms) is longer than...
by ramcdougal
Wed Aug 22, 2018 6:13 am
Forum: NEURON + Python
Topic: Not able to run simulation more than once from a NEURON+Python script
Replies: 4
Views: 2157

Re: Not able to run simulation more than once from a NEURON+Python script

Doesn't solve the mystery, but...

Assuming the morphology is not changing with successive runs, you could load it once before entering the loop, and see this particular issue entirely
by ramcdougal
Mon Aug 13, 2018 1:31 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Computational Optogenetics: modelling ChR2 in NMODL
Replies: 2
Views: 1247

Re: Computational Optogenetics: modelling ChR2 in NMODL

You can probably do what you want by using Vector.play . In brief, Vector.play allows you to use two Vectors (one listing time points and one with the values) to control an arbitrary memory location (e.g. a current, or in your case a variable in a MOD file). Example that plays a stimulus into the in...
by ramcdougal
Mon Aug 13, 2018 1:06 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: A question about USEION statement
Replies: 1
Views: 1042

Re: A question about USEION statement

Currents of the same type from different mechanisms add.

You can test this yourself by creating two trivial mod files that generate a constant current, and measuring the current when one vs both are inserted.
by ramcdougal
Thu Aug 09, 2018 12:36 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: HOC kernel for Jupyter
Replies: 3
Views: 1608

Re: HOC kernel for Jupyter

If you're working on a HOC kernel, I also encourage this... But: (1) Consider teaching in Python instead of HOC. That's what we do for the official NEURON courses. The Python programmer's reference is not only the default version, but it's also more up-to-date and has more examples. (2) As long as y...
by ramcdougal
Tue Aug 07, 2018 7:48 am
Forum: NEURON + Python
Topic: Neuron 7.5 + Python 3.7
Replies: 2
Views: 2990

Re: Neuron 7.5 + Python 3.7

Upgrade to NEURON 7.6.1 (the current release version) to use Python 3.7.

Older versions of NEURON are not compatible with Python 3.7.
by ramcdougal
Tue Jul 31, 2018 4:57 am
Forum: Anatomically detailed models
Topic: Changing diameters of reconstructed neurons
Replies: 5
Views: 1723

Re: Changing diameters of reconstructed neurons

My mistake, sorry. I made that post on my phone without checking it.

You're right. diam3d is ready only. Use pt3dchange to set the diameter: the

Code: Select all

forall { 
  for (j = 0; j < n3d(); j+=1) { 
    pt3dchange(j, diam3d(j)*1.0)
  } 
}