Search found 106 matches

by pascal
Wed Dec 13, 2023 5:15 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Re: Conditional termination of simulation

Thanks, Ted, that makes sense that this would be useful for the purposes of a GUI. Maybe Robert can help with the other question...
by pascal
Thu Dec 07, 2023 7:31 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Re: Conditional termination of simulation

I decided I couldn't live with myself if I didn't try to implement the more acceptable approach you suggested (passing all variables as arguments, and then returning them). However, I'm running into some trouble with syntax. I can change spikehappened to the following: def spikehappened(tsp, count, ...
by pascal
Tue Dec 05, 2023 4:09 pm
Forum: NEURON + Python
Topic: Issue with SaveState
Replies: 2
Views: 11852

Re: Issue with SaveState

Okay, I guess I'll just be more careful in using SaveState. And this actually cleared up my other question, too. Thanks, Ted!
by pascal
Fri Nov 17, 2023 7:42 pm
Forum: NEURON + Python
Topic: Issue with SaveState
Replies: 2
Views: 11852

Issue with SaveState

I am having a few issues using h.SaveState(). First, I've found that switching the order of recording vector statements results in the program crashing when trying to restore. Here is my code (which the BallandStick class from https://neuron.yale.edu/neuron/docs/ball-and-stick-model-part-1 ), which ...
by pascal
Fri Nov 17, 2023 7:32 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Re: Conditional termination of simulation

Thanks, Ted, that worked like a charm! I hadn't thought to use global variables, and that is a perfectly acceptable solution for my purposes. Appreciate the help.
by pascal
Wed Nov 08, 2023 11:45 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Re: Conditional termination of simulation

I got this working, but the code is terribly ugly, and I'd appreciate any insight into how to clean it up. First, I defined a very simple mechanism with the following mod file: NEURON { SUFFIX sp RANGE spike_count, tnow, isinow, isiprev } ASSIGNED { spike_count tnow isinow isiprev } In the Cell temp...
by pascal
Tue Nov 07, 2023 5:04 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Re: Conditional termination of simulation

If I change the function to FInitializeHandler to def set_spike_count(spike_count=0): print('set_spike_count: spike_count = %d' % spike_count) and then replace nc.record(spike_callback) with spike_count = 0 nc.record((spike_callback, spike_count)) then the program runs without error. But it doesn't ...
by pascal
Mon Nov 06, 2023 6:02 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Re: Conditional termination of simulation

Thanks for the help, Ted. I have to admit I don't understand FInitializeHandler very well even after reading its documentation page. In particular, I can't figure out how to initialize a variable 'spike_count' that is associated with the NetCon, and then connect the 'spike_count' variable defined fo...
by pascal
Fri Nov 03, 2023 2:35 pm
Forum: NEURON hacks
Topic: Conditional termination of simulation
Replies: 10
Views: 69367

Conditional termination of simulation

I am simulating a single neuron with adaptation currents, and I would like to run a simulation until the most recent inter-spike interval differs from the second-most-recent inter-spike interval by less than some prescribed threshold. I have basic code that records spike times, so I'm wondering abou...
by pascal
Wed Aug 09, 2023 11:00 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 14043

Re: NMODL code no longer works in version 8.2

That did it...thank you very much for all your help!
by pascal
Wed Aug 09, 2023 5:21 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 14043

Re: NMODL code no longer works in version 8.2

Thanks, that makes sense. Also, I stumbled on one more issue: my mod files are now compiling fine using the Linux distribution, but in Windows I receive the following error message: Ih.c:7:10: fatal error: scoplib_ansi.h: No such file or directory 7 | #include "scoplib_ansi.h" | ^~~~~~~~~~...
by pascal
Wed Aug 09, 2023 2:46 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 14043

Re: NMODL code no longer works in version 8.2

Thank you both for the help. I could use a little more advice, though, because both approaches seemed to work. Simply removing all three extern lines resulted in successful compilation. But your approach also resulted in successful compilation, Michael (although I did have to also remove the third e...
by pascal
Wed Aug 09, 2023 2:06 pm
Forum: MSWin
Topic: Python cannot import neuron library on Windows install
Replies: 4
Views: 13087

Re: Python cannot import neuron library on Windows install

All right, finally got it working. I uninstalled both NEURON and Anaconda. I then re-installed them, but installed Anaconda first, and NEURON second. (Before, the order was reversed.) I'm not sure why, but the order of installation seemed to matter, at least in my case.
by pascal
Mon Aug 07, 2023 12:41 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: NMODL code no longer works in version 8.2
Replies: 7
Views: 14043

NMODL code no longer works in version 8.2

Many moons ago at a NEURON workshop, Michael Hines helped me write the following NMODL code, which I used to stochastically stimulate various sets of synapses: :this code uses Random123, which requires NEURON 7.3 or higher :uses nrnran123.c and nrnran123.h from http://www.neuron.yale.edu/hg/neuron/n...
by pascal
Thu Jul 27, 2023 3:54 pm
Forum: MSWin
Topic: Python cannot import neuron library on Windows install
Replies: 4
Views: 13087

Re: Python cannot import neuron library on Windows install

Uninstalled, reinstalled, restarted...still the exact same error message.