pub struct MotorUnit {}Expand description
Motor unit — functional unit of motor control: alpha motor neuron + muscle fibre.
Each spike from the embedded LIF motor neuron triggers a muscle twitch. Force output is the summation of overlapping twitches (rate coding). Higher firing rates → more twitch overlap → higher force (tetanus).
Muscle twitch modelled as a critically-damped second-order system: f(t) = A * (t/τ) * exp(1 - t/τ), giving a smooth rise-then-decay.
Fuglevand et al., J. Neurophysiol. 70(6), 1993. Heckman & Enoka, Compr. Physiol. 2(4), 2012.
Fields§
§v: f64§v_rest: f64§v_reset: f64§v_threshold: f64§tau_m: f64§adapt: f64§tau_adapt: f64§a_adapt: f64§gain: f64§force: f64§twitch_amp: f64§tau_twitch: f64§force_decay: f64§dt: f64Implementations§
Source§impl MotorUnit
impl MotorUnit
pub fn new() -> Self
fn voltage_valid(value: f64) -> bool
fn force_valid(value: f64) -> bool
fn exact_relax(previous: f64, steady: f64, tau: f64, dt: f64) -> Option<f64>
fn valid_state(&self) -> bool
Sourcepub fn step(&mut self, drive: f64) -> i32
pub fn step(&mut self, drive: f64) -> i32
Step with descending drive (≥ 0). Returns spike (1/0). Force accessible via .force.
pub fn reset(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MotorUnit
impl RefUnwindSafe for MotorUnit
impl Send for MotorUnit
impl Sync for MotorUnit
impl Unpin for MotorUnit
impl UnsafeUnpin for MotorUnit
impl UnwindSafe for MotorUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.