function y=getf(v,vold,nullv,ds)
% function to find zero of at each Newton iteration
y=zeros(2,1);
y(1)=g(v(1),v(2));
y(2)=(v-vold)'*nullv-ds;