% MotionGenesis file: MGDiskRollingDownInclinedPlaneEnergy.txt % Copyright (c) 2020 Motion Genesis LLC. %-------------------------------------------------------------------- NewtonianFrame N % Inclined plane with Nx> downhill and Ny> perpendicular to the plane. RigidFrame E % Earth with Ex> horizontally-right, Ey> vertically-upward. RigidBody B % Cylindrical disk whose symmetry axis parallel to Nz>. Point BN( B ) % Point of B in contact with inclined plane N. %-------------------------------------------------------------------- Constant r % Cylinder's radius. Constant g % Earth's gravitational acceleration. Constant psi % Angle inclined plane makes with Earth's horizontal. Variable theta' % B's rotation angle from Ey> with sense -Nz>. Variable x' % Nx> measure of Bcm's position from No. Variable Fx, Fy % Friction and normal force on B at BN. B.SetMassInertia( m, Ixx, Iyy, Izz ) %-------------------------------------------------------------------- % Rotational kinematics. E.SetRotationMatrixZ( N, psi ) B.RotateNegativeZ( E, theta ) %-------------------------------------------------------------------- % Translational kinematics. Bcm.SetPositionVelocity( No, x*Nx> + r*Ny> ) BN.SetPositionVelocity( Bcm, -r*Ny> ) %-------------------------------------------------------------------- % Motion constraints (rolling at BN). RollingConstraint = Dot( BN.GetVelocity(N), Nx> ) Solve( RollingConstraint = 0, x' ) %-------------------------------------------------------------------- % Add relevant contact/distance forces on body B. B.AddForceGravity( -g*Ey> ) % Gravity force on B. BN.AddForce( Fx*Nx> + Fy*Ny> ) % Friction and normal force on B at BN. %-------------------------------------------------------------------- % Form B's kinetic energy in N. KE = B.GetKineticEnergy() % Valid when B slides or rolls on N. Explicit( KE, m, r, theta' ) % Valid when B rolls on N. %-------------------------------------------------------------------- % Calculate a gravitational potential energy PEgravity. PEgravity = System.GetForceGravityPotentialEnergy( -g*Ey>, No ) %-------------------------------------------------------------------- % For this system, mechanical energy (kinetic energy plus potential energy) is conserved. MechanicalEnergy = Explicit( KE + PEgravity, m, r, theta' ) %-------------------------------------------------------------------- % Determine the initial value of MechanicalEnergy. InitialMechanicalEnergy = Evaluate( MechanicalEnergy, x = 0, theta' = 0 ) %-------------------------------------------------------------------- % Use the fact that MechanicalEnergy is constant to solve for theta'. eqnToSolve = Explicit( MechanicalEnergy - InitialMechanicalEnergy, m, r, theta' ) SolveQuadraticPositiveRoot( eqnToSolve = 0, theta' ) %-------------------------------------------------------------------- % Determine w = theta' for various shapes of B (solid/hollow disk or sphere). wSolidDisk = Evaluate( theta', Izz = 1/2*m*r^2 ) wHollowDisk = Evaluate( theta', Izz = m*r^2 ) wSolidSphere = Evaluate( theta', Izz = 2/5*m*r^2 ) wHollowSphere = Evaluate( theta', Izz = 2/3*m*r^2 ) %-------------------------------------------------------------------- % Form power on B (consider all forces -- e.g., gravity and normal/friction force). % Note: Due to contact, Fy does not show up in power (normal force is a "workless" force). % Note: When B rolls, Fx does not show up in power (friction force is "workless" force when rolling). PowerGravity = Dot( Bcm.GetResultantForce(), Bcm.GetVelocity(N) ) PowerContact = Dot( BN.GetResultantForce(), BN.GetVelocity(N) ) Explicit( PowerContact ) Power = Explicit( PowerGravity + PowerContact, x' ) %-------------------------------------------------------------------- % Optional: Verify that Power = -Dt( PEgravity ). isEqualPower = IsSimplifyEqual( Power, -Dt(PEgravity) ) %-------------------------------------------------------------------- % Record input together with responses. Save MGDiskRollingDownInclinedPlaneEnergy.html if( isEqualPower == true ) { Quit }