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 inside OnEvent
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 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
statements, then all ConditionalDerivedVariable
statements, and finally all TimeDerivative
statements. As with others, they all are placed in the order they appear.Notes:
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. DerivedVariable
that depends on a ConditionalDerivedVariable
, create an always-executing ConditionalDerivedVariable
and place it before other ConditionalDerivedVariable
s that use it. Once translated to NEURON MOD, the statements are grouped and executed within each timestep in the following order:
OnEvent
OnCondition
's DerivedVariable
'sConditionalDerivedVariable
'sTimeDerivative
'sSee: In NEURON .MOD files what is the order of operations of the sections?