[38ba34]: / Tools / ModelUtilities / Reactions / SupportMuscleRot.any

Download this file

54 lines (42 with data), 1.9 kB

#ifndef EXCLUDE_MUSCLE_METABOLISM
#define EXCLUDE_MUSCLE_METABOLISM AnyMetabModelSimple ZeroMetabolicMdl = {EtaCon = 2e22; EtaEcc = 2e22;}; MetabModel = &ZeroMetabolicMdl;
#endif

#ifndef SET_DEFAULT_ACTUATOR_VOLUME
#define SET_DEFAULT_ACTUATOR_VOLUME Volume = 1e-6
#endif

  AnyKinRotational Rot={
     AnyRefFrame &ref1=..StartNode;
     AnyRefFrame &ref2=..EndNode;
     Type=RotAxesAngles;
   };

  AnyKinMeasureOrg RotMeasureOrg={
    AnyKinMeasure &ref=.Rot;
    MeasureOrganizer=.Axis;
  };


  
  AnyRecruitedActuator ArtificialSupportMuscle={
    Strength = .Strength;
    AnyKinMeasure& ref2=.RotMeasureOrg;
    Type = iffun(eqfun(.DirectionOfForce,1), NonNegative, NonPositive);
    SET_DEFAULT_ACTUATOR_VOLUME;
     
  };

  AnyDrawVector DrawVector = {
    AnyRefFrame &ref = .Rot.ref2;
    Vec = ..DrawRef.DrawSettingsSupport.Rot.ScaleFactor*.Direction*.ArtificialSupportMuscle.Fout[0]*.Rot.ref1.Axes';
  
   PointAway = Off;
  DrawCoord = Off;
  
  Line.RGB = ..DrawRef.DrawSettingsSupport.Rot.RGB;
  Line.Thickness = ..DrawRef.DrawSettingsSupport.Rot.Thickness;
  Line.End.Thickness = 2*..DrawRef.DrawSettingsSupport.Rot.Thickness;  
  Line.End.Length = 4*..DrawRef.DrawSettingsSupport.Rot.Thickness;
  };
  
  //Make another arrow to symbolize the moment vector
  AnyDrawVector DrawVector2 = {
    AnyRefFrame &ref = .Rot.ref2;
    Vec = ..DrawRef.DrawSettingsSupport.Rot.ScaleFactor*(.Direction+2*..DrawRef.DrawSettingsSupport.Rot.HeadLength*.Direction)*.ArtificialSupportMuscle.Fout[0]*.Rot.ref1.Axes';
   PointAway = Off;
  DrawCoord = Off;
  
  Line.RGB = ..DrawRef.DrawSettingsSupport.Rot.RGB;
  Line.Thickness = ..DrawRef.DrawSettingsSupport.Rot.Thickness;
  Line.End.Thickness = 2*..DrawRef.DrawSettingsSupport.Rot.Thickness;  
  Line.End.Length = 4*..DrawRef.DrawSettingsSupport.Rot.Thickness;
};