Page 1 of 1

A pump MOD file and no concentration inside

Posted: Sat Jan 30, 2021 3:00 am
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?

Re: A pump MOD file and no concentration inside

Posted: Sun Jan 31, 2021 10:04 am
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).

Re: A pump MOD file and no concentration inside

Posted: Mon Feb 01, 2021 7:28 am
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

Re: A pump MOD file and no concentration inside

Posted: Mon Feb 01, 2021 1:53 pm
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.