A base class representing a muscle-tendon actuator. More...
#include <ActivationFiberLengthMuscle.h>
Public Member Functions | |
ActivationFiberLengthMuscle () | |
Default constructor. | |
ActivationFiberLengthMuscle (const ActivationFiberLengthMuscle &aMuscle) | |
Copy constructor. | |
virtual | ~ActivationFiberLengthMuscle () |
Destructor. | |
virtual Object * | copy () const =0 |
Copy this actuator and return a pointer to the copy. | |
void | setName (const std::string &aName) |
ActivationFiberLengthMuscle & | operator= (const ActivationFiberLengthMuscle &aMuscle) |
Assignment operator. | |
void | copyData (const ActivationFiberLengthMuscle &aMuscle) |
Copy data members from one ActivationFiberLengthMuscle to another. | |
virtual void | updateFromXMLNode () |
Override of the default implementation to account for versioning. | |
virtual void | equilibrate (SimTK::State &state) const |
virtual int | getNumStateVariables () const |
Get the number of state variables allocated by this force. | |
virtual double | getDefaultActivation () const |
virtual void | setDefaultActivation (double activation) |
virtual double | getDefaultFiberLength () const |
virtual void | setDefaultFiberLength (double length) |
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 double | getNormalizedFiberLength (const SimTK::State &s) const |
/** Get the normalized length of the muscle fiber(s). | |
virtual double | getFiberLengthAlongTendon (const SimTK::State &s) const |
Get the length of the muscle fiber(s) along the tendon. | |
virtual double | getTendonLength (const SimTK::State &s) const |
Get the length of 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 |
Get the passive force generated by the muscle fibers. | |
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 | getPassiveForce (const SimTK::State &s) const |
virtual void | setPassiveForce (const SimTK::State &s, double aForce) const |
virtual double | getTendonForce (const SimTK::State &s) const |
virtual void | setTendonForce (const SimTK::State &s, double aForce) const |
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 | getExcitation (const SimTK::State &s) const |
virtual double | getStress (const SimTK::State &s) const |
Get the stress in this actuator. | |
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 | computeIsokineticForceAssumingInfinitelyStiffTendon (SimTK::State &s, double aActivation) const |
Find the force produced by muscle under isokinetic conditions assuming an infinitely stiff tendon. | |
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 (ActivationFiberLengthMuscle, Muscle) | |
Protected Member Functions | |
virtual void | postScale (const SimTK::State &s, const ScaleSet &aScaleSet) |
Perform computations that need to happen after the muscle is scaled. | |
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 | 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. | |
virtual void | setNumStateVariables (int aNumStateVariables) |
virtual std::string | getStateVariableName (int aIndex) const |
Get the name of a state variable, given its index. | |
virtual void | setStateVariableDeriv (const SimTK::State &s, int aIndex, double aValue) const |
Set the derivative of an actuator state, specified by index. | |
virtual double | getStateVariableDeriv (const SimTK::State &s, int aIndex) const |
Get the derivative of an actuator state, by index. | |
virtual SimTK::Vector | computeStateVariableDerivatives (const SimTK::State) |
Protected Attributes | |
Array< std::string > | _stateVariableSuffixes |
double | _defaultActivation |
double | _defaultFiberLength |
SimTK::ZIndex | _zIndex |
Static Protected Attributes | |
static const int | STATE_ACTIVATION = 0 |
static const int | STATE_FIBER_LENGTH = 1 |
A base class representing a muscle-tendon actuator.
It adds states to the Muscle class, but does not implement all of the necessary methods, so it is abstract too. The path information for a muscle is contained in this class, and the force-generating behavior should be defined in the derived classes.
ActivationFiberLengthMuscle::ActivationFiberLengthMuscle | ( | ) |
Default constructor.
ActivationFiberLengthMuscle::ActivationFiberLengthMuscle | ( | const ActivationFiberLengthMuscle & | aMuscle | ) |
Copy constructor.
aMuscle | ActivationFiberLengthMuscle to be copied. |
ActivationFiberLengthMuscle::~ActivationFiberLengthMuscle | ( | ) | [virtual] |
Destructor.
virtual double OpenSim::ActivationFiberLengthMuscle::computeActuation | ( | const SimTK::State & | s | ) | const [pure virtual] |
Compute all quantities necessary for applying the actuator force to the model.
Implements OpenSim::Muscle.
Implemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
void ActivationFiberLengthMuscle::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::Muscle.
double ActivationFiberLengthMuscle::computeIsokineticForceAssumingInfinitelyStiffTendon | ( | SimTK::State & | s, | |
double | aActivation | |||
) | const [virtual] |
Find the force produced by muscle under isokinetic conditions assuming an infinitely stiff tendon.
That is, all the shortening velocity of the actuator (the musculotendon unit) is assumed to be due to the shortening of the muscle fibers alone. This methods calls computeIsometricForce and so alters the internal member variables of this muscle.
Note that the current implementation approximates the effect of the force-velocity curve. It does not account for the shortening velocity when it is solving for the equilibrium length of the muscle fibers. And, a generic representation of the force-velocity curve is used (as opposed to the implicit force-velocity curve assumed by this model.
aActivation | Activation of the muscle. |
virtual double OpenSim::ActivationFiberLengthMuscle::computeIsometricForce | ( | SimTK::State & | s, | |
double | activation | |||
) | const [pure virtual] |
Implements OpenSim::Muscle.
Implemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
virtual SimTK::Vector OpenSim::ActivationFiberLengthMuscle::computeStateVariableDerivatives | ( | const SimTK::State | ) | [inline, protected, virtual] |
virtual Object* OpenSim::ActivationFiberLengthMuscle::copy | ( | ) | const [pure virtual] |
Copy this actuator and return a pointer to the copy.
The copy constructor for this class is used.
Implements OpenSim::Muscle.
Implemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
void ActivationFiberLengthMuscle::copyData | ( | const ActivationFiberLengthMuscle & | aMuscle | ) |
Copy data members from one ActivationFiberLengthMuscle to another.
aMuscle | ActivationFiberLengthMuscle to be copied. |
Reimplemented from OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
void ActivationFiberLengthMuscle::createSystem | ( | SimTK::MultibodySystem & | system | ) | const [protected, virtual] |
allocate and initialize the SimTK state for this acuator.
Reimplemented from OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
void ActivationFiberLengthMuscle::equilibrate | ( | SimTK::State & | state | ) | const [virtual] |
Implements OpenSim::Muscle.
double ActivationFiberLengthMuscle::getActivation | ( | const SimTK::State & | s | ) | const [virtual] |
Implements OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::getActivationDeriv | ( | const SimTK::State & | s | ) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::getActiveFiberForce | ( | const SimTK::State & | s | ) | const [virtual] |
Get the active force generated by the muscle fibers.
Reimplemented from OpenSim::Muscle.
double ActivationFiberLengthMuscle::getActiveFiberForceAlongTendon | ( | const SimTK::State & | s | ) | const [virtual] |
Get the active force generated by the muscle fibers along the direction of the tendon.
Reimplemented from OpenSim::Muscle.
double ActivationFiberLengthMuscle::getDefaultActivation | ( | ) | const [virtual] |
double ActivationFiberLengthMuscle::getDefaultFiberLength | ( | ) | const [virtual] |
double ActivationFiberLengthMuscle::getExcitation | ( | const SimTK::State & | s | ) | const [virtual] |
double ActivationFiberLengthMuscle::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 from OpenSim::Muscle.
double ActivationFiberLengthMuscle::getFiberLength | ( | const SimTK::State & | s | ) | const [virtual] |
Implements OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::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 from OpenSim::Muscle.
double ActivationFiberLengthMuscle::getFiberLengthDeriv | ( | const SimTK::State & | s | ) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::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). |
Implements OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle.
int ActivationFiberLengthMuscle::getNumStateVariables | ( | ) | const [virtual] |
Get the number of state variables allocated by this force.
The default implementation returns 0. Subclasses that allocate state variables must override it.
Reimplemented from OpenSim::Force.
double ActivationFiberLengthMuscle::getPassiveFiberForce | ( | const SimTK::State & | s | ) | const [virtual] |
Get the passive force generated by the muscle fibers.
Current | passive force of the muscle fiber(s). |
Implements OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::getPassiveFiberForceAlongTendon | ( | const SimTK::State & | s | ) | const [virtual] |
Get the passive force generated by the muscle fibers along the direction of the tendon.
Reimplemented from OpenSim::Muscle.
double ActivationFiberLengthMuscle::getPassiveForce | ( | const SimTK::State & | s | ) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
virtual OpenSim::Array<std::string> OpenSim::ActivationFiberLengthMuscle::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::Muscle.
virtual OpenSim::Array<double> OpenSim::ActivationFiberLengthMuscle::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::Muscle.
double ActivationFiberLengthMuscle::getStateVariableDeriv | ( | const SimTK::State & | s, | |
int | aIndex | |||
) | const [protected, virtual] |
Get the derivative of an actuator state, by index.
aIndex | the index of the state to get. |
string ActivationFiberLengthMuscle::getStateVariableName | ( | int | aIndex | ) | const [protected, virtual] |
Get the name of a state variable, given its index.
aIndex | The index of the state variable to get. |
Reimplemented from OpenSim::ModelComponent.
double ActivationFiberLengthMuscle::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::PathActuator.
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::getTendonForce | ( | const SimTK::State & | s | ) | const [virtual] |
Implements OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle.
double ActivationFiberLengthMuscle::getTendonLength | ( | const SimTK::State & | s | ) | const [virtual] |
Get the length of the tendon.
Reimplemented from OpenSim::Muscle.
void ActivationFiberLengthMuscle::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::Muscle.
OpenSim::ActivationFiberLengthMuscle::OPENSIM_DECLARE_DERIVED | ( | ActivationFiberLengthMuscle | , | |
Muscle | ||||
) |
ActivationFiberLengthMuscle & ActivationFiberLengthMuscle::operator= | ( | const ActivationFiberLengthMuscle & | aMuscle | ) |
Assignment operator.
aMuscle | The muscle from which to copy its data |
Reimplemented from OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
void ActivationFiberLengthMuscle::postScale | ( | const SimTK::State & | s, | |
const ScaleSet & | aScaleSet | |||
) | [protected, virtual] |
Perform computations that need to happen after the muscle is scaled.
For this object, that entails updating the muscle path. Derived classes should probably also scale or update some of the force-generating properties.
aScaleSet | XYZ scale factors for the bodies. |
Reimplemented from OpenSim::PathActuator.
void ActivationFiberLengthMuscle::setActivation | ( | SimTK::State & | s, | |
double | activation | |||
) | const [virtual] |
Implements OpenSim::Muscle.
Reimplemented in OpenSim::ContDerivMuscle.
void ActivationFiberLengthMuscle::setActivationDeriv | ( | const SimTK::State & | s, | |
double | activationDeriv | |||
) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
void ActivationFiberLengthMuscle::setDefaultActivation | ( | double | activation | ) | [virtual] |
void ActivationFiberLengthMuscle::setDefaultFiberLength | ( | double | length | ) | [virtual] |
void ActivationFiberLengthMuscle::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::Muscle.
void ActivationFiberLengthMuscle::setFiberLength | ( | SimTK::State & | s, | |
double | fiberLength | |||
) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
void ActivationFiberLengthMuscle::setFiberLengthDeriv | ( | const SimTK::State & | s, | |
double | fiberLengthDeriv | |||
) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
void OpenSim::ActivationFiberLengthMuscle::setName | ( | const std::string & | aName | ) |
Reimplemented from OpenSim::Muscle.
void ActivationFiberLengthMuscle::setNumStateVariables | ( | int | aNumStateVariables | ) | [protected, virtual] |
void ActivationFiberLengthMuscle::setPassiveForce | ( | const SimTK::State & | s, | |
double | aForce | |||
) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
void ActivationFiberLengthMuscle::setStateVariableDeriv | ( | const SimTK::State & | s, | |
int | aIndex, | |||
double | aValue | |||
) | const [protected, virtual] |
Set the derivative of an actuator state, specified by index.
aIndex | The index of the state to set. | |
aValue | The value to set the state to. |
void ActivationFiberLengthMuscle::setTendonForce | ( | const SimTK::State & | s, | |
double | aForce | |||
) | const [virtual] |
Reimplemented in OpenSim::ContDerivMuscle.
void ActivationFiberLengthMuscle::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::Muscle.
Reimplemented in OpenSim::ContDerivMuscle, OpenSim::Delp1990Muscle, OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
void ActivationFiberLengthMuscle::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::Muscle.
double OpenSim::ActivationFiberLengthMuscle::_defaultActivation [protected] |
double OpenSim::ActivationFiberLengthMuscle::_defaultFiberLength [protected] |
Array<std::string> OpenSim::ActivationFiberLengthMuscle::_stateVariableSuffixes [protected] |
SimTK::ZIndex OpenSim::ActivationFiberLengthMuscle::_zIndex [protected] |
const int ActivationFiberLengthMuscle::STATE_ACTIVATION = 0 [static, protected] |
Reimplemented in OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.
const int ActivationFiberLengthMuscle::STATE_FIBER_LENGTH = 1 [static, protected] |
Reimplemented in OpenSim::Schutte1993Muscle, and OpenSim::Thelen2003Muscle.