Hello,
I need advise on how to combine NEURON with a mesoscopic equation (ODE).
I have built a network of simple cells (soma + dendrite with synapses) in NEURON using mainly python. The cells are connected with excitatory synapses (ExpSyn). I have chosen the cell properties in such a way that each cell generates a continuous spike train.
In order to combine the equation and NEURON's simulation, my plan is to change the mod file of the ExpSyn synapse so that at EVERY timestep the voltage change for each cell is calculated for the next time step given the voltage values from the previous timestep of the cell and all connected cells (using the mesoscopic equation). Then I would set the membrane voltage at the soma according to my calculated value. To make sure this happens at each time point, I want to set the threshold of the NetCon pointer in such a way that it is always crossed.
Because I am a student with limited amount of time, I decided to post this before I run into major implementation issues and to avoid spending a lot of time trying to implement something that couldn't work.
I would very much appreciate if someone (with more experience of and knowlegde about NEURON) could give me feedback about my plan. Do you think the ExpSyn mechanism is a good starting point to implement this kind of connection between cells? Are there any aspects that could cause problems that I haven't thought about yet?
Combining NEURON with a mesoscale equation
Moderator: wwlytton

 Site Admin
 Posts: 5590
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Combining NEURON with a mesoscale equation
Regardless of what you are trying to do, the strategy you describe is guaranteed not to work. Instead of diving into the implementational weeds, can you present a concise mathematical statement of your mesoscopic ODE and its constituent terms, or is it spelled out clearly in some publication? If this in any way proprietary, feel free to communicate with me via email
ted dot carnevale at yale dot edu
ted dot carnevale at yale dot edu
Re: Combining NEURON with a mesoscale equation
Hi Ted,
thank you for replying and your opinion!
The mesoscopic equation that I want to integrate with NEURON is the kuramoto equation. To start with I have decided to implement a very simplified version of it, whereby the voltage change over time dV/dt of each cell i is described by dV_i/dt = w_i + K/N*Sum[ sin(V_j  V_i) ] for j=1:N. In the case that there is no connection between the cells, each cell i spikes with its natural frequency w_i. The second term describes the influence of coupling between the cells. K denotes the weight of the connection and N is the number of cells in the network. (The weight of the NetCon connection between the cells should be equal to this K) The voltage change per time dV/dt deviates from its natural frequency when the voltages V_j of neighboring oscillators are unequal to the one of oscillator i.
For the nonsimplified version of the kuramoto model, see https://en.wikipedia.org/wiki/Kuramoto_model .
I have implemented the simplified kuramoto model in python and I am going to translate it into a nmodl function.
Please note that the basic idea of this project was also topic in another post where another question was asked: viewtopic.php?f=12&t=3678&p=15683&hilit=kuramoto#p15683
The mechanism I am trying to build to connect the cells is more an abstract functional one rather than a realistic biophysical synapse. Because the model should incorporate realistic cells, we choose to use NEURON. The aim is to be able to investigate the current flow when the spiking behavior of the cells synchronizes according to the (simplified) kuramoto equation. However I do have concerns how if it is possible to correctly incorporate such an equation with NEURON.
Why do you think my strategy is not going to work? Do you think it is not possible in general or is it my strategy?
thank you for replying and your opinion!
The mesoscopic equation that I want to integrate with NEURON is the kuramoto equation. To start with I have decided to implement a very simplified version of it, whereby the voltage change over time dV/dt of each cell i is described by dV_i/dt = w_i + K/N*Sum[ sin(V_j  V_i) ] for j=1:N. In the case that there is no connection between the cells, each cell i spikes with its natural frequency w_i. The second term describes the influence of coupling between the cells. K denotes the weight of the connection and N is the number of cells in the network. (The weight of the NetCon connection between the cells should be equal to this K) The voltage change per time dV/dt deviates from its natural frequency when the voltages V_j of neighboring oscillators are unequal to the one of oscillator i.
For the nonsimplified version of the kuramoto model, see https://en.wikipedia.org/wiki/Kuramoto_model .
I have implemented the simplified kuramoto model in python and I am going to translate it into a nmodl function.
Please note that the basic idea of this project was also topic in another post where another question was asked: viewtopic.php?f=12&t=3678&p=15683&hilit=kuramoto#p15683
The mechanism I am trying to build to connect the cells is more an abstract functional one rather than a realistic biophysical synapse. Because the model should incorporate realistic cells, we choose to use NEURON. The aim is to be able to investigate the current flow when the spiking behavior of the cells synchronizes according to the (simplified) kuramoto equation. However I do have concerns how if it is possible to correctly incorporate such an equation with NEURON.
Why do you think my strategy is not going to work? Do you think it is not possible in general or is it my strategy?

 Site Admin
 Posts: 5590
 Joined: Wed May 18, 2005 4:50 pm
 Location: Yale University School of Medicine
 Contact:
Re: Combining NEURON with a mesoscale equation
Coupling in the Kuramoto model is continuous and bidirectional between coupled cells. NetCons are for implementing unidirectional spiketriggered communication between cellsi.e. (1) there is no communication of any kind until after a spike occurs in the presynaptic cell, (2) details of what happens in the presynaptic cell, aside from the fact that some presynaptic variable crossed a threshold in a positivegoing direction, are completely irrelevant, and (3) the postsynaptic cell has no effect on the presynaptic cell.
NEURON could be used to implement a Kuramoto model, but there is nothing about the latter's cell description that makes it a natural match to a section with nseg = 1. You'd define your model cell class by writing C or C++ code into a VERBATIM block of an NMODL file, and using POINTERs to communicate between different instances of your cell class. Wrapping this inside NEURON would give you the ability to use its Interviewsbased GUI to create a user interface and display results, and compiling your cell class with nrnivmodl would speed up simulations compared to running in interpreted Pythonbut you'd probably have less work to do and get a similar (or maybe better) speedup by moving your Python implementation to Cython. Just my opinion; somebody else might think otherwise.
NEURON could be used to implement a Kuramoto model, but there is nothing about the latter's cell description that makes it a natural match to a section with nseg = 1. You'd define your model cell class by writing C or C++ code into a VERBATIM block of an NMODL file, and using POINTERs to communicate between different instances of your cell class. Wrapping this inside NEURON would give you the ability to use its Interviewsbased GUI to create a user interface and display results, and compiling your cell class with nrnivmodl would speed up simulations compared to running in interpreted Pythonbut you'd probably have less work to do and get a similar (or maybe better) speedup by moving your Python implementation to Cython. Just my opinion; somebody else might think otherwise.
Re: Combining NEURON with a mesoscale equation
Dear Ted,
Thank you very much for your tips so far!
I am going to go ahead and Implement the model in the following weeks. Now I am more optimistic that I can succeed and cython will definitely make it easier for me!
Best regards, Catharina
Thank you very much for your tips so far!
I am going to go ahead and Implement the model in the following weeks. Now I am more optimistic that I can succeed and cython will definitely make it easier for me!
Best regards, Catharina