generate_mu_recruitment_thresholds#

myogen.simulator.generate_mu_recruitment_thresholds(N, recruitment_range, deluca__slope=None, konstantin__max_threshold=1.0, mode='konstantin')[source]#

Generate recruitment thresholds for a pool of motor units using different models.

This function computes the recruitment thresholds (and zero-based thresholds) for a pool of N motor units according to one of several models from the literature. The distribution of thresholds is controlled by the recruitment range (RR) and, for some models, additional parameters.

Following models are available:
  • Fuglevand et al. (1993) [1]

  • De Luca & Contessa (2012) [2]

  • Konstantin et al. (2020) [3]

  • Combined model

Parameters:
  • N (int) – Number of motor units in the pool.

  • recruitment_range (float) – Recruitment range, defined as the ratio of the largest to smallest threshold \((rt(N)/rt(1))\).

  • deluca__slope (float, optional) – Slope correction coefficient for the 'deluca' mode. Required if mode='deluca'. Typical values range from 25-100.

  • konstantin__max_threshold (float, optional) – Maximum recruitment threshold for the 'konstantin' mode. Required if mode='konstantin'. Sets the absolute scale of all thresholds.

  • mode ('fuglevand' | 'deluca' | 'konstantin' | 'combined', optional) – Model to use for threshold generation. One of 'fuglevand', 'deluca', 'konstantin', or 'combined'. Default is 'konstantin'.

Returns:

  • rt (numpy.ndarray) – Recruitment thresholds for each motor unit (shape: (N,)). Values are monotonically increasing from rt[0] to rt[N-1].

  • rtz (numpy.ndarray) – Zero-based recruitment thresholds where \(rtz[0] = 0\) (shape: (N,)). Computed as \(rtz = rt - rt[0]\), convenient for simulation.

Raises:

ValueError – If a required mode-specific parameter is not provided or if an unknown mode is specified.

Return type:

tuple[ndarray, ndarray]

References

Notes

fuglevandFuglevand et al. (1993) [1] exponential model
\[rt(i) = \exp( \frac{i \cdot \ln(RR)}{N} ) / 100\]

where \(i = 1, 2, \ldots, N\)

delucaDe Luca & Contessa (2012) [2] model with slope correction
\[rt(i) = \frac{b \cdot i}{N} \cdot \exp\left(\frac{i \cdot \ln(RR / b)}{N}\right) / 100\]

where \(b\) = deluca__slope, \(i = 1, 2, \ldots, N\)

konstantinKonstantin et al. (2020) [3] model allowing explicit maximum threshold control
\[\begin{split}rt(i) &= \frac{RT_{max}}{RR} \cdot \exp\left(\frac{(i - 1) \cdot \ln(RR)}{N - 1}\right) \\ rtz(i) &= \frac{RT_{max}}{RR} \cdot \left(\exp\left(\frac{(i - 1) \cdot \ln(RR + 1)}{N}\right) - 1\right)\end{split}\]

where \(RT_{max}\) = konstantin__max_threshold, \(i = 1, 2, \ldots, N\)

combinedA corrected De Luca model that uses the slope parameter for shape control but properly respects the RR constraint and maximum threshold like the Konstantin model
\[rt(i) = \frac{RT_{max}}{RR} + \left(\frac{b \cdot i}{N} \cdot \exp\left(\frac{i \cdot \ln(RR / b)}{N}\right) - \frac{RT_{max}}{RR}\right) \cdot \left(\frac{RT_{max} - RT_{max}/RR}{b \cdot N \cdot \exp\left(\frac{i \cdot \ln(RR / b)}{N}\right) - \frac{RT_{max}}{RR}}\right)\]

where \(b\) = deluca__slope, \(RT_{max}\) = konstantin__max_threshold, \(i = 1, 2, \ldots, N\)

Note

  • All models ensure \(rt(1) < rt(2) < \ldots < rt(N)\) (monotonically increasing)

  • The recruitment range \(RR = rt(N) / rt(1)\) is preserved across all models

  • rtz is a zero-based version where \(rtz(1) = 0\), useful for simulation

  • Motor units are recruited when excitation \(> rt(i)\) for unit \(i\)

Examples

>>> # Generate thresholds using Fuglevand model
>>> rt, rtz = generate_mu_recruitment_thresholds(
...     N=100, recruitment_range=50, mode='fuglevand'
... )
>>>
>>> # Generate thresholds using Konstantin model with explicit max threshold
>>> rt, rtz = generate_mu_recruitment_thresholds(
...     N=100, recruitment
... )