From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-17-2014 07:22 AM
Dear all,
my Levenberg-Marquardt fit works perfectly, but one iteration takes quite long, ca. 5 seconds, as expected from my problem's complexity (~50 fit parameters).
Question: How can I display the current interation count in the main program, for the user to know that it is still going on?
(My workaround until now is to set a probe within the provided Levenberg-Marquardt subroutine on that "i" that is the current interation. But this is not user-friendly.)
Thanks & best regards!
Peter, LMU München, Germany
Solved! Go to Solution.
10-17-2014 08:58 AM
You can use your model VI to increment a count that is displayed elsewhere. If your model function computes partial derivatives, then there will be one model VI call per LM iteration plus 1 for the initial guess. If you are not computing the partial derivatives then LM uses the central difference method to compute them. This means 3 function calls per LM iteration, plus 3 for the initial guess.
-Jim
10-17-2014 09:12 AM
great idea, thanks!
Peter
10-17-2014 09:53 AM
Sometimes it is useful to see more than just the iteration count and there are plenty of methods to do that.
I would recommend to do the partial derivatives inside the model to limit the number of display updates since there are fewer model calls. This makes the relative overhead of displaying the fit progress smaller. It also potentially allows you do parallelize the computation of the partial derivatives for a great speedup, typically on the order of the number of CPU cores. I have a 16 core dual xeon and it is 17x faster when the code is parallelized. (some details are described here).