function [GV]=grad_V(x,y,parms);
%still not sure if we can use langevin


x0=parms(:,1);  y0=parms(:,2);
R1=parms(:,3);  R2=parms(:,4);
theta=parms(:,5); gamma=parms(:,6); w=parms(:,7); 
Q=0;dq=0; dz=0; GV=zeros(2,1);
for i=1:length(R1)
   R=[cos(theta(i)) sin(theta(i)); -sin(theta(i)) cos(theta(i))];
   S=[R1(i)^2 0 ; 0 R2(i)^2];
   G=R'*S^-1*R;
   G_h=0.5*gamma(i)*G;
   q=[x-x0(i);y-y0(i)];
   s_i=G_h*q;
%   Q = Q + 2*pi/gamma(i)/ sqrt( det(G) );
   g_i=w(i)*exp(-q'*G_h*q);
   GV=GV+g_i*s_i;
   dz=dz + g_i;
%   keyboard;
end

GV=2*GV/dz;

