> restart: libname := libname, "C:/MBSymba": with(MBSymba_r6):
> PDEtools[declare](x(t),y(t),z(t),alpha(t),beta(t),r(t),prime=t, quiet):
> T1 := translate(x(t),y(t),0); #set_frame_name(T1,'T1'):
body1 := make_BODY (T1 , m1 , Ix1,Iy2,Iz2): show(body1);
> T2 := T1 . rotate('Z',alpha(t)) . translate(r(t),0,0); #set_frame_name(T2,'T2'):
> body2 := make_BODY (T2 , m2 , Ix2,Iy2,Iz2): show(body2);
Forces
> Describe(make_FORCE);
# Make a FORCE from a VECTOR <FF> applied in <PP> that acts on the body <BA>
# and (optionally) reacts on the body <BR>.
make_FORCE( FF::VECTOR, PP::POINT, BA::{BODY, mframe},
BR::{BODY, mframe} := master_frame, $ )
The application point of the force
> A := make_POINT(T1,a,0,0): show(A);
4a - Define a force acting on a single body (i.e. reacting on the ground)
> make_VECTOR(T2,FX,FY,0):
> FA := make_FORCE(%, A , body1): show(FA);
> project(FA,ground): show(%);
4b - Define a force acting between two bodies
> make_VECTOR(T1,FX12,FY12,0):
F12 := make_FORCE(%, A , body1,body2): show(F12);
Vector operations such as projection can be performed on forces since they are vector entities
> project(F12,T2): show(%);
Torques
> Describe(make_TORQUE);
# Make a TORQUE from a VECTOR <FF> that acts on the body <BA> and (optionally)
# reacts on the body <BR>.
make_TORQUE( FF::VECTOR, BA::{BODY, mframe},
BR::{BODY, mframe} := master_frame, $ )
Define a torque acting on a single body
> M := make_TORQUE( make_VECTOR(ground, MX,MY,MZ), body2): show(M);
Define a torque acting between two bodies
> M12 := make_TORQUE( make_VECTOR(T2,MX12,MY12,MZ12), body1,body2): show(M12);
> project(M12,ground): show(%);
> O2A := join_points(origin(T2),A): show(O2A);
> make_VECTOR(ground,FX12,FY12,0):
F2 := make_FORCE(%, A , body2): show(F2);
> MO2 := cross_prod(O2A,F2): show(MO2);
Power and generalized forces
> show(FA);
> power(FA);
> velocity(CoM(body1)): show(%);
> generalized_force(FA, [x(t),y(t)]): Vector(%);
> simplify(power(F12));
> generalized_force(F12, r(t));
> generalized_force(F12, alpha(t));
> show(MO2);
> power(MO2);
> generalized_force(MO2, [r(t),alpha(t)]): Vector(%);