From 9b12690ef725bbe01b1e6bdb695e95f98ddfc90d Mon Sep 17 00:00:00 2001 From: hs Date: Fri, 11 Oct 2024 10:11:14 +0200 Subject: [PATCH] Moment arm studies for the neck joints include arm muscles as well. --- .../EvaluateMomentArms_IVJs.main.any | 4 +- .../EvaluateMomentArmsSequence.any | 5 +- ...eMomentArmsSequence_IVJs_AxialRotation.any | 7 + ...luateMomentArmsSequence_IVJs_Extension.any | 8 ++ ...MomentArmsSequence_IVJs_LateralBending.any | 6 + .../Trunk/IncludeArms_In_MomentArmStudy.any | 130 ++++++++++++++++++ 6 files changed, 157 insertions(+), 3 deletions(-) create mode 100644 Body/AAUHuman/Trunk/IncludeArms_In_MomentArmStudy.any diff --git a/Application/Validation/EvaluateMomentArms/EvaluateMomentArms_IVJs.main.any b/Application/Validation/EvaluateMomentArms/EvaluateMomentArms_IVJs.main.any index 4b5c6063..ed82a15c 100644 --- a/Application/Validation/EvaluateMomentArms/EvaluateMomentArms_IVJs.main.any +++ b/Application/Validation/EvaluateMomentArms/EvaluateMomentArms_IVJs.main.any @@ -25,8 +25,8 @@ #define BM_LEG_MODEL OFF -#define BM_ARM_LEFT OFF -#define BM_ARM_RIGHT OFF +#define BM_ARM_LEFT ON +#define BM_ARM_RIGHT ON #define EVALUATE_MOMENT_ARMS 1 diff --git a/Body/AAUHuman/BodyModels/GenericBodyModel/EvaluateMomentArmsSequence.any b/Body/AAUHuman/BodyModels/GenericBodyModel/EvaluateMomentArmsSequence.any index 98c398f1..81ff4b72 100644 --- a/Body/AAUHuman/BodyModels/GenericBodyModel/EvaluateMomentArmsSequence.any +++ b/Body/AAUHuman/BodyModels/GenericBodyModel/EvaluateMomentArmsSequence.any @@ -32,13 +32,16 @@ AnyFolder EvaluateMomentArms= #endif #if BM_ARM_RIGHT & BM_ARM_MUSCLES_RIGHT + #ifndef EVALUATE_MOMENT_ARMS_IVJs #include "../../Arm/MomentArmSequenceRight.any" #endif + #endif #if BM_ARM_LEFT & BM_ARM_MUSCLES_LEFT + #ifndef EVALUATE_MOMENT_ARMS_IVJs #include "../../Arm/MomentArmSequenceLeft.any" #endif - + #endif #if (BM_TRUNK_MUSCLES != OFF) #ifdef EVALUATE_MOMENT_ARMS_IVJs #include "../../Trunk/EvaluateMomentArmsSequence_IVJs.any" diff --git a/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_AxialRotation.any b/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_AxialRotation.any index cced734e..ed8c6ab1 100644 --- a/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_AxialRotation.any +++ b/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_AxialRotation.any @@ -802,6 +802,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_T1C7AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -842,6 +843,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C7C6AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -882,6 +884,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C6C5AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -922,6 +925,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C5C4AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -962,6 +966,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C4C3AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -1002,6 +1007,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C3C2AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -1042,6 +1048,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C2C1AxialRotation"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { diff --git a/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_Extension.any b/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_Extension.any index 3eb9143e..05e6b6d2 100644 --- a/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_Extension.any +++ b/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_Extension.any @@ -802,6 +802,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_T1C7Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -842,6 +843,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C7C6Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -882,6 +884,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C6C5Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -922,6 +925,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C5C4Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -962,6 +966,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C4C3Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -1002,6 +1007,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C3C2Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -1042,6 +1048,7 @@ Trunk = { // AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; // AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; // #include "EvaluateMomentArmsStudy_IVJs.any" +// #include "IncludeArms_In_MomentArmStudy.any" // AnyString OutputFileName = "MomentArms_Trunk_C2C1Extension"; // Model.Drivers = { // AnyKinEqSimpleDriver TrunkDriver= { @@ -1082,6 +1089,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C1C0Extension"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { diff --git a/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_LateralBending.any b/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_LateralBending.any index 57c9b1cd..91b3ee88 100644 --- a/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_LateralBending.any +++ b/Body/AAUHuman/Trunk/EvaluateMomentArmsSequence_IVJs_LateralBending.any @@ -802,6 +802,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_T1C7LateralBending"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -842,6 +843,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C7C6LateralBending"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -882,6 +884,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C6C5LateralBending"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -922,6 +925,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C5C4LateralBending"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -962,6 +966,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C4C3LateralBending"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { @@ -1002,6 +1007,7 @@ Trunk = { AnyFolder &TrunkHumanFolderRef =...BodyModel.Trunk; AnyFolder &TrunkHumanInterfaceRef = ...BodyModel.Interface.Trunk; #include "EvaluateMomentArmsStudy_IVJs.any" + #include "IncludeArms_In_MomentArmStudy.any" AnyString OutputFileName = "MomentArms_Trunk_C3C2LateralBending"; Model.Drivers = { AnyKinEqSimpleDriver TrunkDriver= { diff --git a/Body/AAUHuman/Trunk/IncludeArms_In_MomentArmStudy.any b/Body/AAUHuman/Trunk/IncludeArms_In_MomentArmStudy.any new file mode 100644 index 00000000..7c9cce09 --- /dev/null +++ b/Body/AAUHuman/Trunk/IncludeArms_In_MomentArmStudy.any @@ -0,0 +1,130 @@ +// Include Arms in study + +Model = { + AnyFolder &RightBodyModelRef=....BodyModel.Right; + AnyFolder &RightBodyInterfaceRef = ....BodyModel.Interface.Right; + AnyFolder &LeftBodyModelRef=....BodyModel.Left; + AnyFolder &LeftBodyInterfaceRef = ....BodyModel.Interface.Left; + + // Extra Model parts included in the moment arm study + AnyFolder &RightRef = RightBodyModelRef; + AnyFolder &RightArmMusRef = RightBodyModelRef.ShoulderArm.Mus; + AnyFolder &LeftRef = LeftBodyModelRef; + AnyFolder &LeftArmMusRef = LeftBodyModelRef.ShoulderArm.Mus; + + + Drivers = { + AnyFolder ArmDriver = { + // Change the following variables to adjust the moment arm study + AnyVar SCProtraction = DesignVar(-23); + AnyVar SCElevation = DesignVar(11.5); + AnyVar GHAbduction = DesignVar(10); + AnyVar GHFlexion = DesignVar(0); + AnyVar GHExternalRotation = DesignVar(0); + AnyVar ElbowFlexion = DesignVar(0); + AnyVar ElbowPronation = DesignVar(0); + AnyVar WristFlexion = DesignVar(0); + AnyVar WristAbduction = DesignVar(0); + AnyVar ACMedialRotation = DesignVar(-0.1745329); + ///////////////////////////////////////// + + // AnyFloat Mask = {0,1,0,0,0,0,0,0,0,0}; + AnyVector DriverPos = { + SCProtraction, SCElevation, GHAbduction, GHFlexion, + GHExternalRotation ,ElbowFlexion, ElbowPronation, + WristFlexion ,WristAbduction, ACMedialRotation }*pi/180; + + #if BM_ARM_RIGHT + AnyFolder RightArmDrivers = { + // AnyVar AngularVelocity = (..RangeOfMotion[1]-..RangeOfMotion[0])*pi/180; + + AnyKinMeasureOrg ArmMeasure = { + #if BM_ARM_SHOULDER_RHYTHM == OFF + AnyKinMeasure& SCProtraction= ....RightBodyInterfaceRef.SternoClavicularProtraction; + AnyKinMeasure& SCElevation= ....RightBodyInterfaceRef.SternoClavicularElevation; + #endif + AnyKinMeasure& GHAbduction= ....RightBodyInterfaceRef.GlenohumeralAbduction; + AnyKinMeasure& GHFlexion= ....RightBodyInterfaceRef.GlenohumeralFlexion; + AnyKinMeasure& GHExternalRotation= ....RightBodyInterfaceRef.GlenohumeralExternalRotation; + AnyKinMeasure& ElbowFlexion= ....RightBodyInterfaceRef.ElbowFlexion; + AnyKinMeasure& ElbowPronation= ....RightBodyInterfaceRef.ElbowPronation; + AnyKinMeasure& WristFlexion= ....RightBodyInterfaceRef.WristFlexion; + AnyKinMeasure& WristAbduction= ....RightBodyInterfaceRef.WristAbduction; + #if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF + AnyKinMeasure& ACMedialRotation= ....RightBodyInterfaceRef.AcromioClavicular.MedialRotation; + #endif + }; + + + + AnyKinEqSimpleDriver ArmDriver= { + AnyKinMeasure& ref = .ArmMeasure; + + #if BM_ARM_SHOULDER_RHYTHM == OFF & BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF + #define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8],X[9] } + #endif + #if BM_ARM_SHOULDER_RHYTHM == OFF + #define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8] } + #endif + #if BM_ARM_SHOULDER_RHYTHM == ON + #define __MEASURE_INDEXER(X) { X[2], X[3],X[4],X[5],X[6],X[7],X[8] } + #endif + + DriverPos = __MEASURE_INDEXER(..DriverPos); + // AnyFloat Mask = __MEASURE_INDEXER( ...Mask); + + #undef __MEASURE_INDEXER + + DriverVel = repmat(nDim,0);//Mask* (0)*pi/180/...Study.tEnd; + }; + + };// Right Arm Drivers + #endif + #if BM_ARM_LEFT + AnyFolder LeftArmDrivers = { + // AnyVar AngularVelocity = (..RangeOfMotion[1]-..RangeOfMotion[0])*pi/180; + + AnyKinMeasureOrg ArmMeasure = { + #if BM_ARM_SHOULDER_RHYTHM == OFF + AnyKinMeasure& SCProtraction= ....LeftBodyInterfaceRef.SternoClavicularProtraction; + AnyKinMeasure& SCElevation= ....LeftBodyInterfaceRef.SternoClavicularElevation; + #endif + AnyKinMeasure& GHAbduction= ....LeftBodyInterfaceRef.GlenohumeralAbduction; + AnyKinMeasure& GHFlexion= ....LeftBodyInterfaceRef.GlenohumeralFlexion; + AnyKinMeasure& GHExternalRotation= ....LeftBodyInterfaceRef.GlenohumeralExternalRotation; + AnyKinMeasure& ElbowFlexion= ....LeftBodyInterfaceRef.ElbowFlexion; + AnyKinMeasure& ElbowPronation= ....LeftBodyInterfaceRef.ElbowPronation; + AnyKinMeasure& WristFlexion= ....LeftBodyInterfaceRef.WristFlexion; + AnyKinMeasure& WristAbduction= ....LeftBodyInterfaceRef.WristAbduction; + #if BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF + AnyKinMeasure& ACMedialRotation= ....LeftBodyInterfaceRef.AcromioClavicular.MedialRotation; + #endif + }; + + AnyKinEqSimpleDriver ArmDriver= { + AnyKinMeasure& ref = .ArmMeasure; + + #if BM_ARM_SHOULDER_RHYTHM == OFF & BM_ARM_CLAVICULA_ROTATION_RHYTHM == OFF + #define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8],X[9] } + #endif + #if BM_ARM_SHOULDER_RHYTHM == OFF + #define __MEASURE_INDEXER(X) { X[0],X[1],X[2],X[3],X[4],X[5],X[6],X[7],X[8] } + #endif + #if BM_ARM_SHOULDER_RHYTHM == ON + #define __MEASURE_INDEXER(X) { X[2], X[3],X[4],X[5],X[6],X[7],X[8] } + #endif + + DriverPos = __MEASURE_INDEXER(..DriverPos); + // AnyFloat Mask = __MEASURE_INDEXER( ...Mask); + + #undef __MEASURE_INDEXER + + DriverVel = repmat(nDim,0);//Mask* (0)*pi/180/...Study.tEnd; + }; + + };// Left Arm Drivers + #endif + }; + }; + }; +