# [gmx-users] Box size and potential energy calculation

Mark Abraham Mark.Abraham at anu.edu.au
Sat Jan 22 23:40:46 CET 2011

```On 23/01/2011 2:36 AM, Christian Mötzing wrote:
> Am Samstag, den 22.01.2011, 11:39 +1100 schrieb Mark Abraham:
>> On 21/01/2011 6:47 AM, Christian Mötzing wrote:
>>> Hi,
>>>
>>> I currently read through the GMX manual 4.5.3. I have two questions:
>>>
>>> 1) Density is calculated by the density of the material and the box
>>> volume. But I can't find a reference on how the box size is calculated.
>>> Can you point me to some literature?
>> The volume of the box is the determinant of the matrix formed by the box
>> vectors. If that matrix is upper- or lower-triangular, then the volume
>> is the product of the entries in the leading diagonal.
> Ok and where do the box vectors come from? I read the a atom/molecule
> has a vector for the position and a vector for the velocity/direction
> its heading. Are the box vectors determined by the vectors which have
> the maximal component for one axis in the system?

The size of the box, if any, is imposed by the user before the
simulation begins (e.g with editconf). It may have periodic boundary
conditions. Its size may vary if the simulation is not in a
constant-volume ensemble.

It sounds like doing some tutorial material would give you some good
context in which to continue learning.

Mark

>>> 2) I wanted to look up the calculation of the potential energy. Do I
>>> understand the calculation correctly:
>>> - pairwise sum over all molecules
>>> - for each pair Coulomb, Lennard-Jones and bonded terms are summed
>>> aswell
>>> - the calculation involves the position of the molecules (for example
>>> Lennard-Jones)
>> Well that's vaguely accurate. Bonded terms can involve more than pairs
>> of atoms.
>>
>> Mark
>
> Christian
>

```