Here is how you can store a min (or max) value of some quantity over the course of a simulation run. Then use that value at the end of the run. In this case, the "value" is the temperature and is stored in a variable "t". But it could be any other value that the variable calculated. The min value is stored in a variable "tmin", but could also be the max value, if you switch "<" to ">". Think of these lines as replacing a single line like "run 1000" in your script. variable t equal temp variable tmin equal 10000 run 1000 pre no post no every 10 & "if '\$t < \${tmin}' then 'variable tmin equal \$t'" print "Tmin = \${tmin}" Note the use of nested quotation marks, which is needed to satisfy the syntax of the run every and if commands. This example samples the temperature every 10 steps. The "pre no post no" options prevent lots of output between the short 10-step runs. They also prevent reneighboring at the start of each run, which is OK to do, but would slow things down and would also generate a different trajectory over long timescales, due to re-ordering of the atoms. This series of short runs should be identical to a single long run. This example simply prints the min temperature after the run is complete, but you could do something else, like an if test on the value to determine if you want to continue with another run. You could also use this logic in a loop, instead of in a run every command: variable t equal temp variable tmin equal 10000 variable i loop 100 label loop run 10 pre no post no if "\$t < \${tmin}" then "variable tmin equal \$t" next i jump SELF loop print "Tmin = \${tmin}"