Search code examples
biological-neural-networkneuron-simulatorneuromllems

Where does jNeuroML put LEMS commands in generated NEURON .MOD/NMODL?


How do the following tags in LEMS get mapped into NEURON .MOD/NMODL files:

<OnEvent>
   <StateAssignment .. />
</OnEvent>

<OnCondition ... >
   <StateAssignment ... >
</OnCondition>

<DerivedVariable .. />
<ConditionalDerivedVariable .. />
<TimeDerivative .. />

Solution

  • The LEMS tags are mapped to NEURON MOD as follows:

    • OnEvent -> NET_RECEIVE: StateAssignments inside OnEvent are placed into NET_RECEIVE block of NEURON .MOD. The assignments are put in the order they appear in the LEMS file.
    • OnCondition -> BREAKPOINT: All if statements from each OnCondition tag are clumped together and placed in BREAKPOINT section, and get executed in the order in which they appear in the LEMS file.
    • DerivedVariable, ConditionalDerivedVariable, TimeDerivative -> DERIVATIVE: These are also clumped together and appear in the DERIVATIVE section. First, all DerivedVariable statements, then all ConditionalDerivedVariable statements, and finally all TimeDerivative statements. As with others, they all are placed in the order they appear.

    Notes:

    • If you need a DerivedVariable that is used by an OnCondition, create an always-executing OnCondition statement with test="1 .eq. 1", with a new StateVariable, and place it before any other OnCondition statements that will use it.
    • Similarly, if you need a DerivedVariable that depends on a ConditionalDerivedVariable, create an always-executing ConditionalDerivedVariable and place it before other ConditionalDerivedVariables that use it.
    • Once translated to NEURON MOD, the statements are grouped and executed within each timestep in the following order:

      1. OnEvent
      2. OnCondition's
      3. DerivedVariable's
      4. ConditionalDerivedVariable's
      5. TimeDerivative's

    See: In NEURON .MOD files what is the order of operations of the sections?