function xdot=control(t,x)
    m = 20;
    k = 1;
    kp = 10;
    kd = .5;
    ki = 0;
    xd = 2;
    xdot = zeros(3,1);
    xdot(1)=x(2);
    xdot(2) = 1/m*(-(k+kp)*x(1)-kd*x(2)+ki*x(3)+kp*xd);
    xdot(3) = xd-x(1);
end