How do the following tags in LEMS get mapped into NEURON .MOD/NMODL files:
<OnEvent>
<StateAssignment .. />
</OnEvent>
<OnCondition ... >
<StateAssignment ... >
</OnCondition>
<DerivedVariable .. />
<ConditionalDerivedVariable .. />
<TimeDerivative .. />
The LEMS tags are mapped to NEURON MOD as follows:
StateAssignment
s insideOnEvent
are placed into NET_RECEIVE block of NEURON .MOD. The assignments are put in the order they appear in the LEMS file.if
statements from eachOnCondition
tag are clumped together and placed in BREAKPOINT section, and get executed in the order in which they appear in the LEMS file.DerivedVariable
statements, then allConditionalDerivedVariable
statements, and finally allTimeDerivative
statements. As with others, they all are placed in the order they appear.Notes:
DerivedVariable
that is used by anOnCondition
, create an always-executingOnCondition
statement withtest="1 .eq. 1"
, with a newStateVariable
, and place it before any otherOnCondition
statements that will use it.DerivedVariable
that depends on aConditionalDerivedVariable
, create an always-executingConditionalDerivedVariable
and place it before otherConditionalDerivedVariable
s that use it.Once translated to NEURON MOD, the statements are grouped and executed within each timestep in the following order:
OnEvent
OnCondition
'sDerivedVariable
'sConditionalDerivedVariable
'sTimeDerivative
'sSee: In NEURON .MOD files what is the order of operations of the sections?