Two pendulums, connected by a massless spring, are allowed to vibrate in the same vertical plane. For the limiting case of small oscillations, the equations of motion for the system are given by
, ,
where is the acceleration of gravity. You set the masses, lengths and initial displacements. The resulting graph shows the angle between the two pendulums as a function of time.