LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

no error with NonLinearFitWithMaxIters even for 1 iteration only...

Solved!
Go to solution

Dear all,

 

today I have tried using the function in the advanced analysis library NonLinearFitWithMaxIters (CVI 9.0).

 

What I wanted to know is if the function found the best fit within the given number of permitted iterations.

 

According to the help, if NonLinearFitWithMaxIters reaches the maximum number of iterations without reaching a solution, it returns an error.

 

So, for an iteration limit of 1 I would expect an error, because after one iteration only I would not expect the fit to have converged. Unfortunately, it does not return an error condition, the return value is always zero (that is, ok).

 

Plotting the function with the resulting fit parameters unambiguously shows that the fit has NOT converged. Still, the function does not tell so - is it a bug or did I miss something?

 

Thanks, Wolfgang

0 Kudos
Message 1 of 5
(4,131 Views)

Hello,

 

I made a test with the given example for CVI for non linear fitting and it generate en error when the function didn't converged.

See the attachement

 

Which parameters, functions are you using?

 

Best regards

Download All
0 Kudos
Message 2 of 5
(4,111 Views)

I have prepared a stripped down version that is able to demonstrate the problem:

 

1) run the program, load the data file by clicking on the file name string, and start the fit with the Start button (with the preset number of 1000 iterations): everything is fine;

2) restart the program, load the same data file, change the number of iterations to 1: the fit does not converge, as is obvious, but it does not return an error; you may try the same with 2 iterations, the result will already be much better, but still not converged, and still without the appropriate erturn value

 

Regards, Wolfgang

0 Kudos
Message 3 of 5
(4,015 Views)
Solution
Accepted by topic author Wolfgang

Hi Wolfgang,

Thanks a lot for reporting this issue.

I've looked at your program. I agree we need to return an error in the situation you've mentioned and we'll fix it in our next release.

Thanks again for your great help to improve our function.

Best wishes,

 

xearthl

0 Kudos
Message 4 of 5
(3,988 Views)
Is there any update as to the status of this?  I have converted a project from CVI 7.1.1 to CVI 9.0.1.  In CVI 7.1.1, when I hit the max iterations, the function returns an error, but also appers to return the best fit it found.  Often, the fit it found is "good enough" to use.  However, in CVI 9.0.1 when I try to fit the same data, not only do I not get an error code from hitting the max iterations, but the fit it returns is nonsense.  If possible, I would like to have the old CVI 7.1.1 behavior back.  Is there any workarounds in the meantime?
0 Kudos
Message 5 of 5
(3,716 Views)