function Xprime=movingspring(t,X)

     global k;
     global m;
     global omega;
     Xprime=zeros(4,1);

     Xprime(1)= X(2); 
     Xprime(2)= (k/m)*( (1./sqrt( (X(1)-.1*cos(omega*t)).^2 + (X(3)-.1*sin(omega*t)).^2)) - 1 ).*(X(1)-.1*cos(omega*t));
     Xprime(3)= X(4); 
     Xprime(4)= -9.8 + (k/m)*( (1./sqrt( (X(1)-.1*cos(omega*t)).^2 + (X(3)-.1*sin(omega*t)).^2)) - 1 ).*(X(3)-.1*sin(omega*t));
     
