MGAircraftTrifilarPendulumStaticsKaneEmbedded.html  (MotionGenesis input/output).
   (1) % MotionGenesis file:  MGAircraftTrifilarPendulumStaticsKaneEmbedded.txt
   (2) % Copyright (c) 2016-18 Motion Genesis LLC.
   (3) %--------------------------------------------------------------------
   (4) SetAutoZ( OFF )
   (5) NewtonianFrame  N                    % Earth / aircraft hanger.
   (6) RigidBody       C                    % Aircraft.
   (7) Point           N1(N), N2(N), N3(N)  % End-points of cable on N.
   (8) Point           C1(C), C2(C), C3(C)  % End-points of cable on C.
   (9) %--------------------------------------------------------------------
   (10) Constant  L1 = 30 m                  % Length of cable between N1 and C1.
   (11) Constant  L2 = 30 m                  % Length of cable between N2 and C2.
   (12) Constant  L3 = 30 m                  % Length of cable between N3 and C3.
   (13) Constant  dN = 30 m                  % Distance between No and N1.
   (14) Constant  dC = 30 m                  % Distance between Co and C1.
   (15) Constant  wN = 20 m                  % Distance between No and N2.
   (16) Constant  wC = 20 m                  % Distance between Co and C2.
   (17) Constant dcm =  8 m                  % Distance between Co and Ccm.
   (18) Constant  g = 9.8 m/s^2              % Earth's gravitational acceleration.
   (19) C.SetMass( m = 9000 kg )
   (20) %--------------------------------------------------------------------
   (21) Variable  x',   y',   z'             % Locates Ccm from No.
   (22) Variable  q1',  q2',  q3'            % BodyZYX Euler angles.
   (23) SetGeneralizedSpeeds(  x',  y',  q1'  )
   (24) %--------------------------------------------------------------------
   (25) %   Rotational and translational kinematics.
   (26) C.Rotate( N, BodyZYX, q1, q2, q3 )
-> (27) C_N[1,1] = cos(q1)*cos(q2)
-> (28) C_N[1,2] = sin(q1)*cos(q2)
-> (29) C_N[1,3] = -sin(q2)
-> (30) C_N[2,1] = sin(q2)*sin(q3)*cos(q1) - sin(q1)*cos(q3)
-> (31) C_N[2,2] = cos(q1)*cos(q3) + sin(q1)*sin(q2)*sin(q3)
-> (32) C_N[2,3] = sin(q3)*cos(q2)
-> (33) C_N[3,1] = sin(q1)*sin(q3) + sin(q2)*cos(q1)*cos(q3)
-> (34) C_N[3,2] = sin(q1)*sin(q2)*cos(q3) - sin(q3)*cos(q1)
-> (35) C_N[3,3] = cos(q2)*cos(q3)
-> (36) w_C_N> = (q3'-sin(q2)*q1')*Cx> + (sin(q3)*cos(q2)*q1'+cos(q3)*q2')*Cy>
        + (cos(q2)*cos(q3)*q1'-sin(q3)*q2')*Cz>

   (37) CCm.SetPositionVelocity( No, x*Nx> + y*Ny> + z*Nz> )
-> (38) p_No_Ccm> = x*Nx> + y*Ny> + z*Nz>
-> (39) v_Ccm_N> = x'*Nx> + y'*Ny> + z'*Nz>

   (40) Co.SetPosition( CCm, -dcm*Cx> )
-> (41) p_Ccm_Co> = -dcm*Cx>

   (42) C1.SetPosition( Co,    dC*Cx> )
-> (43) p_Co_C1> = dC*Cx>

   (44) C2.SetPosition( Co,   -wC*Cy> )
-> (45) p_Co_C2> = -wC*Cy>

   (46) C3.SetPosition( Co,    wC*Cy> )
-> (47) p_Co_C3> = wC*Cy>

   (48) N1.SetPosition( No,    dN*Nx> )
-> (49) p_No_N1> = dN*Nx>

   (50) N2.SetPosition( No,   -wN*Ny> )
-> (51) p_No_N2> = -wN*Ny>

   (52) N3.SetPosition( No,    wN*Ny> )
-> (53) p_No_N3> = wN*Ny>

   (54) %--------------------------------------------------------------------
   (55) %   Configuration constraints: Length of cables.
   (56) CableConstraint[1] = C1.GetDistanceSquared( N1 ) - L1^2
-> (57) CableConstraint[1] = (dC-dcm)^2 + y^2 + z^2 + (dN-x)^2 + 2*(dC-dcm)*y*
        sin(q1)*cos(q2) - L1^2 - 2*(dC-dcm)*z*sin(q2) - 2*(dC-dcm)*cos(q1)*cos(
        q2)*(dN-x)

   (58) CableConstraint[2] = C2.GetDistanceSquared( N2 ) - L2^2
-> (59) CableConstraint[2] = dcm^2 + wC^2 + x^2 + z^2 + (wN+y)^2 + 2*dcm*z*sin(q2)
        + 2*wC*x*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1)) - L2^2 - 2*dcm*x*cos
        (q1)*cos(q2) - 2*wC*z*sin(q3)*cos(q2) - 2*dcm*sin(q1)*cos(q2)*(wN+y)
        - 2*wC*(wN+y)*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))

   (60) CableConstraint[3] = C3.GetDistanceSquared( N3 ) - L3^2
-> (61) CableConstraint[3] = dcm^2 + wC^2 + x^2 + z^2 + (wN-y)^2 + 2*dcm*z*sin(q2)
        + 2*wC*z*sin(q3)*cos(q2) + 2*dcm*sin(q1)*cos(q2)*(wN-y) - L3^2 - 2*dcm*
        x*cos(q1)*cos(q2) - 2*wC*x*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1))
        - 2*wC*(wN-y)*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))

   (62) %--------------------------------------------------------------------
   (63) %   Embed constraints so tensions do not appear in statics equations.
   (64) %   Need to identify useful subset of generalized speed.  What worked
   (65) %   (from looking at system and using physical insight) was:  x', y', q1'
   (66) %   Hence, need to solve  z', q2', q3'  in terms of  x', y', q1'.
   (67) Solve(  Dt(CableConstraint) = 0,   z',  q2',  q3' )
-> (68) z' = ((dC-dcm)*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*
        cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin
        (q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*(dcm*sin(q1)*cos(q2)*y'+dcm*cos(
        q1)*cos(q2)*x'+dcm*cos(q1)*cos(q2)*(wN+y)*q1'+wC*(cos(q1)*cos(q3)+sin(
        q1)*sin(q2)*sin(q3))*y'-x*x'-(wN+y)*y'-dcm*x*sin(q1)*cos(q2)*q1'-wC*(
        sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1))*x'-wC*x*(cos(q1)*cos(q3)+sin(
        q1)*sin(q2)*sin(q3))*q1'-wC*(wN+y)*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos
        (q1))*q1')+(dC-dcm)*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))
        *(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*
        (sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((wN-y)*y'+dcm*sin(q1)*cos(
        q2)*y'+dcm*cos(q1)*cos(q2)*x'+wC*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(
        q1))*x'+wC*x*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))*q1'-x*x'-dcm*x*
        sin(q1)*cos(q2)*q1'-dcm*cos(q1)*cos(q2)*(wN-y)*q1'-wC*(cos(q1)*cos(q3)+
        sin(q1)*sin(q2)*sin(q3))*y'-wC*(wN-y)*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*
        cos(q1))*q1')+((z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*
        cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*(dcm*z*cos(
        q2)+dcm*x*sin(q2)*cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+
        y)-wC*x*sin(q3)*cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))+(z*
        cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin
        (q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos
        (q1)+wC*x*sin(q3)*cos(q1)*cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(
        q2)*(wN-y)-wC*sin(q1)*sin(q3)*cos(q2)*(wN-y)))*((dN-x)*x'-y*y'-(dC-dcm)
        *sin(q1)*cos(q2)*y'-(dC-dcm)*cos(q1)*cos(q2)*x'-(dC-dcm)*y*cos(q1)*cos(
        q2)*q1'-(dC-dcm)*sin(q1)*cos(q2)*(dN-x)*q1'))/((dC-dcm)*(z+dcm*sin(q2)+
        wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))
        *(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*
        (sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))+(z-(dC-dcm)*sin(q2))*(z*cos(
        q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)
        *cos(q1)-sin(q1)*sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)
        +wC*x*sin(q3)*cos(q1)*cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*
        (wN-y)-wC*sin(q1)*sin(q3)*cos(q2)*(wN-y))+(z*cos(q2)*cos(q3)+x*(sin(q1)
        *sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(
        q2)*cos(q3)))*((dC-dcm)*(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y
        *sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*
        cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*
        (wN+y)-wC*x*sin(q3)*cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))))

-> (69) q2' = -(((z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(z*cos(q2)*cos(q3)+x*(sin(
        q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*
        sin(q2)*cos(q3)))+(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)*cos(q3)
        +x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-
        sin(q1)*sin(q2)*cos(q3))))*((dN-x)*x'-y*y'-(dC-dcm)*sin(q1)*cos(q2)*y'-
        (dC-dcm)*cos(q1)*cos(q2)*x'-(dC-dcm)*y*cos(q1)*cos(q2)*q1'-(dC-dcm)*sin
        (q1)*cos(q2)*(dN-x)*q1')-(z-(dC-dcm)*sin(q2))*(z*cos(q2)*cos(q3)+x*(sin
        (q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*
        sin(q2)*cos(q3)))*(dcm*sin(q1)*cos(q2)*y'+dcm*cos(q1)*cos(q2)*x'+dcm*
        cos(q1)*cos(q2)*(wN+y)*q1'+wC*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))
        *y'-x*x'-(wN+y)*y'-dcm*x*sin(q1)*cos(q2)*q1'-wC*(sin(q1)*cos(q3)-sin(
        q2)*sin(q3)*cos(q1))*x'-wC*x*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))*
        q1'-wC*(wN+y)*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1))*q1')-(z-(dC-dcm)
        *sin(q2))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))
        -(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((wN-y)*y'+dcm*sin(
        q1)*cos(q2)*y'+dcm*cos(q1)*cos(q2)*x'+wC*(sin(q1)*cos(q3)-sin(q2)*sin(
        q3)*cos(q1))*x'+wC*x*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))*q1'-x*
        x'-dcm*x*sin(q1)*cos(q2)*q1'-dcm*cos(q1)*cos(q2)*(wN-y)*q1'-wC*(cos(q1)
        *cos(q3)+sin(q1)*sin(q2)*sin(q3))*y'-wC*(wN-y)*(sin(q1)*cos(q3)-sin(q2)
        *sin(q3)*cos(q1))*q1'))/((dC-dcm)*(z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(z
        *cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*cos(q2)*cos(q3)+x
        *(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(
        q1)*sin(q2)*cos(q3)))+(z-(dC-dcm)*sin(q2))*(z*cos(q2)*cos(q3)+x*(sin(
        q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*
        sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos
        (q1)*cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)
        *sin(q3)*cos(q2)*(wN-y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*
        cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((
        dC-dcm)*(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)
        -sin(q2)*cos(q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)+dcm*x*sin(
        q2)*cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(
        q3)*cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))))

-> (70) q3' = (((dC-dcm)*(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(
        q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)
        +dcm*x*sin(q2)*cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-
        wC*x*sin(q3)*cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y)))*((wN-y)
        *y'+dcm*sin(q1)*cos(q2)*y'+dcm*cos(q1)*cos(q2)*x'+wC*(sin(q1)*cos(q3)-
        sin(q2)*sin(q3)*cos(q1))*x'+wC*x*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(
        q3))*q1'-x*x'-dcm*x*sin(q1)*cos(q2)*q1'-dcm*cos(q1)*cos(q2)*(wN-y)*q1'-
        wC*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))*y'-wC*(wN-y)*(sin(q1)*cos(
        q3)-sin(q2)*sin(q3)*cos(q1))*q1')-((z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(
        dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*
        sin(q2)*(wN+y)-wC*x*sin(q3)*cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*
        (wN+y))-(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(dcm*z*cos(q2)+dcm*x*sin(q2)
        *cos(q1)+wC*x*sin(q3)*cos(q1)*cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*
        sin(q2)*(wN-y)-wC*sin(q1)*sin(q3)*cos(q2)*(wN-y)))*((dN-x)*x'-y*y'-(dC-
        dcm)*sin(q1)*cos(q2)*y'-(dC-dcm)*cos(q1)*cos(q2)*x'-(dC-dcm)*y*cos(q1)*
        cos(q2)*q1'-(dC-dcm)*sin(q1)*cos(q2)*(dN-x)*q1')-((dC-dcm)*(z+dcm*sin(
        q2)+wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(
        dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*
        sin(q3)*cos(q1)*cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)
        -wC*sin(q1)*sin(q3)*cos(q2)*(wN-y)))*(dcm*sin(q1)*cos(q2)*y'+dcm*cos(
        q1)*cos(q2)*x'+dcm*cos(q1)*cos(q2)*(wN+y)*q1'+wC*(cos(q1)*cos(q3)+sin(
        q1)*sin(q2)*sin(q3))*y'-x*x'-(wN+y)*y'-dcm*x*sin(q1)*cos(q2)*q1'-wC*(
        sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1))*x'-wC*x*(cos(q1)*cos(q3)+sin(
        q1)*sin(q2)*sin(q3))*q1'-wC*(wN+y)*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos
        (q1))*q1'))/(wC*((dC-dcm)*(z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(z*cos(q2)
        +y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*cos(q2)*cos(q3)+x*(sin(
        q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*
        sin(q2)*cos(q3)))+(z-(dC-dcm)*sin(q2))*(z*cos(q2)*cos(q3)+x*(sin(q1)*
        sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(
        q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos(q1)
        *cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)*sin
        (q3)*cos(q2)*(wN-y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(
        q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((dC-dcm)
        *(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(
        q2)*cos(q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)+dcm*x*sin(q2)*
        cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(q3)*
        cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y)))))

   (71) %--------------------------------------------------------------------
   (72) %   Add forces from gravity.  It is unnecessary to add tension because tension does
   (73) %   not contribute to generalized forces (force is perpendicular to velocity).
   (74) Ccm.AddForce( m*g*Nz> )
-> (75) Force_Ccm> = m*g*Nz>

   (76) %--------------------------------------------------------------------
   (77) %   For statics: Set generalized forces to zero.
   (78) Statics = System.GetStaticsKane()
-> (79) Statics[1] = -m*g*((dC-dcm)*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(
        q1)*(dN-x))*(x-dcm*cos(q1)*cos(q2)-wC*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*
        cos(q1)))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))
        -(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))-(dC-dcm)*(z*cos(q2)+
        y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(dcm*cos(q1)*cos(q2)-x-wC*(
        sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1)))*(z*cos(q2)*cos(q3)+x*(sin(q1)
        *sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(
        q2)*cos(q3)))-(dN-x-(dC-dcm)*cos(q1)*cos(q2))*((z*cos(q2)*cos(q3)+x*(
        sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(
        q1)*sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*z*sin(q2)
        *sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(q3)*cos(q1)*cos(q2)-wC*sin
        (q1)*sin(q3)*cos(q2)*(wN+y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(
        q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*
        (dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos(q1)*cos(q2)-wC*z*
        sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)*sin(q3)*cos(q2)*(
        wN-y))))/((dC-dcm)*(z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(
        q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(
        q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*
        cos(q3)))+(z-(dC-dcm)*sin(q2))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+
        sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(
        q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos(q1)*cos(q2)
        -wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)*sin(q3)*cos
        (q2)*(wN-y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(
        q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((dC-dcm)*(z+dcm
        *sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(
        q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+
        wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(q3)*cos(q1)*
        cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))))

-> (80) Statics[2] = m*g*((dC-dcm)*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)
        *(dN-x))*(wN+dcm*sin(q1)*cos(q2)-y-wC*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*
        sin(q3)))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))
        -(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))-(dC-dcm)*(z*cos(q2)+
        y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(wN+y-dcm*sin(q1)*cos(q2)-wC*
        (cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3)))*(z*cos(q2)*cos(q3)+x*(sin(
        q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*
        sin(q2)*cos(q3)))-(y+(dC-dcm)*sin(q1)*cos(q2))*((z*cos(q2)*cos(q3)+x*(
        sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(
        q1)*sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*z*sin(q2)
        *sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(q3)*cos(q1)*cos(q2)-wC*sin
        (q1)*sin(q3)*cos(q2)*(wN+y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(
        q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*
        (dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos(q1)*cos(q2)-wC*z*
        sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)*sin(q3)*cos(q2)*(
        wN-y))))/((dC-dcm)*(z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(
        q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(
        q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*
        cos(q3)))+(z-(dC-dcm)*sin(q2))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+
        sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(
        q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos(q1)*cos(q2)
        -wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)*sin(q3)*cos
        (q2)*(wN-y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(
        q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((dC-dcm)*(z+dcm
        *sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(
        q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+
        wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(q3)*cos(q1)*
        cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))))

-> (81) Statics[3] = m*g*(dC-dcm)*((z*cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)
        *(dN-x))*(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))
        +(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*(dcm*cos(q1)*cos(q2)
        *(wN+y)-dcm*x*sin(q1)*cos(q2)-wC*x*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin
        (q3))-wC*(wN+y)*(sin(q1)*cos(q3)-sin(q2)*sin(q3)*cos(q1)))+(z*cos(q2)+y
        *sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*cos(q2)*cos(q3)+x*(sin(q1)*
        sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(
        q2)*cos(q3)))*(wC*x*(cos(q1)*cos(q3)+sin(q1)*sin(q2)*sin(q3))-dcm*x*sin
        (q1)*cos(q2)-dcm*cos(q1)*cos(q2)*(wN-y)-wC*(wN-y)*(sin(q1)*cos(q3)-sin(
        q2)*sin(q3)*cos(q1)))-cos(q2)*(y*cos(q1)+sin(q1)*(dN-x))*((z*cos(q2)*
        cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos
        (q1)-sin(q1)*sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*
        z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(q3)*cos(q1)*cos(
        q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*
        sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*sin(
        q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos(q1)
        *cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)*sin
        (q3)*cos(q2)*(wN-y))))/((dC-dcm)*(z+dcm*sin(q2)+wC*sin(q3)*cos(q2))*(z*
        cos(q2)+y*sin(q1)*sin(q2)-sin(q2)*cos(q1)*(dN-x))*(z*cos(q2)*cos(q3)+x*
        (sin(q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(
        q1)*sin(q2)*cos(q3)))+(z-(dC-dcm)*sin(q2))*(z*cos(q2)*cos(q3)+x*(sin(
        q1)*sin(q3)+sin(q2)*cos(q1)*cos(q3))-(wN+y)*(sin(q3)*cos(q1)-sin(q1)*
        sin(q2)*cos(q3)))*(dcm*z*cos(q2)+dcm*x*sin(q2)*cos(q1)+wC*x*sin(q3)*cos
        (q1)*cos(q2)-wC*z*sin(q2)*sin(q3)-dcm*sin(q1)*sin(q2)*(wN-y)-wC*sin(q1)
        *sin(q3)*cos(q2)*(wN-y))+(z*cos(q2)*cos(q3)+x*(sin(q1)*sin(q3)+sin(q2)*
        cos(q1)*cos(q3))+(wN-y)*(sin(q3)*cos(q1)-sin(q1)*sin(q2)*cos(q3)))*((
        dC-dcm)*(z+dcm*sin(q2)-wC*sin(q3)*cos(q2))*(z*cos(q2)+y*sin(q1)*sin(q2)
        -sin(q2)*cos(q1)*(dN-x))+(z-(dC-dcm)*sin(q2))*(dcm*z*cos(q2)+dcm*x*sin(
        q2)*cos(q1)+wC*z*sin(q2)*sin(q3)+dcm*sin(q1)*sin(q2)*(wN+y)-wC*x*sin(
        q3)*cos(q1)*cos(q2)-wC*sin(q1)*sin(q3)*cos(q2)*(wN+y))))

   (82) %--------------------------------------------------------------------
   (83) %   Statics analysis 1:  Equal-length cables  L1 = L2 = L3 = 30 m.
   (84) SolveSetInput( [Statics;  CableConstraint] = 0,  q1=0 deg,  q2=0 deg,  q3=0 deg,  x = Input(dN)/2 m,  y=0 m,  z = Input(L1) m )

->   %  INPUT has been assigned as follows:
->   %   q1                       -1.521105715913746E-18   deg
->   %   q2                       -7.345729721396523E-16   deg
->   %   q3                       -3.570637067756519E-17   deg
->   %   x                         8                       m
->   %   y                         1.55750044346659E-18    m
->   %   z                         30                      m

   (85) %--------------------------------------------------------------------
   (86) %   Statics analysis 2:  Unequal-length cables  L1 = L2 = 22 m,   L3 = 30 m.
   (87) Input  L1 := 22 m,  L2 := 22 m,  L3 := 30 m
   (88) SolveSetInput( [Statics;  CableConstraint] = 0,  q1=0 deg,  q2=0 deg,  q3=0 deg,  x = Input(dN)/2 m,  y=0 m,  z = Input(L1) m )

->   %  INPUT has been assigned as follows:
->   %   q1                        0.9593486506940107      deg
->   %   q2                        7.659043192403295       deg
->   %   q3                        11.63295584237929       deg
->   %   x                         8.031358951235376       m
->   %   y                        -0.05976274847707831     m
->   %   z                         24.92935115026747       m

   (89) %--------------------------------------------------------------------
   (90) %   Calculate yaw, pitch and roll angles in terms of q1, q2, q3.
   (91) Yaw   = GetAngleBetweenUnitVectors( Nx>, Cy> )  -  pi/2
-> (92) Yaw = -1.570796 + acos(sin(q2)*sin(q3)*cos(q1)-sin(q1)*cos(q3))

   (93) Pitch = GetAngleBetweenUnitVectors( Nz>, Cx> )  -  pi/2
-> (94) Pitch = 1.570796 - acos(sin(q2))

   (95) Roll  = pi/2  -  GetAngleBetweenUnitVectors( Nz>, Cy> )
-> (96) Roll = 1.570796 - acos(sin(q3)*cos(q2))

   (97) %--------------------------------------------------------------------
   (98) %   Calculate numerical values for various quantities.
   (99) DistanceStatic     = EvaluateToNumber( Co.GetDistance(No) )
-> (100) DistanceStatic = 25.99649

   (101) YawStaticDegrees   = EvaluateToNumber( Yaw )   *  180/pi
-> (102) YawStaticDegrees = -0.5999802

   (103) PitchStaticDegrees = EvaluateToNumber( Pitch ) *  180/pi
-> (104) PitchStaticDegrees = 7.659043

   (105) RollStaticDegrees  = EvaluateToNumber( Roll )  *  180/pi
-> (106) RollStaticDegrees = 11.52774

   (107) %--------------------------------------------------------------------
Saved by Motion Genesis LLC.   Copyright (c) 2009-2018 Motion Genesis LLC on command names and syntax. All rights reserved.