Fitting energy surfaces


I was trying to get epsilon and sigma from Lennard-jones potential. But I always got negative values. I’m wondering is there a way to restrict the values to positive?
Any help would be greatly appreciated.

If you are fitting epsilon/sigma via combination rules they should already be constrained to be positive. If you are doing this pairwise you could try the “abs” keyword. That said, if your fit is making the values negative then this suggests that you don’t have sufficient data to constrain the parameters properly and so it might point to a deeper problem with your fitting.

Thank your professor Gale for the reply!
By insufficient data, do you mean I don’t have enough structures in my input? So I have a structure with 3 elements and I want to compute lj potential parameters between each one of them and there is energy shift so there are 13 variables.
What I did was changing the lattice vector of the initial structure and got energy through VASP with fixed volume. By doing that I got 13 structures in total. I’m not sure if there is any problems with that.

I meant changing the lattice constant

Fitting energy surfaces from periodic DFT is a tricky business because you are dealing with small energy changes in a large number & so it’s harder to get right than conventional fitting based on the structure & elastic properties etc. Because there is no information about the dissociation limit then it’s easy for the parameters to go strangely wrong. If you can fit the binding energy of the system rather than the raw total energy then things will be much better and removes the need for the energy shift. Also if you are fitting relatively isotropic lattice constant variations then there is nothing to separate the different LJ potentials for different pairs since just a single potential might be able to fit the curve for the nearest neighbours. You need stronger distortions that have a different effect on different pairs if you are going to separate them. Finally there is the problem of choosing weighting factors. If all energies are weighted equally then there will be no emphasis on getting the minimum right over high energy points. Hence you need to increase the weight on places near the equilibrium structure (e.g. using a Boltzmann factor is one choice for setting weights based on the highest temperature you are likely to care about).