# Pull code for a single window

**URL:** https://gromacs.bioexcel.eu/t/pull-code-for-a-single-window/9958
**Category:** User discussions
**Tags:** free-energy, pull-code
**Created:** [August 22, 2024, 12:31pm UTC](https://gromacs.bioexcel.eu/t/pull-code-for-a-single-window/9958 "2024-08-22T12:31:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![arthurmluz](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arthurmluz](https://gromacs.bioexcel.eu/u/arthurmluz)
#### Post date: [August 22, 2024, 12:31pm UTC](https://gromacs.bioexcel.eu/t/pull-code-for-a-single-window/9958/1 "2024-08-22T12:31:16Z")

</div>

GROMACS version: 2022.2  
GROMACS modification: No

Hello, everyone!

I need to evaluate the free energy contribution of maintaining a molecule within a fixed distance from the center of mass of a phase. I did this by using the umbrella pull code. However, since I only use a single window, I can’t realy use WHAM.

The idea is to calculate the free energy difference between the state where there’s no pull and with the pull code on.

Does anyone know how I could do this?

---

<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: [August 22, 2024, 1:23pm UTC](https://gromacs.bioexcel.eu/t/pull-code-for-a-single-window/9958/2 "2024-08-22T13:23:51Z")

</div>

If I understand you correctly, you can’t get the free energy difference from the data you’ve got. You can get the force that is applied to keep the molecule in place, from the pullf.xvg file. That doesn’t give you the free energy, though.

---

<div class="post-metadata">

### Author: ![arthurmluz](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@arthurmluz](https://gromacs.bioexcel.eu/u/arthurmluz)
#### Post date: [August 22, 2024, 2:33pm UTC](https://gromacs.bioexcel.eu/t/pull-code-for-a-single-window/9958/3 "2024-08-22T14:33:26Z")

</div>

Sure, but is there a way I could couple the pull code with a free energy calculation (maybe with a lambda) to evaluate this free energy difference?

---

<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: [August 22, 2024, 2:48pm UTC](https://gromacs.bioexcel.eu/t/pull-code-for-a-single-window/9958/4 "2024-08-22T14:48:40Z")

</div>

It should work with the free-energy options. See [Molecular dynamics parameters (.mdp options) - GROMACS 2024.2 documentation](https://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#mdp-restraint-lambdas) and [Molecular dynamics parameters (.mdp options) - GROMACS 2024.2 documentation](https://manual.gromacs.org/documentation/current/user-guide/mdp-options.html#mdp-pull-coord1-kB).

Then you can analyse it using `gmx bar`.
