Energy minimisation (CG) at various temperatures


I built a simulation box with fcc aluminium lattice and minimised the energy of the system using conjugate gradient. In this part of the simulation I followed a similar script I found on a different forum for minimisation of a Ni lattice. The minimisation works well, the temperature of the system is about 0 K as desired and the pressure is low as the simulation box is allowed to expand/contract accordingly.

Subsequently, I unfix all previous fix and increase the temperature to 300 K using fix temp/rescape command. This is then unfixed and exactly the same procedure is performed as for 0 K.

Here problems begin. The minimisation converges in 3 steps, but the pressude does not decrease and the lattice parameter does not increase as expected (lattice expansion due to raised temperature).

Also, after the minimisation, when run for 10 000 steps, the temperature would not hold at 300 K but drops and fluctuates, same goes for the pressure.

I cannot attach any files but the minimisation of the imput code is below. Could you, please, give a hint where I am doing things wrong? I also tried using NVT thermostat after switching off NVE, but it never reached the correct temperature Tstop.

Thank you

#--------------------Setting ensemble (NVE)----------------#
fix 1 all nve

#----------------Minimization/Stress relaxation------------#
fix 2 all box/relax iso 0.0
min_style cg
minimize 1e-10 1e-12 10000 100000
run 2000

#--------------------Increase T to 300 K------------------#
unfix 1
unfix 2
fix 3 all temp/rescale 10 300.0 300.0 0.01 1.0
run 1000
unfix 3
fix 4 all nve
fix 5 all box/relax iso 0.0
min_style cg
minimize 1e-10 1e-12 10000 100000
run 10000

Minimization is a 0K procedure. Setting a temperature will assign velocities to atoms, but they will not be changed. That can only happen during an MD run.

At finite temperature it is not possible to have a minimization because there is not a single minimum. Instead there is an ensemble of configurations (atoms with positions and velocities) that has the same total energy. Please have a look at a textbook on statistical mechanics and thermodynamics for further insight.

Temperature and pressure do fluctuate. This is normal. Their fluctuations depends on the compressibility of the system, the potential functions, the timestep and the system size. Again, this is statistical mechanics knowledge that you should gather from the suitable textbooks.

Thank you, I didn’t realise. Is it then possible to perform a simulation at a non-zero temperature and get the temperature to 0 K to perform energy minimisation? Would you use NVT or NPT to decrease the temperature or temp/rescale?

I am familiar with the fact that T and p will fluctuate. The problem is that T fluctuates around a wrong value AND by about 20 % and I found this too off. I will tune the parameters and see

You could do “simulated annealing”, i.e. an MD run with fix nve and remove initially assigned kinetic energy with fix viscous. You can also use a temperature ramp with many thermostats, but you cannot reach exactly 0K. You always need to follow up on that with a regular minimization.

I strongly advise against using fix temp/rescale for anything but initial conditioning of a system. It is unphysical and “brutal” and can cause more problems that it addresses in any simulations that should produce publishable results.

You may also need to consider whether you are computing temperature correctly. The default temperature compute only considers point particles. If you have particles with additional degrees of freedom, you may need to replace it with a different compute instance. Removed degrees of freedom due to constraints are usually counted automatically.

I see, thank you. For initial conditioning, would you have a preference over either fix temp/rescale or velocity all create {T} seed?

Definitely the latter.

1 Like