I'm trying to write code to automatically fit binned simulation data with a Gaussian function, but I'm getting a "Singular matrix in Invert_RtR" error when performing the fit.
I'm currently using gnuplot version 5.0.3 on Windows 8. Code and data are attached below.
Any help / guidance would be much appreciated.
Thanks.
gnuplot code:
resetunsetkeysetxlabel"Time of Flight"setylabel"Counts"A=218.0Mean=3561.978563StdDev=0.008026f(x)=A*exp(-(x-Mean)**2/(2*StdDev**2))setfiterrorvariablesfit[3561.851:3562.008]f(x)"histoTest.txt"u1:2:3yerrorviaA,Mean,StdDevplot"histoTest.txt"u1:2:3wyerrorbars,f(x)
Contents of my data file (please note, the error values are the square root of the counts, but when this would be 0, I chose a value of 0.0001 to try to avoid issues):
Hello,
I'm trying to write code to automatically fit binned simulation data with a Gaussian function, but I'm getting a "Singular matrix in Invert_RtR" error when performing the fit.
I'm currently using gnuplot version 5.0.3 on Windows 8. Code and data are attached below.
Any help / guidance would be much appreciated.
Thanks.
gnuplot code:
Contents of my data file (please note, the error values are the square root of the counts, but when this would be 0, I chose a value of 0.0001 to try to avoid issues):