A base class representing a muscle-tendon actuator. More...
#include <Muscle.h>
Public Member Functions | |
Muscle () | |
Default constructor. | |
Muscle (const Muscle &aMuscle) | |
Copy constructor. | |
virtual | ~Muscle () |
Destructor. | |
virtual Object * | copy () const =0 |
Copy this actuator and return a pointer to the copy. | |
void | setName (const std::string &aName) |
Muscle & | operator= (const Muscle &aMuscle) |
Assignment operator. | |
void | copyData (const Muscle &aMuscle) |
Copy data members from one Muscle to another. | |
virtual void | updateFromXMLNode () |
Override of the default implementation to account for versioning. | |
virtual double | getMaxIsometricForce () const |
virtual double | getOptimalFiberLength () const |
virtual double | getTendonSlackLength () const |
virtual double | getPennationAngleAtOptimalFiberLength () const |
virtual double | getMaxContractionVelocity () const |
virtual void | setMaxIsometricForce (double aMaxIsometricForce) |
virtual void | setOptimalFiberLength (double aOptimalFiberLength) |
virtual void | setTendonSlackLength (double aTendonSlackLength) |
virtual void | setPennationAngleAtOptimalFiberLength (double aPennationAngle) |
virtual void | setMaxContractionVelocity (double aMaxContractionVelocity) |
virtual double | getPennationAngle (const SimTK::State &s) const |
Get the current pennation angle of the muscle fiber(s). | |
virtual double | getTendonLength (const SimTK::State &s) const |
Get the length of the tendon. | |
virtual double | getFiberLength (const SimTK::State &s) const =0 |
virtual double | getNormalizedFiberLength (const SimTK::State &s) const =0 |
virtual double | getFiberLengthAlongTendon (const SimTK::State &s) const |
Get the length of the muscle fiber(s) along the tendon. | |
virtual double | getFiberForce (const SimTK::State &s) const |
Compute the force generated by the muscle fibers. | |
virtual double | getActiveFiberForce (const SimTK::State &s) const |
Get the active force generated by the muscle fibers. | |
virtual double | getPassiveFiberForce (const SimTK::State &s) const =0 |
virtual double | getActiveFiberForceAlongTendon (const SimTK::State &s) const |
Get the active force generated by the muscle fibers along the direction of the tendon. | |
virtual double | getPassiveFiberForceAlongTendon (const SimTK::State &s) const |
Get the passive force generated by the muscle fibers along the direction of the tendon. | |
virtual double | getTendonForce (const SimTK::State &s) const =0 |
virtual double | getActivation (const SimTK::State &s) const =0 |
virtual void | setActivation (SimTK::State &s, double activation) const =0 |
virtual double | computeActuation (const SimTK::State &s) const =0 |
Compute all quantities necessary for applying the actuator force to the model. | |
virtual double | computeIsometricForce (SimTK::State &s, double activation) const =0 |
virtual double | evaluateForceLengthVelocityCurve (double aActivation, double aNormalizedLength, double aNormalizedVelocity) const |
Evaluate the normalized force-length-velocity curve for the muscle. | |
virtual double | calcPennation (double aFiberLength, double aOptimalFiberLength, double aInitialPennationAngle) const |
Utility function to calculate the current pennation angle in a muscle. | |
virtual void | equilibrate (SimTK::State &state) const =0 |
virtual OpenSim::Array < std::string > | getRecordLabels () const |
Methods to query a Force for the value actually applied during simulation The names of the quantities (column labels) is returned by this first function getRecordLabels(). | |
virtual OpenSim::Array< double > | getRecordValues (const SimTK::State &state) const |
Given SimTK::State object extract all the values necessary to report forces, application location frame, etc. | |
OPENSIM_DECLARE_DERIVED (Muscle, PathActuator) | |
Protected Member Functions | |
virtual void | computeForce (const SimTK::State &state, SimTK::Vector_< SimTK::SpatialVec > &bodyForces, SimTK::Vector &generalizedForce) const |
Apply the muscle's force at its points of attachment to the bodies. | |
virtual void | updateGeometry (const SimTK::State &s) const |
virtual void | setup (Model &aModel) |
Perform set up functions after model has been deserialized or copied. | |
virtual void | createSystem (SimTK::MultibodySystem &system) const |
allocate and initialize the SimTK state for this acuator. | |
virtual void | initState (SimTK::State &s) const |
This is called after a SimTK System and State have been created for the Model. | |
virtual void | setDefaultsFromState (const SimTK::State &state) |
Set all default values for this object to match those in a specified State. | |
Protected Attributes | |
PropertyDbl | _optimalFiberLengthProp |
Optimal length of the muscle fibers. | |
double & | _optimalFiberLength |
PropertyDbl | _maxIsometricForceProp |
Maximum isometric force that the fibers can generate. | |
double & | _maxIsometricForce |
PropertyDbl | _tendonSlackLengthProp |
Resting length of the tendon. | |
double & | _tendonSlackLength |
PropertyDbl | _pennationAngleAtOptimalProp |
Angle between tendon and fibers at optimal fiber length. | |
double & | _pennationAngleAtOptimal |
PropertyDbl | _maxContractionVelocityProp |
Maximum contraction velocity of the fibers, in optimal fiberlengths per second. | |
double & | _maxContractionVelocity |
A base class representing a muscle-tendon actuator.
It adds data and methods to PathActuator, but does not implement all of the necessary methods, and remains an abstract class. The path information for a muscle is contained in PathActuator, and the force-generating behavior should be defined in the derived classes.
This class defines a subset of muscle models that include an active fiber (contractile element) in series with a tendon. This class defines common data members and handles the geometry of a unipennate fiber in connection with a tendon. No states are assumed, but concrete classes are free to add whatever states are necessary to describe the specific behavior of a muscle.
Muscle::Muscle | ( | ) |
Default constructor.
Muscle::Muscle | ( | const Muscle & | aMuscle | ) |
Copy constructor.
aMuscle | Muscle to be copied. |
Muscle::~Muscle | ( | ) | [virtual] |
Destructor.
double Muscle::calcPennation | ( | double | aFiberLength, | |
double | aOptimalFiberLength, | |||
double | aInitialPennationAngle | |||
) | const [virtual] |
Utility function to calculate the current pennation angle in a muscle.
Pennation angle increases as muscle fibers shorten. The implicit modeling assumption is that muscles have constant width.
aFiberLength | Current fiber length of muscle. | |
aOptimalFiberLength | Optimal fiber length of muscle. | |
aInitialPennationAngle | Pennation angle at optimal fiber length (in radians). |
virtual double OpenSim::Muscle::computeActuation | ( | const SimTK::State & | s | ) | const [pure virtual] |
Compute all quantities necessary for applying the actuator force to the model.
Reimplemented from OpenSim::PathActuator.
Implemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::RigidTendonMuscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::ActivationFiberLengthMuscle.
void Muscle::computeForce | ( | const SimTK::State & | state, | |
SimTK::Vector_< SimTK::SpatialVec > & | bodyForces, | |||
SimTK::Vector & | generalizedForce | |||
) | const [protected, virtual] |
Apply the muscle's force at its points of attachment to the bodies.
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::Muscle::computeIsometricForce | ( | SimTK::State & | s, | |
double | activation | |||
) | const [pure virtual] |
virtual Object* OpenSim::Muscle::copy | ( | ) | const [pure virtual] |
Copy this actuator and return a pointer to the copy.
The copy constructor for this class is used.
Reimplemented from OpenSim::PathActuator.
Implemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::RigidTendonMuscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::ActivationFiberLengthMuscle.
void Muscle::copyData | ( | const Muscle & | aMuscle | ) |
Copy data members from one Muscle to another.
aMuscle | Muscle to be copied. |
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::RigidTendonMuscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::ActivationFiberLengthMuscle.
void Muscle::createSystem | ( | SimTK::MultibodySystem & | system | ) | const [protected, virtual] |
allocate and initialize the SimTK state for this acuator.
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::RigidTendonMuscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::Muscle::equilibrate | ( | SimTK::State & | state | ) | const [pure virtual] |
Implemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::evaluateForceLengthVelocityCurve | ( | double | aActivation, | |
double | aNormalizedLength, | |||
double | aNormalizedVelocity | |||
) | const [virtual] |
Evaluate the normalized force-length-velocity curve for the muscle.
A simple generic implementation is used here. Derived classes should override this method for more precise evaluation of the force-length-velocity curve.
aActivation | Activation level of the muscle. 1.0 is full activation; 0.0 is no activation. | |
aNormalizedLength | Normalized length of the muscle fibers. 1.0 indicates the muscle fibers are at their optimal length. Lnorm = L / Lo. | |
aNormalizedVelocity | Normalized shortening velocity of the muscle fibers. Positive values indicate concentric contraction (shortening); negative values indicate eccentric contraction (lengthening). Normalized velocity is the fiber shortening velocity divided by the maximum shortening velocity times the optimal fiber length. Vnorm = V / (Vmax*Lo). |
virtual double OpenSim::Muscle::getActivation | ( | const SimTK::State & | s | ) | const [pure virtual] |
Implemented in OpenSim::ContDerivMuscle, OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getActiveFiberForce | ( | const SimTK::State & | s | ) | const [virtual] |
Get the active force generated by the muscle fibers.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getActiveFiberForceAlongTendon | ( | const SimTK::State & | s | ) | const [virtual] |
Get the active force generated by the muscle fibers along the direction of the tendon.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getFiberForce | ( | const SimTK::State & | s | ) | const [virtual] |
Compute the force generated by the muscle fibers.
This accounts for pennation angle. That is, the fiber force is computed by dividing the actuator force by the cosine of the pennation angle.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::Muscle::getFiberLength | ( | const SimTK::State & | s | ) | const [pure virtual] |
Implemented in OpenSim::ContDerivMuscle, OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getFiberLengthAlongTendon | ( | const SimTK::State & | s | ) | const [virtual] |
Get the length of the muscle fiber(s) along the tendon.
This method accounts for the pennation angle.
Reimplemented in OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::Muscle::getMaxContractionVelocity | ( | ) | const [inline, virtual] |
virtual double OpenSim::Muscle::getMaxIsometricForce | ( | ) | const [inline, virtual] |
virtual double OpenSim::Muscle::getNormalizedFiberLength | ( | const SimTK::State & | s | ) | const [pure virtual] |
Implemented in OpenSim::ContDerivMuscle, OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::Muscle::getOptimalFiberLength | ( | ) | const [inline, virtual] |
virtual double OpenSim::Muscle::getPassiveFiberForce | ( | const SimTK::State & | s | ) | const [pure virtual] |
Implemented in OpenSim::ContDerivMuscle, OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getPassiveFiberForceAlongTendon | ( | const SimTK::State & | s | ) | const [virtual] |
Get the passive force generated by the muscle fibers along the direction of the tendon.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getPennationAngle | ( | const SimTK::State & | s | ) | const [virtual] |
Get the current pennation angle of the muscle fiber(s).
Pennation | angle. |
virtual double OpenSim::Muscle::getPennationAngleAtOptimalFiberLength | ( | ) | const [inline, virtual] |
virtual OpenSim::Array<std::string> OpenSim::Muscle::getRecordLabels | ( | ) | const [inline, virtual] |
Methods to query a Force for the value actually applied during simulation The names of the quantities (column labels) is returned by this first function getRecordLabels().
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual OpenSim::Array<double> OpenSim::Muscle::getRecordValues | ( | const SimTK::State & | state | ) | const [inline, virtual] |
Given SimTK::State object extract all the values necessary to report forces, application location frame, etc.
used in conjunction with getRecordLabels and should return same size Array
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::Muscle::getTendonForce | ( | const SimTK::State & | s | ) | const [pure virtual] |
Implemented in OpenSim::ContDerivMuscle, OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
double Muscle::getTendonLength | ( | const SimTK::State & | s | ) | const [virtual] |
Get the length of the tendon.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual double OpenSim::Muscle::getTendonSlackLength | ( | ) | const [inline, virtual] |
void Muscle::initState | ( | SimTK::State & | state | ) | const [protected, virtual] |
This is called after a SimTK System and State have been created for the Model.
It must be implementd to set initial values of state variables.
state | the State to initialize |
Reimplemented from OpenSim::Actuator.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
OpenSim::Muscle::OPENSIM_DECLARE_DERIVED | ( | Muscle | , | |
PathActuator | ||||
) |
Reimplemented in OpenSim::RigidTendonMuscle.
Assignment operator.
aMuscle | The muscle from which to copy its data |
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::RigidTendonMuscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::Muscle::setActivation | ( | SimTK::State & | s, | |
double | activation | |||
) | const [pure virtual] |
Implemented in OpenSim::ContDerivMuscle, OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
void Muscle::setDefaultsFromState | ( | const SimTK::State & | state | ) | [protected, virtual] |
Set all default values for this object to match those in a specified State.
It must be implemented/overriden to set any default values defined by each subclass.
state | the State from which to take values that should become the defaults for this object |
Reimplemented from OpenSim::Actuator.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::Muscle::setMaxContractionVelocity | ( | double | aMaxContractionVelocity | ) | [inline, virtual] |
virtual void OpenSim::Muscle::setMaxIsometricForce | ( | double | aMaxIsometricForce | ) | [inline, virtual] |
void OpenSim::Muscle::setName | ( | const std::string & | aName | ) |
Reimplemented from OpenSim::Object.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
virtual void OpenSim::Muscle::setOptimalFiberLength | ( | double | aOptimalFiberLength | ) | [inline, virtual] |
virtual void OpenSim::Muscle::setPennationAngleAtOptimalFiberLength | ( | double | aPennationAngle | ) | [inline, virtual] |
virtual void OpenSim::Muscle::setTendonSlackLength | ( | double | aTendonSlackLength | ) | [inline, virtual] |
void Muscle::setup | ( | Model & | aModel | ) | [protected, virtual] |
Perform set up functions after model has been deserialized or copied.
aModel | The model containing this muscle. |
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::RigidTendonMuscle, OpenSim::Schutte1993Muscle, OpenSim::Thelen2003Muscle, and OpenSim::ActivationFiberLengthMuscle.
void Muscle::updateFromXMLNode | ( | ) | [virtual] |
Override of the default implementation to account for versioning.
Override default implementation by object to intercept and fix the XML node underneath the model to match current version.
Reimplemented from OpenSim::PathActuator.
Reimplemented in OpenSim::RigidTendonMuscle, and OpenSim::ActivationFiberLengthMuscle.
void Muscle::updateGeometry | ( | const SimTK::State & | s | ) | const [protected, virtual] |
double& OpenSim::Muscle::_maxContractionVelocity [protected] |
Maximum contraction velocity of the fibers, in optimal fiberlengths per second.
double& OpenSim::Muscle::_maxIsometricForce [protected] |
PropertyDbl OpenSim::Muscle::_maxIsometricForceProp [protected] |
Maximum isometric force that the fibers can generate.
double& OpenSim::Muscle::_optimalFiberLength [protected] |
PropertyDbl OpenSim::Muscle::_optimalFiberLengthProp [protected] |
Optimal length of the muscle fibers.
double& OpenSim::Muscle::_pennationAngleAtOptimal [protected] |
Angle between tendon and fibers at optimal fiber length.
double& OpenSim::Muscle::_tendonSlackLength [protected] |
PropertyDbl OpenSim::Muscle::_tendonSlackLengthProp [protected] |
Resting length of the tendon.