kill(all)$

lagrangian (mech7),peter.vlasschaert@gmail.com,01/08/2017
Atwood Machine : ref (floor pE=0)

Atwood Machine 
generalized coordinate  X(=q) - axis (Nothing to do XY axis cartesian coordinate system)

--------------------------------    floor

assume(m1>m2),ref :floor = 0
distance_i = floor  to m_i = X_i   (i=1,2)
! positive direction X is from floor away.
result :m2  moves positive direction  : v_2
              m1  moves negative direction  : v_1
               l = Abitrary constant
set : X_1 = X
         X_2 =  l - X

assume(m1>0,m2>0,g>0);

depends(X,t);

set  'see above',same for mech6

generalized coordinates :X for m_i => i=1,2

X_1:X;
X_2:l-X;

find : kinetic Energy(=kE)

p1:v_1=diff(X_1,t);
p2:v_2=diff(X_2,t);

kE:1/2*m1*(part(p1,2))^2+1/2*m2*(part(p1,2))^2;

find : ref:(pE = 0 at floor) ,potential Energy (=pE)

pE:(m1*g*X_1+m2*g*X_2);

find : Lagrangian

p3:Lag:kE-pE;

set : diff(X,t)=v

p4:diff(X,t) = v;
p5:lag=ev(p3,p4);

find : diff(lag,X)

p6:'diff(lag,x) =diff(part(p5,2),X);

find : diff(lag,v)

p7:'diff(lag,v)=diff(part(p5,2),v);

find : diff(diff(lag,v),t)

p8:part(p7,1)=ev(part(p7,2),v=diff(X,t));

p9:'diff(part(p8,1),t)=diff(part(p8,2),t);

formula :diff(lag,X)-diff(diff(lag,v),t)=0

p10:part(p6,2)-part(p9,2)=0;

solve for : a=diff(X,t,2); a= acelleration

p11:part(solve(p10,diff(X,t,2)),1);

p12:factor(ev(p11,part(p11,1)=a));