# Interface pinning

**Interface pinning**^{[1]} is used to determine the melting point from a molecular-dynamics simulation of the interface between a liquid and a solid phase.
The typical behavior of such a simulation is to freeze or melt, while the interface is *pinned* with a bias potential.
This potential applies an energy penalty for deviations from the desired two-phase system.
It is preferred simulating above the melting point because the bias potential prevents melting better than freezing.

The Steinhardt-Nelson^{[2]} order parameter discriminates between the solid and the liquid phase.
With the bias potential

penalizes differences between the order parameter for the current configuration and the one for the desired interface . is an adjustable parameter determining the strength of the pinning.

Under the action of the bias potential, the system equilibrates to the desired two-phase configuration. An important observable is the difference between the average order parameter in equilibrium and the desired order parameter . This difference relates to the the chemical potentials of the solid and the liquid phase

where is the number of atoms in the simulation.

Computing the forces requires a differentiable . In the VASP implementation a smooth fading function is used to weight each pair of atoms at distance for the calculation of the order parameter. This fading function is given as

Here and are the near- and far-fading distances, respectively.
The radial distribution function of the crystal phase yields a good choice for the fading range.
To prevent spurious stress, should be small where the derivative of is large.
Set the near fading distance to the distance where goes below 1 after the first peak.
Set the far fading distance to the distance where goes above 1 again before the second peak.

## References