Second degree polynomial fit
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi everyone,
R = c0-c1*(Tp)+c2*(Tp)^2,
I have a second degree polynomial function, where I have to fit the three constants (c0,c1,c2) The values for R and Tp are fixed, where R=998.9 and Tp=24.0 Can anyone help me out with this problem?
Regards,
Marc
0 Commenti
Risposte (1)
Star Strider
il 22 Lug 2016
Modificato: Star Strider
il 22 Lug 2016
You have one equation in three unknowns, so there are an infinity of solutions. The solution you get depends on your initial parameter estimates:
R=998.9;
Tp=24.0;
f = @(c) c(1) - c(2).*Tp + c(3).*Tp^2 - R;
C0 = [1; 1; 1];
C = fsolve(f, C0)
One set of solutions with this ‘C0’:
C =
1.0013
0.9678
1.7728
8 Commenti
Star Strider
il 25 Lug 2016
My pleasure!
With only one value of ‘Tp’, regardless of the number of ‘R’ values you have, they are arbitrary. Choose a value for ‘c0’, then:
c1 = c0/Tp;
Since you’ve already calculated ‘c2’ from ‘Tp’ and ‘R’, neglecting ‘c0’ and ‘c1’ (assuming they are negligible), the remaining terms have to equate to 0.
Vedere anche
Categorie
Scopri di più su Get Started with Curve Fitting Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!