% Blocks problem from homework problem 4.2 % used to demonstrate generalized speeds overwrite on % Set up problem newtonian a frames b,c bodies d points o mass d=md inertia d,i1,i2,i3,0,0,0 variables q{6}',u{6}' % Note that q is for generalized coordinates % and u is for generalized speeds % Rotation matrices simprot(a,b,3,q1) simprot(b,c,1,q2) simprot(c,d,3,q3) a_d=a_b*b_c*c_d % Kinematic relationships and rotational kinematics for third approach w_d_a>=u1*a1>+u2*a2>+u3*a3> w_d_a_alt>=q1'*a3>+q2'*b1>+q3'*c3> express(w_d_a_alt>,a) diff>=w_d_a>-w_d_a_alt> eqn[1]=dot(diff>,a1>) eqn[2]=dot(diff>,a2>) eqn[3]=dot(diff>,a3>) solve(eqn,q1',q2',q3') expand(q1') expand(q2') expand(q3') q4'=u4 q5'=u5 q6'=u6 pause alf_d_a>=dt(w_d_a>,d) % Via million dollar formula % Translational kinematics for third approach p_o_do>=q4*a1>+q5*a2>+q6*a3> v_do_a>=dt(p_o_do>,a) a_do_a>=dt(v_do_a>,a) % Dynamics equations for second approach zero=fr()+frstar() expand(zero) % Note that to solve these equations via numerical integration, % you need to start with initial conditions for the following % variables: q1->q6 and u1->u6. Then two sets of first order % (rather than one set of second order) differential equations % must be solved via numerical integration: q' = f(q,u) and % u' = f(q,u). The dependence of the dynamical (i.e., u') % differential equations on q remains due to a poor choice % of generalized speeds, and in fact, the equations become % extremely complicated. Furthermore, the kinematical % (i.e., q') differential equations still depend on q, and % even those equations are more complicated than when a better % choice of generalized speeds is made.