Hi, I have two questions about simulated annealing. First, is this the same as the process of annealing?
fix 3 all npt temp 298.15 298.15 100 iso 1.0 1.0 1000
timestep 0.5
run 100000
unfix 3
fix 3 all npt temp 298.15 345.15 100 iso 1.0 1.0 1000
timestep 0.5
run 150000
unfix 3
fix 3 all npt temp 345.15 345.15 100 iso 1.0 1.0 1000
timestep 0.5
run 100000
unfix 3
Second, if I want to continue my simulation, should I use the write_data
command and then use its output to continue my simulation at a different temperature? Alternatively, should I use the write_restart
command and its output file to continue my simulation for temperature annealing?
Likely not. Annealing includes a process of slowly cool down the system, while your input does not. In addition, the rate of temperature change in MD is usually much higher than what is reasonable in real life (due to the limited simulation time), so you can’t really reproduce the annealing in experiments. The “simulated annealing” procedure (heat the system to a high temperature and slowly cool it down) is still useful in MD though, e.g. for finding the energy minimum for a complicated system, but it’s not what you are doing here anyway.
Either could achieve what you want, just organize your input for continuation following the relevant doc pages (especially, note the description in read_restart command — LAMMPS documentation to see how fixes are handled when using restart files).
1 Like
Thank you for your comment; it’s really helpful. I have another question: Do I need to reach equilibrium at each temperature before moving on to the next temperature? Is the same true when I decrease the temperature?
It really depends on what you want to achieve. If you just want a continuous heating/cooling, then there is no need to set any arbitrary intermediate temperature — simply let it change continuously (at a proper rate). If you want to, for example, simulate a real-world heat treatment recipe including staying at an intermediate temperature for a finite time, they you definitely should do so — though as I said above, it’s not really reliable to imitate experiments in this way.
2 Likes