% MotionGenesis file: MGAircraftTrifilarPendulumStaticsKaneEmbedded.txt % Copyright (c) 2016-18 Motion Genesis LLC. %-------------------------------------------------------------------- SetAutoZ( OFF ) NewtonianFrame N % Earth / aircraft hanger. RigidBody C % Aircraft. Point N1(N), N2(N), N3(N) % End-points of cable on N. Point C1(C), C2(C), C3(C) % End-points of cable on C. %-------------------------------------------------------------------- Constant L1 = 30 m % Length of cable between N1 and C1. Constant L2 = 30 m % Length of cable between N2 and C2. Constant L3 = 30 m % Length of cable between N3 and C3. Constant dN = 30 m % Distance between No and N1. Constant dC = 30 m % Distance between Co and C1. Constant wN = 20 m % Distance between No and N2. Constant wC = 20 m % Distance between Co and C2. Constant dcm = 8 m % Distance between Co and Ccm. Constant g = 9.8 m/s^2 % Earth's gravitational acceleration. C.SetMass( m = 9000 kg ) %-------------------------------------------------------------------- Variable x', y', z' % Locates Ccm from No. Variable q1', q2', q3' % BodyZYX Euler angles. SetGeneralizedSpeeds( x', y', q1' ) %-------------------------------------------------------------------- % Rotational and translational kinematics. C.Rotate( N, BodyZYX, q1, q2, q3 ) CCm.SetPositionVelocity( No, x*Nx> + y*Ny> + z*Nz> ) Co.SetPosition( CCm, -dcm*Cx> ) C1.SetPosition( Co, dC*Cx> ) C2.SetPosition( Co, -wC*Cy> ) C3.SetPosition( Co, wC*Cy> ) N1.SetPosition( No, dN*Nx> ) N2.SetPosition( No, -wN*Ny> ) N3.SetPosition( No, wN*Ny> ) %-------------------------------------------------------------------- % Configuration constraints: Length of cables. CableConstraint[1] = C1.GetDistanceSquared( N1 ) - L1^2 CableConstraint[2] = C2.GetDistanceSquared( N2 ) - L2^2 CableConstraint[3] = C3.GetDistanceSquared( N3 ) - L3^2 %-------------------------------------------------------------------- % Embed constraints so tensions do not appear in statics equations. % Need to identify useful subset of generalized speed. What worked % (from looking at system and using physical insight) was: x', y', q1' % Hence, need to solve z', q2', q3' in terms of x', y', q1'. Solve( Dt(CableConstraint) = 0, z', q2', q3' ) %-------------------------------------------------------------------- % Add forces from gravity. It is unnecessary to add tension because tension does % not contribute to generalized forces (force is perpendicular to velocity). Ccm.AddForce( m*g*Nz> ) %-------------------------------------------------------------------- % For statics: Set generalized forces to zero. Statics = System.GetStaticsKane() %-------------------------------------------------------------------- % Statics analysis 1: Equal-length cables L1 = L2 = L3 = 30 m. 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 ) %-------------------------------------------------------------------- % Statics analysis 2: Unequal-length cables L1 = L2 = 22 m, L3 = 30 m. Input L1 := 22 m, L2 := 22 m, L3 := 30 m 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 ) %-------------------------------------------------------------------- % Calculate yaw, pitch and roll angles in terms of q1, q2, q3. Yaw = GetAngleBetweenUnitVectors( Nx>, Cy> ) - pi/2 Pitch = GetAngleBetweenUnitVectors( Nz>, Cx> ) - pi/2 Roll = pi/2 - GetAngleBetweenUnitVectors( Nz>, Cy> ) %-------------------------------------------------------------------- % Calculate numerical values for various quantities. DistanceStatic = EvaluateToNumber( Co.GetDistance(No) ) YawStaticDegrees = EvaluateToNumber( Yaw ) * 180/pi PitchStaticDegrees = EvaluateToNumber( Pitch ) * 180/pi RollStaticDegrees = EvaluateToNumber( Roll ) * 180/pi %-------------------------------------------------------------------- Save MGAircraftTrifilarPendulumStaticsKaneEmbedded.html Quit