function Dy = spring4(t,y)     
% ODE system for 4 springs connected together, with k/m=1

for i=1:4
   Dy(i)=y(i+4);
end;

Dy(5)=y(2)-y(1);

for i=6:7
   Dy(i)=y(i-3)-2*y(i-4)+y(i-5);
end;

Dy(8)=y(3)-y(4);

Dy=Dy';

end
    
    