Answer
The kinetic energy and potential energy from the coupling spring constant k for this system can written as
T=21mx˙2+21My˙2
And
V=21k(x−y)2
So lagrangial of this system can witten as
L=21mx˙2+21My˙2−21k(x−y)2
Now calculating as below
∂x˙∂L=mx˙,∂x∂L=−k(x−y)∂x∂L˙=mx˙,∂L/∂x=−k(x−y)∂L/∂y˙=My˙,∂L/∂y=k(x−y)∂L/∂y˙=M
Now lagrangian equation of motion is given by
dtd∂x˙∂L−∂x∂L=0,
dtd∂y˙∂L−∂y∂L=0,
Putting all values then we get
Equation of motion
mx¨+k(x−y)=0my¨+k(y−x)=0
Comments