Search found 214 matches

by ramcdougal
Thu Apr 09, 2020 12:31 am
Forum: The GUI
Topic: PlotShape colormap
Replies: 1
Views: 694

Re: PlotShape colormap

The documentation says that colormaps are local by default. If they're not, maybe you could try explicitly setting/unsetting the global flag when you define the size of your colormap before setting its values. For what it's worth, you can change the default colormap for all of your plotshapes by edi...
by ramcdougal
Thu Apr 09, 2020 12:13 am
Forum: NEURON + Python
Topic: Record from multiple neurons
Replies: 2
Views: 473

Re: Record from multiple neurons

The basic sequence is to: (1) for each location, create a vector and do the record; (2) finitialize (this is done automatically if you use run() (h.run() in Python)); (3) simulate for some time; then (4) store the results as you wish. With respect to (1), you are only ever creating a single vector. ...
by ramcdougal
Tue Apr 07, 2020 7:45 am
Forum: OS X
Topic: NRNGUI not working from command line after switch to zsh
Replies: 10
Views: 1268

Re: NRNGUI not working from command line after switch to zsh

No.

nrngui is actually a script that begins by loading the compiled mod files (that's the x86_64/special file), if any, before giving you a prompt.
by ramcdougal
Sat Apr 04, 2020 4:55 pm
Forum: NEURON + Python
Topic: Copy a nrn object in Python?
Replies: 5
Views: 727

Re: Copy a nrn object in Python?

Here's a simple example of using os.fork() to do the first part of a simulation once and then explore two different options; this launches a new process not a new thread, so the GIL does not apply: from neuron import h from neuron.units import ms, mV import matplotlib.pyplot as plt import os h.load_...
by ramcdougal
Fri Apr 03, 2020 5:56 pm
Forum: NEURON + Python
Topic: Copy a nrn object in Python?
Replies: 5
Views: 727

Re: Copy a nrn object in Python?

If you're running a single process simulation on Linux or Mac, an alternative strategy is to just do an os.fork() once everything has been run for however long, and have each fork test a different variant afterwards. e.g. You might simulate for a 1000 * ms, then os.fork(), then in one fork simulate ...
by ramcdougal
Thu Apr 02, 2020 9:47 am
Forum: NEURON + Python
Topic: NetStim and NetCon
Replies: 3
Views: 651

Re: NetStim and NetCon

Yes. If you're specifying each cell's inputs separately, as Ted pointed out, you can use VecStim (defined in vecevent.mod , which you'd have to include in your model and compile like any other mod file). Here's an example, showing three inputs, two of which are able to cause a spike, one of which oc...
by ramcdougal
Wed Apr 01, 2020 2:09 pm
Forum: OS X
Topic: NRNGUI not working from command line after switch to zsh
Replies: 10
Views: 1268

Re: NRNGUI not working from command line after switch to zsh

Looks like you need to recompile the mod files. It remembers the version of NEURON that was used to compile things.
by ramcdougal
Wed Mar 25, 2020 3:10 pm
Forum: Other questions
Topic: Problem with fscan (SOLVED)
Replies: 2
Views: 412

Re: Problem with fscan

fscan is a function used for a single file opened with the ropen function (File.ropen is different).

If you are instead using the File class, then you'll want the scanvar method instead.
by ramcdougal
Wed Mar 18, 2020 10:12 am
Forum: Getting started
Topic: Is Mersenne Twister RNG available in NEURON
Replies: 2
Views: 449

Re: Is Mersenne Twister RNG available in NEURON

Random123 is a high-quality PRNG available from Python/HOC/NMODL in NEURON. It has the additional advantage of providing a large number of independent random streams parameterized by 3 numbers; this is extremely convenient for creating reproducible randomness that works in a parallel computing envi...
by ramcdougal
Sun Mar 15, 2020 6:36 pm
Forum: Other questions
Topic: Action Potential propagation
Replies: 3
Views: 542

Re: Action Potential propagation

1. Point models are fine. If you want biophysical kinetics, just use a section with nseg=1. If you want something more like an integrate-and-fire type cell, use one of the built-in types (e.g. IntFire, IntFire2, IntFire4), find one on ModelDB, or create your own with a MOD file of type ARTIFICIAL_CE...
by ramcdougal
Sun Mar 15, 2020 11:32 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

Dereference a NEURON pointer using [0]. e.g.

Code: Select all

>>> from neuron import h
>>> h.t = 17
>>> print(h._ref_t[0])
17.0
This also works in C/C++; the way to think of it is that referring to an array is the same as referring to a block of memory.
by ramcdougal
Sun Mar 15, 2020 11:28 am
Forum: OS X
Topic: NRNGUI not working from command line after switch to zsh
Replies: 10
Views: 1268

Re: NRNGUI not working from command line after switch to zsh

Zsh has two things that are roughly equivalent to .bashrc (and .bash_profile): .zshrc and .zshenv (both of these files go in your home folder; they may or may not already be there). .zshrc is only used by interactive shells, and .zshenv is used by all shells, interactive or not. Thus you probably wa...
by ramcdougal
Tue Mar 03, 2020 1:53 pm
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

Without looking closely at this or directly answering your question, my immediate thought is to wonder if lm_callback gets a meaningful value of y? You can avoid doing callbacks at every time step (and thus have a faster simulation) by using a StateTransitionEvent to do an action whenever a variable...
by ramcdougal
Tue Mar 03, 2020 11:27 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

For (1): That's a statement about the variable step solver and does not directly apply to using the fixed step solver. However: above the example, there's also a statement about the fixed step solver, which LinearMechanism forces to use a matrix solver by Kundert (because adding arbitrary equations...
by ramcdougal
Tue Mar 03, 2020 8:34 am
Forum: NEURON + Python
Topic: Using vectors as arguments for pt3dadd
Replies: 2
Views: 486

Re: Using vectors as arguments for pt3dadd

There are two ways to define 3D points. The more object-oriented way is to use sections, e.g. soma.pt3dadd(x, y, z, d) Unfortunately, that way requires numbers for the arguments. The older (and, apparently, more flexible in that it supports Vectors) way uses h and requires a sec= argument; in partic...