% MotionGenesis file: ParticlePendulumKane.txt % Problem: Particle pendulum with air resistance. % Copyright (c) 2009 Motion Genesis LLC. All rights reserved. %------------------------------------------------------------ NewtonianFrame N % Earth RigidFrame B % Massless cable. Particle Q % Particle at end of cable. %------------------------------------------------------------ Q.SetMass( m = 100 kg ) Constant g = 9.8 m/s^2 % Earth's gravitational acceleration Constant L = 50 m % Cable length Constant bAir = 2.0 N*s/m % Air-resistance constant Variable theta'' % Pendulum swing angle %------------------------------------------------------------ % Rotation and translation kinematics. B.RotateZ( N, theta ) Q.Translate( No, -L*By> ) %------------------------------------------------------------ % Contact and distance forces on Q. % Note: Constraint forces such as tension do not appear in Kane's equations. Q.AddForce( -m*g*Ny> - bAir*Q.GetVelocity(N) ) %------------------------------------------------------------ % Form equations of motion with Kane's method. SetGeneralizedSpeed( theta' ) Dynamics = System.GetDynamicsKane() Solve( Dynamics, theta'' ) %------------------------------------------------------------ % Initial values and numerical integration parameters. Input theta = 60 deg, theta' = 0 deg/sec Input tFinal = 120 sec, tStep = 0.1 sec %------------------------------------------------------------ % List output quantities and solve ODEs. Output t sec, theta degrees ODE() ParticlePendulumKane %------------------------------------------------------------ Save ParticlePendulumKane.html Quit