Hi Dave,
Thank you for your reply.
I have coded 'NetMoment' for L3/L4 joint level as per your suggestions. It is as below.
AnyForceMomentMeasure2 NetMomentAtL3L4 = {
AnyRefFrame &ref = Main.HumanModel.BodyModel.Trunk.Segments.L4Seg.L3L4JntNode.RotNode;
IncludeSegments = {
&Main.HumanModel.BodyModel.Right.Leg.Seg.Foot,
&Main.HumanModel.BodyModel.Right.Leg.Seg.Talus,
&Main.HumanModel.BodyModel.Right.Leg.Seg.Shank,
&Main.HumanModel.BodyModel.Right.Leg.Seg.Patella,
&Main.HumanModel.BodyModel.Right.Leg.Seg.Thigh,
&Main.HumanModel.BodyModel.Left.Leg.Seg.Foot,
&Main.HumanModel.BodyModel.Left.Leg.Seg.Talus,
&Main.HumanModel.BodyModel.Left.Leg.Seg.Shank,
&Main.HumanModel.BodyModel.Left.Leg.Seg.Patella,
&Main.HumanModel.BodyModel.Left.Leg.Seg.Thigh,
&Main.HumanModel.BodyModel.Trunk.Segments.SacrumSeg,
&Main.HumanModel.BodyModel.Trunk.Segments.PelvisSeg,
&Main.HumanModel.BodyModel.Trunk.Segments.L5Seg,
&Main.HumanModel.BodyModel.Trunk.Segments.L4Seg
};
AnyObjectPtrArray pArrJntReactions = {
&Main.HumanModel.BodyModel.Right.Leg.Jnt.Hip.Constraints.Reaction,
&Main.HumanModel.BodyModel.Right.Leg.Jnt.Knee.Constraints.Reaction,
&Main.HumanModel.BodyModel.Right.Leg.Jnt.Ankle.Constraints.Reaction,
&Main.HumanModel.BodyModel.Right.Leg.Jnt.SubTalar.Constraints.Reaction,
&Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaFemur.Constraints.Reaction,
&Main.HumanModel.BodyModel.Right.Leg.Jnt.PatellaMovement.Reaction,
&Main.HumanModel.BodyModel.Left.Leg.Jnt.Hip.Constraints.Reaction,
&Main.HumanModel.BodyModel.Left.Leg.Jnt.Knee.Constraints.Reaction,
&Main.HumanModel.BodyModel.Left.Leg.Jnt.Ankle.Constraints.Reaction,
&Main.HumanModel.BodyModel.Left.Leg.Jnt.SubTalar.Constraints.Reaction,
&Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaFemur.Constraints.Reaction,
&Main.HumanModel.BodyModel.Left.Leg.Jnt.PatellaMovement.Reaction,
&Main.HumanModel.BodyModel.Trunk.Joints.Lumbar.SacrumPelvis.Constraints.Reaction,
&Main.HumanModel.BodyModel.Trunk.Joints.Lumbar.L5Sacrum.Constraints.Reaction,
&Main.HumanModel.BodyModel.Trunk.Joints.Lumbar.L4L5.Constraints.Reaction,
&Main.HumanModel.BodyModel.Trunk.Joints.Lumbar.L3L4.Constraints.Reaction
};
IncludeForces = arrcat(
ObjSearch("Main.HumanModel.BodyModel.*.Leg.Mus.*", "AnyMuscle"),
ObjSearch("Main.HumanModel.BodyModel.Trunk.Muscles.*.*.*", "AnyMuscle"),
ObjSearchRecursive("Main.HumanModel.BodyModel.Trunk.JointMuscles", "*", "AnyMuscle"),
pArrJntReactions
);
AnyVec3 Mlocal = M*Main.HumanModel.BodyModel.Trunk.Segments.L4Seg.L3L4JntNode.RotNode.Axes;
};
AnyVar LateralBendingOnL4 = Main.Studies.InverseDynamicStudy.OncoEngLoadingAnalysis.Lumbar.NetMomentAtL3L4.Mlocal[0]; // Positive to the right lateral bending
AnyVar AxialRotationMomentOnL4 = Main.Studies.InverseDynamicStudy.OncoEngLoadingAnalysis.Lumbar.NetMomentAtL3L4.Mlocal[1]; // Positive to the right axial turning
AnyVar FlexionExtensionMomentOnL4 = Main.Studies.InverseDynamicStudy.OncoEngLoadingAnalysis.Lumbar.NetMomentAtL3L4.Mlocal[2]; // Positive in extension direction
I am just wondering if there are other elements that I still haven't considered (e.g. disc?).
I am not the best programmer around but I tried
So, I am also just wondering if you think the code could be improved to be more concise (as I am planning to measure moments in all level in lumbar and thoracic).
Let me know. Thank you very much.
Kind regards,
Faizal