Search found 162 matches

by ramcdougal
Fri Jun 08, 2018 4:09 pm
Forum: NEURON + Python
Topic: Neuron code
Replies: 20
Views: 6576

Re: Neuron code

Not having seen your nadifl.mod, it's impossible to say for certain, but if we consider this file of the same name, the interesting part is the KINETIC block: KINETIC conc { COMPARTMENT PI*diam*diam/4 {nai} LONGITUDINAL_DIFFUSION D {nai} ~ nai << (-ina/(FARADAY)*PI*diam*(1e4)) } The COMPARTMENT line...
by ramcdougal
Fri Jun 08, 2018 2:26 pm
Forum: NEURON + Python
Topic: Neuron code
Replies: 20
Views: 6576

Re: Neuron code

The equations for nadifl and kdifl are in the mod files that you're using; they're not part of NEURON itself. Without seeing them, they are likely to just be LONGITUDINAL_DIFFUSION based mechanisms, possibly with radial diffusion as well. If by "small dimension" you're talking about the 0.1 microns ...
by ramcdougal
Thu Jun 07, 2018 9:15 pm
Forum: NEURON + Python
Topic: Neuron code
Replies: 20
Views: 6576

Re: Neuron code

This is probably not doing what you meant to do, although I'm not entirely sure what your question is. The following HOC code (did you want to use Python instead of HOC?) soma { nseg = 10000 L = 1// [µm] length diam = 0.1 // [µm] diameter creates a single section called soma with total length of jus...
by ramcdougal
Mon May 28, 2018 6:47 pm
Forum: NEURON + Python
Topic: Best way(s) to advance() in Python
Replies: 3
Views: 1901

Re: Best way(s) to advance() in Python

Minor comments: the inside of proc advance should invoke fadvance not advance. Also note you can get slightly more readable code by using a multiline string: h(r""" proc advance() { fadvance() m1 = IntFire1[0].M() }""") The r in front of the multi-line string opening is not needed here, but allows y...
by ramcdougal
Thu May 10, 2018 5:45 pm
Forum: Reaction-diffusion in NEURON
Topic: Negative concentrations
Replies: 5
Views: 2229

Re: Negative concentrations

I second Ted's point about the need for state-specific error tolerance scale multipliers. Unfortunately, the rxd state variables are not integrated into the VariableStepControl GUI's analysis at this time. You can, however, specify a species-specific atolscale. The rxd.Species constructor prototype ...
by ramcdougal
Mon May 07, 2018 12:51 pm
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 3374

Re: gui not accessible and graphs not updating while running simulations from Python

This is still a bit of a hack, but it should keep the GUI responsive and avoid the memory issue.

Before you do your h.run() (or equivalent), do:

Code: Select all

h('''
proc advance() {
    fadvance()
    nrnpython("")
}
''')
by ramcdougal
Mon May 07, 2018 12:46 pm
Forum: Reaction-diffusion in NEURON
Topic: Negative concentrations
Replies: 5
Views: 2229

Re: Negative concentrations

Also: do the concentrations go negative with fixed-step integration?
by ramcdougal
Mon May 07, 2018 12:44 pm
Forum: Reaction-diffusion in NEURON
Topic: Negative concentrations
Replies: 5
Views: 2229

Re: Negative concentrations

Not directly. If you're not using mass-action, it's possible to write reactions that mathematically demand concentrations go negative. Can you tell us more about your reaction specification? Assuming some are not mass action, have you checked to make sure the reaction rates are not such that the con...
by ramcdougal
Tue Apr 24, 2018 11:01 am
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 3374

Re: gui not accessible and graphs not updating while running simulations from Python

This windows-specific bug also seems to only occur if the simulation is run from the terminal or from a script. If you were to click the "Run" button on the GUI (e.g. in Tools - Run Control), the graphs should update etc during the simulation. That may or may not be useful to you.
by ramcdougal
Tue Apr 24, 2018 10:53 am
Forum: Reaction-diffusion in NEURON
Topic: basic questions on RxD
Replies: 7
Views: 2625

Re: basic questions on RxD

(1) To get a concentration pointer in Python, use ._concentration_ref ; you can pass that to Vector.record . An example follows: from neuron import h, rxd from matplotlib import pyplot h.load_file('stdrun.hoc') dend = h.Section(name='dend') cyt = rxd.Region([dend], name='cyt', nrn_region='i') ca = r...
by ramcdougal
Thu Apr 19, 2018 9:29 am
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 3374

Re: gui not accessible and graphs not updating while running simulations from Python

Point of clarification: are you saying it runs without memory problems if you don't use that workaround, but crashes when you do? How long does each simulation run (h.tstop) for, and how many simulations are you running? If you would like, I can take a look at your code to try to track down the memo...
by ramcdougal
Wed Apr 18, 2018 4:43 pm
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 3374

Re: gui not accessible and graphs not updating while running simulations from Python

Both of your difficulties are due to a Windows-specific bug that keeps NEURON from releasing the GIL during integration, which blocks both the NEURON GUI and Matplotlib threads from executing... thus the graphs never get updated. Thanks for bringing this to our attention. A workaround for now (besid...
by ramcdougal
Tue Apr 17, 2018 9:45 am
Forum: NEURON + Python
Topic: gui not accessible and graphs not updating while running simulations from Python
Replies: 8
Views: 3374

Re: gui not accessible and graphs not updating while running simulations from Python

Is this problem Spyder-specific, or does it also occur if you run the script from the regular Python prompt?

What operating system and NEURON version are you using?

The "from neuron import gui" is supposed to be all you need.
by ramcdougal
Tue Apr 10, 2018 10:16 pm
Forum: Reaction-diffusion in NEURON
Topic: Radial diffusion using RxD?
Replies: 2
Views: 1676

Re: Radial diffusion using RxD?

Yes but it's not currently anywhere near as clean as it should be. Diffusion between shells within a section can be implemented using MultiCompartmentReactions similarly to how one might do a leak between the ER and the cytosol. I don't have an example of this, but I'll try to make one tomorrow unle...
by ramcdougal
Tue Apr 03, 2018 9:04 pm
Forum: NEURON + Python
Topic: Recording Currents & Current Stimulation
Replies: 12
Views: 4215

Re: Recording Currents & Current Stimulation

The leak current in the hh mechanism is il_hh not ileak_hh.

Alternatively, a more Pythonic syntax is to access it via the mechanism; e.g. seg.hh.il (or seg.hh._ref_il if you need the pointer).