A bit of clarification appears to be in order.
bee wrote:I now understand that vext[n] is not the external voltage at each node.
The word "node" is ambiguous in this context. Must distinguish between "node of Ranvier" (if your axon is myelinated) and "node as a discrete point in space at which NEURON computes the local potential." Which did you have in mind when writing "vext[n]"? In the following comments I use "node" without other qualifications to refer to the latter, and "node of Ranvier" to refer to the former.
Also, I believe that I have to write an extra mod file for my sinusoidal stimulation and add it as a point process?
The question is: how to make potential at extracellular nodes follow the desired time course. One could literally insert hoc statements into the main computational loop that would, at every time step, evaluate the sine function, then loop over all extracellular nodes, one at a time, computing the product of the sine value and an appropriate scale factor and storing the result in v at this node. This would be much slower than necessary, and it would also be incompatible with adaptive integration.
I found a file called fsin.mod
Presumably you refer to
http://www.neuron.yale.edu/ftp/ted/neuron/fsin.mod. Be sure to follow the instructions in its header with regard to order of compilation of mod files.
I am not sure how to deal with the pointer x.
Time to review what the Programmer's Reference says about setpointer. Also look for other examples of setpointer usage in the hoc files that accompanied xtra.mod. Then realize that it's mercifully simpler than you thought, because is_xtra is GLOBAL -- which means you only need one instance of the Fsin class and just one setpointer statement to link its x variable to is_xtra.
- Code: Select all
objref fsin
soma fsin = new Fsin(0.5)
setpointer fsin.x, is_xtra
I would define the values for f, amp, del, and n in my hoc file right?
True.
But then there is also the xtra.mod file that works with the extracellular mechanism and I am confused about the different pointers
There is no change in how xtra's im and ex POINTER variables are dealt with. The only new thing is the Fsin object and its x POINTER. I know it seems kind of mindbending the first time, if not migraine inducing, but it's really not that bad.