Search found 33 matches

by ajpc6d
Sat Aug 05, 2023 5:04 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Stimulus Activation/Deactivation in NMODL
Replies: 3
Views: 17400

Stimulus Activation/Deactivation in NMODL

I made the following NMODL file to deliver a transmembrane current injection into a cell. The RANGE variable amp receives a played-in vector from a Python script. Below, I show the original method (which doesn't work quite right) and the second method (which does). The difference between them is onl...
by ajpc6d
Thu Jul 27, 2023 2:46 pm
Forum: NEURON + Python
Topic: Play a Unique Vector to Each Model Segment
Replies: 1
Views: 15356

Play a Unique Vector to Each Model Segment

How can I play a unique vector into an arbitrary variable in each of an arbitrary number of cell segments? For example, in this NMODL file NEURON { SUFFIX playtest :RANGE xx : doesn't work :NONSPECIFIC_CURRENT xx : doesn't work :GLOBAL xx : works, but inflexible :ELECTRODE_CURRENT xx : doesn't work ...
by ajpc6d
Fri Jul 21, 2023 10:20 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Extracellular Mechanism and Hodgkin-Huxley
Replies: 10
Views: 26332

Re: Extracellular Mechanism and Hodgkin-Huxley

Wow, that's incredible - thank you! I've been working to meet a deadline this week, but hoping to return to this issue first thing next week--
by ajpc6d
Mon Jul 10, 2023 1:34 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Extracellular Mechanism and Hodgkin-Huxley
Replies: 10
Views: 26332

Re: Extracellular Mechanism and Hodgkin-Huxley

v is not the sum of e_extracellular and anything else This was my deduction both from the documentation at https://nrn.readthedocs.io/en/latest/hoc/modelspec/programmatic/mechanisms/mech.html -- Vext is solved simultaneously with the v. When the extracellular mechanism is present, v refers to the m...
by ajpc6d
Mon Jul 10, 2023 10:13 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Extracellular Mechanism and Hodgkin-Huxley
Replies: 10
Views: 26332

Re: Extracellular Mechanism and Hodgkin-Huxley

I'd like to avoid having to look at any of your hoc or Python code, if possible. Totally understand - my original question was just about the mechanics of how NEURON handles e_extracellular in a custom Hodgkin-Huxley-style .mod file, specifically, about the use of the NMODL 'v'. Is e_extracellular ...
by ajpc6d
Fri Jul 07, 2023 5:41 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Extracellular Mechanism and Hodgkin-Huxley
Replies: 10
Views: 26332

Re: Extracellular Mechanism and Hodgkin-Huxley

I have assumed the cell to experience the propagating electric field as a plane wave (i.e., the potential difference between any points on the plane to which the axis of propagation is orthogonal will be zero). The extracellular potential, I derived using the the formula V_ecm(t) = -E.l_c (from Bosh...
by ajpc6d
Fri Jul 07, 2023 10:23 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Extracellular Mechanism and Hodgkin-Huxley
Replies: 10
Views: 26332

Extracellular Mechanism and Hodgkin-Huxley

What does NEURON do with extracellular potential 'under the hood'? From the documentation, I took it that NEURON implicitly references both membrane voltage 'v' and extracellular potential 'e' when solving the cable equation, but this gave me unexpected results. When I added the extracellular potent...
by ajpc6d
Mon Mar 20, 2023 11:19 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Current NMODL Best Practices
Replies: 3
Views: 14468

Current NMODL Best Practices

The available information on NMODL best practices seems to be contradictory at points, and I wonder if the best current practices could be summarized in one place? As an example, the xtra.mod file states: Prior to NEURON 5.5, the SOLVE statement in the BREAKPOINT block used METHOD cvode_t so that th...
by ajpc6d
Mon Mar 20, 2023 11:03 am
Forum: NEURON + Python
Topic: Unbounded Membrane Voltage Increase
Replies: 5
Views: 21649

Re: Unbounded Membrane Voltage Increase

I did get the file online, but it was quite a while ago and I'm not sure of the source. The cell is the layer 5 pyramid from https://www.nature.com/articles/382363a0 , but I had to do some searching to find it. Also, I believe I did some light re-formatting at some point; it's entirely possible I'm ...
by ajpc6d
Thu Mar 16, 2023 10:57 am
Forum: NEURON + Python
Topic: Unbounded Membrane Voltage Increase
Replies: 5
Views: 21649

Re: Unbounded Membrane Voltage Increase

I found the issue - bad model data. Just in case anyone else finds themselves with the same behavior, I was using swc data that defined the soma as a single point (in other words, soma_section.n3d()=1). By adding another xyz set to that section, the issue vanished. My guess is that 'extracellular' w...
by ajpc6d
Mon Mar 13, 2023 1:41 pm
Forum: NEURON + Python
Topic: Unbounded Membrane Voltage Increase
Replies: 5
Views: 21649

Unbounded Membrane Voltage Increase

This may be a long-shot, but I'm hoping I can get some help with a new issue. I've written a Python script to automate cell creation. The script worked perfectly for a cell with Hodgkin-Huxley-like governing equations stimulated by an 'activating function' approach. Now, I'm trying to change to mode...
by ajpc6d
Tue Feb 14, 2023 8:13 pm
Forum: NEURON + Python
Topic: Stimulating a Cell
Replies: 10
Views: 22595

Re: Stimulating a Cell

And one last bit -- I implemented fieldrec() in this way. def fieldrec(v): summa = 0.0 for sec in h.allsec(): for seg in sec: summa += float(seg.xtra.er) v.append(summa) # # later in the code # vrec = [] pyFcall = (fieldrec,vrec) h.CVode().extra_scatter_gather(0,pyFcall) # after which h.finitialize(...
by ajpc6d
Tue Feb 14, 2023 12:20 pm
Forum: NEURON + Python
Topic: Stimulating a Cell
Replies: 10
Views: 22595

Re: Stimulating a Cell

Regarding calc_rxc() -- my understanding is that this function only calculates the resistance of the extracellular medium between the electrode and the neurite segment, and that this value is based on the spatial data from interp_xyz() and is passed on to xtra for calculation of the extracellular po...
by ajpc6d
Mon Feb 13, 2023 10:37 pm
Forum: NEURON + Python
Topic: Stimulating a Cell
Replies: 10
Views: 22595

Re: Stimulating a Cell

I'm going to take these one at a time, starting with interp_xyz() .. I believe the function I posted above is incorrect. I changed the range_var block when I realized I was selecting the edge of the segment, rather than the center . def interp_xyz(section): nn = xr = 0 sec = section #h.cas() # get t...
by ajpc6d
Fri Jan 20, 2023 4:35 pm
Forum: NEURON + Python
Topic: Stimulating a Cell
Replies: 10
Views: 22595

Re: Stimulating a Cell

This issue has kind of sprawled for me as I looked into your suggestions - sorry if the breadth of this post is inappropriate for the forum setting, but hopefully others who are facing the same issues will find this useful. So one thing I realized, as I was going through the read-me associated with ...