LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Levenberg-Marquardt - termination?

The termination input to the Levenberg-Marquardt VI produces bizarre results.

 

The default max iteration = 200.  Yet will return "no of function calls" output as great than 200.  In other words the max iteration input doesnt seem to work.  Or does it?  Particular input data can hang the program as it searches for a solution (often returning obscene values after a great deal of time). 

 

I need to limit the no of iterations (or time) of the Lev-Mar VI but can't understand how the max iteration input works.

 

Can anyone help?

0 Kudos
Message 1 of 26
(4,448 Views)
What you specify in the termination is the number of iterations for the fit routine.  The value which is returned is the number of function calls which can happen several times per iteration.
0 Kudos
Message 2 of 26
(4,428 Views)
What I have to say may or may not help. I'm sorry if it doesn't. Darin is right. But it also sounds like you have a badly defined problem. L-M is pretty robust but it can thrash around and get lost if it is in the middle of a more-or-less flat region. I think you should examine the function you are optimizing more closely and try to come up with a better initial guess.
0 Kudos
Message 3 of 26
(4,417 Views)

How can I ensure accuracy for my test data (high number of iterations) yet get the Lev-Mar algorithm to terminate after a certain time (sometimes it seems to freeze)?

 

Is there a while loop I need to Stop?

0 Kudos
Message 4 of 26
(4,383 Views)
If you look on the BD of the Nonlinear Curve FIT LM.vi you see that the termination cluster feeds into a Bundle By Name node with a cluster constant.  The last value in the constant (-1) is the maximum time in sec, if you set that to a value greater than 0 it adds a time limit to the fitting routine.
0 Kudos
Message 5 of 26
(4,375 Views)

Thanks but the Non-Linear Curve Fit VI is a clone (re-entrant).  You can modify and you can't Save then modify.

 

Any ideas?

0 Kudos
Message 6 of 26
(4,371 Views)

Ok I opened it fom disk in the vi.lib.  It allows you to Save the changes (i.e. permanently altering the original on disk) but not save a new version to the Project and then modify it.  This seems like not a good thing to do..

 

Suggestions?

0 Kudos
Message 7 of 26
(4,370 Views)

I wouldnt mess with the VI's in vi.lib

 

If you want to modify the code either "save as" to a location outside of vi.lib andalter the name to *_mod.vi etc.  Or copy the actual code (Ctrl A) and paste it into a completely new vi.

 

Craig

LabVIEW 2012
0 Kudos
Message 8 of 26
(4,366 Views)

I can't get the Non-Linear Curve Fit LM.VI to terminate after an elapsed period (5 seconds).

 

I opened the VI.lib and changed the constant in the Cluster (see image) to 5.

 

The VI doesn't stop executing (I can't even tell which part of it is still operating) for a set of data it cannot solve.

 

Please help.

 

Nonlinear Curve Fit LM_Terminate after 5sec.png

0 Kudos
Message 9 of 26
(4,338 Views)

How to get the Non-Linear Curve Fit LM.VI to terminate after an elapsed period (5 seconds)?

0 Kudos
Message 10 of 26
(4,305 Views)