Page 1 of 1

Accessing state variables of one mechanisn in another mechanism

Posted: Sun Dec 01, 2019 11:35 pm
by bdut
I have a mechanism that has a state variable cAMP. Is it possible to access this state variable in another mechanism (.mod file)? The second mechanism has a state variable depending on cAMP.

Thanks

Re: Accessing state variables of one mechanisn in another mechanism

Posted: Mon Dec 02, 2019 12:09 pm
by ted
One way would be to make the dependent mechanisms' cAMP variables be POINTERs. Read about setpointer in the Programmer's Reference. For an example, see caL.mod and kir2.mod in ModelDB entry 39949. These mechanisms specify ion channels whose properties are modulated by a second messenger, the concentration of which is perturbed by synaptic activation of a particular dopamine receptor. damsg.mod describes the properties of the DAsyn class, each instance of which has its own state variable msg. caL.mod and kir2.mod are density mechanisms that have a POINTER variable called mu, which is linked to a DAsyn instance's msg by a setpointer statement.

If your model has significant spatial extent, you will need to make sure that spatial discretization is adequate (do you have any idea of how far or fast a perturbation of cAMP spreads?) and that each instance of the dependent mechanism(s) is coupled to the anatomically corresponding cAMP variable. This will involve running tests on simplified models.

Re: Accessing state variables of one mechanisn in another mechanism

Posted: Fri Dec 13, 2019 2:05 am
by bdut
Thank you for the details, Ted. I have gone through the modeldb entry you indicated, But, this code has a POINT PROCESS which is accessed by 2 .mod files. Is there a way to interact between the 2 mechanisms directly, without the POINT PROCESS?

Thanks and regards

Re: Accessing state variables of one mechanisn in another mechanism

Posted: Fri Dec 13, 2019 11:02 am
by ted
The example is to be read as an illustration of the use of pointers to link variables in different mechanisms. Period. There's nothing about pointers that requires that any point processes be involved at all. If mechanism B has some variable y whose value is actually computed in mechanism A, then revise mechanism B so that y is declared to be a POINTER. In your model setup code, make sure that setpointer statements couple the the correct instances of B's y to the corresponding instances of A's y. Keep in mind the facts that
  • STATE variables are automatically RANGE
  • a PARAMETER is automatically GLOBAL unless it is declared to be RANGE
  • an ASSIGNED variable must be declared RANGE or GLOBAL in order to be visible to hoc or Python

Re: Accessing state variables of one mechanisn in another mechanism

Posted: Fri Jan 03, 2020 4:52 am
by bdut
Thank you Ted for the detailed reply. It really helped.