A class implementing a SIMM muscle. More...
#include <ContDerivMuscle.h>
Public Member Functions | |
ContDerivMuscle () | |
Default constructor. | |
ContDerivMuscle (const ContDerivMuscle &aMuscle) | |
Copy constructor. | |
virtual | ~ContDerivMuscle () |
Destructor. | |
virtual Object * | copy () const |
Copy this muscle point and return a pointer to the copy. | |
ContDerivMuscle & | operator= (const ContDerivMuscle &aMuscle) |
Assignment operator. | |
void | copyData (const ContDerivMuscle &aMuscle) |
Copy data members from one ContDerivMuscle to another. | |
virtual double | getActivationTimeConstant () const |
virtual double | getDeactivationTimeConstant () const |
virtual double | getVmax () const |
virtual double | getVmax0 () const |
virtual double | getFmaxTendonStrain () const |
virtual double | getFmaxMuscleStrain () const |
virtual double | getKshapeActive () const |
virtual double | getKshapePassive () const |
virtual double | getDamping () const |
virtual double | getAf () const |
virtual double | getFlen () const |
virtual double | getNormalizedFiberLength (const SimTK::State &s) const |
_____________________________________________________________________________ /** Get the normalized length of the muscle fiber(s). | |
virtual double | getPassiveFiberForce (const SimTK::State &s) const |
Get the passive force generated by the muscle fibers. | |
virtual double | getStress (const SimTK::State &s) const |
Get the stress in this actuator. | |
virtual double | getActivation (const SimTK::State &s) const |
virtual void | setActivation (SimTK::State &s, double activation) const |
virtual double | getActivationDeriv (const SimTK::State &s) const |
virtual void | setActivationDeriv (const SimTK::State &s, double activationDeriv) const |
virtual double | getFiberLength (const SimTK::State &s) const |
virtual void | setFiberLength (SimTK::State &s, double fiberLength) const |
virtual double | getFiberLengthDeriv (const SimTK::State &s) const |
virtual void | setFiberLengthDeriv (const SimTK::State &s, double fiberLengthDeriv) const |
virtual void | setTendonForce (const SimTK::State &s, double aForce) const |
virtual double | getTendonForce (const SimTK::State &s) const |
virtual void | setActiveForce (const SimTK::State &s, double aForce) const |
virtual double | getActiveForce (const SimTK::State &s) const |
virtual void | setPassiveForce (const SimTK::State &s, double aForce) const |
virtual double | getPassiveForce (const SimTK::State &s) const |
virtual void | computeEquilibrium (SimTK::State &s) const |
Compute the equilibrium states. | |
virtual double | computeActuation (const SimTK::State &s) const |
Compute the actuation for the muscle. | |
double | calcTendonForce (const SimTK::State &s, double aNormTendonLength) const |
Tendon force is calculated by an integral-of-sigmoid function - zero for most negative inputs, linear for most positive inputs, and a toe region that's continuous and smooth with both linear regions. | |
double | calcPassiveForce (const SimTK::State &s, double aNormFiberLength) const |
Written by Darryl Thelen, modified by Tom Erez this routine calculates the passive force in the muscle fibers using an exponential-linear function instead of cubic splines. | |
double | calcActiveForce (const SimTK::State &s, double aNormFiberLength) const |
From gmc.dt.c - calc_active_force_dt. | |
double | calcFiberVelocity (const SimTK::State &s, double aActivation, double aActiveForce, double aVelocityDependentForce) const |
This function is based on the equations in appendix 3 to Lisa Schutte's Ph.D. | |
virtual double | computeIsometricForce (SimTK::State &s, double activation) const |
Find the force produced by an actuator (the musculotendon unit), assuming static equilibrium. | |
OPENSIM_DECLARE_DERIVED (ContDerivMuscle, ActivationFiberLengthMuscle) | |
Protected Member Functions | |
virtual void | setup (Model &aModel) |
Perform some set up functions that happen after the object has been deserialized or copied. | |
virtual void | createSystem (SimTK::MultibodySystem &system) const |
allocate and initialize the SimTK state for this acuator. | |
virtual SimTK::Vector | computeStateVariableDerivatives (const SimTK::State &s) const |
Compute the derivatives of the muscle states. | |
Protected Attributes | |
PropertyDbl | _activationTimeConstantProp |
Activation time constant. | |
double & | _activationTimeConstant |
PropertyDbl | _deactivationTimeConstantProp |
Deactivation time constant. | |
double & | _deactivationTimeConstant |
PropertyDbl | _vmaxProp |
Max contraction velocity full activation in fiber lengths per second. | |
double & | _vmax |
PropertyDbl | _vmax0Prop |
Max contraction velocity at low activation. | |
double & | _vmax0 |
PropertyDbl | _fmaxTendonStrainProp |
Tendon strain due to maximum isometric muscle force. | |
double & | _fmaxTendonStrain |
PropertyDbl | _fmaxMuscleStrainProp |
Passive muscle strain due to maximum isometric muscle force. | |
double & | _fmaxMuscleStrain |
PropertyDbl | _kShapeActiveProp |
Shape factor for Gaussian active muscle force-length relationship. | |
double & | _kShapeActive |
PropertyDbl | _kShapePassiveProp |
Exponential shape factor for passive force-length relationship. | |
double & | _kShapePassive |
PropertyDbl | _dampingProp |
Passive damping included in the force-velocity relationship. | |
double & | _damping |
PropertyDbl | _afProp |
Force-velocity shape factor. | |
double & | _af |
PropertyDbl | _flenProp |
Maximum normalized lengthening force. | |
double & | _flen |
A class implementing a SIMM muscle.
ContDerivMuscle::ContDerivMuscle | ( | ) |
Default constructor.
ContDerivMuscle::ContDerivMuscle | ( | const ContDerivMuscle & | aMuscle | ) |
Copy constructor.
aMuscle | ContDerivMuscle to be copied. |
ContDerivMuscle::~ContDerivMuscle | ( | ) | [virtual] |
Destructor.
double ContDerivMuscle::calcActiveForce | ( | const SimTK::State & | s, | |
double | aNormFiberLength | |||
) | const |
From gmc.dt.c - calc_active_force_dt.
CALC_ACTIVE_FORCE_DT: this routine calculates the active component of force in the muscle fibers. It uses the current fiber length to interpolate the active force-length curve - described by Gaussian curve as in Thelen, JBME 2003 *
aNormFiberLength | Normalized length of the muscle fiber. |
double ContDerivMuscle::calcFiberVelocity | ( | const SimTK::State & | s, | |
double | aActivation, | |||
double | aActiveForce, | |||
double | aVelocityDependentForce | |||
) | const |
This function is based on the equations in appendix 3 to Lisa Schutte's Ph.D.
dissertation (Stanford, Dec. 1992), as implemented in the Schutte1993Muscle. My modification involves smoothing the transition between the two formulas using a sigmoidal function.
This equation is parameterized using the following dynamic parameters which must be specified in the muscle file Dynamic Parameters: damping - normalized passive damping in parallel with contractile element Af - velocity shape factor from Hill's equation Flen - Maximum normalized force when muscle is lengthening
aActivation | Activation of the muscle. | |
aActiveForce | Active force in the muscle fibers. | |
aVelocityDependentForce | Force value that depends on fiber velocity. |
double ContDerivMuscle::calcPassiveForce | ( | const SimTK::State & | s, | |
double | aNormFiberLength | |||
) | const |
Written by Darryl Thelen, modified by Tom Erez this routine calculates the passive force in the muscle fibers using an exponential-linear function instead of cubic splines.
This equation is parameterized using the following dynamic parameters which must be specified in the muscle file Dynamic Parameters: FmaxMuscleStrain - passive muscle strain due to the application of maximum isometric muscle force KshapePassive - exponential shape factor
The normalized force due to passive stretch is given by For L < (1+maxStrain)*Lo f/f0 = exp(ks*(L-1)/maxStrain) / exp(ks)
At higher normalized lengths, we transition to a linear model through a smoothed-sigmoidal transition.
aNormFiberLength | Normalized length of the muscle fiber. |
double ContDerivMuscle::calcTendonForce | ( | const SimTK::State & | s, | |
double | aNormTendonLength | |||
) | const |
Tendon force is calculated by an integral-of-sigmoid function - zero for most negative inputs, linear for most positive inputs, and a toe region that's continuous and smooth with both linear regions.
The slope of the linear region is specified by the variable klin, and is taken from older code by Thelen. Currently, this value is about 51.87, which is bigger than the value found in the spline usually specifying the Schutte model (which has an effective slope of about 37.52).
The size of the toe region (where the function transitions from one linear region to another) is parameterized by "smoothcoef". The bigger its value, the wider the toe region. For smoothcoef=1, the area where the discrepency between the linear models and the function is bigger than 0.1 is about [-0.04, 0.04], and the area where it is bigger than 0.5 is smaller than [-0.01, 0.01], with maximum discrepency of about 0.7.
Note that while the tendon strain depends on the tendon length normalized in tendon slack length units, the input to this function is assumed to be the tendon length normalized in optimal fiber length units, hence the transformations in the first two lines.
FmaxTendonStrain - this function is parameterized by the tendon strain due to maximum isometric muscle force This should be specified as a dynamic parameter in the muscle file
aNormTendonLength | Normalized length of the tendon. |
double ContDerivMuscle::computeActuation | ( | const SimTK::State & | s | ) | const [virtual] |
Compute the actuation for the muscle.
This function assumes that computeDerivatives has already been called.
This function is based on muscle_deriv_func9 from derivs.c (old pipeline code)
Implements OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::computeEquilibrium | ( | SimTK::State & | s | ) | const [virtual] |
Compute the equilibrium states.
This method computes a fiber length for the muscle that is consistent with the muscle's activation level.
Reimplemented from OpenSim::Actuator_.
double ContDerivMuscle::computeIsometricForce | ( | SimTK::State & | s, | |
double | aActivation | |||
) | const [virtual] |
Find the force produced by an actuator (the musculotendon unit), assuming static equilibrium.
Using the total muscle-tendon length, it finds the fiber and tendon lengths so that the forces in each match. This routine takes pennation angle into account, so its definition of static equilibrium is when tendon_force = fiber_force * cos(pennation_angle). This funcion will modify the object's values for _length, _fiberLength, _activeForce, and _passiveForce.
aActivation | Activation of the muscle. |
Implements OpenSim::ActivationFiberLengthMuscle.
SimTK::Vector ContDerivMuscle::computeStateVariableDerivatives | ( | const SimTK::State & | s | ) | const [protected, virtual] |
Compute the derivatives of the muscle states.
rDYDT | the state derivatives are returned here. |
Reimplemented from OpenSim::ModelComponent.
Object * ContDerivMuscle::copy | ( | ) | const [virtual] |
Copy this muscle point and return a pointer to the copy.
The copy constructor for this class is used.
Implements OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::copyData | ( | const ContDerivMuscle & | aMuscle | ) |
Copy data members from one ContDerivMuscle to another.
aMuscle | ContDerivMuscle to be copied. |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::createSystem | ( | SimTK::MultibodySystem & | system | ) | const [protected, virtual] |
allocate and initialize the SimTK state for this acuator.
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::ContDerivMuscle::getActivation | ( | const SimTK::State & | s | ) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::ContDerivMuscle::getActivationDeriv | ( | const SimTK::State & | s | ) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::ContDerivMuscle::getActivationTimeConstant | ( | ) | const [inline, virtual] |
double ContDerivMuscle::getActiveForce | ( | const SimTK::State & | s | ) | const [virtual] |
virtual double OpenSim::ContDerivMuscle::getAf | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getDamping | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getDeactivationTimeConstant | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getFiberLength | ( | const SimTK::State & | s | ) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::ContDerivMuscle::getFiberLengthDeriv | ( | const SimTK::State & | s | ) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::ContDerivMuscle::getFlen | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getFmaxMuscleStrain | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getFmaxTendonStrain | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getKshapeActive | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getKshapePassive | ( | ) | const [inline, virtual] |
double ContDerivMuscle::getNormalizedFiberLength | ( | const SimTK::State & | s | ) | const [virtual] |
_____________________________________________________________________________ /** Get the normalized length of the muscle fiber(s).
This is the current fiber length(s) divided by the optimal fiber length.
Current | length of the muscle fiber(s). |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
double ContDerivMuscle::getPassiveFiberForce | ( | const SimTK::State & | s | ) | const [virtual] |
Get the passive force generated by the muscle fibers.
Current | passive force of the muscle fiber(s). |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
double ContDerivMuscle::getPassiveForce | ( | const SimTK::State & | s | ) | const [virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
double ContDerivMuscle::getStress | ( | const SimTK::State & | s | ) | const [virtual] |
Get the stress in this actuator.
It is calculated as the force divided by the maximum isometric force (which is proportional to its area).
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
double ContDerivMuscle::getTendonForce | ( | const SimTK::State & | s | ) | const [virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::ContDerivMuscle::getVmax | ( | ) | const [inline, virtual] |
virtual double OpenSim::ContDerivMuscle::getVmax0 | ( | ) | const [inline, virtual] |
OpenSim::ContDerivMuscle::OPENSIM_DECLARE_DERIVED | ( | ContDerivMuscle | , | |
ActivationFiberLengthMuscle | ||||
) |
ContDerivMuscle & ContDerivMuscle::operator= | ( | const ContDerivMuscle & | aMuscle | ) |
Assignment operator.
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::ContDerivMuscle::setActivation | ( | SimTK::State & | s, | |
double | activation | |||
) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::ContDerivMuscle::setActivationDeriv | ( | const SimTK::State & | s, | |
double | activationDeriv | |||
) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::setActiveForce | ( | const SimTK::State & | s, | |
double | aForce | |||
) | const [virtual] |
virtual void OpenSim::ContDerivMuscle::setFiberLength | ( | SimTK::State & | s, | |
double | fiberLength | |||
) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::ContDerivMuscle::setFiberLengthDeriv | ( | const SimTK::State & | s, | |
double | fiberLengthDeriv | |||
) | const [inline, virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::setPassiveForce | ( | const SimTK::State & | s, | |
double | aForce | |||
) | const [virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::setTendonForce | ( | const SimTK::State & | s, | |
double | aForce | |||
) | const [virtual] |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
void ContDerivMuscle::setup | ( | Model & | aModel | ) | [protected, virtual] |
Perform some set up functions that happen after the object has been deserialized or copied.
aModel | model containing this ContDerivMuscle. |
Reimplemented from OpenSim::ActivationFiberLengthMuscle.
double& OpenSim::ContDerivMuscle::_activationTimeConstant [protected] |
Activation time constant.
double& OpenSim::ContDerivMuscle::_af [protected] |
PropertyDbl OpenSim::ContDerivMuscle::_afProp [protected] |
Force-velocity shape factor.
double& OpenSim::ContDerivMuscle::_damping [protected] |
PropertyDbl OpenSim::ContDerivMuscle::_dampingProp [protected] |
Passive damping included in the force-velocity relationship.
double& OpenSim::ContDerivMuscle::_deactivationTimeConstant [protected] |
Deactivation time constant.
double& OpenSim::ContDerivMuscle::_flen [protected] |
PropertyDbl OpenSim::ContDerivMuscle::_flenProp [protected] |
Maximum normalized lengthening force.
double& OpenSim::ContDerivMuscle::_fmaxMuscleStrain [protected] |
Passive muscle strain due to maximum isometric muscle force.
double& OpenSim::ContDerivMuscle::_fmaxTendonStrain [protected] |
Tendon strain due to maximum isometric muscle force.
double& OpenSim::ContDerivMuscle::_kShapeActive [protected] |
Shape factor for Gaussian active muscle force-length relationship.
double& OpenSim::ContDerivMuscle::_kShapePassive [protected] |
Exponential shape factor for passive force-length relationship.
double& OpenSim::ContDerivMuscle::_vmax [protected] |
double& OpenSim::ContDerivMuscle::_vmax0 [protected] |
PropertyDbl OpenSim::ContDerivMuscle::_vmax0Prop [protected] |
Max contraction velocity at low activation.
PropertyDbl OpenSim::ContDerivMuscle::_vmaxProp [protected] |
Max contraction velocity full activation in fiber lengths per second.