3.1 Lagrange's Equations

> restart:

> mylib :="D:/LIBS": libname := mylib,libname: with(MBsymba):

 

Lagrangian Mechanics has a SCALAR approach to problems

[Maple Metafile]

> TT := translate(x(t),0,z(t)) * rotate('Z',psi(t)) * rotate('X',phi);

TT := matrix([[cos(psi(t)), -sin(psi(t))*cos(phi), ...

> mybody := make_BODY(TT, m, Ix,Iy,Iz, Iyz,Ixz,Ixy): show(mybody);

mybody = BODY(CM = matrix([[0], [0], [0], [1]]),fra...

> G := origin(TT): show(G);

> myforce := make_FORCE(ground,Fx,Fy,Fz,G,mybody): show(myforce);

G = POINT(coords = matrix([[0], [0], [0], [1]]),fra...

myforce = FORCE(comps = matrix([[Fx], [Fy], [Fz], [...

> mytorque := make_TORQUE(ground,Mx,My,Mz,mybody): show(mytorque);

mytorque = TORQUE(comps = matrix([[Mx], [My], [Mz],...

kinetic energy

> KE := kinetic_energy(mybody);

KE := 1/2*m*(diff(x(t),t)^2+diff(z(t),t)^2)+1/2*(di...

potential energy

> _gravity := make_VECTOR(ground,0,0,g): show(_gravity);

> PE := gravitational_energy(mybody);

_gravity = VECTOR(comps = matrix([[0], [0], [g], [0...

PE := -m*z(t)*g

Lagrange's Equations

Lagrangian function

> L := KE-PE;

L := 1/2*m*(diff(x(t),t)^2+diff(z(t),t)^2)+1/2*(dif...

[Maple OLE 2.0 Object]

since the mechanism has three DOF, three equations of motion must be found

> leqns1 := lagrange(L,x(t),t) - generalized_force({myforce,mytorque},x(t)); 1st

leqns1 := m*diff(x(t),`$`(t,2))-Fx

> leqns2 := lagrange(L,z(t),t) - generalized_force({myforce,mytorque},z(t)); 2nd

leqns2 := m*diff(z(t),`$`(t,2))-m*g-Fz

> leqns3 := lagrange(L,psi(t),t) - generalized_force({myforce,mytorque},psi(t)); 3rd

leqns3 := -diff(psi(t),`$`(t,2))*(-Iy+Iy*cos(phi)^2...

>

same system, Netwon equtions

> newton_equations ({mybody,myforce,mytorque},ground): show(%);

VECTOR(comps = matrix([[m*diff(x(t),`$`(t,2))-Fx], ...

> eqnsE := euler_equations ({mybody,myforce,mytorque},CoM(mybody),TT): #show(%);

> collect(Xcomp(eqnsE),[diff(psi(t),t,t), diff(psi(t),t)]);

(-Ixy*sin(phi)-Ixz*cos(phi))*diff(psi(t),`$`(t,2))+...

> collect(Ycomp(eqnsE),[diff(psi(t),t,t), diff(psi(t),t)]);

(sin(phi)*Iy-cos(phi)*Iyz)*diff(psi(t),`$`(t,2))+(-...

> collect(Zcomp(eqnsE),[diff(psi(t),t,t), diff(psi(t),t)]);

(-sin(phi)*Iyz+cos(phi)*Iz)*diff(psi(t),`$`(t,2))+(...

>