A pump MOD file and no concentration inside

NMODL and the Channel Builder.
Post Reply
bremen
Posts: 45
Joined: Mon Apr 24, 2017 8:15 am
Location: Italy

A pump MOD file and no concentration inside

Post by bremen »

Hi.

My workflow contains the following steps: a substance is generated into a section (MOD file), is pumped out (MOD file) in a cubic ECS (RxD).
Than from the ECS it is pumped (MOD file) into another section where there are a series of reactions (RxD).
This works fine.

Now I'm trying to substitute the last step from RxD to a new MOD file but, probably for some trivial reason, it does not work.

The pump MOD file is this one.
https://github.com/neuronsimulator/nrn/ ... s/pump.mod

Since the pump provides a current, I have tried combination of USEION and internal variables to translate it into a concentration but the internal concentration (xi) remains at zero, instead the external one correctly changes (xo).

I have looked at many MOD files to understand the requirement, but there is something I'm overlooking about the correct way to translate a current into a concentration.
What I'm missing?
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: A pump MOD file and no concentration inside

Post by ted »

The concentration of a solute y in a compartment will not change unless there is a mass balance equation that relates y' (the rate of change of concentration in that compartment) to the net flux of y into that compartment. The mass balance equation can be specified in an NMODL file or by a statement that uses rxd. For NMODL examples, see nacum.mod and similar files in nrn/share/examples/nrniv/nmodl (packaged with NEURON's source code).

If the compartment happens to correspond to the classical NMODL intracellular or extracelluar space, the concentration in that compartment will have a hoc name of the form yi or yo (e.g. nai, nao); the Python name will be of the form seg.yi or seg.yo (e.g. seg.nai, seg.nao). Furthermore, if the mass balance equation is specified in an NMODL file, that file's NEURON block will need a USEION y statement that ends with
WRITE yi
(or
WRITE yo
or
WRITE yi, yo
as appropriate).
bremen
Posts: 45
Joined: Mon Apr 24, 2017 8:15 am
Location: Italy

Re: A pump MOD file and no concentration inside

Post by bremen »

Hello Ted.

Thank you very much.
I was missing the "mass balance equation".
I have added it to the MOD file and everything is working fine.

Best
Stefano
ted
Site Admin
Posts: 6286
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Re: A pump MOD file and no concentration inside

Post by ted »

I was missing the "mass balance equation".
That'll do it.

Be sure to check your revised mod file with modlunit to verify that units are consistent, and if they aren't, apply the necessary scale factors.
Post Reply