[38ba34]: / Body / AAUHuman / Trunk / JointsCervical.any

Download this file

245 lines (203 with data), 8.5 kB

/**
Definitions of the Joints of the cervical spine spine. From T1C7 to Skull
*/
AnyFolder JointsCervicalSpine = {
  
  AnySphericalJoint T1C7Jnt = {
    AnyRefNode &T1Node = ..SegmentsThorax.T1Seg.T1C7JntNode;
    AnyRefNode &C7Node = ..SegmentsCervicalSpine.C7Seg.T1C7JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.T1Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsThorax.T1Seg};
      AnyFloat Flocal = -F * .T1Node.RotNode.Axes;
    };
  };
  
  AnySphericalJoint C7C6Jnt = {
    AnyRefNode &C7Node = ..SegmentsCervicalSpine.C7Seg.C7C6JntNode;
    AnyRefNode &C6Node = ..SegmentsCervicalSpine.C6Seg.C7C6JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C7Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C7Seg};
      AnyFloat Flocal = -F * .C7Node.RotNode.Axes;
    };
  };
  
  AnySphericalJoint C6C5Jnt = {
    AnyRefNode &C6Node = ..SegmentsCervicalSpine.C6Seg.C6C5JntNode;
    AnyRefNode &C5Node = ..SegmentsCervicalSpine.C5Seg.C6C5JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C6Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C6Seg};
      AnyFloat Flocal = -F * .C6Node.RotNode.Axes;
    };
  };
  
  AnySphericalJoint C5C4Jnt = {
    AnyRefNode &C5Node = ..SegmentsCervicalSpine.C5Seg.C5C4JntNode;
    AnyRefNode &C4Node = ..SegmentsCervicalSpine.C4Seg.C5C4JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C5Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C5Seg};
      AnyFloat Flocal = -F * .C5Node.RotNode.Axes;
    };
  };
  
  AnySphericalJoint C4C3Jnt = {
    AnyRefNode &C4Node = ..SegmentsCervicalSpine.C4Seg.C4C3JntNode;
    AnyRefNode &C3Node = ..SegmentsCervicalSpine.C3Seg.C4C3JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C4Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C4Seg};
      AnyFloat Flocal = -F * .C4Node.RotNode.Axes;
    };
  };
  
  AnySphericalJoint C3C2Jnt = {
    AnyRefNode &C3Node = ..SegmentsCervicalSpine.C3Seg.C3C2JntNode;
    AnyRefNode &C2Node = ..SegmentsCervicalSpine.C2Seg.C3C2JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C3Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C3Seg};
      AnyFloat Flocal = -F * .C3Node.RotNode.Axes;
    };
  };
  
  AnyRevoluteJoint C2C1Jnt = {
    Axis = y;
    AnyRefNode &C2Node = ..SegmentsCervicalSpine.C2Seg.C2C1JntNode;
    AnyRefNode &C1Node = ..SegmentsCervicalSpine.C1Seg.C2C1JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C2Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C2Seg};
      AnyFloat Flocal = -F * .C2Node.RotNode.Axes;
    };
  };
  
  AnyRevoluteJoint C1C0Jnt = {
    Axis = z;
    AnyRefNode &C1Node = ..SegmentsCervicalSpine.C1Seg.C1C0JntNode;
    AnyRefNode &C0Node = ..SegmentsCervicalSpine.SkullSeg.C1C0JntNode;
    //Joint reaction force transformed to the rotated reference node aligned with the vertebral body. 
    AnyForceMomentMeasure2 ReactionForceRotated = {
      RefPoint = &.C1Node.RotNode;
      IncludeForces = {&.Constraints.Reaction};
      IncludeSegments = {&...SegmentsCervicalSpine.C1Seg};
      AnyFloat Flocal = -F * .C1Node.RotNode.Axes;
    };
  };
  

  AnyKinRotational SkullThoraxRotMeasure = {
    AnyRefFrame &Thorax = ..SegmentsThorax.T1Seg.AnatomicalFrameTrunk;  
    AnyRefFrame &Skull = ..SegmentsCervicalSpine.SkullSeg.AnatomicalFrame; 
    Type = RotVector;
  };
  
  
  // CervicalRhythm
  AnyFolder Flexion = {
    
    #if BM_TRUNK_CERVICAL_RHYTHM != OFF
    RhythmDriverLinear rhythmC2C7( _REDEFINE_VARIABLES=On) = 
    {
       AnyVector RhythmCoefficients ??= {1,1,1,1,1,1};
       Measures.Input  = {
         AnyKinMeasure& ref1 = ....C3C2Jnt;
         AnyKinMeasure& ref2 = ....C4C3Jnt;
         AnyKinMeasure& ref3 = ....C5C4Jnt;
         AnyKinMeasure& ref4 = ....C6C5Jnt;
         AnyKinMeasure& ref5 = ....C7C6Jnt;
         AnyKinMeasure& ref6 = ....T1C7Jnt;
         MeasureOrganizer = iarr(0, 3, 17)+2;
      };   
       
       #if BM_TRUNK_CERVICAL_RHYTHM == _RHYTHM_SOFT_
       CType = repmat(nDim, Soft);
       #endif
       
     };
     
     RhythmDriverLinear rhythmC1C0SkullThoraxFlexion( _REDEFINE_VARIABLES=On) = 
     {
       // The -1 is because C1C0Jnt has extension as positive opposite signs for output.
       AnyVector RhythmCoefficients ??= {122/40,-1};
       
       Measures.Input  = {
         AnyKinMeasure& ref = ...SkullThoraxFlexion;
         AnyKinMeasure& u1 = ....C1C0Jnt;  // z direction
         MeasureOrganizer = {0, 1};
       };   
       
       #if BM_TRUNK_CERVICAL_RHYTHM == _RHYTHM_SOFT_
       CType = repmat(nDim, Soft);
       #endif
    };  
    #endif

        
  AnyKinMeasureLinComb SkullThoraxFlexion  = {
    AnyKinMeasureOrg select ={
      AnyKinMeasure& ref = ...SkullThoraxRotMeasure;
      MeasureOrganizer = {2};
    };
    Coef ={{-1}};
    Const = {0};
    OutDim=1;
  };

    
  };
  
  AnyFolder LateralBending = {
       
    #if BM_TRUNK_CERVICAL_RHYTHM != OFF
    RhythmDriverLinear rhythmC2C7(_REDEFINE_VARIABLES=On) = 
    {
       AnyVector RhythmCoefficients ??= {1,1,1,1,1,1};
       Measures.Input  = {
         AnyKinMeasure& ref1 = ....C3C2Jnt;
         AnyKinMeasure& ref2 = ....C4C3Jnt;
         AnyKinMeasure& ref3 = ....C5C4Jnt;
         AnyKinMeasure& ref4 = ....C6C5Jnt;
         AnyKinMeasure& ref5 = ....C7C6Jnt;
         AnyKinMeasure& ref6 = ....T1C7Jnt;
         MeasureOrganizer = iarr(0, 3, 17)+0;
      };   
       
       #if BM_TRUNK_CERVICAL_RHYTHM == _RHYTHM_SOFT_
       CType = repmat(nDim, Soft);
       #endif
       
     };
    #endif
    
    AnyKinMeasureOrg SkullThoraxLateralBending  = {
      MeasureOrganizer = {0};
      AnyKinMeasure& ref = ..SkullThoraxRotMeasure;
    };
    
  };//LateralBending
  
  AnyFolder Rotation = {
    
    
    #if BM_TRUNK_CERVICAL_RHYTHM != OFF
    RhythmDriverLinear rhythmC2C7(_REDEFINE_VARIABLES=On) = 
    {
       AnyVector RhythmCoefficients ??= {1,1,1,1,1,1};
       Measures.Input  = {
         AnyKinMeasure& ref1 = ....C3C2Jnt;
         AnyKinMeasure& ref2 = ....C4C3Jnt;
         AnyKinMeasure& ref3 = ....C5C4Jnt;
         AnyKinMeasure& ref4 = ....C6C5Jnt;
         AnyKinMeasure& ref5 = ....C7C6Jnt;
         AnyKinMeasure& ref6 = ....T1C7Jnt;
         MeasureOrganizer = iarr(0, 3, 17)+1;
      };   
       #if BM_TRUNK_CERVICAL_RHYTHM == _RHYTHM_SOFT_
       CType = repmat(nDim, Soft);
       #endif
     };
     
     RhythmDriverLinear rhythmC2C1SkullThoraxRotation( _REDEFINE_VARIABLES=On) = 
     {
       AnyVector RhythmCoefficients ??= {132/77, 1};
       
       Measures.Input  = {
         AnyKinMeasure& ref = ...SkullThoraxRotation;
         AnyKinMeasure& u1 = ....C2C1Jnt;  // y direction
         MeasureOrganizer = {0, 1};
       };   
       
       #if BM_TRUNK_CERVICAL_RHYTHM == _RHYTHM_SOFT_
       CType = repmat(nDim, Soft);
       #endif
    };  
    

    #endif
    
    AnyKinMeasureOrg SkullThoraxRotation  = {
      MeasureOrganizer = {1};
      AnyKinMeasure& ref = ..SkullThoraxRotMeasure;
    };
    
  };//Rotation
  
  
}; //End of JointsCervicalSpine