myogen.simulator.IntramuscularElectrodeArray.traj_mixing_fun#

IntramuscularElectrodeArray.traj_mixing_fun(t, n_nodes, node)[source]#

Compute mixing weight for a specific trajectory node at given time.

This function calculates the interpolation weight for a trajectory node based on the current time/position along the trajectory. Uses triangular weighting where nodes closer to the current time get higher weights.

Parameters:
  • t (float) – Current normalized time or position in trajectory (0.0 to 1.0).

  • n_nodes (int) – Total number of nodes in the trajectory.

  • node (int or array_like) – Node index(es) for which to calculate mixing weights. Can be scalar or array of node indices.

Returns:

Mixing weight(s) for the specified node(s) at time t. Returns 0 for distant nodes, max weight 1 for closest node.

Return type:

float or numpy.ndarray