I am trying to fit some data using gnuplot.
Here is the data (variables h, k,l and I):
#h k l I
2 1 1 7807
2 2 0 9664
3 2 1 6042
4 0 0 1394
3 3 2 1358
4 2 0 4896
### Function
I(h,k,l) = M * (F * ( (sin(A*pi*sqrt(h*h+k*k+l*l)*L))/(A*2*pi*sqrt(h*h+k*k+l*l)) ))^2
### Initial values
M=1
F=0.5
A=1
L=1
### Fitting
fit I(h,k,l) "cavendish.data" using 1:2:3 via M, F, A, L
I want to determine the constants M,F,A and L from this fitting.
When I run this code I get message undefined variable: h
How can I could determine the variables. Thanks in advance.
usingstatement. And your initial values seem to be way off, the fit converges far away on something that does not look very cystallographic. ;-)