-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modcc: ion concentration writers #1532
Comments
modcc's current behavior has been designed to support common nmodl patterns:
If these are the only patterns we want to support, we need to properly document this and ideally also raise exceptions if users attempt to do something different. |
Points to make clear in the documentation (at least for me, these were confusing. If I got some of them still wrong, all the more reason to document them) (also sorry for repeating some from above)
Suggestions/Thoughts:
Obvious drawback not mentioned. |
It's only added (with a weight factor) in order to handle partial CV coverage by a concentration-writing mechanism. We explicitly test to ensure that no two mechanisms writing to the same ionic concentration overlap (see This means that once we make it past the initialization phase, there should be no order-dependence issues in ion concentration writes. Note that for each concentration, we compute in
This is what we're doing with the process outlined above. |
Just to clarify the semantics as implemented: for Arbor, a concentration-writing mechanism doesn't 'see' the effects of any other concentration-writing process, or averaging, etc. It is responsible purely for governing the evolution of the concentration as a function of ionic currents and any internal state it might hold. Consequently, the only way the mechanism should be able to read that ionic concentration is at mechanism initialization time, and the value it should see at initialization is the 'reset concentration' described above. |
The request for zeroing these contributions was motivated by the idea that a user -- knowing it is an additive component -- might not explicitly initialise |
Inasmuch as The issue is, in part, NMODL. When we see But again, we should determine what semantics we want and proceed accordingly. |
As we have found out (and documented) over implementing the #1729 feature, this is part of the cable model, if a different model is required, one can use the diffusive concentration Xd, without actual diffusion as needed. |
Note: the internal concentration of "ca" is used here, but the issue applies for all ions and for both internal and external concentrations
How do
nrnivmodl
andmodcc
interpret this nmodl code?nrnivmodl
concentration
to the internal concentration of the "ca" ion.cai
is aPARAMETER
orASSIGNED
instead ofSTATE
, and ifcai
is READ or READ/WRITE instead.modcc
BREAKPOINT
block, and forica
to not beASSIGNED
so :concentration
to a mechanism internal variable namedcai
, which is not going to contain the value of the internal concentration of "ca". The same code is generated ifcai
has READ instead of WRITE permission.cai
is not aSTATE
variable (or anything else) and it has WRITE permission: generates code that expect the internal concentration to be written:cai
is not aSTATE
variable (or anything else) and it has READ permission: generates code that assignsconcentration
to the internal concentration of the "ca" ion.cai
can't have bothREAD
andWRITE
permissions in the nmodl code.Summary of
modcc
's behavior:cai
has READ permission andcai
is not a STATE variable, we observe the correct behavior: variables assigned tocai
, get assigned the internal concentration of "ca".cai
in STATE complicates things:cai
no longer points to the internal concentration of "ca", but a separate uninitialized (or zero'd) variable. READ permission no longer works, and WRITE permission doesn't give read access either. (Question: what doescai
being aSTATE
variable mean here? It alters the meaning ofcai
which now indicates it is both the internal concentration of "ca" and not at the same time.)cai
has WRITE permission andcai
is a STATE variable, modcc expectscai
to be initialized in the mechanism, the user can't expect it to have the same value as the internal concentration of "ca" if it is not initialized.cai
has WRITE permission andcai
is not a STATE variable, modcc expects the internal concentration of "ca" to be written anytime it is used, which means that if it is read in some places but not written, the internal concentration will be written to zero.Expected behavior of modcc:
cai
get assigned the internal concentration of "ca".cai
has WRITE permission, it's unreasonable for the internal concentration of "ca" to be modified ifcai
is not.cai
as a STATE variable should be better explained, and it should result in sane code for both READ and WRITE permissions, or raise an exception.The text was updated successfully, but these errors were encountered: