function coupledspring(k1,k2,m1,m2,y10,y1p0,y20,y2p0,t0,tend)
%
% Examples:
%      stiff k1: coupledspring(30,2,1,1,1,0,2,0,0,10)
%      stiff k2: coupledspring(3,20,1,1,1,0,2,0,0,10)
%          #39c: coupledspring(3,2,1,1,1,0,2,0,0,20)
%          #39d: coupledspring(3,2,1,1,-2,0,1,0,0,20)
%        others: coupledspring(3,2,1,1,1,1,2,0,0,20)
%                coupledspring(3,2,1,1,-2,1,1,0,0,20)
%                coupledspring(3,2,1,1,-2,1,1,1,0,20)
%

  set(0,'DefaultAxesLineWidth',2);
  set(0,'DefaultLineLineWidth',2);
  get(0,'Default');
  options = odeset('OutputFcn',@odeplot,'OutputSel',[1,2]);
  ode45(@(t,y) ode(t,y,k1,k2,m1,m2) ,[t0 tend],[y10 y20 y1p0 y2p0],options);
  set(gca,'FontSize',18)
  xlabel('t','FontSize',18)
  ylabel('y','FontSize',18)
  title(sprintf('k_1=%g, k_2=%g, m_1=%g, m_2=%g',k1,k2,m1,m2),'FontSize',18);
  
function dydt=ode(t,y,k1,k2,m1,m2)

  dydt = [y(3);y(4);-(k1+k2)/m1*y(1)+k2/m1*y(2);k2/m2*(y(1)-y(2))];
