Two masses, m1 and m2, are attached by a light string of length D. Mass m1 starts at rest on an inclined plane and mass m2 hangs as shown. The pulley is frictionless but has a moment of inertia I and radius R. Find the Lagrangian of the system and determine the acceleration of the masses using the Lagrangian. Though there are three coordinates of interest (along the plane for mass m1, down for mass m2, and an angle for the rotation of the pulley), there are two constraints. 2. Relevant equations ∂L/∂q - d/dt(∂L/∂(q-dot)2) = 0 L = T - V 3. The attempt at a solution If I define the x-direction to be in the direction of the inclined plane then L = 0.5*m1*(x-dot)2 + 0.5*m2*(y-dot)2 + 0.5*I*(phi-dot)2 + m1*g*x*sin(θ) + m*g*y where φ is the angle that the pulley is rotating through The length of the string is constant so the length of string on the plane plus the bit on the pulley plus the rest that is hanging holding up m2 is equal to D so x + R(π/2 + θ) + y = D -----> x-dot = -(y-dot) ≡ q-dot and the other constraint involves the string moving on the pulley without slipping y = Rφ ----> y-dot = R(φ-dot) ---> q-dot = R(φ-dot) then L = 0.5*m1*(q-dot)2 + 0.5*m2*(q-dot)2 + 0.5*I*(q-dot/R)2 + m1*g*q*sin(θ) + m*g*(D - R(π/2 + θ) - q) i dont know if what i have so far is correct. Anybody care to give me a hand? The setup is shown in the attachment.