LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem non-linear curve fit:Lev-Mar

Solved!
Go to solution

Hello, I am trying to use lev-mar to fit my data. I think lev-mar is suitable for my non-linear data of diode I-V curve. How can I connect the input of the lev-mar VI? what should I put in the data/ initial parameters/ covarience? I have seen examples in the labview , but still can't find the solution. 

 

 

0 Kudos
Message 1 of 7
(4,329 Views)
Solution
Accepted by topic author aidasaufi
Suggest you to start here: Introduction to Curve Fitting http://www.ni.com/white-paper/7669/en/
Thanks
uday
Message 2 of 7
(4,320 Views)
Solution
Accepted by topic author aidasaufi

Hello, thanks! I have fixed the connection. But the fitted curve doesn't plot. As the i-v curve  only nonlinear at first until 2.5V (refer to the graph) , right after 2.5 V it increases drastically (start to linearly increase). I wonder if this Lev-Mar method is suitable for my data. Kindly assist me. 

Download All
0 Kudos
Message 3 of 7
(4,278 Views)
Solution
Accepted by topic author aidasaufi

When you do "curve-fitting", what you generally are trying to do is to come up with a "rule" (which I will call a "function") that will provide a description of a set of data over some finite range.  This function generally approximates the data points, largely because it has far fewer free parameters (often 2-5) than there are data points (often 20-1000).  Indeed, if you have as many parameters as there are points, you can create a function that will pass through all of the points (though it will probably wiggle wildly between the points).

 

The choice of the function is a key step in any curve-fitting routine.  For example, if I wanted to fit a function to the distribution of heights for all of the undergraduates at the University of North Oshkosh, I should probably not use a simple polynomial, but rather a Gaussian, a two-parameter function involving exponentials.

 

What function did you choose for your I-V curve?

 

Bob Schor

Message 4 of 7
(4,255 Views)
Solution
Accepted by topic author aidasaufi

We do not know why we do not know what does not work we do not know with what. (attach VIs, data you try to fit, specify function you want to use and parameter ranges you might have).

General considerations.

Your task can be solved using this method. How efficient and universal will it be, depends on your description of the model (vi or formula string).

For all fits initial guess is crucial.

For lev-mar you specify vi that calculates residue based on input parameters and data you want to fit. Help: "Use the VI template located at labview\vi.lib\gmath\NumericalOptimization\LM model function and gradient.vit to create the VI from a template".

You have to limit parameters inside your vi: for wrong parameter values it should at least generate huge residue.

 

0 Kudos
Message 5 of 7
(4,230 Views)
Solution
Accepted by topic author aidasaufi

It is completely pointless to show us broken code images. I also don't recognize the fitting function in your third image (with the L-M on the icon). Where is it in the palette? (I've seen it before, but dont quite remember where).

 

Please attach a simplfied version of your VI and model (code, no image!) and some typical data. I guarantee you that we will be able to fit it once the model is correctly implemented and the starting values are reasonable. Did you ever try to graph the model function with your initial guess parameters? How similar does it look to your data?

Message 6 of 7
(4,210 Views)

Sorry for late reply, the paper really helps me a lot! Thank you 🙂

 

0 Kudos
Message 7 of 7
(4,135 Views)