200 lines (168 with data), 7.2 kB
//This file contains a moment measures for the following joints in the Leg:
//Ankle
//Knee
//Hip
//The measures named:
//AnkleNetMoment
//KneeNetMoment
//HipNetMoment
//will measure the moments and forces supplied by the muscles spanning these and on top of these
//moments and force the forces and moments from the constraints in the joints will be added.
//The resulting force and moment are equal to the to total moment and force which
//could replace both the muscles spanning the joint and the joints reactions.
//The measures named:
//AnkleNetMomentMuscle
//KneeNetMomentMuscle
//HipNetMomentMuscle
//will measure ONLY the moments and forces supplied by the muscles spanning these joint and not the moments and forces which from the constraints in the joints.
//The resulting force and moment are equal to the to total moment and force which
//are supplied by the muscles.
//In both cases the resulting force and moment is given in the global coordinate system.
//A vector which shows the resulting moment as an arrow, will automatically be shown in the model view the parameters of it can
//be controlled from the "DrawSettings.any" file typically to be found in the application directory.,
#if BM_FOOT_MODEL == _FOOT_MODEL_DEFAULT_
AnyForceMomentMeasure2 AnkleNetMomentMuscle = {
AnyRefNode &ref=..Seg.Shank.AnkleJoint.RotNode;
AnySeg &seg=..Seg.Foot;
#include "LegMuscleNames.any"
AnyVec3 Mlocal=M*ref.Axes;
AnyVar MPlantarFlexion= -Mlocal[2];
AnyVar MEversionFlexion=Mlocal[1];
// AnyDrawVector DrawVector= {
// AnyRefNode &ref1=...Seg.Shank.AnkleJoint.RotNode;
// Vec = Main.DrawSettings.NetMomentMuscleVector.ScaleFactor*.M;
// PointAway = On;
// DrawCoord = Off;
// Line.RGB = Main.DrawSettings.NetMomentMuscleVector.RGB;
// Line.Thickness = Main.DrawSettings.NetMomentMuscleVector.Thickness;
// Line.End.Thickness = 2*Main.DrawSettings.NetMomentMuscleVector.Thickness;
// Line.End.Length = 4*Main.DrawSettings.NetMomentMuscleVector.Thickness;
// };
};
AnyForceMomentMeasure2 KneeNetMomentMuscle = {
AnyRefNode &ref = ..Seg.Thigh.KneeJoint.RotNode;
AnySeg &seg1=..Seg.Shank;
AnySeg &seg2=..Seg.Foot;
#include "LegMuscleNames.any"
AnyVec3 Mlocal=M*ref.Axes;
AnyVar MKneeFlexion=Mlocal[2];
// AnyDrawVector DrawVector=
// {
// AnyRefNode &ref1 = ...Seg.Thigh.KneeJoint.RotNode;
// Vec = Main.DrawSettings.NetMomentMuscleVector.ScaleFactor*.M;
// PointAway = On;
// DrawCoord = Off;
// Line.RGB = Main.DrawSettings.NetMomentMuscleVector.RGB;
// Line.Thickness = Main.DrawSettings.NetMomentMuscleVector.Thickness;
// Line.End.Thickness = 2*Main.DrawSettings.NetMomentMuscleVector.Thickness;
// Line.End.Length = 4*Main.DrawSettings.NetMomentMuscleVector.Thickness;
// };
};
AnyForceMomentMeasure2 HipNetMomentMuscle = {
AnyRefNode &ref = ..HipNodeRef.RotNode;
AnySeg &seg1=..Seg.Shank;
AnySeg &seg2=..Seg.Foot;
AnySeg &seg3=..Seg.Thigh;
#include "LegMuscleNames.any"
AnyVec3 Mlocal=M*ref.Axes;
AnyVar MHipAbduction=Mlocal[0];
AnyVar MHipFlexion=Mlocal[2];
AnyVar MHipExternalRotation=Mlocal[1];
// AnyDrawVector DrawVector=
// {
// AnyRefNode &ref1 = ...HipNodeRef.RotNode;
//
// Vec = Main.DrawSettings.NetMomentMuscleVector.ScaleFactor*.M;
// PointAway = On;
// DrawCoord = Off;
//
// Line.RGB = Main.DrawSettings.NetMomentMuscleVector.RGB;
// Line.Thickness = Main.DrawSettings.NetMomentMuscleVector.Thickness;
// Line.End.Thickness = 5*Main.DrawSettings.NetMomentMuscleVector.Thickness;
// Line.End.Length = 10*Main.DrawSettings.NetMomentMuscleVector.Thickness;
// };
};
//****************************************************************************
AnyForceMomentMeasure2 AnkleNetMoment = {
AnyRefNode &ref1=..Seg.Shank.AnkleJoint.RotNode;
AnySeg &seg=..Seg.Foot;
#include "LegMuscleNames.any"
AnyReacForce &jnt2=..Jnt.Ankle.Constraints.Reaction;
// //Make transformation to the anklejoint.rotnode coordinate system
// AnyVec3 Mlocal=M*ref1.Axes;
//
// AnyRefNode &ref2=..Seg.Foot.AnkleJoint.RotNode;
// AnyVar MPlantarFlexion=Mlocal[2];
// AnyVar MEversionFlexion=Mlocal[1];
//
// AnyDrawVector DrawVector=
// {
// AnyRefNode &ref1=...Seg.Shank.AnkleJoint.RotNode;
// Vec = Main.DrawSettings.NetMomentVector.ScaleFactor*.M;
// PointAway = On;
// DrawCoord = Off;
// Line.RGB = Main.DrawSettings.NetMomentVector.RGB;
// Line.Thickness = Main.DrawSettings.NetMomentVector.Thickness;
// Line.End.Thickness = 2*Main.DrawSettings.NetMomentVector.Thickness;
// Line.End.Length = 4*Main.DrawSettings.NetMomentVector.Thickness;
// };
};
AnyForceMomentMeasure2 KneeNetMoment = {
AnyRefNode &ref1 = ..Seg.Thigh.KneeJoint.RotNode;
AnySeg &seg1=..Seg.Shank;
AnySeg &seg2=..Seg.Foot;
AnyReacForce &jnt1=..Jnt.Knee.Constraints.Reaction;
AnyReacForce &jnt2=..Jnt.Ankle.Constraints.Reaction;
#include "LegMuscleNames.any"
// AnyRefNode &ref2 = ..Seg.Shank.KneeJoint.RotNode;
//
// AnyVec3 Mlocal=M*ref2.Axes;
// AnyVar MKneeFlexion=Mlocal[2];
// AnyDrawVector DrawVector=
// {
// AnyRefNode &ref1 = ...Seg.Thigh.KneeJoint.RotNode;
// Vec = Main.DrawSettings.NetMomentVector.ScaleFactor*.M;
// PointAway = On;
// DrawCoord = Off;
//
// Line.RGB = Main.DrawSettings.NetMomentVector.RGB;
// Line.Thickness = Main.DrawSettings.NetMomentVector.Thickness;
// Line.End.Thickness = 2*Main.DrawSettings.NetMomentVector.Thickness;
// Line.End.Length = 4*Main.DrawSettings.NetMomentVector.Thickness;
// };
};
AnyForceMomentMeasure2 HipNetMoment = {
AnyRefNode &ref1 = ..HipNodeRef.RotNode;
AnySeg &seg1=..Seg.Shank;
AnySeg &seg2=..Seg.Foot;
AnySeg &seg3=..Seg.Thigh;
#include "LegMuscleNames.any"
AnyReacForce &jnt1=..Jnt.Hip.Constraints.Reaction;
AnyReacForce &jnt2=..Jnt.Knee.Constraints.Reaction;
AnyReacForce &jnt3=..Jnt.Ankle.Constraints.Reaction;
// AnyRefNode &ref2 = ..Seg.Thigh.HipJoint.RotNode;
// AnyVec3 Mlocal=M*ref2.Axes;
// AnyVar MHipAbduction=Mlocal[0];
// AnyVar MHipFlexion=Mlocal[2];
// AnyVar MHipExternalRotation=Mlocal[1];
// AnyDrawVector DrawVector=
// {
// AnyRefNode &ref1 = ...HipNodeRef.RotNode;
//
// Vec = Main.DrawSettings.NetMomentVector.ScaleFactor*.M;
// PointAway = On;
// DrawCoord = Off;
//
// Line.RGB = Main.DrawSettings.NetMomentVector.RGB;
// Line.Thickness = Main.DrawSettings.NetMomentVector.Thickness;
// Line.End.Thickness = 2*Main.DrawSettings.NetMomentVector.Thickness;
// Line.End.Length = 4*Main.DrawSettings.NetMomentVector.Thickness;
// };
};
#endif
AnyForceMomentMeasure KneeJointReactionMoments =
{
AnyForceBase &Force = ..Jnt.Knee.Constraints.Reaction;
AnyRefFrame &Thighknee = ..Seg.Thigh.KneeJoint;
AnyVec3 Mlocal = M*Thighknee.Axes;
};