function f=dampedspring(t,x)
% dampedspring
% Compute the righthand side f(x) in ODE, dot(x)=f(x).

g=9.81;
k=2;
mu=0.5;
m=5;
x10=1.5;

f1=x(2);
f2=-k*(x(1)-x10)/m-mu*x(2)/m-g;
f=[f1;f2];