Extracellular stimulation giving problems

NMODL and the Channel Builder.
Post Reply
karthik1024

Extracellular stimulation giving problems

Post by karthik1024 »

Hi,

I am trying to use neuron to do extracellular stimulation with different electrode geometries. As a starter I found useful information in this forum here and used the program http://www.neuron.yale.edu/ftp/ted/neur ... nd_rec.zip

The extracellular potential is modeled using a transfer resistance (Rx) approach where Rx(x,y,z) = V(x,y,z)/Is and the program calculates Rx for all segments and during simulaition multiples it with I to get V(x,y,z) = Rx(x,y,z)*I.

I modified the original files mentioned above to directly use V(x,y,z) instead of transfer resistances since for complex electrode geometries it is not easy to calculate Rx, but is relatively easier to calculate V(x,y,z).

I am interested in looking at threshold levels for stimulation as a function of electrode distance. To test direct use of V(x,y,z) I simulated extracellular stimulation using a spherical electrode (same as in the program linked above). When I supply equivalent parameters to both the original and modified programs, under a certain range of electrode distance and stimulus current I get exact same results but in some range of values my modified program doesn't work. The problem occurs when I am too close or too far away from the cell and when the current is too low. What happens then is that none of the variables change from their original resting values during a simulation. Once this happens, even if I give values which did work previously now stop working and remain in their resting values. The only way to get the modified program to start working again is to exit neuron and start it again.

I can see that my modification works and that under certain set of conditions it gives rise to some exception which is causing problems. I've seen similar problems when doing C programming and they are usually associated with memory issues. Is there a way to debug this ? Currently I am not sure how to go about fixing this bug since neuron doesn't signal any error during runtime.

Thanks for your time,
Karthik
ted
Site Admin
Posts: 6300
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Test your program on a toy model that has simple topology.
Insert print statements at critical points in your code, to discover at what point the program
stops doing what it should.
Post Reply