Hello everyone,
I'm writing to ask for advice on how to correctly implement electrical synapses in a custom NESTML neuron model (aeif_cond_beta_nestml).
I have attached the relevant NESTML and Python files used to build and install the aeif_cond_beta neuron model with gap junctions enabled.
I ran a trial using the "Gap Junctions: Inhibitory network example" script available on the nest website, changing the neuron model to my aeif_cond_beta_nestml, and it does not seem to implement the gap junctions correctly, as changing parameters like gap weight does synchronise the network or influence the output.
For reference, I am using NEST version 3.9.0.
If you had any advice on how to correctly implement gap junctions using NESTML, I would greatly appreciate it.
Thanks. Best regards, Beatrice
Dear Beatrice,
Thanks very much for bringing this to our attention! Using your provided code, I have been able to track this down to a small bug in the code generation, that only occurs for the case where an ``integrate_odes()`` call is used inside the model without any further parameters. This bug escaped our tests because most of the neuron models use parameterized calls to integrate the ODEs, for example ``integrate_odes(V_m, w)``. I have now fixed the bug and added this model to our set of tests so the issue cannot re-occur.
You can find the updated code here: https://github.com/nest/nestml/pull/1281
You can install this updated version of NESTML by running: pip install git+https://github.com/clinssen/nestml@fix_gap_integrate_odes_no_arg
Note that after peer review, the fix will be incorporated into a new official release of NESTML, but it might still take a few weeks of time before that happens; with the pip command you can already test the fixed code now.
Because the network script was originally written for Hodgkin-Huxley-type neuron models, I have had to tweak the parameters a little bit to get the synchronisation effect due to gap junctions. The following seems to work for demonstrating that the gap junctions lead to synchronisation:
n_neuron = 500 gap_per_neuron = 60 inh_per_neuron = 50 delay = 1.0 j_exc = 10.0 j_inh = -50.0 threads = 8 stepsize = 0.05 simtime = 501.0 gap_weight = 15. # or 0
Please note that there was a slight bug in the neuron model as you sent it: the continuous-time input port "I_stim" should have its units specified (or have type "real" in case it does not have physical units). I have fixed this in the version on the PR.
Please let me know in case you have any more questions or run into any issues.
Cheers, With kind regards, Charl
On Fri, Dec 19, 2025, at 18:01, Beatrice Baldi wrote:
Hello everyone,
I'm writing to ask for advice on how to correctly implement electrical synapses in a custom NESTML neuron model (aeif_cond_beta_nestml).
I have attached the relevant NESTML and Python files used to build and install the aeif_cond_beta neuron model with gap junctions enabled.
I ran a trial using the "Gap Junctions: Inhibitory network example" script available on the nest website, changing the neuron model to my aeif_cond_beta_nestml, and it does not seem to implement the gap junctions correctly, as changing parameters like gap weight does synchronise the network or influence the output.
For reference, I am using NEST version 3.9.0.
If you had any advice on how to correctly implement gap junctions using NESTML, I would greatly appreciate it.
Thanks. Best regards, Beatrice
NEST Users mailing list -- users@nest-simulator.org To unsubscribe send an email to users-leave@nest-simulator.org
*Attachments:* • aeif_cond_beta.nestml • create_gap_enabled_aeif.py.zip • gap_junctions_inhibitory_network-test.py.zip