% MotionGenesis file: MGAircraftTrifilarPendulumStaticsKaneAugmented.txt % Copyright (c) 2016 Motion Genesis LLC. For use only with MotionGenesis. %-------------------------------------------------------------------- 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 T1, T2, T3 % Tension in cables. Variable x', y', z' % Locates Ccm from No. Variable q1', q2', q3' % BodyZYX Euler angles. SetGeneralizedSpeeds( x', y', z', q1', q2', q3' ) %-------------------------------------------------------------------- % 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 %-------------------------------------------------------------------- % Replace all forces on C (gravity and tension) with equivalent set, % consisting of the set's resultant at Ccm along with a torque equal % to the moment of the cable tensions about Ccm. %-------------------------------------------------------------------- % Resultant force on C in terms of Fx, Fy, Fz. unitVectorToN1FromC1> = N1.GetPosition(C1) / L1 unitVectorToN2FromC2> = N2.GetPosition(C2) / L2 unitVectorToN3FromC3> = N3.GetPosition(C3) / L3 Tension1> = T1 * unitVectorToN1FromC1> Tension2> = T2 * unitVectorToN2FromC2> Tension3> = T3 * unitVectorToN3FromC3> ResultantForce> = Tension1> + Tension2> + Tension3> + m*g*Nz> Fx = Dot( ResultantForce>, Nx> ) Fy = Dot( ResultantForce>, Ny> ) Fz = Dot( ResultantForce>, Nz> ) Ccm.AddForce( Fx*Nx> + Fy*Ny> + Fz*Nz> ) %-------------------------------------------------------------------- % Calculate moment of all forces on C about Ccm in terms of Mx, My, Mz. ResultantMoment> = Cross( C1.GetPosition(Ccm), Tension1> ) & + Cross( C2.GetPosition(Ccm), Tension2> ) & + Cross( C3.GetPosition(Ccm), Tension3> ) Mx = Dot( ResultantMoment>, Cx> ) My = Dot( ResultantMoment>, Cy> ) Mz = Dot( ResultantMoment>, Cz> ) C.AddTorque( Mx*Cx> + My*Cy> + Mz*Cz> ) %-------------------------------------------------------------------- % For statics: Set generalized forces to zero (Kane and Lagrange are identical). Statics = System.GetStaticsKane() %-------------------------------------------------------------------- % 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> ) %-------------------------------------------------------------------- % Static analysis. Since equations are nonlinear, solution requires a guess. StaticsWithConstraints = [ Statics; CableConstraint ] %-------------------------------------------------------------------- % Statics 1: Equal-length cables L1 = L2 = L3 = 30 m. ans1 = Solve( StaticsWithConstraints, q1=0 deg, q2=0 deg, q3=0 deg, x = Input(dN)/2 m, y=0 m, z = Input(L1) m, & T1 = Input(m*g)/2 N, T2 = Input(m*g)/4 N, T3 = Input(m*g)/4 N ) %-------------------------------------------------------------------- % Statics 2: Unequal-length cables L1 = L2 = 22 m, L3 = 30 m. Input L1 := 22 m, L2 := 22 m, L3 := 30 m SolveSetInput( StaticsWithConstraints, q1=0 deg, q2=0 deg, q3=0 deg, x = Input(dN)/2 m, y=0 m, z = Input(L1) m, & T1 = Input(m*g)/2 N, T2 = Input(m*g)/4 N, T3 = Input(m*g)/4 N ) DistanceStatic = EvaluateToNumber( Co.GetDistance(No) ) YawStaticDegrees = EvaluateToNumber( Yaw ) * 180/pi PitchStaticDegrees = EvaluateToNumber( Pitch ) * 180/pi RollStaticDegrees = EvaluateToNumber( Roll ) * 180/pi %-------------------------------------------------------------------- Save MGAircraftTrifilarPendulumStaticsKaneAugmented.html Quit