Im interested in modeling intracellular and extracellular ion accumulation and internal ion diffusion. I have created a mod file for the ion accumulation part but im not sure how to include internal ion diffusion. Here is my code:

Code: Select all

```
NEURON
{
SUFFIX ionFlux
USEION cl READ icl WRITE cli, clo VALENCE -1
USEION k READ ik WRITE ki , ko VALENCE 1
USEION na READ ina WRITE nai, nao VALENCE 1
RANGE cli0, clo0, ki0, ko0, nai0, nao0
RANGE rho
}
UNITS
{
(molar) = (1/liter) : moles do not appear in units
(mM) = (millimolar)
(um) = (micron)
(mV) = (millivolt)
(mA) = (milliamp)
FARADAY = 9.6485e4 (coulombs)
R = 8.3134 (joule/degC)
PI = (pi) (1)
}
PARAMETER
{
::::::::: Initial ion concentration ::::::::::
cli0 = 4.2 (mM)
clo0 = 123 (mM)
ki0 = 155 (mM)
ko0 = 4 (mM)
nai0 = 12 (mM)
nao0 = 145 (mM)
rho = 0.2 (1) : extra vol : intra vol
diam (um)
celsius (degC)
}
ASSIGNED
{
icl (mA/cm2)
ik (mA/cm2)
ina (mA/cm2)
cli (mM)
ki (mM)
nai (mM)
clx (mM)
kx (mM)
nax (mM)
}
STATE
{
clo (mM)
ko (mM)
nao (mM)
}
INITIAL
{
cli = cli0
clo = clo0
ki = ki0
ko = ko0
nai = nai0
nao = nao0
clx = cli0 + clo0 * rho
kx = ki0 + ko0 * rho
nax = nai0 + nao0 * rho
}
BREAKPOINT
{
SOLVE state METHOD cnexp
}
DERIVATIVE state
{
clo' = 4 * (-icl) / (rho*diam*FARADAY) * (1e4)
cli = clx - clo * rho
ko' = 4 * ik / (rho*diam*FARADAY) * (1e4)
ki = kx - ko * rho
nao' = 4 * (ina) / (rho*diam*FARADAY) * (1e4)
nai = nax - nao * rho
}
```

I greatly appreciate any help,