I am trying to make a script to fit 50 files of free energy vs volume using the Birch Murnaghan equation of state. I'm fitting for 3 parameters, emin, v0 and k0. I can't seem to get a loop to work which would loop over each file fitting it and then making 50 new files of the three fitting parameters.
birch(x) = emin + 1.5*v0*k0/1602 * ( 0.75*(1+2*xsi)*(v0/x)**(4.0/3.0) \
-xsi/2*(v0/x)**2 - 3.0/2.0*(1+xsi)*(v0/x)**(2.0/3.0) + 0.5*(xsi+1.5) )
emin=-8
k0=2000
v0=10
xsi=0
do for [n=100:5000:100]{
file = sprintf('free.%.f',n)
fit birch(x) file via emin,v0,k0
A = A.sprintf(%f,emin)
B = B.sprintf(%f,v0)
C = C.sprintf(%f,k0)
}
''' The data is saved in files going free.100 free.200 and so on till free.5000, does anybody know how I could do this I only really want to make a script so I don't have to manually fit all the data
