Cell behavior driven by "if" statements

The basics of how to develop, test, and use models.
Post Reply
ehb
Posts: 6
Joined: Tue Jun 10, 2014 9:02 pm

Cell behavior driven by "if" statements

Post by ehb »

I created 3 neurons (Neuron_1, Neuron_2 and Neuron_3).
When Neuron_1 is stimulated with an IClamp, Neuron_1 depolarizes Neuron_2.
When Neuron_3 is stimulated with an IClamp, Neuron_3 also depolarizes Neuron_2.

I am trying to create the following conditional statement:
If Neuron_1 fires at Neuron_2, Neuron_2 fires back to Neuron_1.
If Neuron_3 fires at Neuron_2, Neuron_2 fires back to Neuron_3.

I created the following “if” statement:

Code: Select all

Access Neuron_2_axon
if(Neuron_1_soma.v > 0) {    
nclist.append(new NetCon (&v(1), syn1, -20, 1, 1))  // syn1 belongs to the dendrite of Neuron_1
}
if(Neuron_3_soma.v > 0) {
nclist.append)new NetCon (&v(1), syn3, -20, 1, 1)) // syn3 belongs to the dendrite of Neuron_3
}
I used soma.v > 0 as my logical expression because if that soma is stimulated with an IClamp, the -65mV should depolarize to a value > 0, which will make that expression "true" and thus execute the appropriate statement. The problem I am noticing is that “if” statements seem to only work while the simulation IS NOT running. My statements rely on the voltage change that only occurs while the simulation IS running. How can I get the program to execute the “if” statements while the simulation is running?
ted
Site Admin
Posts: 5787
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: Cell behavior driven by "if" statements

Post by ted »

Time to rethink much (everything perhaps?) of what you thought about how to use NEURON.

Model setup code is not model execution code.

Model setup code consists of statements that specify the properties of cells and how they are connected.
Statements that create a new instance of the NetCon class and specify the spike source and the target that is to be driven by spike events fall into the category of model setup code.

Executing model setup code makes NEURON create what is basically a bag of algebraic and differential equations that define an initial value problem. Launching a simulation tells NEURON to use numerical methods to generate an approximate solution to that initial value problem.

During the solution of that initial value problem, the geometry of those equations remains unchanged. You don't get to create new neural elements or new connections between them. And if you want something like this to happen
ehb wrote:If Neuron_1 fires at Neuron_2, Neuron_2 fires back to Neuron_1.
If Neuron_3 fires at Neuron_2, Neuron_2 fires back to Neuron_3.
where the three cells are biophysical model cells (i.e. they contain mechanistic representations of synapses and membrane capacitance and voltage- and/or ligand-gated ionic currents), it must happen as a consequence of the anatomical and biophysical properties of the cells that are involved and the synaptic connections between them. A case in point would be the dendrodendritic synaptic interactions in olfactory bulb--which is definitely not equivalent to using a bunch of conditional statements to execute model setup statements.
Post Reply