LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

non linear curve fitting from lvm file

Hi,

 

I am currently trying to get the fitting equation from a set of data (x and y) in lvm file. I am using the curve fitting vi under mathematics > fitting.

I am using the nonlinear fitting function of this vi and the equation is as follow:

 

y = a-0.15*2-b/x-c*x+d*ln(x)+e*ln(1-x)

 

however whenever i try to run the program, it shows an error pointing to the curve fitting vi stating this:

 

Analysis:  Input parameters has at least one element that is Inf, NaN, DBL_MAX, or DBL_MIN

 

what could be the problem?

 

Regards,

 

atoz

0 Kudos
Message 1 of 6
(3,257 Views)

Hard to tell from the information given.

 

Can you attach your VI?

 

Is one of the x values zero? You have a division by x, so that would result into a NaN.

Do you use reasonable guesses for the 5 parameters?

0 Kudos
Message 2 of 6
(3,251 Views)

Thanks for the quick response. This attachment are the vi and the lvm file from measurement i have. I do not have a point which is exactly zero. I am not too sure about the initial guess as well.

 

Regards,

 

atoz

Download All
0 Kudos
Message 3 of 6
(3,247 Views)

 

  • Well, the last value is x=0, so 1/x will fail.
  • A lot of points at the beginning are x>1, so ln(1-x) will be undefined too.

 

 

I haven't looked in detail at your function, but it seems insufficient to describe the data. Can you point me to a website describing the model in more detail?

0 Kudos
Message 4 of 6
(3,240 Views)

Thanks for the reply.

 

Actually the function is taken from a research paper on a Kalman Filter for battery state-of-charge estimation. it is describing the battery terminal voltage interm of the state-of-charge.

 

Regards,

 

atoz

0 Kudos
Message 5 of 6
(3,233 Views)

Do you have a link to the research paper?

0 Kudos
Message 6 of 6
(3,210 Views)