Skip to main content

MuscleModel

Struct MuscleModel 

Source
pub struct MuscleModel {
    pub f_max: f64,
    pub l_opt: f64,
    pub v_max: f64,
    pub pennation_angle: f64,
}
Expand description

Muscle model using Hill’s three-element (active + passive + series) model.

Fields§

§f_max: f64

Maximum isometric force [N].

§l_opt: f64

Optimal fiber length [m].

§v_max: f64

Maximum shortening velocity [m/s].

§pennation_angle: f64

Pennation angle at optimal length [radians].

Implementations§

Source§

impl MuscleModel

Source

pub fn new(f_max: f64, l_opt: f64, v_max: f64, pennation_angle: f64) -> Self

Create a new muscle model.

Source

pub fn tibialis_anterior() -> Self

Typical human tibialis anterior muscle.

Source

pub fn quadriceps() -> Self

Typical human quadriceps (rectus femoris).

Source

pub fn active_force_length(&self, l_normalized: f64) -> f64

Active force-length relationship f_l(l̃) where l̃ = l/l_opt.

Gaussian: f_l = exp(-((l̃ - 1)/ω)^2), ω ≈ 0.45

Source

pub fn passive_force_length(&self, l_normalized: f64) -> f64

Passive force-length relationship f_p(l̃).

Exponential rise for l̃ > 1: f_p = (exp(k_p*(l̃-1)/ε_0) - 1) / (exp(k_p) - 1)

Source

pub fn force_velocity(&self, v_normalized: f64) -> f64

Force-velocity relationship f_v(ṽ) where ṽ = v/v_max (Hill’s equation).

Concentric: f_v = (1 - ṽ)/(1 + ṽ/a_v), a_v ≈ 0.25 Eccentric: f_v = (1.8 - 0.8*(1+ṽ)/(1-7.56*ṽ))

Source

pub fn muscle_force(&self, l: f64, v: f64, activation: f64) -> f64

Compute muscle force [N] given fiber length [m], velocity [m/s], and activation a ∈ [0,1].

Source

pub fn max_power(&self) -> f64

Maximum power output [W].

Trait Implementations§

Source§

impl Clone for MuscleModel

Source§

fn clone(&self) -> MuscleModel

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MuscleModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.