# How to gradualy decrease restrain during equilibration step?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449>\
**Category:** User discussions\
**Created:** [July 11, 2022, 4:06am UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449 "2022-07-11T04:06:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jxdlneto](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jxdlneto](https://gromacs.bioexcel.eu/u/jxdlneto)\
**Post date:** [July 11, 2022, 4:06am UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/1 "2022-07-11T04:06:54Z")

</div>

GROMACS version: 2021.3  
GROMACS modification: Yes/No

Dear users,

I’m completely noob working with MD and I performed a simulation following the Lemkul tutorial recently. Now, I would like to apply, in the same protein-ligand system, some points I read in two papers, which are:

1. “At total, each system was equilibrated using integration steps of 1 fs through 2 ns following gradually decreasing ligand restraint force constants along 4 steps of 250 ps each.”

2. “The system was heated in cycles of 100 ps simulations with gradual temperature increases (10, 50, 150, and 300 K) using the Berendsen thermostat. Then, the pressure was adjusted to 1 atm using the Berendsen barostat in a 400 ps simulation. The 100 kcal/(mol Å2) restraints were gradually removed in cycles of 500 ps simulations (50, 10, 5, and 1 kcal/(mol Å2))”

Both papers showed that restraints were removed gradually during the equilibration steps. Thus, I have some questions:

1- How can I “gradually decrease ligand restraint force constants” during the equilibration step?

2- My idea about the first question is that each step uses the previous result decreasing the force - set 1000 in the first step - that is in the file “posre\_ligand.ipt” (1000, 500, 100…) to start the simulation again, is it right?

3- The “gradual temperature increases (10, 50, 150, and 300 K)” is a normal characteristic of the thermostats or should I set any function to this gradual temperature increase?

I’d like to thank you for your time and answer  
Sincerely,  
José Xavier

---

<div class="post-metadata">

**Author:** ![ebriand](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ebriand/32/2314_2.png) [@ebriand](https://gromacs.bioexcel.eu/u/ebriand)\
**Post date:** [July 11, 2022, 7:49am UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/2 "2022-07-11T07:49:05Z")

</div>

You are correct that the method as described is to do successive run of 250/500 ps, changing the parameters for each of those.

For the thermostat: customarily, for the first simulation run after minimization, the velocities for each particle will be drawn from a Boltzmann distribution at the target temperature (see `gen_vel = yes`), so that the first step is not effectively at 0K (and, of course, the thermostat will act as usual for the run). For the subsequent run, in the described methodology, the temperature will be raised by the thermostat at a rate given by the `tau_t` parameter (see description of the thermostat algorithm for exact meaning of this time constant).

Just a note: the procedure as described is very gentle. While that cannot hurt, unless there is specific concern for the equilibration of this protein system, some might say it is unnecessarily so. Also you might want to read [this for more details on equilibration (and other issues)](https://livecomsjournal.org/index.php/livecoms/article/view/v1i1e5957).

---

<div class="post-metadata">

**Author:** ![jxdlneto](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jxdlneto](https://gromacs.bioexcel.eu/u/jxdlneto)\
**Post date:** [July 11, 2022, 7:48pm UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/3 "2022-07-11T19:48:10Z")

</div>

Dear @ebriand,  
Thank you for your help.

I’ll read carefully the information from the link you sent. It looks to be very complete.

About the answers:

> You are correct that the method as described is to do successive run of 250/500 ps, changing the parameters for each of those.

According to Lemkul’s tutorial, I introduced the POSRES and the POSRES\_LIG in the .top and .mdp files, as well as I merged protein and ligand as the _Protein\_Lig_ group in the _tc-grps_ during the equilibration (NVT and NPT). If I understood it correctly, the functions POSRES and POSRES\_LIG restrain the protein and the ligand based on the energy threshold in the .itp files, and the tc-grps = Protein\_Lig makes both molecules a single entity during the calculation.

If I want to perform a third equilibration step (NPT or NVT), “decreasing gradually the ligand restrains”,  
1- should I change something else than the energy value in the posre\_ligand.itp file (ex.:mdp/top files)?  
2- Are there any values I shouldn’t use as an energy threshold?

Thank you again

---

<div class="post-metadata">

**Author:** ![ebriand](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ebriand/32/2314_2.png) [@ebriand](https://gromacs.bioexcel.eu/u/ebriand)\
**Post date:** [July 12, 2022, 7:49am UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/4 "2022-07-12T07:49:36Z")

</div>

Decreasing the ligand restraint will indeed mean changing the force constant in that file. There are no particular values to avoid.

The parameter `tc-grps = Protein_Lig` means that the group named `Protein_Lig`, that you have defined previously, will be considered together by the thermostat (`tc-grps`: temperature control groups). This has no influence on things other that the thermostat, and does nothing for the restraints.

A few more details on how this works mechanically. In the `.mdp` file, you have a line like such:

```auto
define = -DPOSRES -DPOSRES_WATER 

```

This instructs gromacs to remember that `POSRES` and `POSRES_WATER ` are defined. (Why these start with `-D` is because it mimics the command line argument for the [C preprocessor](https://en.wikipedia.org/wiki/C_preprocessor) - though this is not important)

In the topology `.top`, you have line like these:

```auto
#ifdef POSRES
#include "posre.itp"
#endif

```

The paired `#ifdef` and `#endif` directive instruct gromacs to remove whatever is in between these if `POSRES` is not defined. The `#include` directive says to look for a file named `posre.itp`, and paste its content at this position.

This means that, if you have `define = -DPOSRES`, the following line will be translated to something like this, placed at the position these directives were:

```auto
; In this topology include file, you will find position restraint
; entries for all the heavy atoms in your original pdb file.
; This means that all the protons which were added by pdb2gmx are
; not restrained.

[position_restraints]
; atom type fx fy fz
     1 1 1000 1000 1000
     5 1 1000 1000 1000
     6 1 1000 1000 1000
...

```

But if its not defined (`define = `), then it is equivalent to no text at all.

---

<div class="post-metadata">

**Author:** ![jxdlneto](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jxdlneto](https://gromacs.bioexcel.eu/u/jxdlneto)\
**Post date:** [July 12, 2022, 8:13pm UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/5 "2022-07-12T20:13:11Z")

</div>

Thank you again for your answer and explanations. I understood much better the ideas now!

I just want to ask one more question…  
Following the tutorial, I performed two equilibration steps, an NVT and an NPT, using the restrains with 1000 of force constraint. Could it be considered a “gradually decrease restrain” of the ligand by performing the same two steps, and adding a third step in which I use the same NPT MDP script, but change the force constraint to 500 in the ligand posre itp file for this third step?

---

<div class="post-metadata">

**Author:** ![ebriand](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ebriand/32/2314_2.png) [@ebriand](https://gromacs.bioexcel.eu/u/ebriand)\
**Post date:** [July 13, 2022, 7:17am UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/6 "2022-07-13T07:17:11Z")

</div>

Yes, I would say something like an NVT equilibration (with restraint of 1000), then NPT (restraint 1000) then any number of additional NPT equilibration step with decreasing restraining force would qualify as “gradually decrease restrain” .

---

<div class="post-metadata">

**Author:** ![jxdlneto](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@jxdlneto](https://gromacs.bioexcel.eu/u/jxdlneto)\
**Post date:** [July 13, 2022, 4:06pm UTC](https://gromacs.bioexcel.eu/t/how-to-gradualy-decrease-restrain-during-equilibration-step/4449/7 "2022-07-13T16:06:10Z")

</div>

Thank you very so much for your help!
