fitting a parabola giving unreasonable answer
Afficher commentaires plus anciens
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 commentaires
Image Analyst
le 11 Avr 2019
Attach your script. Also, what is the sum of your residuals (fitted values minus training values) at the 4 points?
Walter Roberson
le 11 Avr 2019
What are the four data points, in numeric form?
Michael Phillips
le 11 Avr 2019
Michael Phillips
le 11 Avr 2019
John D'Errico
le 12 Avr 2019
Modifié(e) : John D'Errico
le 12 Avr 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];
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox 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!
