Second degree polynomial fit

6 visualizaciones (últimos 30 días)
Maarten van Sommeren
Maarten van Sommeren el 22 de Jul. de 2016
Comentada: Star Strider el 25 de Jul. de 2016
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

Respuestas (1)

Star Strider
Star Strider el 22 de Jul. de 2016
Editada: Star Strider el 22 de Jul. de 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 comentarios
Maarten van Sommeren
Maarten van Sommeren el 25 de Jul. de 2016
Thankyou! and if c2 is known, How do I fit the values of c0 and c1 subsequently?
Star Strider
Star Strider el 25 de Jul. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by