Solution (source code)

= Solution

The three nearly horizontal segments have lengths $2a,a,a$. To first order in small transverse slopes, the upward <force> on the first <point mass> is $T[(y_2-y_1)/a-y_1/(2a)]$. The force on the second is $T[(y_1-y_2)/a-y_2/a]$. Applying <Newton's second law> to masses $m,2m$ therefore gives
$$
\boxed{\ddot y_1+\frac{T}{2ma}(3y_1-2y_2)=0,\qquad
\ddot y_2+\frac{T}{2ma}(2y_2-y_1)=0.}
$$
The approximation treats the string as massless, retains the imposed equilibrium <tension> and neglects gravity, as stipulated.