From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.


Showing results for 
Search instead for 
Did you mean: 

User defined high degree polynomial fit (surface fitting)

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

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

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

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

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