Assume that the cord remains tight during the motion of the masses. The tension T remains constant along the length of the cord. Initially the masses are at rest. Let us say the diameter of the pulley is d.

Initially the center of mass is at the center joining M1 and M2, directly below the center of the pulley. M1 and M2 move with the same acceleration in opposite directions. They move same distances y in the same time t. So, the center of mass C (Xc, Yc) always remains at the same position horizontally. C moves vertically downwards as M1 (> M2) moves downwards.

Xc = (0*M1 + d M2)/(M1+M2) = d * M2 / (M1+M2)

Xc is measured from the vertical line of cord with M1.

Equations of motion for M1 and M2 are:

M1 g - T = M1 a T - M2 g = M2 a

add the above equations to get:

a = (M1 - M2) g / (M1+M2)

T = (2 M1 M2 g) / (M1 + M2)

Vertical displacement from initial position of M1:

Vertical displacement from initial position of M2:

Center of mass Yc =

Acceleration of the center of mass (Xc , Yc) is vertically downwards with magnitude =