fitting a parabola giving unreasonable answer
Ältere Kommentare anzeigen
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 Kommentare
Image Analyst
am 11 Apr. 2019
Attach your script. Also, what is the sum of your residuals (fitted values minus training values) at the 4 points?
Walter Roberson
am 11 Apr. 2019
What are the four data points, in numeric form?
Michael Phillips
am 11 Apr. 2019
Michael Phillips
am 11 Apr. 2019
John D'Errico
am 12 Apr. 2019
Bearbeitet: John D'Errico
am 12 Apr. 2019
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];
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
