% MotionGenesis file: ParticlePendulumFma.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 Variable Tension % Tension in cable. %------------------------------------------------------------ % Rotation and translation kinematics. B.RotateZ( N, theta ) Q.Translate( No, -L*By> ) %------------------------------------------------------------ % Contact and distance forces on Q. Q.AddForce( -m*g*Ny> + Tension*By> - bAir*Q.GetVelocity(N) ) %------------------------------------------------------------ % Form equations of motion with F = m *a ZeroFma[1] = Dot( Bx>, Q.GetDynamics() ) ZeroFma[2] = Dot( By>, Q.GetDynamics() ) Solve( ZeroFma, theta'', Tension ) %------------------------------------------------------------ % 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. OutputPlot t sec, theta degrees, Tension Newtons ODE() ParticlePendulumFma %------------------------------------------------------------ Save ParticlePendulumFma.html Quit