
clear all

%*** Parameter/Startwerte
r = 1; 
M = [0;0]; 
k = 1.5; 
a = -1;
P = [2.6,2.5,2.4,2.3,2.2,2.1,2.0,1.9; ...
      2  ,  2,  2,  2,  2,  2,  2,  2];
d = ones(2,size(P,2)); 
x_ex = g(M,r,P,d,k,a,zeros(1,size(P,2)));

%*** Gauss-Newton Verfahren
iter = 0;
tol = 1e-10;
maxit = 12;

% Startwerte  (Plausibilitaet beachten)
r = 2; M = [-0.2;0.5];

%*** Werte g und Dg aus


%*** Berechne erste Schrittweite s


while norm(s) > tol && k < maxit
  iter = iter+1;
  %*** update m und r
  M = M + s(1:2);
  r = r + s(3);
  disp([M',r])
  
  %*** Berechne g,Dg, s
  
  
  
  data(iter) = norm(s);
end  
semilogy(data,'*-')
M
r
