LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

non linear curve fitting

Hi
I am using Labview 8.5 to capture data form VNA. I need to do the Curve Fitting On the obtained data.
I am using the nonlinear Curve fitting function at the moment but when I run the  VI it gives me an error.
I was wondering to see if someone can help me on that.
 
Thanks
0 Kudos
Message 1 of 16
(4,277 Views)

We cannot help without more information.

  1. What kind of error? (error popup, incorrect result, labview crash, cannot find a solution, ...?)
  2. What is the model you are trying to fit?
  3. How many parameters?
  4. Do you provide the correct number of initial parameter estimates?
  5. Are you using the fitting express VI or the plain nonlinear fit?
  6. VI model or formula model?
  7. Show us some code!

😄

... and what is VNA???



Message Edited by altenbach on 02-28-2008 10:58 AM
0 Kudos
Message 2 of 16
(4,259 Views)
Thanks for your quick response.
 
1. The Error is: 23026 occured at maximum iterations exceeded
                     possible reason(s):
                     Analysis: No optimum Found
 
2. the model is      a1/(1+4*((x-a2)/a3)^2) which is the lorentzian curve.
3.   3 parameters
4. yes, I do.
5. I am using the non linear curve fitting function which is availbe in the Mathematics Library.
 
VNA is vector network analyser the measurement eqipment that I am using for my project. it gives me the waveform of S21 against frequency.
and the 3 parameters are the resonator parameters which are Quality factor, resonant frequency and insertion loss.
 
The code That I have written is attached.
I would be really gratefull if you could help me on that.
 
Thanks
 
0 Kudos
Message 3 of 16
(4,229 Views)
Debugging this will be easier if you provide some data, since we don't have the instrument. Your VI writes the X and Y data to file. How about uploading that data?
0 Kudos
Message 4 of 16
(4,220 Views)
Hi
 
Here are the data files, one for x and the other for y
 
thanks
Download All
0 Kudos
Message 5 of 16
(4,213 Views)

Because the first bit of the program is trying to capture data from VNA and then it does the fitting, I think it is better to make those parts disabled and try to do the fitting on the data Files that I have already attached.

 

If you do not have time to do that I will do it post it in 1 or 2 hours, because I do not have access to labview now.

 

Thanks

0 Kudos
Message 6 of 16
(4,212 Views)

OK, with a few minor tweaks if fits just fine. 🙂

  1. Make sure that the estimates are reasonable, e.g. a1=small negative, a2 near  xmin,  a3 similar to the xwidth.
  2. Your data is not very well balanced, so you need to increase the tolerance to e.g. 1e-16.




Message Edited by altenbach on 02-29-2008 09:37 AM
Download All
0 Kudos
Message 7 of 16
(4,198 Views)
Also make sure you save with enough significant digits. Your Y data is highly truncated.
 
Save it with at least 6 digits of precision.
0 Kudos
Message 8 of 16
(4,177 Views)
Hi,
 

Sorry, I attached a wrong file.  I have two sets of data for y one of them is used for linear fitting the other for non linear.

This time I have attached the correct one.

 

The fitting still does not work.

Could you have a look at the code again?

 

Thanks

 

Download All
0 Kudos
Message 9 of 16
(4,153 Views)

Smiley SadHi

Have a look at the imgae of fitting that I captured.

 

0 Kudos
Message 10 of 16
(4,152 Views)