How can I fit data to a Lennard-Jones potential in Gnuplot?

38 Views Asked by At

I'm trying to perform a fit in Gnuplot for the following dataset, using the Lennard-Jones potential formula according to the corresponding data:

1    20.6711
1.1  12.8327
1.2  6.70081
1.3  2.56984
1.4  -0.0348628
1.5  -1.50733
1.6  -2.21619
1.7  -2.41084
1.8  -2.29524
1.9  -2.02128
2    -1.76153
2.1  -1.47329
2.2  -1.21735
2.3  -0.986853
2.4  -0.786588
2.5  -0.602345
2.6  -0.442397
2.7  -0.314293
2.8  -0.208958
2.9  -0.121526
3    -0.16448
4    -0.0488864
5    0
6    0.0207913
7    0.0275973
8    0.186272
9    0.0402228
10   0.0421324

enter image description here

I tried the following but it does not give me the expected values for sigma and epsilon.

f(x) = (4*epsilon) * ( (sigma/(x))**12 - (sigma/(x))**6  )
set fit brief nolog
fit f(x) "data" u 1:2 via sigma,epsilon
plot f(x) lw 3 lc "blue"

The calculation of the parameters should yield that Epsilon equals 2.43 and Sigma equals 1.39, as can be seen in the graph.

Could anyone provide guidance on how to perform this fit in Gnuplot, or perhaps suggest an alternative approach? Any help or insights would be greatly appreciated.

Thank you!

0

There are 0 best solutions below