LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug? strange behaviour of LM nonlinear curve fit VI when used for Lorentzian fit

Hi there,

I am in need for some help in the LM nonlinear curve fitting.

 

I want to do Lorentzian fit to a set of data using the LM nonlinear curve fit VI, and get the optimum peak parameters (peak frequency, peak height and HWHM).

I coded VIs for this task in LabView 2011 environment. Please download the VIs named "LMFitTest.vi" and "Lorentzian.vi", attached to this post below, and run the first one.

As you can see, the LM nonlinear fit VI does not do the job right, giving the fit results far from the optimum.

 

However, if the input data is multiplied by a factor larger than 1e6 (please type in this or a larger value into the control labeled as Scale factor), then the

LM nonlinear fit VI works fine, giving the optimum peak parameters.

 

As you can see in the block diagram of my VI, the input data is simply multiplied by the scale factor, LM fit is performed on it and the results are divided by the

scale factor when being spit out. Nothing more.

 

So my questions are,

1) Is it a normal behavior of the LM nonlinear fit VI? Why does it work only for large input values?

2) What conditions need to be met in order for this VI to work?

 

I spent days to figure out what was wroing with my VI, and finally found that the LM nonlinear fit VI does not work if the input data values are small.

It was a big waste of time. I believe what I am trying to do is a very common task so the answer for this question should be helpful for many other people.

 

Your help on my question is very much appreciated!

 

Download All
0 Kudos
Message 1 of 1
(2,080 Views)