fitting a parabola giving unreasonable answer
이전 댓글 표시
Hello,
I'm trying to fit a parabola to 4 data points using the following equation:
y = a.*exp(((-4.*pi.*b.*6.022e23)./(8.314.*1623)).*(((c./2.*(c-x).^2) - (1/3.*(c-x).^3))));
I'm getting an unreasonable result, which looks like this:
I think the equation is correct because I copy and pasted it from a function that employs it to create this graph, which models the same points:
댓글 수: 5
Image Analyst
2019년 4월 11일
Attach your script. Also, what is the sum of your residuals (fitted values minus training values) at the 4 points?
Walter Roberson
2019년 4월 11일
What are the four data points, in numeric form?
Michael Phillips
2019년 4월 11일
Michael Phillips
2019년 4월 11일
John D'Errico
2019년 4월 12일
편집: John D'Errico
2019년 4월 12일
But your model is not a parabola. It is a nasty to compute exponential thing. (Nasty in double precision arithmetic.)
Seems confusing. I'd suggest your problem is the huge dynamic range of the parameters. That gets the solver in trouble.
b = [2;-1.15e21;1.2e-10];
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
