LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems about the nonlinear least squares

My job is to fit a nonlinear curve,which model is I=f(a,u).Then I use the least squares to solve this fuction. I need to export the coefficient arrays a and the curve of I=f(a,u).
I have been putting all my energy to this for days ,but the problem is that the fitted coefficients are not export on the indicator!! I really don't know the reason after debugging many times .Any man can help me solve this problem ?
I have attached my BYSJ.vi,you can run this and help me find the problem,thanks very much,

you can mail me to zhang_qing_hui@yahoo.com.cn
I am from China ,so my English is a little poor .I hope you can understand what I have said.
As a man you should be ....
0 Kudos
Message 1 of 16
(3,786 Views)
Please save your VI as Development Distribution (file...save with options) and make als sure that all subVIs (e.g. the model function) are included. Currently, all the relevant subVIs are missing so we cannot tell what is happening.
0 Kudos
Message 2 of 16
(3,776 Views)
sorry it is mid night here ,so i am a little confused, i have attached the Sub vi already
As a man you should be ....
0 Kudos
Message 3 of 16
(3,772 Views)
The information is not suffient to troubleshoot the problem.

The best guess values are generated by the lev-mar VI and there are many possible problems but we cannot tell because the VIs are missing. The function alone cannot tell us much. What is the error code output?
Message 4 of 16
(3,762 Views)
the error code is :-20003.I have referred to the help which says that the #samples >0,but we have assumed it >0.
do you use msn ? my id is :refresh508@msn.com
As a man you should be ....
0 Kudos
Message 5 of 16
(3,758 Views)
I substituted an old Xufit that I had laying around and I get error -20041 which means that alpha is singular. Are there some wires missing in your fit subVI?
Message 6 of 16
(3,752 Views)
The error is probably because the X and Y array have not the same number of elements. The X array fed in the curve fitting function is in fact the X&dX array. Most likely a wiring error...

CC
Chilly Charly    (aka CC)
0 Kudos
Message 7 of 16
(3,750 Views)
yeah, you are right .there is something wrong with my subvi and the wired line to the X,the port on the "nonlinear fit" should be connected to the X instead of x and dx array(i think),thank you very much for your help. could we make friends ?
my name is zhang qinghui
As a man you should be ....
0 Kudos
Message 8 of 16
(3,622 Views)

@chilly charly wrote:
The error is probably because the X and Y array have not the same number of elements. CC


Sorry CC, but I wrote that XuFit VI myself and this is not the problem. The only thing matters is the size of the y-input and a model VI that knows how to deinterlace the x-values. The output of the model function has equal lenght to the y-input. That's all that matters.

In this particular case, we can give the Function as y(t)=f(x(t),dx(t)). For mode details, see my fully working demod in this old thread..

Refresh508, you might want to discuss this with Xuelang8, you seem to be working on the same problem. 🙂
Message 9 of 16
(3,735 Views)
Altenbach
Of course you are right, I could have verified my hypothesis on a standard LMvi. Ben is right, I'm a distinguished member of NI Hall-of-Shame...

CC
Chilly Charly    (aka CC)
0 Kudos
Message 10 of 16
(3,729 Views)