# Awh mdp options

**URL:** <https://gromacs.bioexcel.eu/t/awh-mdp-options/6186>\
**Category:** User discussions\
**Created:** [April 14, 2023, 11:04am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186 "2023-04-14T11:04:30Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [April 14, 2023, 11:04am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/1 "2023-04-14T11:04:30Z")

</div>

GROMACS version: 2021.5  
GROMACS modification: No

Hi!

I am trying the seemingly simple task of pulling a molecule through a bilayer using the pull-code + awh, but I am confused about some of the options, and how they influence each other.

The initial setup I have is the molecule outside of the bilayer, and “above” the bilayer with reference to the z-axis. My aim is to pull it to the middle of the bilayer, a distance of approx. 5 nm. I am using the cylinder pull geometry, here is my mdp-file:

pull-group1-name = bilayer  
pull-group2-name = MOL

pull-coord1-groups = 1 2  
pull-coord1-geometry = cylinder  
pull-coord1-vec = 0.0 0.0 -1.0  
pull-cylinder-r = 1.0  
pull-coord1-type = external-potential  
pull-coord1-potential-provider = AWH

awh = yes ; AWH on.  
awh-nstout = 500000  
awh-nbias = 1  
awh1-ndim = 1  
awh1-dim1-coord-index = 1  
awh1-dim1-start = 7  
awh1-dim1-end = 2  
awh1-dim1-force-constant = 100000  
awh1-dim1-diffusion = 5e-3

With this setup I was intending to enable a simulation where the molecule starts from its initial position (at z=7, pull for 5 nm (until z=2), so along the vector 0, 0, -1.) However, grompp tells me that the distance at start (I presume between the molecule and the bilayer) is -1.627 nm, and the awh gives a fatal error saying that: For the non-periodic pull coordinates awh1-dim1-start (7.000000) cannot be larger than awh1-dim1-end (2.000000).

Please advise how I need to modify the mdp-file to acheive what I want.

Kind regards  
/PK

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [April 17, 2023, 8:58am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/2 "2023-04-17T08:58:59Z")

</div>

Anyone, please?

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [April 19, 2023, 1:13pm UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/3 "2023-04-19T13:13:56Z")

</div>

Why do you used 0,0,-1 as pull vector and not 0,0,1 ? If the initial value of the pull coordinate is -1.627, it seems to me that your molecule is above the bilayer in the starting configuration and not below.

But if you change to 0,0,1 as vector, you starting pull value is still outside of the interval. So either you need to run a short steered MD run to move your molecule to 2 or beyond, or you need to change the interval in the AWH parameters.

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [April 20, 2023, 7:53am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/4 "2023-04-20T07:53:31Z")

</div>

Thanks Berk, much appreciated!

The molecule is indeed above the bilayer in the starting configuration, and my reasoning for using 0,0,-1 was to pull it in the negative direction along z.  
But I am clearly not understanding 100% how this works. When I run grompp, the distance that is reported changes sign (from -1.627 to 1.627) when the pull vector instead is 0,0,1. This does not make sense to me, why would the initial distance be affected by this vector?

Sedondly, how should the awh interval be specified for pulling from above to below the bilayer?

Thanks!!

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [April 20, 2023, 9:28am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/5 "2023-04-20T09:28:02Z")

</div>

If you use -1 as z-component of the vector, then a distance of 1.627 above the bilayer changes to a location of -1.627.

The pull coordinate value is given as the z-position with as reference, or zero-, point the middle of the bilayer. If you want to pull it through, you can set the interval to e.g. -1.8 to 1.8.

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [April 20, 2023, 11:12am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/6 "2023-04-20T11:12:47Z")

</div>

Thanks again, I think I understand now. Will do some runs to see if the outcome is as intended.

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [April 20, 2023, 11:21am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/7 "2023-04-20T11:21:25Z")

</div>

So, still something I am not clear about, now about the values of awh-dim1-start and -end. Assuming a pull-vec of 0,0,-1, and (therefore) an initial position of -1.627, I put  
awh-dim1-start = -1.8 and awh-dim1-end to 3.2 (I want to pull about 5 nm in total, approximately to the middle of the bilayer). Grompp works fine, but after about 100000 steps I get this from gromacs:

_Simulation instability detected:_  
_Coordinate 1 of an AWH bias has a value -1.872609 which is more than 10 sigma_  
_out of the AWH range of [-1.800000, 3.200000]._

How should the start and end awh interval be specificied in this case?  
I really appreciate your help!

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [May 10, 2023, 12:21pm UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/8 "2023-05-10T12:21:36Z")

</div>

Hello again!

Unfortunately still struggling with this, any input would be appreciated. How should the values for awh-dim1-start and awh-dim1-end be picked in relation to the intial position of my molecule above the lipid bilayer, with the intention of using awh to sample passage across the bilayer?

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 19, 2023, 8:36am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/9 "2023-05-19T08:36:19Z")

</div>

Your start and end look reasonable to me. I don’t see how the molecule can end up so much beyond the start, unless you system is unstable.

Are you still using a force constant of 100000? What is the mass of your molecule?

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [May 22, 2023, 10:07am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/10 "2023-05-22T10:07:52Z")

</div>

Thanks again Berk for your reply! The mass of my molecule is ~1000 Da, and the force constant is 10000.

Over the weekend I was working more with this, testing also different pulling geometries. Before it was always cylinder. I have now also tried distance and direction, and I have additional questions as a consequence of that.

1. In cases like this (pulling from one side of a bilayer to the other), what should be group1 and group2 in the pull-code? I was always putting the bilayer as group 1 and the permeant as group2, but does it matter (other than the sign of the distance being reversed)?

2. With pull-geometry=direction, (and the bilayer as group2) the distance as reported by grompp is -3.069 nm, but with pull-geometry = cylinder is is the ~1.6 nm value from above. This makes sense since the COM of the bilayer is different for these two cases, but given the different values, how should one think when specifiying the awh boundaries to make sure the entire passage is sampled? I suppose I am trying to understand still if the distances and positions that grompp prints and uses are directly comparable or not to the awh start and end positions?

3. With pull-geometry = direction, and the awh start and end put to -3.1 and 3.1, I obtained the following PMF:  
 ![awh_pmf](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/b/b9fc53071e5aec7a46d3a90999be52bb0edb711d.png)

When I visualise the trajectory in VMD, it seems as if my molecule is pulled to about the center of the bilayer, possibly a little bit further. How does this PMF match with that trajectory, since the PMF is flat from about -1 and onwards. I was expecting a more “classical” PMF that was changing as a function of the reaction coordinate inside the bilayer?

Apologies for the ton of questions, but I would very much like to get going with AWH for permeation studies.

THANKS!

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 23, 2023, 6:52am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/11 "2023-05-23T06:52:47Z")

</div>

With geometry=cylinder, the cylinder group should be group 1.

The PMF you show is the result of a simulation where the reaction coordinate never reached the flat part. You would need to run longer.

But cylinder is the right choice. I don’t understand what happens with the distance ending up outside the interval. You did not set any more pull and AWH parameters than what you show in your first post, right?

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 23, 2023, 6:55am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/12 "2023-05-23T06:55:42Z")

</div>

Since I have no clue what is going wrong, could you change the pull direction to 0,0,1 and exchange the start and end values and their sign? I don’t think this will make a difference, but maybe there is a bug somewhere.

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [May 23, 2023, 7:15am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/13 "2023-05-23T07:15:18Z")

</div>

This is the full pull and awh parts of my mdp-file.

pull-group1-name = bilayer  
pull-group2-name = MOL

pull-coord1-groups = 1 2  
pull-coord1-geometry = cylinder  
pull-coord1-vec = 0.0 0.0 1.0  
pull-group1-pbcatom = 20100  
pull-pbc-ref-prev-step-com = yes  
pull-coord1-k = 1000  
pull-coord1-start = yes  
pull-cylinder-r = 1.5  
pull-coord1-type = external-potential  
pull-coord1-potential-provider = AWH

awh = yes  
awh-nstout = 50000  
awh-nbias = 1  
awh1-ndim = 1  
awh1-dim1-coord-index = 1  
awh1-dim1-start = 3.1  
awh1-dim1-end = -3.1  
awh1-dim1-force-constant = 10000  
awh1-dim1-diffusion = 5e-5  
awh1-dim1-coord-provider = pull

Here is the output that I get with these settings:

Pull group natoms pbc atom distance at start reference at t=0  
1 40200 20100  
2 131 40266 1.661 nm 1.661 nm

* * *

Program: gmx grompp, version 2021.5  
Source file: src/gromacs/applied\_forces/awh/read\_params.cpp (line 994)

Fatal error:  
For the non-periodic pull coordinates awh1-dim1-start (3.100000) cannot be  
larger than awh1-dim1-end (-3.100000)

For more information and tips for troubleshooting, please check the GROMACS  
website at [Common Errors — GROMACS webpage https://www.gromacs.org documentation](http://www.gromacs.org/Documentation/Errors)

I also attach a screen-shot of the initial position of my molecule and the bilayer (lipid headgroups as spheres):

 ![Skärmavbild 2023-05-23 kl. 09.13.42](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/4/4024c8dab01b82c887c10479ed5bd20dd9fd703e.jpeg)

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 23, 2023, 8:11am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/14 "2023-05-23T08:11:32Z")

</div>

You need to swap start and end, or swap their signs, which is equivalent in this case.

You don’t need the pull-pbc-ref-prev-step-com = yes setting. I don’t think this causes issues, but it might be good to try without.

---

<div class="post-metadata">

**Author:** ![Gmx\_QA](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@Gmx\_QA](https://gromacs.bioexcel.eu/u/Gmx_QA)\
**Post date:** [May 23, 2023, 9:30am UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/15 "2023-05-23T09:30:17Z")

</div>

Thanks, I will try and report back!  
Before starting with this, is there some setting that I can change/add to the mdp-file that allows me to quickly assess if the simulation is exploring the entire awh-range as intended? (I am thinking similarly to specifying a high pull-rate when not combining with awh?)

Best,  
/PK

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [May 23, 2023, 8:39pm UTC](https://gromacs.bioexcel.eu/t/awh-mdp-options/6186/16 "2023-05-23T20:39:00Z")

</div>

If you run gmx awh -more you get the coordinate distribution.
