Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The steps covered in part one are:

...

computeInitialFiberEquillibrium()

The function computeInitialFiberEquilibrium() computes values of the muscle states assuming the muscle is in an equilibrium state. It is typically called for each muscle before beginning a dynamic simulation. In our muscle class, this function initializes the new states to reasonable values prior to simulation.

Code Block
/* Determine the initial state values based on initial fiber equlibrium. */
void FatigableMuscle::computeInitialFiberEquilibrium(SimTK::State& s) const
{
       // initialize th target activation to be the actual.
       setTargetActivation(s, getActivation(s));
       // assume that all motor units can be activated initially and there is
       // no appreciable fatigue
       setActiveMotorUnits(s, 1.0);
       setFatiguedMotorUnits(s, 0.0);

       // Compute the fiber & tendon lengths according to the parent Muscle 
       Super::computeInitialFiberEquilibrium(s);
}

...

Panel
borderColorgray
bgColorwhite
borderWidth5
borderStylesolid

Next: Custom Muscle Model Part Two

Previous: Creating a Customized Muscle Model

Home: Scripting and Development | Developer's Guide | Adding New Functionality