fitting a parabola giving unreasonable answer
Show older comments
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 Comments
Image Analyst
on 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
on 11 Apr 2019
What are the four data points, in numeric form?
Michael Phillips
on 11 Apr 2019
Michael Phillips
on 11 Apr 2019
John D'Errico
on 12 Apr 2019
Edited: John D'Errico
on 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];
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with Curve Fitting Toolbox 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!