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.
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.
05-16-2011 08:52 AM
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
05-16-2011 09:44 AM
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.
05-16-2011 09:57 AM
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.
05-16-2011 10:54 AM
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!
05-17-2011 04:49 AM
can anyone help with this next problem?
Thanks!