02-28-2013 12:23 PM
Hi there,
I have been stuck for a while now by an error occurring when I use the Nonlinear curve fit LM Bound with a VI as the curve fit model. The error code is -20003 and occurs at the "LM get new coefficients" vi and the analysis says "The number of samples must be > 0". I checked a number of things but I can't get rid of it. The VI is pretty simple: it uses a data base of three arrays of numbers (or spectra) and it aims at fitting a curve that is the sum of those three spectra in order to determine the multiplicative coefficient associated to each spectrum. The code is joined to this message, thank you very much for any input!
Solved! Go to Solution.
03-01-2013 08:35 AM
Hi Jeraud,
I found these forums with similar issue:
http://forums.ni.com/t5/LabVIEW/constrained-lm-fit-having-problem/td-p/902909
http://forums.ni.com/t5/LabVIEW/Levenberg-Marquardt-curve-fitting-pt-2/td-p/582187
Please take a look to them.
Best,
Carmen C.
03-01-2013 11:19 AM
Thank you for your input, I went through those topics and tried a few modifications, but still the same error. I tried to replace the constrained nonlinear curve fit VI by the nonlinear curve fit VI and it gives the same error. I checked the size of the f(X,a) array and it is the same as the size of my input array. I could not find an example where actual data (in opposition to a mathematical model) where used as an input to the curve fit model. This VI simply aims at scaling the amplitude of stored traces to match the input array. All the data are included in the previously attached code so one can test the VI easily. Thank you for your help! 🙂
03-04-2013 08:17 AM
Looks like your model function has default data stored in the f'(x,a) output. Try emptying that array (make sure to 'save as default' after emptying) and rerun. This solved the problem on my machine.
Aside from that specific error, it looks like your model is linear in the molecule spectra, so perhaps using General Linear Fit.vi is a better match for your problem? Both algorithms yield the same results on my machine.
-Jim
03-04-2013 05:39 PM
Thanks a lot Jim, that was indeed the cause of my problem, I thought f'(x,a) was empty.