function xdot=pend(t,x)
xdot=x;
g=-1;
alpha = 1.0;
L = 1.0;
xdot(1)=x(3);
xdot(2)=x(4);
r=sqrt(x(1)^2+x(2)^2);
s=(r-L)/r;
xdot(3)=-alpha*x(1)*s;
xdot(4)= g -alpha*x(2)*s;