Working with lsqcurvefit: edit optimization options structure
Afficher commentaires plus anciens
Hi,
i tried to fix some Data to the folling function:
function Z = FitFunc(p, f ) % Vector p must be [R1, C1, R2, C2]'
Z = abs( 1 ./ (1/p(1) + i*2*pi*f*p(2)) + 1 ./ (1/p(3) + i*2*pi*f*p(4)));
end
The function represents a electric circuit.
%for f i used:
f = logspace(1,6)
%for p:
p = [1000, 1e-9, 10, 1e-7]
%after saving for y:
y = FitFunc(p,f);
%i tried to fix the problem with the following startvalues
p2 = [1100, 5e-9, 22, 5.5e-7]
[x, resnorm] = lsqcurvefit(@FitFunc, p2, f, y);
%But Matlab the says: %Local minimum possible.
%lsqcurvefit stopped because the size of the current step is less %than the default value of the step size tolerance.
%<stopping criteria details>
%i already worked with optimset:
options = optimset('TolX', 1e-12, 'TolFun', 1e-12, 'MaxFunEvals', 4000, 'MaxIter', 4000);
%and used than:
[x, resnorm] = lsqcurvefit(@FitFunc, p2, f, y, [], [], options);
but it says again the same thing.
Thanks for your help!
Jan
Réponses (1)
Jan
le 11 Juil 2011
0 votes
Catégories
En savoir plus sur Systems of Nonlinear Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!