Search found 214 matches

by ramcdougal
Fri Feb 28, 2020 11:37 am
Forum: Modeling networks
Topic: Incorporating a firing model to induce different stages of sleep
Replies: 14
Views: 1096

Re: Incorporating a firing model to induce different stages of sleep

You can also do this using the LinearMechanism class. LinearMechanism solves vector ODEs of the form: c y' + gy = b In particular, let's consider the simple firing rate model: tau * y' + decay * y = f(I(t)) For this example, we suppose that I(t) and hence f(I(t)) are known in advance; this allows us...
by ramcdougal
Fri Feb 28, 2020 10:50 am
Forum: Reaction-diffusion in NEURON
Topic: Multicomp model, ECS, pumps and strange concentrations
Replies: 3
Views: 456

Re: Multicomp model, ECS, pumps and strange concentrations

Okay, so the fundamental situation is as follows: dend00 and dend11 both have the pump as defined by a mod file: dend00.insert('pump') ... dend11.insert('pump') This means that x and the pump dynamics must exist in both of these sections. cyt is defined only on dend00: cyt = rxd.Region(dend00, name=...
by ramcdougal
Thu Feb 27, 2020 11:13 am
Forum: Reaction-diffusion in NEURON
Topic: Multicomp model, ECS, pumps and strange concentrations
Replies: 3
Views: 456

Re: Multicomp model, ECS, pumps and strange concentrations

I made a quick attempt to reproduce this, but was unsuccessful (in the sense that no mass was created). Can you compare your version to mine and tell me how we differ? from neuron import h, rxd from neuron.units import mV, ms h.load_file('stdrun.hoc') soma = h.Section(name='soma') dend0 = h.Section(...
by ramcdougal
Wed Feb 26, 2020 3:50 pm
Forum: Parallel NEURON
Topic: Is the CVode class implemented so that it scales well with many nodes?
Replies: 2
Views: 649

Re: Is the CVode class implemented so that it scales well with many nodes?

CVode is an adaptive algorithm that chooses time steps to give results within a specified error tolerance . Thus it will use small timesteps when things are changing rapidly (e.g. synaptic input, during an action potential) and larger timesteps where they are not. To get the same accuracy out of fix...
by ramcdougal
Wed Feb 26, 2020 9:46 am
Forum: NEURON + Python
Topic: Vector Values
Replies: 2
Views: 493

Re: Vector Values

I suspect if you look at t, v, etc, you would find that they're lists of Vectors (or maybe but probably not strings), whereas the code you found on the NEURON site assumes them to be lists/vectors of floats. i.e. what is returned in t_, v_, etc is likely Vectors showing the full time course of the v...
by ramcdougal
Wed Feb 19, 2020 5:13 pm
Forum: UNIX/Linux
Topic: How do I collect data for plots without IV
Replies: 4
Views: 631

Re: How do I collect data for plots without IV

There's also a HOC version of the programmer's reference at: https://www.neuron.yale.edu/neuron/stat ... index.html
by ramcdougal
Wed Feb 05, 2020 9:32 am
Forum: Reaction-diffusion in NEURON
Topic: length scales and SparseEfficiencyWarning
Replies: 5
Views: 828

Re: length scales and SparseEfficiencyWarning

That's very weird because there's nothing wrong with h('{sw4=new PlotShape(0)}') by itself. There's no way there's a weird character in there, is there? (Non-breaking space, that sort of thing?) Otherwise, my guess is that something badly destabilized NEURON before you got that far. If you're willin...
by ramcdougal
Fri Jan 31, 2020 5:15 pm
Forum: NEURON + Python
Topic: For loop over section's segments in Python and HOC returns different values
Replies: 4
Views: 707

Re: For loop over section's segments in Python and HOC returns different values

Given that you're trying to make a Python version of the HOC... you could change the HOC to do it right using for (x,0), and then validate your Python against that.
by ramcdougal
Fri Jan 31, 2020 5:50 am
Forum: NEURON + Python
Topic: For loop over section's segments in Python and HOC returns different values
Replies: 4
Views: 707

Re: For loop over section's segments in Python and HOC returns different values

The short version, as you've figured out, is that your Python code and your HOC code are not equivalent ; they do different things, but both languages support both types of loops . Density mechanisms (like hh) exist on segments of positive surface area not on the 0 and 1 end points (which by definit...
by ramcdougal
Wed Jan 29, 2020 8:07 pm
Forum: NEURON + Python
Topic: Rset or reboot neuron without exist in python
Replies: 6
Views: 1578

Re: Rset or reboot neuron without exist in python

h.finitialize() resets a model (if the mod files, etc were setup right) but it does not reset the simulator . importlib.reload will have no useful effect. It will not cause Sections to disappear, it will not reset the temperature, etc. It's basically only useful for modules that are themselves writ...
by ramcdougal
Wed Jan 29, 2020 12:31 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Interfacing NEURON with other software on runtime
Replies: 4
Views: 635

Re: Interfacing NEURON with other software on runtime

Your specific code doesn't work because you are evaluating the function foo(ns) at the time of your callback (it returns None) and that's what's being set as your callback. (By the order of operations, we evaluate foo(ns) before calling set_callback.) You could fix this by passing in a lambda that e...
by ramcdougal
Fri Jan 17, 2020 9:00 am
Forum: NEURON + Python
Topic: Dynamically accessing vectors in python (_ref_x)
Replies: 5
Views: 744

Re: Dynamically accessing vectors in python (_ref_x)

Think of these things with [] as an array of sections; what that means is that the object you getattr is the array, not any individual section. i.e. do something like this: >>> from neuron import h >>> h('create axon[6]') 1 >>> getattr(h, 'axon')[5] axon[5] >>> sec = getattr(h, 'axon')[5] >>> ptr = ...
by ramcdougal
Tue Jan 14, 2020 4:41 pm
Forum: UNIX/Linux
Topic: Failed to run neuron inside virtual environment in Ubuntu18 with Anaconda (PATH issue?)
Replies: 3
Views: 1290

Re: Failed to run neuron inside virtual environment in Ubuntu18 with Anaconda (PATH issue?)

Do you have root access? Assuming so, when you installed with dpkg, I believe you meant for PYTHONPATH to start with /usr/ not with /home/usr/ That worked for me in Ubuntu 19.04: (base) robert@robert-VirtualBox:~/anaconda3/envs/my_env$ cd (base) robert@robert-VirtualBox:~$ conda activate my_env (my_...
by ramcdougal
Mon Jan 13, 2020 2:00 pm
Forum: NEURON + Python
Topic: Dynamically accessing vectors in python (_ref_x)
Replies: 5
Views: 744

Re: Dynamically accessing vectors in python (_ref_x)

I believe you're looking for Python's getattr function: You can get a pointer to the membrane potential at the center of the soma via: ptr = getattr(soma(0.5), '_ref_v') (Here, I'm assuming "soma" is a Python Section object... adjust accordingly for HOC variables, which you can also get by name with...
by ramcdougal
Mon Jan 13, 2020 1:43 pm
Forum: NEURON + Python
Topic: different section names, morphology - h.Section
Replies: 2
Views: 525

Re: different section names, morphology - h.Section

Specify the name attribute when creating a section to give them meaningful names: soma = h.Section(name='soma') Specify both name and cell (and give the cell a reasonable __repr__) for meaningful dot notation: from neuron import h class MyCell: def __repr__(self): return 'MyCell[{}]'.format(self._id...