# Temperature raise in Gromacs run

**URL:** <https://gromacs.bioexcel.eu/t/temperature-raise-in-gromacs-run/10500>\
**Category:** User discussions\
**Tags:** mdp-parameters\
**Created:** [November 7, 2024, 11:32am UTC](https://gromacs.bioexcel.eu/t/temperature-raise-in-gromacs-run/10500 "2024-11-07T11:32:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priscilla](https://avatars.discourse-cdn.com/v4/letter/p/5f9b8f/32.png) [@Priscilla](https://gromacs.bioexcel.eu/u/Priscilla)\
**Post date:** [November 7, 2024, 11:32am UTC](https://gromacs.bioexcel.eu/t/temperature-raise-in-gromacs-run/10500/1 "2024-11-07T11:32:24Z")

</div>

Hi,

I want to raise the temperature of a Polystyrebe melt systen that has run for 1000ns in 500K to 800K.Below is the gro.mdp I used to raise temperature with Temperature ramp.  
I would like to know T ramp method is good to raise the T in a system or is there any other reommended ways to do that in gromacs?  
In below script I used 800K in ref\_t and gen\_t and alsoannealing T as 500 800 based on my understanding.  
Please advice.

; Time step in ps  
dt = 0.001

; Number of steps to run  
nsteps = 1000000000

; Remove center of mass motion every 100 steps  
comm-mode = Linear  
nstcomm = 100

; Write positions and velocities to the trr file every 5000 steps  
; Output frequency for coords (x), velocities (v) and forces (f)  
nstxout = 500000  
nstvout = 500000

; Write to the log and energy file every 5000 steps  
nstlog = 500000  
nstenergy = 500000

; Calculate energies every 100 steps  
nstcalcenergy = 100

; Write positions to three decimal places to xtc file every 5000 steps  
nstxout-compressed = 500000  
compressed-x-precision = 1000

; Use the Verlet cutoff scheme with grid neighbor searching; you should basically always use this when you can (the only time you wouldn’t would be if you were using tabulated potentials, buckingham interactions, or energy group exclusions; see manual for more detail)  
cutoff-scheme = Verlet  
ns\_type = grid

; Periodic in all three dimensions  
pbc = xyz

; Minimum cutoffs in nm for neighbor list, electrostatics, and LJ interactions. mdrun will tune rcoulomb for improved performance.  
rlist = 1.2  
rcoulomb = 1.2  
rvdw = 1.2

; Use the PME algorithm (an alternative to PPPM) (this is very likely the electrostatics algorithm you want to use)  
coulombtype = PME

; Smoothly shift vdw interactions to zero at the cutoff  
vdw-type = Cut-off  
vdw-modifier = Potential-shift-Verlet

; GENERATE VELOCITIES FOR STARTUP RUN =  
gen-vel = yes  
gen-temp = 800  
gen-seed = 173529

; Use the v-rescale thermostat with a time constant of 0.1 ps and temperature of 600. V-rescale correctly samples the canonical distribution. Nose-hoover would be another good choice.  
tcoupl = V-rescale  
tc-grps = System  
tau\_t = 0.1  
ref\_t = 800

;Use when ramping temperature  
annealing = single;ramps a single time to the final T and remains constant at final T  
annealing-npoints = 2 ;number of reference points (match the number of temps, ie 300K to 550K would be 2, one for each temp)  
annealing-time = 0 1000 ;ramping time in ps - (1000 is 1 ns)  
annealing-temp = 500 800 ;start and stop temp

; Don’t use pressure coupling. For NPT this should be set. For equilibration, Berendsen is best since it is more stable. For production runs, Parrinello-Rahman is best since it samples the correct ensemble.  
pcoupl = no  
pcoupltype = Isotropic  
tau-p = 1  
refcoord-scaling = No

; Use the LINCS algorithm to turn all bonds with hydrogen atoms into constraints. This allows a larger timestep. (can also use shake if needed, but lincs is faster)  
constraint\_algorithm = lincs  
constraints = H-bonds

; Do not generate initial velocities; rather this run is a continuation from a previous run. Alternately, set gen\_vel to yes and give it a temperature to sample the maxwell distribution at, and set continuation to no.  
;gen\_vel = no  
;continuation = yes

; Dielectric constant (DC) for cut-off or DC of reaction field =  
epsilon-r = 1

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [November 7, 2024, 12:25pm UTC](https://gromacs.bioexcel.eu/t/temperature-raise-in-gromacs-run/10500/2 "2024-11-07T12:25:50Z")

</div>

With those settings you generate velocities at 800 K and then your annealing settings will make your thermostat set the temperature to 500 K and then you quickly (in 1 ns) scale up the temperature to 800 K again. Is that really what you want?

Why not `gen-temp = 500` and `ref_t = 500` (`ref_t` does not really matter, but I find the intention easier to understand if it matches the temperature of the generated velocities)? You are running for 1000 ns, but you are heating the system from 500 K to 800 K over a period of 1 ns. With such a short annealing time, is there a reason why you are starting at 500 K at all? Why not start at 800 K? Or set `annealing-time` to, e.g., `0 100000` to increase the temperature for 100 ns. Why are you using such a low `tau-t`? I’d recommend 0.5 - 2 ps.
