I have a Gromacs NVT simulation with a constant external electric field using the option "electric-field-z = 1.5 0 0 0".

When calling gmx energy -f (...).edr to calculate the potential energy of the system, is the energy due to interaction with the electric field included or not?

Particularly, I have a lot of molecular dipoles in the system which can align wrt to the electric field. I want to know if the dipole - field interaction energy is contained in the potential from gmx energy, and if not, how I can quantify it.

  • 1
    $\begingroup$ I would ask this on the GROMACS forum $\endgroup$
    – B. Kelly
    May 13, 2022 at 11:59
  • $\begingroup$ Did Hess answer your question well enough ;) $\endgroup$
    – B. Kelly
    May 19, 2022 at 1:30
  • $\begingroup$ Yes, he did :) I guess I should link his answer here? $\endgroup$
    – curio
    May 19, 2022 at 14:52
  • $\begingroup$ Hmm, I am not sure. $\endgroup$
    – B. Kelly
    May 19, 2022 at 19:04
  • $\begingroup$ @curio you can add a link to the answer by Hess as an answer to this question, after clicking the "community wiki" box, to indicate that this is a link to an answer by the community rather than by yourself. If you don't want to do that, we'll just close this question since it's already been answered! Might as well keep it open and answered though. Next time, please tell Hess to answer the question here :) Ideally we wouldn't need to sign up for 100 different forums (with maybe 100 different usernames and passwords), because everyone will ask MM questions here at MMSE :) $\endgroup$ Dec 10, 2022 at 16:03

1 Answer 1


This was answered after being re-asked on the GROMACS forum. Quoting Hess's answer:

In general it is not possible to define an energy, so this is not computed by mdrun. If you only have neutral molecules, you can compute this energy afterwards from the net dipole of the system. I forgot if mdrun always stores the dipole in the energy file. If not, you can use an analysis tool.

Note that you need to think about the choice of boundary condition at infinity (surface_epsilon mdp parameter) when using an electric field.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .