function May3()
% Part (a)
% Apply Fsolve to find a zero of F(xtilde) = [A(lambda)*x;x'*x-1]
% where xtilde = [lambda;x], a length n+1 vector.
% Part (b)
% Hand this over to lsqnonlin...
function R = MyF(htilde,G,h1)
[i,j,s] = find(G);
R = zeros(length(s),1);
h = [h1;htilde];
for k=1:length(s);
    % Standing on node i(k)  and estimating the elevation change
    % when you go to node j(k).
    % s(k) the measured elevation change.
    % h(j(k)) - h(i(k)) is what the model predicts.
    % 
    R(k) = s(k) - (h(j(k)) - h(i(k)));
end