Is it Possible to Specify General Polynomial Fit Coefficient Value?

Updated Dec 31, 2024

Reported In

Software

  • LabVIEW

Issue Details

  • I am using General Polynomial Fit in LabVIEW to fit cubic polynomial. Is it possible to fit ax3+bx2+cx+d, where the value for a will always be positive?
  • Is it possible to use LabVIEW to fit only the first degree and third degree of polynomial, ax3+cx?

Solution

It is possible to achieve these by utilizing the Coefficient Constraint of the General Polynomial Fit.vi. However, by utilizing the Coefficient Constraint input, instead of making the value a to be always positive, you can set the value a to a specific value.

 

Using the Regression Solver.vi sample program which can be searched using NI Example Finder in LabVIEW as an example, you can set the value a to a fixed value by setting the order to 3 and enter a positive value to coefficient. By clicking Run, you can see that the value of a at the Equation of fit will be a positive value that you had entered.

 

regression solver front panel a positive.png

 

You can also utilize the Coefficient Constraint input to only fit first-order and third-order polynomial, ax3+cx. To achieve this, you need to configure the order of the Coefficient Constraint for both 0 order and 2 order to 0. 

 

regression solver front panel 1st and 3rd order.png