# Stepwise temperature ramp MD

**URL:** <https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229>\
**Category:** User discussions\
**Created:** [May 26, 2021, 8:36pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229 "2021-05-26T20:36:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [May 26, 2021, 8:36pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/1 "2021-05-26T20:36:31Z")

</div>

GROMACS version:2021  
GROMACS modification: /No  
Here post your question

I plan to run stepwise temperature ramp MD, i.e. 50 ns at 300 K, followed by 50 ns at 350 K.

I plan to do it like this, can I ask is this the “standard” way to do it? Should I always need to do NVT/NPT between the two temperatures?

(Omit the preparation)  
energy minimisation  
NVT at 300 K  
NPT at 300 K  
MD at 300 K for 50 ns  
; extract the last-frame gro from xtc  
NVT at 350 K  
NPT at 350 K  
MD at 350 K for 50 ns

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 27, 2021, 12:13pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/2 "2021-05-27T12:13:25Z")

</div>

Hi,

I would say that if the purpose of the study is to investigate the non-equilibrium transition between 300K and 350K repeating equilibration in between would defeat the purpose, am I right?  
I believe there is no way to change temperature on-the-run, unfortunately, so manually repeating `grompp` and `mdrun` starting from the last `confout.gro` and specifing a different temperature in the `.mdp` is the only option that comes to my mind.

Michele

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [May 27, 2021, 12:33pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/3 "2021-05-27T12:33:00Z")

</div>

I’d be curious as to what you’re trying to achieve by doing this. As soon as you re-initialize velocities at 350 K, there was really no point in running any MD at 300 K, because you’re just randomizing the system. A steady increase in temperature via simulated annealing is probably a more common approach, but if you want to do this stepwise, I’d at least suggest that there is no need for an intermediate NVT step since you’ve already run substantial simulation time under the ensemble of interest (NPT). The initial NVT that people often do (and this may well come from my conventions in my tutorials) is just to ensure that the initial case of being far from equilibrium doesn’t lead to instability with random velocities. Once that’s over, you never really need NVT again unless it’s the ensemble you’re trying to model.

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [May 27, 2021, 1:37pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/4 "2021-05-27T13:37:27Z")

</div>

Hi Both, thank you for your feedback.

I would run multiple increased temperature steps, e.g. 300 K for 50 ns, 310 K for 50 ns, 320 K for 50 ns, … …  
I only mentioned two temperatures just for simplicity.

There is no particular rationale behind the stepwise ramp. It is mainly to see when the protein would denature. I can certainly run multiple independent MD at different temperatures. But I have seen some papers using stepwise ramp within one MD.

So I should skip the NVT but keep the NPT when changing the temperature.

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [May 27, 2021, 3:34pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/5 "2021-05-27T15:34:36Z")

</div>

I would recommend doing simulated annealing, as you can specify a time period for ramping the temperature (thus allowing the system to slowly adapt to the new temperature) and then intervals of given length for which the temperature is held constant. You can do all of this in one continuous simulation very easily.

---

<div class="post-metadata">

**Author:** ![MichelePellegrino](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/michelepellegrino/32/628_2.png) [@MichelePellegrino](https://gromacs.bioexcel.eu/u/MichelePellegrino)\
**Post date:** [May 27, 2021, 4:06pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/6 "2021-05-27T16:06:15Z")

</div>

So I was mistaken, one can change temperature in a stepwise manner without having to re-run; good to know!

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [May 27, 2021, 7:38pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/7 "2021-05-27T19:38:14Z")

</div>

Thank you very much Justin, the “simulated annealing” is indeed what I was looking for!

I have

```
tc-grps = Protein Non-Protein
ref_t = 300 300

```

in the `npt.mdp` files (taken from your lysozyme tutorial), so should I just add these lines to the end of the` npt.mdp` file, without changing anything else? So the temperature is kept constantly for 50 ns, linearly increased to the next temperature in 10 ns, then kept constantly again for 50 ns, etc.

```
; Simulated annealing
annealing	= single single	   
annealing_npoints	= 6 6
annealing_time = 0 50000 60000 110000 120000 170000 0 50000 60000 110000 120000 170000
annealing_temp	= 300 300 310 310 320 320 300 300 310 310 320 320

```

Here I use 10 ns for 10 K, i.e. 1 K per ns. What could be the ideal ramping rate?

Can I ask why you have three `single` at this [membrane\_protein tutorial](http://www.mdtutorials.com/gmx/membrane_protein/Files/anneal_npt.mdp)? There are only two groups: `tc_grps = Protein_DPPC Water_and_ions`

```
; Simulated annealing
annealing	= single single single ; single sequence of points for each T-coupling group
annealing_npoints	= 2 2 2 ; two points - start and end temperatures
annealing_time = 0 500 0 500 0 500 ; time frame of heating - heat over period of 500 ps
annealing_temp	= 0 323 0 323 0 323 ; start and end temperatures
```

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [May 28, 2021, 5:40pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/8 "2021-05-28T17:40:38Z")

</div>

> [@lanselibai](#):
>
> Here I use 10 ns for 10 K, i.e. 1 K per ns. What could be the ideal ramping rate?

See what people do in the literature; there probably isn’t a set standard here.

> [@lanselibai](#):
>
> Can I ask why you have three `single` at this [membrane\_protein tutorial](http://www.mdtutorials.com/gmx/membrane_protein/Files/anneal_npt.mdp)? There are only two groups: `tc_grps = Protein_DPPC Water_and_ions`

Simple oversight from not updating a file that isn’t used by the core tutorial, that’s all.

---

<div class="post-metadata">

**Author:** ![lanselibai](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@lanselibai](https://gromacs.bioexcel.eu/u/lanselibai)\
**Post date:** [January 8, 2022, 11:05pm UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/9 "2022-01-08T23:05:13Z")

</div>

> [@lanselibai](#):
>
> `Simulated annealing`

Hi @jalemkul, in your [simulated annealing mdp file](http://www.mdtutorials.com/gmx/membrane_protein/Files/anneal_npt.mdp), the reference temperature is `ref_t = 323 323`, while the annealing temperature is `annealing_temp	= 0 323 0 323`. So the starting annealing (i.e. 0 K) does not equal to the reference temperature (i.e. 323 K). Is that still okay?

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [January 9, 2022, 2:19am UTC](https://gromacs.bioexcel.eu/t/stepwise-temperature-ramp-md/2229/10 "2022-01-09T02:19:55Z")

</div>

`ref_t` is ignored when simulated annealing is turned on.
