ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nonlinear Curve Fitting with string formula

Solved!
Go to solution

Dear Forum Members,

 

I am working on a nonlinear curve fitting vi using formula string. The fitting formula is quite simple (Y0+A*(X-X0)^1.5). I can provide Y0 and X0 values for initial parameters quite good (from graph) but initial value of A, is a rough guess. The fit turns out well, but it doesn't iterate the initial parameter "A" at all. Rather it iterates X0 and Y0 parameters and returns the same value of A, as mentioned in initial parameters.

 

The vi and a set of data is attached. The best fit parameters I found from Origin Software are A=11310, X0=0 & Y0= -4e-6. With this as initial parameters one can get perfect fit. But if one changes the initial parameter "A" value to 14000, it still returns good fit, but retuns the same value for A in best fit parameters.

 

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

0 Kudos
Message 1 of 3
(4,937 Views)
Solution
Accepted by topic author Nav21

Dear Nav21,

 

I looked at your VI. If you set the tolerance in the termination cluster to a lover value (1e-14 for example), the resulting 'A' will be different, closer to your optimal value.

 

Daniel

Dániel Fülöp
Field Application Engineer (CLA, CTA)
National Instruments
Message 2 of 3
(4,883 Views)

Dear Daniel,

 

Thanks..it did help.

 

Best,

 

 

0 Kudos
Message 3 of 3
(4,862 Views)