nmodl icon indicating copy to clipboard operation
nmodl copied to clipboard

GLOBAL propagation.

Open 1uc opened this issue 2 years ago • 0 comments

Some MOD files, including ProbAMPANMDA_EMS.mod, define RANGE variables that solely depend on GLOBAL variables. Hence, these variables don't need to be RANGE and could be converted to GLOBAL. Example:

NEURON {
    GLOBAL tau_r_AMPA, tau_r_NMDA, tau_d_NMDA
    RANGE tau_d_AMPA

    RANGE A_AMPA_step, B_AMPA_step, A_NMDA_step, B_NMDA_step
}

INITIAL {
    A_AMPA_step = exp(dt*(( - 1.0 ) / tau_r_AMPA))
    B_AMPA_step = exp(dt*(( - 1.0 ) / tau_d_AMPA))
    A_NMDA_step = exp(dt*(( - 1.0 ) / tau_r_NMDA))
    B_NMDA_step = exp(dt*(( - 1.0 ) / tau_d_NMDA))
}

The idea is similar to const-propagation. Here the motivation is to reduce the number of bytes per instance.

1uc avatar Oct 09 '23 12:10 1uc