function u=Newton2(F,u0,tol,maxit)
% Solves the system of two non-linear equations 
% F1(x,y)=0, F2(x,y)=0 using 2D Newton method
%
% Input arguments:
%
% maxit - maximal number of iterations 
% tol   - tolerance (successful exit if |F(u)|<tol)
% u0    - coordinates of the initial point, u0=[x0,y0]
% F     - the handle of a user supplied function Z=F(u)
%         which, for a given u=[x,y] returns 2x3 matrix 
%         containing the values of F1, F2, and their derivatives,
%         Z=[F1  dF1/dx  dF1/dy;
%            F2  dF2/dx  dF2/dy]
%         (user supplies the derivatives, do not try to differentiate)
% Output argument:
% u     - coordinates [x,y] of the solution u found; set u=[NaN,NaN] 
%         if no convergence was achieved in maxit iterations.
