myogen.simulator.ForceModel.generate_force#

ForceModel.generate_force(spike_train__matrix)[source]#

Generate force output from motor unit spike trains using the Fuglevand model.

This method simulates muscle force by converting spike trains into force output through individual motor unit twitches with nonlinear gain modulation based on discharge rate. Each motor unit contributes to the total force according to its twitch properties and firing pattern.

Parameters:

spike_train__matrix (SPIKE_TRAIN__MATRIX) – Spike train matrix with shape (n_pools, n_neurons, n_time_points). Binary array where 1 indicates a spike occurrence. The number of neurons (axis 1) must match the number of recruitment thresholds.

Returns:

Force output array with shape (n_pools, n_time_points). Force values in arbitrary units representing muscle force over time. Each row corresponds to one motor neuron pool’s force response.

Return type:

numpy.ndarray

Raises:

ValueError – If spike train matrix dimensions don’t match the number of motor units. If twitch parameters have not been computed.

Notes

The force generation follows these steps: 1. Convert spike trains to inter-pulse intervals (IPIs) 2. Calculate nonlinear gain based on discharge rates 3. Sum weighted twitch responses for each spike 4. Apply gain modulation to final force output