% MotionGenesis file: MGFourBarStaticsFBD.txt % Copyright (c) 2009 Motion Genesis LLC. All rights reserved. %-------------------------------------------------------------------- NewtonianFrame N % Ground link. RigidBody A, B, C % Crank, coupler, rocker links. Point BC( B ) % Point of B connected to C. Point CB( C ) % Point of C connected to B. %-------------------------------------------------------------------- Constant LN = 1 m, LA = 1 m % Length of ground link, crank link. Constant LB = 2 m, LC = 2 m % Length of coupler link, rocker link. Constant g = 9.81 m/s^2 % Earth's gravitational acceleration. Constant H = 200 Newtons % Horizontal force at point CB. Variable qA, qB, qC % Link angles (relative to ground). Variable FCx, FCy % Contact forces on C from B. %-------------------------------------------------------------------- A.SetMass( mA = 10 kg ) B.SetMass( mB = 20 kg ) C.SetMass( mC = 20 kg ) %-------------------------------------------------------------------- % Rotational kinematics. A.RotateZ( N, qA ) B.RotateZ( N, qB ) C.RotateZ( N, qC ) %-------------------------------------------------------------------- % Translational kinematics. Ao.SetPosition( No, 0> ) Acm.SetPosition( Ao, 0.5*LA*Ax> ) Bo.SetPosition( Ao, LA*Ax> ) Bcm.SetPosition( Bo, 0.5*LB*Bx> ) BC.SetPosition( Bo, LB*Bx> ) Co.SetPosition( No, LN*Ny> ) Ccm.SetPosition( Co, 0.5*LC*Cx> ) CB.SetPosition( Co, LC*Cx> ) %-------------------------------------------------------------------- % Add relevant forces. System.AddForceGravity( g * Nx> ) CB.AddForce( H * Ny> ) CB.AddForce( BC, FCx*Nx> + FCy*Ny> ) % "Cut" linkage at CB/BC %-------------------------------------------------------------------- % Form statics equations ("cut" linkage at CB/BC). Statics[1] = Dot( Nz>, System(A,B).GetStatics(Ao) ) Statics[2] = Dot( Nz>, B.GetStatics(Bo) ) Statics[3] = Dot( Nz>, C.GetStatics(Co) ) %-------------------------------------------------------------------- % Loop (configuration) constraint. Loop> = LA*Ax> + LB*Bx> - LC*Cx> - LN*Ny> Loop[1] = Dot( Loop>, Nx> ) Loop[2] = Dot( Loop>, Ny> ) %-------------------------------------------------------------------- % Solve statics with constraints (nonlinear algebraic equations need a guess for its solution). StaticSolution = Solve( [Statics; Loop] = 0, qA = 10 deg, qB = 50 deg, qC = 30 deg, FCx = 0 N, FCy = 0 N ) %-------------------------------------------------------------------- % Save input together with program responses Save MGFourBarStaticsFBD.html Quit