# [gmx-users] Non-equilibrium Viscosity Calculation

David van der Spoel spoel at xray.bmc.uu.se
Tue Apr 21 07:31:45 CEST 2009

```Yanmei Song wrote:
>   Hi, David:
>
>   I performed the NEMD and got the following results for averaging the
> last 1 ns. So the second column should be the acceleration and last
> column should be the 1/viscosity. But notice that there are so many
> big negative numbers, which makes the average negative. Can you help
> me out here? what would be possible reason for this.

xmgrace will tell you which is which, I think the first is shear
viscosity and the second bulk viscosity. Your system might be too smal
(Berk Hess recommends at least 1000 molecules) or the simulation too
short. However bulk viscosity is much more difficult to get right.
Once more, read the literature, and use the tools (xmgrace) the
information is in the xvg file, but you cut it out here.
>
>   1000.000061   -0.007012  -369.713501
>   1020.000061    0.006066  320.372314
>   1040.000000    0.002330  122.940369
>   1060.000000   -0.001427  -75.253372
>   1080.000000    0.002888  152.323944
>   1100.000000    0.005696  300.385651
>   1120.000000    0.002224  117.322388
>   1140.000000    0.005990  316.127655
>   1160.000000    0.008966  472.723846
>   1180.000000    0.004485  236.538010
>   1200.000000   -0.000249  -13.136140
>   1220.000000    0.005020  264.962219
>   1240.000000    0.009248  488.308197
>   1260.000000   -0.000559  -29.509850
>   1280.000000   -0.003190  -168.296112
>   1300.000122    0.002394  126.418747
>   1320.000122    0.003682  194.374222
>   1340.000122    0.000371   19.600368
>   1360.000122   -0.002311  -122.002975
>   1380.000122    0.001776   93.685326
>   1400.000122   -0.003357  -177.067062
>   1420.000122   -0.002963  -156.359772
>   1440.000122   -0.001078  -56.895496
>   1460.000122   -0.002273  -119.947853
>   1480.000122   -0.000658  -34.716648
>   1500.000122   -0.000928  -48.969398
>   1520.000122    0.003464  182.804337
>   1540.000122   -0.001149  -60.652023
>   1560.000122    0.004629  244.299088
>   1580.000122    0.000485   25.557356
>   1600.000122    0.002339  123.374527
>   1620.000122    0.002612  137.982239
>   1640.000122    0.002827  149.150589
>   1660.000122   -0.001614  -85.147079
>   1680.000122    0.005144  271.660522
>   1700.000122   -0.002053  -108.302643
>   1720.000122    0.006096  321.414948
>   1740.000122    0.006021  317.682129
>   1760.000122   -0.001203  -63.409481
>   1780.000122    0.000394   20.755482
>   1800.000122    0.001910  100.748962
>   1820.000122   -0.001588  -83.742523
>   1840.000122    0.002268  119.578842
>   1860.000122    0.002422  127.769302
>   1880.000122   -0.000288  -15.188296
>   1900.000122    0.003324  175.257568
>   1920.000122    0.003688  194.440231
>   1940.000122    0.005800  305.705505
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Mon, Apr 20, 2009 at 11:31 AM, David van der Spoel
> <spoel at xray.bmc.uu.se> wrote:
>> Yanmei Song wrote:
>>> Yes, I want to get the equilibrium viscosity. My question is how I can
>>> identify the system approach a zero acceleration after I try several
>>> values. Thank you so much for your help.
>> Plot viscosity as a function of acceleration. Check the reference (Wensink
>> et al.) that I mailed earlier.
>>> On Mon, Apr 20, 2009 at 10:17 AM, David van der Spoel
>>> <spoel at xray.bmc.uu.se> wrote:
>>>> Yanmei Song wrote:
>>>>> Dear David:
>>>>>
>>>>>
>>>>> Do I have to start the non-equilibrium simulation after the system
>>>>> reach the equilibrium? Or I just need to start at the same starting
>>>>> point as the my equilibrium systems?
>>>> At least equilibrium density.
>>>>> What I need to do is just add the cos_acceleration: to the mdp file
>>>>> and nothing else need to be changed, right?  Also what do you mean by
>>>>> "You need to do a few values such that you can extrapolate to zero
>>>>> acceleration."
>>>> You are interested (I assume) in the equilibrium viscosity, therefore you
>>>> need to do this extrapolation. You can not assume that a small
>>>> acceleration
>>>> is small enough.
>>>>> After I finish the run, what option I should use for g_energy in order
>>>>> to get the viscosity?
>>>> No option.
>>>>
>>>> Just do it (tm).
>>>>> Thank you so much in advance!
>>>>>
>>>>> On Thu, Apr 16, 2009 at 11:33 PM, David van der Spoel
>>>>> <spoel at xray.bmc.uu.se> wrote:
>>>>>> Yanmei Song wrote:
>>>>>>> Dear All:
>>>>>>>
>>>>>>> I wanted to get the viscosity of my simulated polymer system. From the
>>>>>>> manual it said that : GROMACS also has a non-equilibrium method for
>>>>>>> determining the viscosity" (page 123) Does this mean I just need to do
>>>>>>> a separate non-equilibrium MD run? In terms of mdp file, I just need
>>>>>>> to add the following options, right?
>>>>>>> acc_grps:
>>>>>>> accelerate:
>>>>>>> cos_acceleration:
>>>>>> Just the last one.
>>>>>>
>>>>>>> My question is: first, how to set the value of cos_acceleration: ?
>>>>>> You need to do a few values such that you can extrapolate to zero
>>>>>> acceleration.
>>>>>>
>>>>>>> Second, after I finish the run, how can I get the viscosity from the
>>>>>>> simulation result? Anyone has done this yet? Thank you so much for
>>>>>>>
>>>>>> g_energy.
>>>>>>
>>>>>> J Chem Phys 116 (2002) 209-217
>>>>>> J Chem Phys 119 (2003) 7308-7317
>>>>>> --
>>>>>> David van der Spoel, Ph.D., Professor of Biology
>>>>>> Molec. Biophys. group, Dept. of Cell & Molec. Biol., Uppsala
>>>>>> University.
>>>>>> Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205. Fax: +4618511755.
>>>>>> spoel at xray.bmc.uu.se    spoel at gromacs.org   http://folding.bmc.uu.se
>>>>>> _______________________________________________
>>>>>> gmx-users mailing list    gmx-users at gromacs.org
>>>>>> http://www.gromacs.org/mailman/listinfo/gmx-users
>>>>>> Please search the archive at http://www.gromacs.org/search before
>>>>>> posting!
>>>>>> 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 van der Spoel, Ph.D., Professor of Biology
>>>> Molec. Biophys. group, Dept. of Cell & Molec. Biol., Uppsala University.
>>>> Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205. Fax: +4618511755.
>>>> spoel at xray.bmc.uu.se    spoel at gromacs.org   http://folding.bmc.uu.se
>>>> _______________________________________________
>>>> gmx-users mailing list    gmx-users at gromacs.org
>>>> http://www.gromacs.org/mailman/listinfo/gmx-users
>>>> Please search the archive at http://www.gromacs.org/search before
>>>> posting!
>>>> 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 van der Spoel, Ph.D., Professor of Biology
>> Molec. Biophys. group, Dept. of Cell & Molec. Biol., Uppsala University.
>> Box 596, 75124 Uppsala, Sweden. Phone:  +46184714205. Fax: +4618511755.
>> spoel at xray.bmc.uu.se    spoel at gromacs.org   http://folding.bmc.uu.se
>> _______________________________________________
>> gmx-users mailing list    gmx-users at gromacs.org
>> http://www.gromacs.org/mailman/listinfo/gmx-users
>> Please search the archive at http://www.gromacs.org/search before posting!
>> 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 van der Spoel, Ph.D., Professor of Biology
Molec. Biophys. group, Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205. Fax: +4618511755.
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://folding.bmc.uu.se

```