LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

User defined high degree polynomial fit (surface fitting)

Solved!
Go to solution

Thank you very much,this method is good for showing the result .

here i met a big problem about the coefficients ,i typed the same value into the polynomial ,and got the result "Z" ,but i really can not understand that there is different value between the best  fit  result 。

0 Kudos
Message 11 of 15
(1,099 Views)

Looking at the formula, the coefficients c10, c11, c12 are defined slightly differently. Mine are pure and only depend on x and y, while in your case they also depend on c0..c6. It seems ill advised to mix these terms and that's why I changed it. If some coefficients depend on other coefficient, the problem cannot be solved this way.

 

Do you have a publication that describes the theory behind all this? Are you sure your formula is correct?

0 Kudos
Message 12 of 15
(1,087 Views)

Here I quickly modified your formula so it agrees with the graphical code. Now the results are the same between the two methods (there will probably be slight binary differences due to DBL limitations and operation reordering).

 

 

0 Kudos
Message 13 of 15
(1,084 Views)

thank you very much ,i got  it ,it looks a little bit complicated to get the surface from the raw data directly ,especially when your raw data just one X -one Y -one Z .:)

thanks again for your great help

0 Kudos
Message 14 of 15
(1,071 Views)

That's why I generate a grid of equally spaced x and y values. Now the z values based on the best fit can just be generated with a simple matrix multiplication.

 You can wrap it all into a subVI. (xmi, xmax, ymin, ymax, # of grid lines >> surface)

 

My version is not complicated, only yours is! So don't use a formula node all all that complicated stuff that is hard to debug.

0 Kudos
Message 15 of 15
(1,067 Views)