====== Angular Momentum about a Point ======
This example demonstrates how to calculate the angular momentum of a [[visual3d:documentation:modeling:segments:segment_overview|segment]] about an arbitrary point.
**Note**: It is very important to note that the total body angular momentum is not calculated by summing the [[visual3d:documentation:visual3d_signal_types:link_model_based_data_type:angular_momentum|ANGULAR_MOMENTUM]] for each segment because this model-based item represents the angular momentum of each segment about its [[visual3d:documentation:modeling:segments:segment_properties#inertial_properties|own centre of mass]]. To calculate the total body angular momentum you must calculate the angular momentum for each segment about the same axis, such as the total body center of mass. The equations in the [[#Angular_Momentum:_About_Total_Body_Center_of_Mass|About Total Body Center of Mass]] section describe how to do this.
===== Calculating Angular Momentum =====
Visual3D's built in [[visual3d:documentation:visual3d_signal_types:link_model_based_data_type:angular_momentum|ANGULAR_MOMENTUM]] command calculates the angular momentum of a segment about the segment's center of mass, but angular momentum can also be calculated about a different point in space.
==== About a Segment's Centre of Mass ====
A segment's angular momentum about its own centre of mass is calculated as:
{{:SegmentAngularMomentumExpression.jpg}}
where
I = Moment of Inertia
w = Angular velocity
==== About Total Body Center of Mass ====
A segment's angular momentum about the total body's centre of mass is calculated as:
|{{:SegmentAngularMomentum_AboutaPoint_Eq.png}} |{{:SegmentAngularMomentum_AboutaPoint.png}} |
where
Iw = angular momentum of the segment
r = distance from the segment's centre of mass to the total body centre of mass
m = mass of the segment
v = translational velocity
**NOTE:** In this case angular momentum for the whole body about the total body center of mass is simply the summation of the angular momentum of **each** segment about the total body center of mass.
===== Example =====
This example script demonstrates how to calculate a segment's angular momentum about a point, such as the [[visual3d:documentation:visual3d_signal_types:link_model_based_data_type:model_cog|model centre of mass]], by the following steps:
- Compute //r//
- Compute //mv//
- Compute //r// x //mv//
- Compute the angular momentum of the segment using the [[visual3d:documentation:visual3d_signal_types:link_model_based_data_type:angular_momentum|Angular Momentum]] command
- Compute //Iw// x (//r// x //mv//)
==== Files ====
This script and sample CMO files can be downloaded [[https://www.has-motion.com/download/examples/AngularMomentum/AngularMomentum_AboutAPoint.zip|here]]. The download also contains a PDF file with the Angular Momentum equations.
==== Script ====
First_Derivative
/SIGNAL_TYPES=KINETIC_KINEMATIC
/SIGNAL_FOLDER=Model
/SIGNAL_NAMES=CenterOfMass
/RESULT_TYPES=DERIVED
/RESULT_FOLDER=COM
! /RESULT_NAMES=
/RESULT_SUFFIX=_VEL
;
! Nested Loops
! Outer Loop gets an active segment
For_Each
/ITERATION_PARAMETER_NAME=SEG_NAME
/ITEMS=RFT+RSK+RTH+LFT+LSK+LTH+RPV
;
! compute the r for (r x mv)
Evaluate_Expression
/EXPRESSION=vector((Kinetic_Kinematic::&::SEG_NAME&:&:CGPos::X - KINETIC_KINEMATIC::MODEL::CenterOfMass::X ), (Kinetic_Kinematic::&::SEG_NAME&:&:CGPos::Y - KINETIC_KINEMATIC::MODEL::CenterOfMass::Y), (Kinetic_Kinematic::&::SEG_NAME&:&:CGPos::Z - KINETIC_KINEMATIC::MODEL::CenterOfMass::Z))
/RESULT_NAME=::SEG_NAME&_R
! /RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;
! compute mv
Evaluate_Expression
/EXPRESSION=(MODEL::SEGMENT::&::SEG_NAME&:&:MASS)*(Kinetic_Kinematic::&::SEG_NAME&:&:CGVel - DERIVED::COM::CENTEROFMASS_VEL)
/RESULT_NAME=::SEG_NAME&_mv
! /RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;
! compute r x mv
Evaluate_Expression
/EXPRESSION=cross(DERIVED::PROCESSED::&::SEG_NAME&_R, DERIVED::PROCESSED::&::SEG_NAME&_mv)
/RESULT_NAME=::SEG_NAME&_rxmv
! /RESULT_TYPE=DERIVED
! /RESULT_FOLDER=PROCESSED
;
! compute Iw
Compute_Model_Based_Data
/RESULT_NAME=::SEG_NAME&_IW
/FUNCTION=ANGULAR_MOMENTUM
/SEGMENT=::SEG_NAME
/REFERENCE_SEGMENT=LAB
! /RESOLUTION_COORDINATE_SYSTEM=LAB
! /USE_CARDAN_SEQUENCE=FALSE
! /NORMALIZATION=FALSE
! /NORMALIZATION_METHOD=
! /NORMALIZATION_METRIC=
! /NEGATEX=FALSE
! /NEGATEY=FALSE
! /NEGATEZ=FALSE
! /AXIS1=X
! /AXIS2=Y
! /AXIS3=Z
;
! compute Iw x (r x mv)
Evaluate_Expression
/EXPRESSION=LINK_MODEL_BASED::ORIGINAL::&::SEG_NAME&_IW + DERIVED::PROCESSED::&::SEG_NAME&_rxmv
/RESULT_NAME=::SEG_NAME&_IW
/RESULT_TYPE=DERIVED
/RESULT_FOLDER=Momentum_Contribution
;
End_For_Each
/ITERATION_PARAMETER_NAME=SEG_NAME
;
The script:
- calculates the angular momentum **for each of the listed segments** (RFT+RSK+RTH+LFT+LSK+LTH+RPV). If the user would like to calculate the **total body angular momentum about the model center of mass**, the resulting signals from the last Evaluate Expression command for all segments should be summed together. If you would like to calculate the total body angular momentum, you can use the [[Visual3D:Documentation:Pipeline:Signal_Commands:Add_Signals|Add_Signals]] command after the End_For_Each.
- computes the angular momentum about the total body centre of mass, if the user would like to calculate angular momentum about a different point then they simply need to specify the desired signal in place of "KINETIC_KINEMATIC::MODEL::CenterOfMass".