Well, I plugged
your xls data into my version of the code and I agree the fit is not great. It seems that a 2D polynomial without cross terms is insufficient to describe your data. Your model is not appropriate.
The attached adaptdation (LabVIEW 6.1) compares a 2D fit (default poly order 4) with 5 simple 1D polynomial fits, one for each slice. As you can see, each slice needs different coefficients and the fits are pretty good. There is no global set of coefficients that can fit all at once in 2D very well.
I did not bother to reshape the inputs and outputs to 2D, it is irrelevant for the fit. Also the order of points should be irrelevant for this algorithm.
Let me know if this makes sense.
🙂If you just need interpolated data (no formula) for anywhere on the 2D space, you could do it in two steps. First interpolate each slice as above, pick the interpolated value of each slice at the desired position, then do a second polynomial fit in the second dimension.