Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
GROMACS 2025.2 documentation
Logo
  • Downloads
  • Release notes
    • GROMACS 2025.2 release notes
    • GROMACS 2025.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Changes to the API
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2024.6 release notes
    • GROMACS 2024.5 release notes
    • GROMACS 2024.4 release notes
    • GROMACS 2024.3 release notes
    • GROMACS 2024.2 release notes
    • GROMACS 2024.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Changes to the API
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2023.6 release notes
    • GROMACS 2023.5 release notes
    • GROMACS 2023.4 release notes
    • GROMACS 2023.3 release notes
    • GROMACS 2023.2 release notes
    • GROMACS 2023.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Changes to the API
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2022.6 release notes
    • GROMACS 2022.5 release notes
    • GROMACS 2022.4 release notes
    • GROMACS 2022.3 release notes
    • GROMACS 2022.2 release notes
    • GROMACS 2022.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Changes to the API
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2021.7 release notes
    • GROMACS 2021.6 release notes
    • GROMACS 2021.5 release notes
    • GROMACS 2021.4 release notes
    • GROMACS 2021.3 release notes
    • GROMACS 2021.2 release notes
    • GROMACS 2021.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2020.7 release notes
    • GROMACS 2020.6 release notes
    • GROMACS 2020.5 release notes
    • GROMACS 2020.4 release notes
    • GROMACS 2020.3 release notes
    • GROMACS 2020.2 release notes
    • GROMACS 2020.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2019.6 release notes
    • GROMACS 2019.5 release notes
    • GROMACS 2019.4 release notes
    • GROMACS 2019.3 release notes
    • GROMACS 2019.2 release notes
    • GROMACS 2019.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Improvements to GROMACS tools
    • Bugs fixed
    • Deprecated functionality
    • Removed functionality
    • Portability
    • Miscellaneous
    • GROMACS 2018.7 release notes
    • GROMACS 2018.6 release notes
    • GROMACS 2018.5 release notes
    • GROMACS 2018.4 release notes
    • GROMACS 2018.3 release notes
    • GROMACS 2018.2 release notes
    • GROMACS 2018.1 release notes
    • Highlights
    • New and improved features
    • Performance improvements
    • Improvements to GROMACS tools
    • Bugs fixed
    • Removed features
    • Portability
    • Miscellaneous
    • GROMACS 2016.5 Release Notes
    • GROMACS 2016.4 Release Notes
    • GROMACS 2016.3 Release Notes
    • GROMACS 2016.2 Release Notes
    • GROMACS 2016.1 Release Notes
    • Highlights
    • New and improved features
    • Performance improvements
    • GPU improvements
    • CPU improvements
    • Threading improvements
    • Other improvements
    • Improvements to GROMACS tools
    • Bugs fixed
    • Fixes for bugs introduced during development
    • Removed mdrun features
    • Miscellaneous
    • Release notes for older GROMACS versions
  • Installation guide
    • Installation guide for exotic configurations
  • User guide
    • Known issues affecting users of GROMACS
    • Getting started
      • Flow Chart
    • System preparation
    • Managing long simulations
    • Answers to frequently asked questions (FAQs)
    • Force fields in GROMACS
    • Molecular dynamics parameters (.mdp options)
    • Useful mdrun features
    • Getting good performance from mdrun
    • Common errors when using GROMACS
    • Command-line reference
      • molecular dynamics simulation suite
      • gmx anaeig
      • gmx analyze
      • gmx angle
      • gmx awh
      • gmx bar
      • gmx bundle
      • gmx check
      • gmx chi
      • gmx cluster
      • gmx clustsize
      • gmx confrms
      • gmx convert-tpr
      • gmx convert-trj
      • gmx covar
      • gmx current
      • gmx density
      • gmx densmap
      • gmx densorder
      • gmx dielectric
      • gmx dipoles
      • gmx disre
      • gmx distance
      • gmx dos
      • gmx dssp
      • gmx dump
      • gmx dyecoupl
      • gmx editconf
      • gmx eneconv
      • gmx enemat
      • gmx energy
      • gmx extract-cluster
      • gmx filter
      • gmx freevolume
      • gmx gangle
      • gmx genconf
      • gmx genion
      • gmx genrestr
      • gmx grompp
      • gmx gyrate
      • gmx gyrate-legacy
      • gmx h2order
      • gmx hbond
      • gmx hbond-legacy
      • gmx helix
      • gmx helixorient
      • gmx help
      • gmx hydorder
      • gmx insert-molecules
      • gmx lie
      • gmx make_edi
      • gmx make_ndx
      • gmx mdmat
      • gmx mdrun
      • gmx mindist
      • gmx mk_angndx
      • gmx msd
      • gmx nmeig
      • gmx nmens
      • gmx nmr
      • gmx nmtraj
      • gmx nonbonded-benchmark
      • gmx order
      • gmx pairdist
      • gmx pdb2gmx
      • gmx pme_error
      • gmx polystat
      • gmx potential
      • gmx principal
      • gmx rama
      • gmx rdf
      • gmx report-methods
      • gmx rms
      • gmx rmsdist
      • gmx rmsf
      • gmx rotacf
      • gmx rotmat
      • gmx saltbr
      • gmx sans-legacy
      • gmx sasa
      • gmx saxs-legacy
      • gmx scattering
      • gmx select
      • gmx sham
      • gmx sigeps
      • gmx solvate
      • gmx sorient
      • gmx spatial
      • gmx spol
      • gmx tcaf
      • gmx traj
      • gmx trajectory
      • gmx trjcat
      • gmx trjconv
      • gmx trjorder
      • gmx tune_pme
      • gmx vanhove
      • gmx velacc
      • gmx wham
      • gmx wheel
      • gmx x2top
      • gmx xpm2ps
      • Selection syntax and usage
    • Terminology
    • Environment Variables
    • Floating point arithmetic
    • Security when using GROMACS
    • Policy for deprecating GROMACS functionality
  • Short How-To guides
    • Beginners
    • Adding a Residue to a Force Field
    • Water solvation
    • Non water solvent
    • Mixed solvent
    • Making Disulfide Bonds
    • Running membrane simulations in GROMACS
    • Parameterization of novel molecules
    • Potential of Mean Force
    • Single-Point Energy
    • Carbon Nanotube
    • Visualization Software
    • Extracting Trajectory Information
    • External tools to perform trajectory analysis
    • Plotting Data
    • Micelle Clustering
  • Reference Manual
    • Preface and Disclaimer
    • Introduction
    • Definitions and Units
    • Algorithms
      • Periodic boundary conditions
      • The group concept
      • Molecular Dynamics
      • Shell molecular dynamics
      • Constraint algorithms
      • Simulated Annealing
      • Stochastic Dynamics
      • Brownian Dynamics
      • Energy Minimization
      • Normal-Mode Analysis
      • Free energy calculations
      • Replica exchange
      • Essential Dynamics sampling
      • Expanded Ensemble
      • Parallelization
      • Domain decomposition
    • Interaction function and force fields
      • Non-bonded interactions
      • Bonded interactions
      • Restraints
      • Polarization
      • Free energy interactions
      • Methods
      • Virtual interaction sites
      • Long Range Electrostatics
      • Long Range Van der Waals interactions
      • Force field
    • Topologies
      • Particle type
      • Parameter files
      • Molecule definition
      • Constraint algorithms
      • pdb2gmx input files
      • File formats
      • Force field organization
    • File formats
    • Special Topics
      • Free energy implementation
      • Potential of mean force
      • Non-equilibrium pulling
      • Collective variables: the pull code
      • Adaptive biasing with AWH
      • Enforced Rotation
      • Electric fields
      • Computational Electrophysiology
      • Calculating a PMF using the free-energy code
      • Removing fastest degrees of freedom
      • Viscosity calculation
      • Shear simulations
      • Tabulated interaction functions
      • Hybrid Quantum-Classical simulations (QM/MM) with CP2K interface
      • MiMiC Hybrid Quantum Mechanical/Molecular Mechanical simulations
      • Using VMD plug-ins for trajectory file I/O
      • Interactive Molecular Dynamics
      • Embedding proteins into the membranes
      • Applying forces from three-dimensional densities
      • Collective Variable simulations with the Colvars module
      • Using PLUMED
      • Neural Network Potentials
    • Run parameters and Programs
    • Analysis
      • Using Groups
      • Looking at your trajectory
      • General properties
      • Radial distribution functions
      • Correlation functions
      • Curve fitting in GROMACS
      • Mean Square Displacement
      • Bonds/distances, angles and dihedrals
      • Radius of gyration and distances
      • Root mean square deviations in structure
      • Covariance analysis
      • Dihedral principal component analysis
      • Hydrogen bonds
      • Protein-related items
      • Interface-related items
    • Some implementation details
    • Averages and fluctuations
    • Bibliography
  • gmxapi Python package
    • Full installation instructions
    • Using the Python package
    • gmxapi Python module reference
  • (Non-)Bonded LIBrary (NB-LIB) API
    • Guide to Writing MD Programs
  • C++ API
    • Public C++ API
  • Developer Guide
    • Contribute to GROMACS
    • Codebase overview
    • Build system overview
    • Change Management
    • Relocatable binaries
    • Documentation generation
    • Style guidelines
      • Guidelines for code formatting
      • Guidelines for #include directives
      • Naming conventions
      • Allowed language features
      • Guidelines for creating meaningful issue reports
      • Guidelines for formatting of git commits
      • Error handling
    • Development-time tools
      • Using Doxygen
      • Change Management
      • Automation and Infrastructure
        • GitLab CI Pipeline Execution
      • Source tree checker scripts
      • Automatic source code formatting
      • Unit testing
      • Physical validation
    • Known issues relevant for developers
  • Doxygen documentation
Back to top
View this page
Edit this page

Interface-related items¶

gmx order, gmx density, gmx potential, gmx traj
When simulating molecules with long carbon tails, it can be interesting to calculate their average orientation. There are several flavors of order parameters, most of which are related. The program gmx order can calculate order parameters using the equation:
(474)¶\[S_{z} = \frac{3}{2}\langle {\cos^2{\theta_z}} \rangle - \frac{1}{2}\]

where \(\theta_z\) is the angle between the \(z\)-axis of the simulation box and the molecular axis under consideration. The latter is defined as the vector from C\(_{n-1}\) to C\(_{n+1}\). The parameters \(S_x\) and \(S_y\) are defined in the same way. The brackets imply averaging over time and molecules. Order parameters can vary between 1 (full order along the interface normal) and \(-1/2\) (full order perpendicular to the normal), with a value of zero in the case of isotropic orientation.

The program can do two things for you. It can calculate the order parameter for each CH\(_2\) segment separately, for any of three axes, or it can divide the box in slices and calculate the average value of the order parameter per segment in one slice. The first method gives an idea of the ordering of a molecule from head to tail, the second method gives an idea of the ordering as function of the box length.

The electrostatic potential (\(\psi\)) across the interface can be computed from a trajectory by evaluating the double integral of the charge density (\(\rho(z)\)):

(475)¶\[\psi(z) - \psi(-\infty) = - \int_{-\infty}^z dz' \int_{-\infty}^{z'} \rho(z'')dz''/ \epsilon_0\]

where the position \(z=-\infty\) is far enough in the bulk phase such that the field is zero. With this method, it is possible to “split” the total potential into separate contributions from lipid and water molecules. The program gmx potential divides the box in slices and sums all charges of the atoms in each slice. It then integrates this charge density to give the electric field, which is in turn integrated to give the potential. Charge density, electric field, and potential are written to xvgr input files.

The program gmx traj is a very simple analysis program. All it does is print the coordinates, velocities, or forces of selected atoms. It can also calculate the center of mass of one or more molecules and print the coordinates of the center of mass to three files. By itself, this is probably not a very useful analysis, but having the coordinates of selected molecules or atoms can be very handy for further analysis, not only in interfacial systems.

The program gmx density calculates the mass density of groups and gives a plot of the density against a box axis. This is useful for looking at the distribution of groups or atoms across the interface.

Next
Some implementation details
Previous
Protein-related items
Copyright © 2025, GROMACS development team
Made with Sphinx and @pradyunsg's Furo