# [lammps-users] how to use fix spring to calculate the PMF

Hi everyone,

I want to use the fix spring to calculate the PMF between two large particles A , B. The A and B is, respectively, rigids with fix rigid command.

I have read the fix spring command, which says that "It can also be used to hold the centers of mass of two groups of atoms at a given distance or orientation with respect to each other. " That’s what I want.

This fix also computes global 4-vector which can be accessed by various output commands. The first 3 quantities in the vector are xyz components of the total force added to the group of atoms by the spring. In the case of the couple style, it is the force on the fix group (group-ID) or the negative of the force on the 2nd group (group-ID2). The 4th quantity in the vector is the magnitude of the force added by the spring, as a positive value if (r-R0) > 0 and a negative value if (r-R0) < 0. This sign convention can be useful when using the spring force to compute a potential of mean force (PMF). Good

My command is

``````fix PMF A spring couple B 100.0 NULL NULL z_value 0.0 (x_value is from 0nm to 5nm)

Then I get the f_PMF f_PMF f_PMF f_PMF f_PMF

``````

My question is how to use the above five quantities to calculate the PMF. Is there a formula between the PMF and the five quantities?

Any suggestion is appreciated. Thanks in advance.

Then I get the f_PMF f_PMF f_PMF f_PMF f_PMF

My question is how to use the above five quantities to calculate the PMF. Is
there a formula between the PMF and the five quantities?

Any suggestion is appreciated. Thanks in advance.

there is a *ton* of literature on free energy calculations.
both papers and text books. i suggest you have a look
at those. there is no point in trying to do this kind of
calculation without understanding what you are doing.

cheers,
axel.