ThreePlatesMassInertia.html   (MotionGenesis input/output).
   (1) % MotionGenesis file:  ThreePlatesMassInertia.txt
   (2) % Copyright (c) 2009 Motion Genesis LLC.  All rights reserved.
   (3) %----------------------------------------------------------
   (4) %       Physical declarations
   (5) RigidBody  A, B, C           % Right, middle, top plate
   (6) Point      O, P              % Points on L
   (7) Point      SystemCM          % System's center of mass
   (8) %----------------------------------------------------------
   (9) %       Mathematical declarations
   (10) Variable   q                 % Angle between plates A and B
   (11) Constant   w = 1 m           % Width of plate
   (12) A.SetMassInertia( m = 12 kg,  I = m*w^2/12,  I, 2*I )
-> (13) I = 0.08333333*m*w^2

   (14) B.SetMassInertia( m,          I,             I, 2*I )
   (15) C.SetMassInertia( m,          I,           2*I,   I )
   (16) %----------------------------------------------------------
   (17) %       Geometry relating unit vectors
   (18) B.RotateNegativeY( A, q )
-> (19) B_A = [cos(q), 0, sin(q);  0, 1, 0;  -sin(q), 0, cos(q)]

   (20) C.SetRotationMatrix( A, IdentityMatrix(3) )
-> (21) C_A = [1, 0, 0;  0, 1, 0;  0, 0, 1]

   (22) %----------------------------------------------------------
   (23) %       Position vectors
   (24) Acm.SetPosition( O, -0.5*w*Ax> + 0.5*w*Ay> )
-> (25) p_O_Acm> = -0.5*w*Ax> + 0.5*w*Ay>

   (26) Bcm.SetPosition( O, -w*Ax> + 0.5*w*Ay> + 0.5*w*Bx> )
-> (27) p_O_Bcm> = -w*Ax> + 0.5*w*Ay> + 0.5*w*Bx>

   (28) Ccm.SetPosition( O,  w*Ay> - 0.5*w*Cx> - 0.5*w*Cz> )
-> (29) p_O_Ccm> = w*Ay> - 0.5*w*Cx> - 0.5*w*Cz>

   (30) P.SetPosition( O, w*Ay> - w*Cz> )
-> (31) p_O_P> = w*Ay> - w*Cz>

   (32) %----------------------------------------------------------
   (33) %       System's center of mass position from point O.
   (34) P_O_SystemCM> = System.GetCMPosition( O )
-> (35) P_O_SystemCM> = -0.5*w*Ax> + 0.6666667*w*Ay> + 0.1666667*w*Bx> - 0.1666667
        *w*Cx> - 0.1666667*w*Cz>

   (36) uL> = P.GetUnitVector( O )     % Unit vector parallel to line L
-> (37) uL> = 0.7071068*w/abs(w)*Ay> - 0.7071068*w/abs(w)*Cz>

   (38) DistanceFromLineLToSystemCM = GetMagnitude( Cross(uL>, SystemCM.GetPosition(O) ) )
-> (39) DistanceFromLineLToSystemCM = 0.1178511*sqrt(-w^2*(-42+16*cos(q)-6*sin(
        q)-cos(q)^2))

   (40) %----------------------------------------------------------
   (41) %       System's inertia matrix about its center of mass.
   (42) SetAutoEpsilon( 1.0E-14 )      % Round to integers
   (43) SystemInertiaMatrix = EvaluateToNumber( System.GetInertiaMatrix( SystemCM, A ) )
-> (44) SystemInertiaMatrix[1,1] = 7 + 2*sin(q) + 3*sin(q)^2
-> (45) SystemInertiaMatrix[1,2] = -1 + cos(q)
-> (46) SystemInertiaMatrix[1,3] = 1 + 2*sin(q) - cos(q) - 3*sin(q)*cos(q)
-> (47) SystemInertiaMatrix[2,1] = -1 + cos(q)
-> (48) SystemInertiaMatrix[2,2] = 10 + 2*sin(q) - 4*cos(q)
-> (49) SystemInertiaMatrix[2,3] = 2 + sin(q)
-> (50) SystemInertiaMatrix[3,1] = 1 + 2*sin(q) - cos(q) - 3*sin(q)*cos(q)
-> (51) SystemInertiaMatrix[3,2] = 2 + sin(q)
-> (52) SystemInertiaMatrix[3,3] = 11 - 4*cos(q) - 3*sin(q)^2

   (53) %----------------------------------------------------------
   (54) %       Extract 1st eigenvector and calculate angle between Ay>
   (55) Lamba = GetEigen( Evaluate( SystemInertiaMatrix, q = 90 deg), EigenVecs )
-> (56) EigenVecs = [0.4082483, 0.7071068, -0.5773503;  0.4082483, -0.7071068, 
        -0.5773503;  -0.8164966, 0, -0.5773503]

-> (57) Lamba = [5;  13;  14]

   (58) EigenColumnMatrix1 = GetColumn( EigenVecs, 1 )
-> (59) EigenColumnMatrix1 = [0.4082483;  0.4082483;  -0.8164966]

   (60) EigenVec1> = Vector( A,  EigenColumnMatrix1 )
-> (61) EigenVec1> = 0.4082483*Ax> + 0.4082483*Ay> - 0.8164966*Az>

   (62) AngleBetweenEigenVec1AndAy = GetAngleBetweenUnitVectorsDegrees( EigenVec1>, Ay> )
-> (63) AngleBetweenEigenVec1AndAy = 65.90516

   (64) %----------------------------------------------------------
   (65) %       System's moment of inertia and radius of gyration of system about line OP.
   (66) MomentOfInertiaAboutLineL = System.GetMomentOfInertia(  O, uL> )
-> (67) MomentOfInertiaAboutLineL = 4.5*I + 2.125*m*w^2 + 0.125*sin(q)*(2*m*w^2
        -4*I*sin(q)-m*w^2*sin(q)) - m*w^2*cos(q)

   (68) RadiusOfGyrationAboutL    = System.GetRadiusOfGyration( O, uL> )
-> (69) RadiusOfGyrationAboutL = 0.2041241*sqrt(17*w^2+(36*I+sin(q)*(2*m*w^2-4*
        I*sin(q)-m*w^2*sin(q)))/m-8*w^2*cos(q))

   (70) %----------------------------------------------------------
   (71) %       Create Output and write MATLAB (or C or Fortran) program.
   (72) Output  q degs,  DistanceFromLineLToSystemCM m,  RadiusOfGyrationAboutL m
   (73) CODE Algebraic()  [ q deg = 0, 360, 1 ]  ThreePlatesMassInertia.m

   (74) %----------------------------------------------------------
Saved by Motion Genesis LLC.   Command names and syntax: Copyright (c) 2009-2021 Motion Genesis LLC. All rights reserved.