Re: How to maintain Density constant?

From: Ivan Gregoretti (
Date: Thu Mar 06 2014 - 10:34:43 CST

Thank you Kenno.

So, going back to try to help Roy.

1) Running MD simulations where you control both pressure and
temperature is routine. Kenno tells us that it makes no sense to also
try to impose a control on the volume. (Of course.)

2) Why is your system's density dropping? I wonder if the periodic
boundary conditions are properly set. I can picture a situation where
there is no boundary conditions and the molecules start to slowly
diffuse away from the center of mass of your system.


Ivan Gregoretti, PhD

On Thu, Mar 6, 2014 at 10:57 AM, Kenno Vanommeslaeghe
<> wrote:
> On 03/06/2014 08:23 AM, Ivan Gregoretti wrote:
>> p V = n R T
>> with n being the number of molecules and V being volume. It's an ideal
>> gas state equation. Notice that n/V is your density.
>> In your molecular dynamics, n does not change, so, if you want to keep
>> the density constant, you need to run your simulation at constant
>> volume.
>> Do I get it right Kenno?
> Mostly. We usually don't simulate gases, so the ideal gas law you brought up
> is of very limited value, but there exist similar equations for liquids and
> solid, and one thing they all have in common is that (assuming n is
> constant) out of p, V and T (and also E and/or Q), you can set two to an
> arbitrary value, but then you don't have control over the other one(s); this
> is very fundamental and doesn't take advanced statistical mechanics to see.
> There exist mechanisms in nature to impose *some* combinations of these
> variables on a system, and these combinations ("ensembles" in thermodynamic
> speak) are often implemented in MD engines. The "constant pressure and
> volume" Roy asked for is not one of them; even if someone would somehow
> implement it, it would be of no practical relevance. Besides, the
> temperature would shift and fluctuate uncontrollably (remember, you can only
> choose 2), which is probably not what Roy (or anyone else) wants.

This archive was generated by hypermail 2.1.6 : Wed Dec 31 2014 - 23:22:12 CST