Maintaining Constant Pressure and Temperature in NAMD.

Sulstice
2 min readJan 1, 2023

--

I run a lot of simulations using Molecular Dynamics to validate Force Field parameters that I am adding are useful to part of my PhD. We use a variety of different software to perform the simulation, and a major one is NAMD.

In NAMD, you can setup a constant pressure control and temperature control with the simulation using Langevin Dynamics which introduces new forces as a dampening effect to maintain control.

In NAMD, the configuration for setting up a constant pressure and temperature simulation looks like this:

useGroupPressure yes
useConstantArea no
langevinPiston on
langevinPistonTarget 1.01325
langevinPistonPeriod 200.0
langevinPistonDecay 100.0
langevinPistonTemp 298.15

langevin on
langevinTemp 298.15
langevinDamping 5
langevinHydrogen off

Where the pressure is maintained with a piston. Think of it like a car engine, when the simulation is running at a target pressure of 1.01325 Bar. The pressure is determined by the expansion of the volume of the simulation. The piston acts a compression device that pushes back on the simulation as it expands to maintain the pressure. How often the piston checks is the period cycle and the rate of the compression allowing the volume to expand is the decay.

In NAMD, the `PRESSURE` is the pressure calculated on individual atoms and the “GPRESSURE” have different meanings where the GPRESSURE also includes the hydrogens. If you wanted to check that your simulation was stable at least with constant pressure then you would check the GPRESSAVG value over time which is the average of the pressure and temperature over time. This can give you some insight that okay my system didn’t explode. Here you can see block averages of 3 of my simulations over the course of 10 ns. The simulation maintained the pressure around the target 1–2 atmospheric pressure (atm) which is what I wanted. Any more over I would have been greatly concerned. The error bars show the fluctuations of the pressure with each timestep but an average is still maintained.

--

--

Sulstice
Sulstice

No responses yet