modeling int/ext ion accumulation AND diffusion

NMODL and the Channel Builder.
Post Reply
cwei_h

modeling int/ext ion accumulation AND diffusion

Post by cwei_h »

Hello,
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 know how to add diffusion if it is a KINETIC block, but im not sure how to do it in DERIVATIVE block.

I greatly appreciate any help,
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: modeling int/ext ion accumulation AND diffusion

Post by ted »

cwei_h wrote:I know how to add diffusion if it is a KINETIC block, but im not sure how to do it in DERIVATIVE block.
Write out the set of "reactions" that represent the flux of solute between compartments, then for each "reaction" write the corresponding differential equation.

Example: in a closed system, with two compartments i and o, the diffusion of solute a between i and o can be written as

ai <-> ao (kf, kr)

where

ai and ao are in units of concentration
kf = kr = Da * A / x
Da is the diffusion coefficient of a
A is the area of the interface between i and o
x is the length of the diffusion path (generally taken to be the distance between the centers of i and o)

subject to the conservation rule

ai * voli + ao * volo = atotal
where voli and volo are the volumes of i and o, and atotal is the total amount of a in units of "quantity" (moles, millimoles, # of atoms, or equivalent)

ai <-> ao (kf, kr)
tells us that the flux of a from i to o, in units of "quantity"/time, is
-ai*kf + ao*kr
so
dai/dt in units of "concentration"/time is (-ai*kf + ao*kr)/voli

Of course,
dao/dt in units of "concentration"/time is (ai*kf - ao*kr)/volo
but that's not an independent DE--ao is much more easily found from ai and the conservation rule
ai * voli + ao * volo = atotal

So now I hope you have a glimmering of how to get started. Frankly, kinetic scheme notation (plus CONSERVE statements) provides a much easier way to write descriptions of diffusion.
cwei_h

Re: modeling int/ext ion accumulation AND diffusion

Post by cwei_h »

Hello,
I am a little confused by your example. My understanding is that the example is on the diffusion of some ion 'a' between intracellular and extracellular environment. That isnt what i was after - i would like to add diffusion of ion inside a compartment (more specifically longitudinal diffusion). On top of that, i would like to keep track of the extracellular concentration of 'a'.
The above code only calculates intracellular and extracellular concentration of the ions but it doesnt have diffusion of ions from one segment to another.

Your help is appreciated,
ted
Site Admin
Posts: 5810
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: modeling int/ext ion accumulation AND diffusion

Post by ted »

Sorry about any misunderstanding. Your original message didn't mention longitudinal diffusion, so I incorrectly inferred that you meant diffusion between adjacent compartments in the same segment. On the other hand, my reply only stated that i and o were adjacent compartments, but you inferred that these were "intracellular" and "extracellular." So much for clarity of statement and accuracy of inference.

If you want to represent longitudinal diffusion with NMODL, you're stuck with kinetic scheme notation. I refer you to chapter 9 of The NEURON Book, specifically the models of calcium diffusion with buffering. If you don't have that, then if you're using MSWin look at
c:\nrnxx\examples\nrniv\nmodl\cadif.mod
or, for UNIX/Linux/OS X, download and expand the nrn*tar.gz source code, expand it, and look at
nrn/share/examples/nrniv/nmodl/cadif.mod
i would like to keep track of the extracellular concentration of 'a'.

Using cadif.mod as a specific example, this would require
--changing the USEION statement to
USEION ca READ cai, cao, ica WRITE cai, cao
--declaring a new STATE variable cao with proper units
--adding appropriate initialization statements to the INITIAL block and declaring an initial value parameter in the PARAMETER block
--adding a COMPARTMENT statement to the KINETIC block that specifies an appropriate volume of distribution for cao
--adding a statement to the KINETIC block that specifies the effect of ica on cao. This would be something of the form
~cao << (ica*PI*diam/(2*FARADAY))
(note the absence of a - sign).

And if you wanted to include longitudinal diffusion of cao, a LONGITUDINAL_DIFFUSION statement would be necessary for it.
Post Reply