Rigid Body Dynamics Library
MuscleFunctionFactory Class Reference

#include <MuscleFunctionFactory.h>

Static Public Member Functions

static void createFiberActiveForceLengthCurve (double lce0, double lce1, double lce2, double lce3, double minActiveForceLengthValue, double plateauSlope, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry ::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createFiberForceVelocityCurve (double fmaxE, double dydxC, double dydxNearC, double dydxIso, double dydxE, double dydxNearE, double concCurviness, double eccCurviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createFiberForceVelocityInverseCurve (double fmaxE, double dydxC, double dydxNearC, double dydxIso, double dydxE, double dydxNearE, double concCurviness, double eccCurviness, const std::string &muscleName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createFiberCompressiveForcePennationCurve (double phi0, double kiso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createFiberCompressiveForceCosPennationCurve (double cosPhi0, double kiso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createFiberCompressiveForceLengthCurve (double l0, double kiso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createFiberForceLengthCurve (double eZero, double eIso, double kLow, double kIso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 
static void createTendonForceLengthCurve (double eIso, double kIso, double fToe, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
 

Detailed Description

Definition at line 156 of file MuscleFunctionFactory.h.

Member Function Documentation

◆ createFiberActiveForceLengthCurve()

static void createFiberActiveForceLengthCurve ( double  lce0,
double  lce1,
double  lce2,
double  lce3,
double  minActiveForceLengthValue,
double  plateauSlope,
double  curviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry ::SmoothSegmentedFunction &  smoothSegmentedFunctionToUpdate 
)
static

This is a function that will produce a C2 (continuous to the second derivative) active force length curve.

Parameters
lce0Normalized fiber length at the left-most shoulder of the active force-length curve. The value of the active force length curve for lce < lce0 will be equal to the value set in shoulderVal. Normally lce0 is approximately 0.5
lce1Normalized fiber length at the transition point between the ascending limb and the plateau region of the active force length curve.
lce2Normalized fiber length at the maximum active force length curve value of 1. Normally lce2 is by definition 1.
lce3Normalized fiber length of the at the right most shoulder of the active-force length curve. The value of the active force length curve for lce > lce2 will be equal to the value of shoulderVal. Normally lce3 is approximately 1.5
minActiveForceLengthValueThe minimum value of the active force length curve. A physiological non-equibrium muscle model would have this value set to 0. An equilibrium muscle model would have a non-zero lower bound on this value of 0.1 typically. shoulderVal must be greater than, or equal to 0.
plateauSlopeThe slope of the plateau of the active force length curve between lce1 and lce2. This parameter can vary depending on the muscle model, but a value of 0.8616 is a good place to start.
curvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow). A value of 0 will yield an active force length curve that is composed of slightly curved line segments. A value of 1 will yield an active force length curve that is smoothly rounded.
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_fiberActiveForceLengthCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts if these conditions aren't met -0 < lce0 < lce1 < lce2 < lce3 -shoulderVal >= 0 -0 <= plateauSlope < (1/(lce3-lce2)) -0 <= curviness <= 1

Conditions:

Computational Costs

~20,500 flops

Example:

double lce0 = 0.5;
double lce1 = 0.75;
double lce2 = 1;
double lce3 = 1.5;
double shoulderVal = 0.1;
double plateauSlope = 0.75;
double curviness = 0.9;
SmoothSegmentedFunction fiberfalCurve = SmoothSegmentedFunction();
createFiberActiveForceLengthCurve(lce0, lce1, lce2, lce3,
shoulderVal, plateauSlope, curviness,"test", fiberfalCurve);
fiberfalCurve.printCurveToFile();
static void createFiberActiveForceLengthCurve(double lce0, double lce1, double lce2, double lce3, double minActiveForceLengthValue, double plateauSlope, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry ::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)

◆ createFiberCompressiveForceCosPennationCurve()

static void createFiberCompressiveForceCosPennationCurve ( double  cosPhi0,
double  kiso,
double  curviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

This element will generate a C2 continuous (continuous to the 2nd derivative) compressive force profile curve as a function of cos(pennation).

A muscle model with this element usually places this element in line with the tendon. The main function of this element is to prevent the fiber from achieving a pennation angle of pi/2 radians. This type of element is necessary for a parallelogram pennated muscle models because without it, the muscle model can deform to the point where a pennation angle of pi/2 radians is reached, which causes a singularity in the model.

Parameters
cosPhi0The cosine of the pennation angle at which the compressive force element starts to engage. When the cos of the pennation angle is greater than cosPhi0, the compressive element generates no force. When cos of the pennation angle is less than cosPhi0, the compressive element generates a compressive force.
kisoThis is the maximum stiffness of the compressive element, which occurs when cosPhi is zero. This parameter must be negative cos
curvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow)
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_fiberCompressiveForceCosPennationCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts unless the following conditions are met: -0 < cosPhi0 -kiso > 1/(cosPhi0) -0 <= curviness <= 1

Computational Costs

~4,100 flops

Example:

double cosPhi0 = cos( (80.0/90.0)*SimTK::Pi/2);
double kiso = -1.2/(cosPhi0);
double c = 0.5;
SmoothSegmentedFunction fiberCECosPhiCurve = MuscleFunctionFactory::
fiberCEPhiCurve.printCurveToFile();
static void createFiberCompressiveForceCosPennationCurve(double cosPhi0, double kiso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)
MX_Xd_scalar cos(const MX_Xd_scalar &x)
Definition: MX_Xd_utils.h:351

◆ createFiberCompressiveForceLengthCurve()

static void createFiberCompressiveForceLengthCurve ( double  l0,
double  kiso,
double  curviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

This element will generate a C2 continous (continuous to the second derivative) curve that models a compressive force profile that is a function of fiber length. The main function of this element is to prevent the fiber from achieving an unrealistically short length. This type of element is necessary for equilibrium-type muscle models because of the editing that is done to the active force length curve that endows an equilibrium model fiber with the ability to to generate force when a physiological fiber cannot.

Parameters
l0The normalized fiber length at which the compressive element starts to engage. When the fiber is shorter than l0, the compressive element is generating a force. When the fiber length is longer than l0, the compressive element generates no force.
kisoThis is the maximum stiffness of the compressive element, which occurs when the fiber has a length of 0, under a load of 1 maximum isometric unit of force.
curvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow)
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_fiberCompressiveForceLengthCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts unless the following conditions are met -e0 > 0 -kiso > 1/(e0) -0 <= curviness <= 1

Computational Costs

~4,100 flops

Example:

double lmax = 0.6;
double kiso = -8.389863790885878;
double c = 0.1;//0.0;
SmoothSegmentedFunction fiberCECurve = MuscleFunctionFactory::
fiberCECurve.printCurveToFile();
static void createFiberCompressiveForceLengthCurve(double l0, double kiso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)

◆ createFiberCompressiveForcePennationCurve()

static void createFiberCompressiveForcePennationCurve ( double  phi0,
double  kiso,
double  curviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

This element will generate a C2 continuous (continuous to the 2nd derivative) compressive force profile curve as a function of pennation. A muscle model with this element usually places this element parallel to the fiber.The main function of this element is to prevent the fiber from achieving a pennation angle of pi/2 radians. This type of element is necessary for a parallelogram pennated equilibrium muscle models because without it, the muscle model can deform to the point where a pennation angle of pi/2 radians is reached, which causes a singularity in the model.

Parameters
phi0The pennation angle at which the compressive force element starts to engage . When the pennation angle is greater than phi0, the compressive element is generating a force. When the pennation angle is less than phi0, the compressive element generates no force.
kisoThis is the maximum stiffness of the compressive element, which occurs when the fiber is pennated by 90 degrees
curvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow)
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_fiberCompressiveForcePennationCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts unless the following conditions are met -0 < phi0 < SimTK::Pi/2 -kiso > 1/(SimTK::Pi/2-phi0) -0 <= curviness <= 1

Computational Costs

~4,100 flops

Example:

double phi0 = (SimTK::Pi/2)*(8.0/9.0);
double kiso = 8.389863790885878;
double c = 0.0;
SmoothSegmentedFunction fiberCEPhiCurve = SmoothSegmentedFunction();
createFiberCompressiveForcePennationCurve(phi0,kiso,c,"test",fiberCEPhiCurve);
fiberCEPhiCurve.printCurveToFile();
static void createFiberCompressiveForcePennationCurve(double phi0, double kiso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)

◆ createFiberForceLengthCurve()

static void createFiberForceLengthCurve ( double  eZero,
double  eIso,
double  kLow,
double  kIso,
double  curviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

This function will generate a C2 continuous curve that fits a fiber's tensile force length curve.

Parameters
eZeroThe fiber strain at which the fiber begins to develop force. Thus an e0 of 0.0 means that the fiber will start to develop passive force when it has a normalized length of 1.0. Note that e0 can be postive or negative.
eIsoThe fiber strain at which the fiber develops 1 unit of normalized force (1 maximum isometric force). Note that the '1' is left off. Thus an e0 of 0.6 means that the fiber will develop an 1 normalized force unit when it is strained by 60% of its resting length, or to a normalized length of 1.6
kLowThe normalized stiffness (or slope) of the fiber curve close to the location where the force-length curve approaches a normalized force of 0. This is usually chosen to be a small, but non-zero fraction of kIso (kLow = 0.025 kIso is typical).
kIsoThe normalized stiffness (or slope) of the fiber curve when the fiber is strained by eIso (or has a length of 1+eIso) under a load of 1 maximum isometric unit of force.
curvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow)
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_fiberForceLengthCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts unless the following conditions are met -eIso > eZero
-kIso > 1/(eIso-eZero) -0 < kLow < kIso -0 <= curviness <= 1

Computational Costs

~4,100 flops

Example:

double eIso = 0.6;
double eZero = 0.0;
double kIso = 4.0/(eIso-eZero);
double kNearZero = 0.025*kIso
double c = 0.5;
SmoothSegmentedFunction fiberFLCurve
kLow, kIso, c,"test");
fiberFLCurve.printCurveToFile();
static void createFiberForceLengthCurve(double eZero, double eIso, double kLow, double kIso, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)

◆ createFiberForceVelocityCurve()

static void createFiberForceVelocityCurve ( double  fmaxE,
double  dydxC,
double  dydxNearC,
double  dydxIso,
double  dydxE,
double  dydxNearE,
double  concCurviness,
double  eccCurviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

This function will generate a C2 continous (continuous to the second derivative) force velocity curve of a single muscle fiber. The main function of this element is to model the amount the force enhancement or attenuation that is associated with contracting at a particular velocity.

Parameters
fmaxEThe normalized maximum force the fiber can generate when is being stretched. This value is reported to range between 1.1 and 1.8 in the literature, though all values are above 1.
dydxCThe slope of the fv(dlce(t)/dt) curve at the maximum normalized concentric contraction velocity. Although physiologically the value of dydxC at the maximum concentric contracton velocity is by definition 0, a value of 0 is often used. If you are using an equilbrium type model this term must be positive and greater than zero so that the fv curve can be inverted.

Minimum Value: 0 Maximum Value: dydxC < 1

dydxNearCThe slope of the force velocity curve as it approaches the maximum concentric (shortening) contraction velocity.

Minimum Value: > dydxC Maximum Value: dydxNearC < 1

dydxIsoThe slope of the fv curve when dlce(t)/dt = 0.

Minimim Value: dydxIso > 1.0 Maximum Value: dydxIso < Inf
dydxEThe analogous term of dydxC parameter but for the eccentric portion of the force-velocity curve. As with the dydxC term, the physiologically accurate value for this parameter is 0, though a value of 0 is rarely used in muscle models. If you are using an equilbrium type model this term must be positive and greater than zero so that the fv curve can be inverted.

Minimum Value: 0 Maximum Value: dydxC < (fmaxE-1).

As with the dydxC term, the size of this term also affects the stiffness of the integration problem for equilibrium-type muscle models: the closer to zero this term is, the stiffer the model will be (but only when (dlce(t)/dt)/vmax approaches 1.
dydxNearEThe slope of the force velocity curve as it approaches the maximum eccentric (lengthening) contraction velocity.

Minimum Value: > dydxE Maximum Value: dydxNearE < (fmaxE-1)

concCurvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow). This parameter affects only the concentric side of the fv curve.
eccCurvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow). This parameter affects only the eccentric side of the fv curve.
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_fiberForceVelocityCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts unless these conditions are met
-0 <= dydxC < 1 -dydxC < dydxNearC < 1 -1 < dydxIso -dydxE < (fmaxE-1) -dydxE < dydxNearC < (fmaxE-1) -0<= concCurviness <=0 -0 <= eccCurviness <= 0

Computational Costs

~8,200 flops

Example:

double fmaxE = 1.8;
double dydxC = 0.1;
double dydxNearC = 0.25;
double dydxE = 0.1;
double dydxNearE = 0.15;
double dydxIso= 5;
double concCurviness = 0.1;
double eccCurviness = 0.75;
SmoothSegmentedFunction fiberFVCurve = SmoothSegmentedFunction();
dydxC, dydxNearC, dydxIso, dydxE, dydxNearE,
concCurviness, eccCurviness,"test", fiberFVCurve);
fiberFVCurve.printCurveToFile();
static void createFiberForceVelocityCurve(double fmaxE, double dydxC, double dydxNearC, double dydxIso, double dydxE, double dydxNearE, double concCurviness, double eccCurviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)

◆ createFiberForceVelocityInverseCurve()

static void createFiberForceVelocityInverseCurve ( double  fmaxE,
double  dydxC,
double  dydxNearC,
double  dydxIso,
double  dydxE,
double  dydxNearE,
double  concCurviness,
double  eccCurviness,
const std::string &  muscleName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

This function will generate a C2 continuous (continuous to the 2nd derivative) inverse curve that the function createFiberForceVelocityCurve generates. The inverse force velocity curve is required by every equilibrium muscle model in order to compute the derivative of fiber velocity. To generate the inverse force velocity curve simply call this function with EXACTLY the same parameter values that you used to generate the force velocity curve. See the parameter descriptions for createFiberForceVelocityCurve, as the parameters for the inverse function are identical. The curve name should be different, however, because this is an inverse curve (e.g. "bicep_fiberForceVelocityInverseCurve")

◆ createTendonForceLengthCurve()

static void createTendonForceLengthCurve ( double  eIso,
double  kIso,
double  fToe,
double  curviness,
const std::string &  curveName,
RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction smoothSegmentedFunctionToUpdate 
)
static

Will generate a C2 continous (continuous to the second derivative) curve in a MuscleFunctionObject object that fits a tendon's tensile force length curve.

Parameters
eIsoThe tendon strain at which the tendon develops 1 unit of normalized force (1 maximum isometric force). Note that the'1' is left off. Thus an e0 of 0.04 means that the tendon will develop an 1 normalized force unit when it is strained by 4% of its resting length, at a normalized length of 1.04
kIsoThe normalized stiffness (or slope) of the tendon curve when the tendon is strained by e0 (or has a length of 1+e0) under a load of 1 maximum isometric unit of force.
fToeThe normalized force at which the tendon smoothly transitions from the curved low stiffness region to the linear stiffness region.
curvinessThe dimensionless 'curviness' parameter that can vary between 0 (a line) to 1 (a smooth, but sharply bent elbow)
curveNameThe name of the muscle this curve applies to. This curve name should have the name of the muscle and the curve in it (e.g. "bicep_tendonForceLengthCurve") sothat if this curve ever causes an exception, a userfriendly error message can be displayed to the end user to help them debug their model.
smoothSegmentedFunctionToUpdateA SmoothSegmentedFunction object that will be erased and filled with the coefficients that are defined by this curve.

aborts unless the following conditions are met: -0 < fToe < 1 -e0 > 0 -kiso > 1/e0 -0 <= curviness <= 1

Computational Costs

~4,100 flops

Example:

double e0 = 0.04;
double kiso = 42.79679348815859;
double fToe = 1.0/3.0
double c = 0.75;
SmoothSegmentedFunction* tendonCurve = MuscleFunctionFactory::
e0,kiso,fToe,c,"test");
tendonCurve.printCurveToFile();
static void createTendonForceLengthCurve(double eIso, double kIso, double fToe, double curviness, const std::string &curveName, RigidBodyDynamics::Addons::Geometry::SmoothSegmentedFunction &smoothSegmentedFunctionToUpdate)

The documentation for this class was generated from the following file: