LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multi peak fitting Error -20041

Solved!
Go to solution

I programmed a multipeak gaussian fit. Its displaying the following error

 

"Error -20041 occurred at NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi:6620001"

 

Possible reason(s):

Analysis: The system of equations cannot be solved because the input matrix is singular.

 

Can someone help me on this?

0 Kudos
Message 1 of 5
(3,699 Views)

There seems to be a lot of unecessary and comvoluted code.

 

(e.g. the flat sequence could probably be replaced by a simple "reshape array", "element" should be an indicator. none of the local variables are needed. Same for the FOR loop at the end)

 

All your array controls are empty. Could you please put reasonable data into the controls (e.g. "A-mu-sigma"), make current values the default, save and attach it again.

Message 2 of 5
(3,690 Views)

The primary problem is the fact that to get the last element, you need to do Index = array size - 1 (first element is index=0!), yor model never sees the offset parameter

0 Kudos
Message 3 of 5
(3,676 Views)
Solution
Accepted by Vijay_Reddy

I cleaned things up a little bit and it all seems to work OK. (might need to tune the peak detector). LabVIEW 2013.

 

0 Kudos
Message 4 of 5
(3,670 Views)

Yes. your programs work great. Thanks. Ya. I need to set a better way of inputting peak parameters but that can always be done interactively. Thanks for correcting and cleaning it.

0 Kudos
Message 5 of 5
(3,633 Views)