deff("xdot = derpol(t,x)","xdot(1)=x(2);xdot(2)=-omega2*x(1)")
//
deff("xdot = derpol2(t,x)","xdot(1)=x(2);xdot(2)=-omega2*x(1)-k*x(2)")
//
xf= -1:0.1:1;
yf= -1:0.1:1;
omega2=1;
k=0.1;
//
xset('window',0)
clf()
fchamp(derpol,0,xf,yf)
for i=1:10;
  Y0=[rand();rand()];
  t=0:0.01:100;
  Y=ode(Y0,0,t,derpol);
  plot2d(Y0(1),Y0(2),-1);
  plot2d(Y(1,:),Y(2,:),i);
end
//
xtitle('portrait de phase, pendule non amorti')
xset('window',1)
clf()
fchamp(derpol2,0,xf,yf)
//
for i=1:10;
  Y0=[rand();rand()];
  t=0:0.01:100;
  Y=ode(Y0,0,t,derpol2);
  plot2d(Y0(1),Y0(2),-1);
  plot2d(Y(1,:),Y(2,:),i);
end
xtitle('portrait de phase, pendule non amorti')
//
xset('window',2)
plot2d(t,Y(1,:),1)

