gmx potential -correct outputs the wrong potential
Whilst using Computational electrophysiology (CompEL) with the dual bilayer setup, gmx potential with the -correct flag outputs a offset potential.
In the case of no ion imbalance and therefore no voltage, gmx potential will give a potential difference of roughly 1z.
This can be fixed by translating the box using the -tz flag by half the box length. Alternatively translation by gmx trjconv also fixes the offset.
The direction of the translation does not matter, both will give the correct output.
The offset by gmx potential is the same regardless of the ion imbalance (-tz "half box length", will give correct voltage regardless of ion imbalance).
I've attached a sample tpr as well as gmx potential output (only 1ns but clearly shows the problem) for -tz = -, 0, +.
This issue has been present since gromacs 4.6, and has been present in all versions of gromacs I've tested (v4, v5, v2016 and v2018).
#2 Updated by Owen Vickery about 2 years ago
- File charge_vs_voltage.png charge_vs_voltage.png added
- File index.ndx index.ndx added
- File md.mdp md.mdp added
I've added the index used and mdp settings as well as the charge imbalance vs voltage.
The selection was system and the line to get the potential was:
echo 0 | gmx potential -f *.xtc -s *.tpr -sl 1000 -n index.ndx -o pot-untranslated -correct
echo 0 | gmx potential -f *.xtc -s *.tpr -sl 1000 -n index.ndx -o pot-translated -correct -tz -14