The equations of motion of the spring mass system with, m = 1
$ \ddot{y_1} = -k_1y_1 + k_1(y_2-y_1)$
$ \ddot{y_2} = -k(y_2-y_1) - ky_2$
My question is with the second term in the first equation. I don't understand why the second term is
$ y_2 - y_1$
and why the second term is added instead of subtracted.
I know the spring force is in the opposite direction of displacement, and only displacement of the spring is taken into account. But, since the position is defined as zero at equilibrium position of each mass, I'm confused at the subtraction. Shouldn't they be added together since, stretching the system in the positive direction would stretch the string in the $y_1$ and $y_2$