%
%     spring_fun
%

  function y = spring_fun(t,params)

  global m k
 
  c = params;
 
  num = sqrt(4*m*k - c^2);
  den = 2*m;
  y = 2*exp((-c/den)*t).*cos((num/den)*t);
