polynomial fitting(second degree) [message #70834] |
Mon, 10 May 2010 11:36 |
sid
Messages: 50 Registered: January 1995
|
Member |
|
|
Hi,
I am having wavelength in x axis from say c=(3933.2002 ,...
3933.4724) and intensity in y axis from say d
=(0.085022407,.....0.081581624,.....,0.085993795).
Now I did res=poly_fit(c,d,2)
then, x=(-res(1)/(2*res(2) which should give the site of minimum
value, but instead im getting some very weird answer as 4410.8199. I
calculated y = res(0) + res(1)*x + res(2)*x^2 which should give the
minimum value but it is also obviously weird.
But the same procedure if I proceed with c=dindgen(78)(that is the
number of wavelength values initially in c).
Then if I do res=poly_fit(c,d,2)
then i did x=(-res(1)/(2*res(2) and y = res(0) + res(1)*x +
res(2)*x^2, in this way im getting resonable x and y value.
Why it happens and please help me to get the correct solution, even if
i do the same with the wavelength values.
regards
sid
|
|
|