Bob02 wrote:Thank you for the comprehensive explanation.

That was not the only issue with your mod file. Others are discussed after I answer your next question.

does NEURON deal with "cai'= f*(-(alpha*(ican))-(kca*cai))" as:

cai'= f*(-(alpha*(ican*area))-(kca*cai))

I mean How NEURON converts the distributed mechanism of "cai" and "vca" to point process in this mod file?

I don't understand your question. The NEURON block of your mod file declares

SUFFIX CaSTest4ed

which means that CaSTest4ed is a density mechanism, not a point process, so what does "point process" have to do with anything?

Besides, the equation

cai' = -(1e7)*f*alpha*ican/depth/2/FARADAY + kca*(cai0 - cai)

is dimensionally consistent. The term on the left hand side

cai'

has units of mM/ms = (millimole per liter) per ms

The second term on the right hand side

kca*(cai0 - cai)

also has units of mM/ms.

The first term on the right hand side, leaving out its scale factor, is

f*alpha*ican/depth/2/FARADAY

f and alpha are dimensionless.

ican is in mA/cm2

FARADAY is in coulombs/mole

If the units of depth were cm, this

ican/depth/2/FARADAY (which is just a lazy programmer's way to write ican/(depth*2*FARADAY))

would have units of mM/ms = (millimole/liter)/ms

But depth is in nm (nanometers), and 1 cm = 1e7 nm, so

ican/depth/2/FARADAY

is really in units of (millimole/(1000 cm2 * nm))/ms

and needs to be multiplied by a factor of 1e7 to convert it to mM/ms.

Which is just a long way of saying that the first term on the right hand side, including the (1e7) scale factor, has units of mM/ms.

So both terms on the right hand side have exactly the same units as the term on the left hand side of the equation.

**Other issues with the mod file**
These three are minor:

tau_mn and tau_hn are declared in the NEURON block but are not used.

dt is declared in the ASSIGNED block but is not used.

v2 is declared in PROCEDURE evaluate_fct but is not used.

The following two could cause problems:

celsius is assigned a value in the PARAMETER block. This assignment will have no effect--it will be overridden by the value assigned to NEURON's built-in celsius parameter. Note that the default value of celsius is 6.3 deg C.

The BREAKPOINT block contains the directive

SOLVE states METHOD runge

but that is inappropriate because runge is an explicit method and prone to instability, especially with an ion accumulation mechanism that is decribed by a differential equation. For such a mechanism, derivimplicit should be used. See

**Integration methods for SOLVE statements**
in the

**Hot tips** area of the NEURON Forum for more information about which method to use in various situations.