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:
StateAssignments insideOnEventare placed into NET_RECEIVE block of NEURON .MOD. The assignments are put in the order they appear in the LEMS file.ifstatements from eachOnConditiontag are clumped together and placed in BREAKPOINT section, and get executed in the order in which they appear in the LEMS file.DerivedVariablestatements, then allConditionalDerivedVariablestatements, and finally allTimeDerivativestatements. As with others, they all are placed in the order they appear.Notes:
DerivedVariablethat is used by anOnCondition, create an always-executingOnConditionstatement withtest="1 .eq. 1", with a newStateVariable, and place it before any otherOnConditionstatements that will use it.DerivedVariablethat depends on aConditionalDerivedVariable, create an always-executingConditionalDerivedVariableand place it before otherConditionalDerivedVariables that use it.Once translated to NEURON MOD, the statements are grouped and executed within each timestep in the following order:
OnEventOnCondition'sDerivedVariable'sConditionalDerivedVariable'sTimeDerivative'sSee: In NEURON .MOD files what is the order of operations of the sections?