lagrangian (mech5),peter.vlasschaert@gmail.com, 26/07/2017
q=general coordinates   (qi ,i=1,2)
q_t= time derivative from general coordinates.(qi_t,i=1,2)

assume(m1>0,m2>0,g>0);
depends(lag,[q1,q2,q1_t,q2_t],[q1,q2,q1_t,q2_t],t);

eK:1/2*m1*(q1_t)^2+1/2*m2*(q2_t)^2;
eP:m1*g*q1;

lag:eK-eP;

=>   " Euler-Lagrange equation (qi,i=1,2)  "

p1:double(lag,q,q_t):=diff(lag,q)-diff(diff(lag,q_t),t);

Euler-Lagrange equation(q1,q1_t)

p2:double(lag,q1,q1_t)=0;
p21:ev(p2,q1_t=diff(q1,t),q2_t=diff(q2,t));

p22:ode2(p21,q1,t);

%k2,%k1  => from the physics,chemistry..........

Euler-Lagrange equation(q2,q2_t)

p3:double(lag,q2,q2_t)=0;
p31:ev(p3,q1_t=diff(q1,t),q2_t=diff(q2,t));

rem :indepent m2 >  0 ,m2 <>0 (example)

p32:ode2(p31,q2,t)$
p33:ev(p32,%k1=%k3,%k2=%k4);

%k3,%k4  => from the physics,chemistry..........