LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with converting levenberg marquardt fitting program from LV6.1 to LV7

I wrote an application that does Levenberg Marquardt fitting on a measured power spectrum (that should be a lorentzian). In LV6.1 this application worked perfectly. Even if the initial guess coefficients were very different from the actual coefficients, the algorithm would find the right values.
Recently, I started running the application in LV7, and now, the fitting doesn't work anymore. No matter the number of iterations, the found coefficients are always (almost) equal to the guess coefficients and not to the actual coefficients. Even if I set the guess coefficients very close to the actual coefficients, it sticks to the guess coefficients.
Did anyone else have similar problems? Does s
omeone know a solution to this problem?
0 Kudos
Message 1 of 7
(3,018 Views)
In lv6.1 there was already a problem when the numbers were very small.
The error (stopping criterium) is a fixed number somewhere around 10^-6 instead of a percentage of the real numbers !
greetings from the Netherlands
0 Kudos
Message 2 of 7
(3,018 Views)
Albert, thanks for your answer. Which "numbers" do you mean actually? Do you mean that I can solve my problem by first multiplying my data by 10^6 and dividing after fitting?

Regards,

Ruud
0 Kudos
Message 3 of 7
(3,018 Views)
Ruud,

Thank you for contacting National Instruments.

The problem does in fact have to do with the very small values of Y. As you mentioned, the solution is to scale the Y values, perhaps by multiplying them by 10^+8. The following link will take you to a knowledge base article that will give you more information:

http://digital.ni.com/public.nsf/websearch/6F23B120B7A2C585862566F700130A0A?OpenDocument

Hope this helps!

Matthew C
Applications Engineer
National Instruments
Message 4 of 7
(3,018 Views)
Thank you very much! This solution indeed helps! Any idea why I am only having this problem in LV7 and not in LV6.1?

Regards,

Ruud
0 Kudos
Message 5 of 7
(3,018 Views)
Matthew,

Another thing that strikes me is that the actual fitting in LV7 takes *way* longer than in LV6.1. Is that a known thing?

Regards,

Ruud
0 Kudos
Message 6 of 7
(3,018 Views)
Hello Ruud,

I apologize for the delayed response.

I am not aware of the curve fitting taking longer in LabVIEW 7. LV 7
is, however, threaded differently than LV 6.1. This may result in
some differences.

Another thing to consider is that the speed of the curve fitting is
highly dependent on your initial guess coefficients. The more
accurate they are, the faster the fitting will be.

If you have further questions, let me know.

Matthew C
Applications Engineer
National Instruments
0 Kudos
Message 7 of 7
(3,018 Views)