How to find parameters of implicit function?
4 views (last 30 days)
Show older comments
I have to find parameters a and b of this implicit function y=1614413.7*(coth((x+b*y)/a)-a/(x+b*y)).
This function best describes my data. So far I have written this code:
function y=deviskaF(x,p)
y=zeros(size(x)); NN=length(x); opt=optimset('display','off');
for i=1:NN y(i)=fsolve(@(y) y-1.5e6*(coth((x(i)+p(2)*y)./p(1))-(p(1)./(x(i)+p(2)*y))), .1, opt); end end
Then I call this function in lsqcurvefit in matlab command window.
lsqcurvefit(@(params, xdata) deviskaF(xdata,params),[10 1e-6], x, y)
Parameter a should be somewere around 10 and parameter B around 10^-6. The results are far away from predicted results and I also get this message:
Local minimum possible.
lsqcurvefit stopped because the size of the current step is less than the default value of the step size tolerance.
What am I doing wrong?
0 Comments
Answers (0)
See Also
Categories
Find more on Web Services in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!