Code covered by the BSD License  

Highlights from
LMFsolve.m: Levenberg-Marquardt-Fletcher algorithm for nonlinear least squares problems

image thumbnail

LMFsolve.m: Levenberg-Marquardt-Fletcher algorithm for nonlinear least squares problems

by

 

23 Aug 2007 (Updated )

LMFsolve.m finds least-squares solution of an overdetermined system of nonlinear equations

rosen(x)
function r = rosen(x)
%%%%%%%%%%%%%%%%%%%%%   Rosenbrock valey with a constraint

R = sqrt(x(1)^2+x(2)^2)-.5;
%R = sqrt(x(1)^2+x(2)^2)-1;
%R = sqrt(x(1)^2+x(2)^2)-2;

%   Residuals:
r = [ 10*(x(2)-x(1)^2)  %   first part
      1-x(1)            %   second part
     (R>0)*R*500.     %   penalty
    ];

Contact us