LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nonlinear Curve Fitting with string formula error out -29083

Solved!
Go to solution

Dear Forum Members,

 

I am working on a nonlinear curve fitting vi using formula string. i just want to get the fitting value of a and b through the formula y=a*(x-b)^1.5. But I can only get error with code -23083, when i run it.

 

The vi and a set of data is attached. I found if i choose any integer exponent instead of 1.5. The vi will run successfully. 

 

I am wondering if I am doing something wrong. Can someone have quick look at my vi??

 

regards

Download All
0 Kudos
Message 1 of 9
(3,434 Views)

Note to anyone in the U.S. who tests this VI. The text file uses comma as decimal point.  You may need to change the format on Read from Spreadsheet File.vi to %,;%.3f

 

 

According to the detailed help for the curve fitting VI, the operator for exponentiation is ** not ^ but making that change generates an error.  Strange.

 

Your data may also be an issue. Some of the data points are in the X < 0, Y < 0 quadrant. Depending on the value of b, (x-b)^1.6 may not be a valid expression. I think that may be where some of the errors are happening.

 

Lynn

0 Kudos
Message 2 of 9
(3,391 Views)

@johnsold wrote:

According to the detailed help for the curve fitting VI, the operator for exponentiation is ** not ^ but making that change generates an error.  Strange.

 


there are differences between the parser and formula node and ^ is correct here for exponentiation (see here). (even the example on the help page shows a ^).

 

0 Kudos
Message 3 of 9
(3,374 Views)

As a first step, graph the data and graph the model as a function of the best guess parameters (you can get the parser model from within the fitting VI, just get the strictly typed VI reference and use call by reference node).

 

It seems that most of the noise in your data is in X, is this correct?

0 Kudos
Message 4 of 9
(3,358 Views)
Solution
Accepted by topic author Jing89

OK, your model is insufficient to fit the data. You need either shift the y data by 2 or add an offset term to the model.

 

Here's a quick draft. Modify as needed.

 

Download All
0 Kudos
Message 5 of 9
(3,347 Views)

That information does not appear in the files linked from the Nonlinear Curve Fit VI detailed help. The inability to use two-argument functions is also not documented in the detailed help.

 

 

If you start a help search from "parser" you get to the info altenbach linked. If you start from the Context Help Detailed Help link for Nonlinear Curve Fit.vi, you will never find that information.

 

The information on the Formula Node and Expression Node Functions page is wrong, or at least worded in such a manner as to be quite misleading. It specifically states that the functions "except for the binary functions" can be used with Nonlinear Curve Fit.vi.  Maybe a mathematician would realize that functions with two arguments are called binary functions.  When I saw that term, I assumed they were talking about boolean functions or something like sign(x).

 

At the very least this appears to be a significant documentation omission, if not a bug.

 

Lynn

Message 6 of 9
(3,329 Views)
I agree that there is a serious problem with the help. I thought that was once correct in the past. (?)

I'll try to bring it up elsewhere...
0 Kudos
Message 7 of 9
(3,317 Views)

thank u all very much

0 Kudos
Message 8 of 9
(3,292 Views)

All that said, I would recommend to switch to the VI model. It is much more efficient and does not need to deal with obscure formula syntax. Try it!

 

Also fitting typically assumes that the error is mostly in x, but in your case the error seems to be mostly in x.

Maybe you can rewrite the model to fit for x(y) instead of y(x).

0 Kudos
Message 9 of 9
(3,243 Views)