LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Power fit function is not fitting correctly to sub-array controlled by graph cursors?

I am using two cursors on an XY graph to select a subset of the graphed data to fit a power function to. I noticed that the first selection cursor (left-most on the graph) seems to have more control of the amplitude and power of the power fit while the second cursor only seems to limit the "range" of data selected (i.e. does not have much influence over the fit, even though it should).  When comparing the exact same data in excel using a power fit, the excel fits a completely different line.

 

Any help would be much appreciated. (please disregard the local variables in my code, only been at this 3 months) I have attached the VI as well.

 

 

Excel fit:

power fit excel.png

Labview fit.gif

 

 

0 Kudos
Message 1 of 2
(2,502 Views)

Two suggestions.  Change the default parameter bounds.  Specifically, the offset upper and lower limit are both 0, forcing this parameter to be 0.  Change the limits to be Inf for upper limit and -Inf for lower limit.  Also, tighten the tolerance of the fit to be 1E-6 or so.

-Jim

0 Kudos
Message 2 of 2
(2,486 Views)