n=100;
z=randn(1,n)+1i*randn(1,n);

t=0;
dt=0.2;
tnext=0;

while (1>0)
   t=t+dt;
   dz=z*0;
   for j=1:n
      k=[1:j-1,j+1:n];
      r=abs(z(j)-z(k));
      F=1./r-r;
      %F=tanh((1-r)*7.7)+0.7;
 
      dz(j)=1/n*sum(F.*(z(j)-z(k))./r);
      
     
   end;
   z=z+dz*dt;
   if t>tnext,
      tnext=tnext+dt*100;
      plot(z,'.'); 
      axis equal;

      title(sprintf('t=%g, radius=%g',t, max(abs(mean(z)-z))));
      drawnow;
%      pause;
   end;
end;



