# Recreate P(Wf) & P(-Wr) from the raw data

**URL:** <https://gromacs.bioexcel.eu/t/recreate-p-wf-p-wr-from-the-raw-data/7658>\
**Category:** User discussions\
**Created:** [November 16, 2023, 10:16pm UTC](https://gromacs.bioexcel.eu/t/recreate-p-wf-p-wr-from-the-raw-data/7658 "2023-11-16T22:16:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pinoji1](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pinoji1/32/1442_2.png) [@pinoji1](https://gromacs.bioexcel.eu/u/pinoji1)\
**Post date:** [November 16, 2023, 10:16pm UTC](https://gromacs.bioexcel.eu/t/recreate-p-wf-p-wr-from-the-raw-data/7658/1 "2023-11-16T22:16:48Z")

</div>

GROMACS version:2023.3  
GROMACS modification: No  
“Can I recreate P(Wf) & P(-Wr) by myself from the raw data?”  
When I originally run the alchemical simulation (solute, solvent ,and ions), I get dgdl.xvg file for nonequilibium free energy calculations from a starting state A (I just choose the first one) to state B.  
gmx mdrun … -dhdl dgdl.xvg  
These individual xvg file contains time axis and dU/dl(?) in the unit of kJ/mol.

The way I understand is that we compute W by  
 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/7/77322b74760b21c3f1b8c1e71ff5e07771760c3e.png)  
The P(wf) in the forward process range around -27kJ/mol.

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/8/8fd890559d30b0e87bc5670d5d050203550970ab.png)  
I somehow get the close number by simply taking the average of the 2nd column in the dgdl.xvg.  
If I believe the formula is the way to compute W in the program, then I can use the system energy(U) stored in edr file at each step (80ps 1fs step) and compute W by using above formula. Unfortunately, the number looked completely off(these dgdl.xvg & energy.xvg files are taken from the same simulation). This suggest that I am misunderstanding the calculation of the W term. What is the second column in the dgdl.xvg? Is there a way to manually get the W from edr file? Thank you very much for the clarification.
