Adjust shift while fitting to ab initio energies

Hello everyone,

I’m using GULP to fit a Lennard-Jones potential based on some dimers that were previously calculated with DFT.
I have prepared the input and everything seems to work, however, I’m not able to set the energy shift to be adjusted.

From example22, I should add


just before setting the LJ parameters.
However, when I run GULP, only 4 parameters are fitted (the epsilons and sigmas of my 2 species):

Number of variables = 4
Number of observables = 592

I tried looking for the “vary” command in help, but the command is not found.
From the “shift” entry, I guess “vary” is an alternative to “variables”, so I tried replacing “vary” with “variables”, but had no luck.

How can I fit the shift in order to get better fittings of the LJ parameters?


Hi Henrique,
If you can post a (cut-down) version of your input this would help to identify where the problem is since it may depend on where you’ve added the command relative to where the shift is specified (the variable/shift/end has to come after the shift has been specified).

Hi Julian,

Thank you for replying so quickly.

Indeed, the problem was that I did not include a shift in the initial configuration (that is carried to all subsequent configurations).
Therefore, GULP did not have an initial guess and did not fit the shift.
I think I may have missed that it is necessary to add an initial value in the documentation (even though it makes total sense).

I’m not sure I should open another thread, but I have another question.
Is there a way to set a minimum and maximum value for a parameter during the fit process?
While fitting, one of the epsilons of the LJ potential is going to zero, and I would like to fit it with a constraint.

Thanks again,

Hi Henrique,
Apologies that it wasn’t made clear that the shift needs to be non-zero. I’ll think about whether things can be changed so that vary shift causes a shift to be applied where none is present in future.
For the fitting parameters, there isn’t currently a way to specify a minimum/maximum. Usually when the parameters go unphysical it indicates that the model isn’t quite right or that the problem is under determined (i.e. more fitting observables are needed that help fix the variables). Often the C6 part of LJ (assuming you are using that form) is not very sensitive to things since it’s a background cohesive contribution that is relatively uniform. Therefore it’s usually best to fix this part using physically sensible values & only fit the repulsion which is much more sensitive to most observables.