From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unjustified 'syntax error of parser' message (-23001) when fitting 2 Lorentz profiles and polynomial baseline

Dear all,

 

I am fitting 2 Lorentzian profiles and a polynomial baseline to an array of data. I have attached my program and the initial data set.

 

I do not understand why I get a 'syntax error of parser message' when the program is run. To check the fitted formula is correct I have plotted the curve on the data set and it works fine, so I cannot see how the error is justified.

 

To run the program open and press run. The white curve displayed is the data set to which I would like to fit. The green curve is the simulation curve used to create good initial coefficients for the fit. When the 'fit?' button is selected a red curve should appear fitting the white data more accurately than the green curve does. However I get the above mentioned error.

 

Could someone advise me on how to fix this please? I'm new to Labview and would be very grateful. I also apologise if my program is a mess!

 

Doug

Download All
0 Kudos
Message 1 of 5
(3,373 Views)

After your variables (a1, a2, a, b, and c) there are 7 empty strings in the array. Are those supposed to be there? After removing them, you then get the following error message:

 

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

Possible reason(s):

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

Message 2 of 5
(3,362 Views)

By the way, after removing the empty strings, the function does succeed in calculating the best fit coefficients. Error -20041 does not occur until the function attempts to calculate the covariance, which you are not using anyways.

Message 3 of 5
(3,358 Views)

Thank you dbohls. Your suggestion has certainly allowed Labview to fit to my data. However the fitted function does not find the best solution for the first initial coefficient.

 

In fact it finds a solution for a1 = 0 and displays the best fit coefficient a1 the same as its initial value.

 

What can I do to make the fit work properly?

 

Thanks!

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

can anyone help with this next problem?

 

Thanks!

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