# [gmx-users] Pressure Calculation

David spoel at xray.bmc.uu.se
Sun Jul 11 08:30:55 CEST 2004

```On Sat, 2004-07-10 at 23:49, Farshid Mostowfi wrote:
> Hi david;
>
> Thanks for your reply. I considered the that factor (16.6) but it didn't work.
> Here is the sample calculations, (g_energy output results are at the bottom
> of the page):
> 2/V(Ekin-Vir(1,1))*16.6  =   2/343(84749.94-211153.88)*16.6   =  6155bar
>
> I'd appreciate it if you let me know where my mistake is.

The kinetic energy is a tensor as well. The diagonal elements hold the
largest energy, each roughly one third of the number you are using. If
you divide that by three you will find reasonable correspondence to the
pressure tensor.
> Thanks,
> Farshid
>
>
> g_energy output results:
>
> Ekin=84749.94 (Kj/mol)
> V=343 (nm3)
> P= 1114.501 (bar)
>
>
>         	21153.88 	1892.37  	-5107.3
> Vir=  	1820.15  	18818.25 	-4488.1
>         	-5025.92   	-4484.56  	10246.22
>
>
>      719.3521	195.9087	515.1461
> P= 188.9157	920.3499	450.6406
>       507.2669	450.298	         	1703.802
>
>
> On Saturday 10 July 2004 14:16, you wrote:
> > On Sat, 2004-07-10 at 20:44, Farshid Mostowfi wrote:
> > > Hello Everyone;
> > >
> > > I have a problem with pressure calculations. Based on the manual (pp 21,
> > > eq 3.16) the pressure tensor is calculated using the difference between
> > > kinetic energy and virial tensor : P=2/V*(Ekin-Vir)
> > > I extracted the kinetic energy, virial and pressure tensors using
> > > g_energy from energy file, but they don't match and I don't know why.
> > > Is there anybody who can help me with this problem?
> >
> > check units. there is a magic factor 16.6 somewhere.
> >
> > > Thanks in advance.
> > >
> > > Regards,
> > > Farshid
> > > Ph.D student
> > > Mechanical Engineering Dept.
> > > University of Alberta
> > > _______________________________________________
> > > gmx-users mailing list
> > > gmx-users at gromacs.org
> > > http://www.gromacs.org/mailman/listinfo/gmx-users
> > > Please don't post (un)subscribe requests to the list. Use the
> > > www interface or send it to gmx-users-request at gromacs.org.
> _______________________________________________
> gmx-users mailing list
> gmx-users at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-users
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-users-request at gromacs.org.
--
David.
________________________________________________________________________
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,  	75124 Uppsala, Sweden
phone:	46 18 471 4205		fax: 46 18 511 755
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

```