subhasishg wrote:How did you make sure that the internal variable v does not conflict with the voltage reset (v = c) that you are doing ?
Is there any way to stop the internal integration for v and then again start it ?
Good questions. Yes, v does "conflict" in the sense that an assignment to v in the NMODL-specified mechanism affects the v that NEURON calculates by integrating the cable equation, and no, there is no way to prevent integration of the cable equation. These are actually features rather than bugs, as long as one implements the Izhikievich model as a point process that generates a current.
Ideally, a "membrane current" implementation of Izhikevich's spiking neuron model should be
* dimensionally consistent so that it can be used in combination with other current sources such as IClamp, ExpSyn etc.
* dynamically correct so that it reproduces the published spiking patterns
* but at the same time fosters conceptual clarity by allowing one to use parameter values that are numerically identical to those reported in his papers
Furthermore, if you plan to use it as a "plug-in substitute" for a conventional biophysical model cell, it should be easy to use with models that have different anatomical sizes and specific membrane
The principal difficulties in creating such an implementation lie in the fact that Izhikevich's original formulation involves implicit assumptions about model surface area, specific capacitance, and parameter scaling. These assumptions are very convenient for him (avoids having to deal with units at all) but quite unnatural for NEURON. Example: according to his principal ODE, 1 unit of current
produces dv/dt of 1 mV/ms. Whether you try to represent the right hand side of that equation with a density mechanism or a point process, you're in trouble from the start. If you try a density mechanism, you have a current of 1 mA/cm2 producing dv/dt of 1 mV/ms which forces cm to be 1000 uf/cm2. If you try a point process, you have a net current of 1 nA, so the model's total membrane capacitance must be 1 nf, and if you assume cm is 1 uf/cm2, you're stuck with a surface area of 0.001 cm2 = 1e5 um2.
A density mechanism implementation has other problems too (you still need a point process to detect spikes and force the necessary jumps of v and u). So a point process makes the most sense, but then you must also deal with rescaling the generated current so that spike dynamics will be correct regardless of the surface area or specific membrane capacitance of the compartment to which the point process is attached.
Finally, for some purposes it might be nice to have the option of specifying a refractory period after each spike. This could be useful if a dendritic tree is attached to the compartment that contains the Izhikevich spike mechanism--you'll want the spike mechanism to introduce a large shunt conductance at the "soma" and have this conductance persist for long enough to suck some charge out of the dendrites.
That's what I've done with the code in this file: http://www.neuron.yale.edu/ftp/ted/devel/izhdistrib.zip
The code's operation is demonstrated by two toy models, each of which has a single compartment with surface area 100 um2. The "magic" is all in izh.mod and icell.hoc.
The duration of the refractory period in ms is specified by refrac; a value <= 0 does nothing.
Notice how izh.mod scales the generated current. Also note that the Izh mechansism's parameters are numerically identical to those in the papers. The Cm parameter is used to automatically scale the current that it generates. If you change cm in the compartment to which Izh is attached, you need to change Izh.Cm to the same value (or else Izh will generate more or less current than it should, and spiking dynamics will be affected). You don't have to specify compartment surface area, because that value is automatically available in NMODL.
initx.hoc brings up a single compartment model to which an IClamp is attached. The IClamp's del is 1e9 by default, so clicking on Init&Run produces a simulation in which the cell is driven by its own internal "stimulator" (the I term in the main ODE, which is controlled by parameters Izh.del, dur, and amp). You can turn I off by setting del in the Izh parameter panel to 20*e9, and replace it with the IClamp by changing the IClamp's del to 20 ms. Simulation results should be identical.
initnet.hoc brings up a toy network that illustrates how to attach a synaptic mechanism to a model cell that uses Izh, and how to use the cell as a spike source (use a NetCon that monitors its soma.v(0.5) for the occurrence of a spike--and make sure that this NetCon's threshold is 30!!
). The "synaptic weight" panel makes it easy to adjust the strength of excitation received by the model cell. Note the use of a custom initialization that allows the model cell to reach its steady state _before_ t=0.