jjnaylor wrote:I want the calcium to accumulate only in specific spots and then diffuse along the dendrites. This should lead to a traveling wave of calcium and also a wave of depolarization. However, the neuron seems to depolarize and change internal calcium uniformly across the whole cell.
. . .
how does neuron handle ions? Is diffusion between compartments already handled (ie. if I make k_ip=gsyn=0 at all places besides the synapses will calcium only accumulate in those compartments and then diffuse with neuron's built-in mechanisms)? or do I need to code for that in an nmodl file?
All you get for free is the cable equation, and the total transmembrane current for each ionic species. If you need ion accumulation, buffering, pumps, diffusion, you have to add the equations yourself. Chapter 9 of the NEURON Book contains several examples of intra- and extracellular ion accumulation, some with buffering, some with radial diffusion, one with longitudinal diffusion. Similar examples are provided in the gzipped source code for NEURON--look in share/examples/nrniv/nmodl
Initialization of models that involve ion accumulation is important, and for calcium it can be a particular challenge. Chapter 8 goes into some detail about initialization.
Your implementation strategy should exploit modularity. Each variety of channel that generates a transmembrane current should have its own mod file. Each ionic species (e.g. ca, na, k, whatever) whose accumulation must be simulated should also have its own mod file which WRITEs the intra- and/or extracellular concentration adjacent to the membrane, e.g. cai, cao. This file will eventually contain statements that compute dcai/dt from ica, and specify all processes that are directly involved in accumulation, such as buffering, exchangers, pumps, radial and longitudinal diffusion, uptake into and release from internal stores. But make this latter file simple to start with, e.g. just the contribution of ica to cai, and add complications one by one, testing after each change to make sure everything is working properly.
The spatial grid will be important. The easiest diffusional architecture to specify in NEURON is longitudinal, but you will have to make sure that nseg of all relevant sections is large enough for good spatial accuracy. Radial diffusion between adjacent cylindrical shells isn't too hard to set up; you'll see examples in the places to which I referred you.
You might find it useful to examine the code for the NEURON implementation of the model by Fink et al. (2000) of calcium waves in neuroblastoma cells--see ModelDB accession # 125745http://senselab.med.yale.edu/modeldb/ShowModel.asp?model=125745
Ion accumulation mechanisms are best implemented with density mechanisms, but synaptic interactions are best implemented with point processes. Second-messenger-mediated synaptic effects on density mechanisms can be implemented with POINTERs; see for example the way dopaminergic synaptic modulation of L current and inward rectifier via a messenger was treated in the NEURON implementation of the spiny neuron model of Gruber et al. 2003--ModelDB accession # 39949http://senselab.med.yale.edu/modeldb/ShowModel.asp?model=39949
I expect you'll have some more questions.