# How to calculate diffusion constant vs time?

**URL:** <https://gromacs.bioexcel.eu/t/how-to-calculate-diffusion-constant-vs-time/1204>\
**Category:** User discussions\
**Created:** [December 5, 2020, 2:29pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-diffusion-constant-vs-time/1204 "2020-12-05T14:29:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mj.rezayani](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/mj.rezayani/32/3918_2.png) [@mj.rezayani](https://gromacs.bioexcel.eu/u/mj.rezayani)\
**Post date:** [December 5, 2020, 2:29pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-diffusion-constant-vs-time/1204/1 "2020-12-05T14:29:53Z")

</div>

GROMACS version:2020  
GROMACS modification: Yes/No

Dear all

I want to calculate diffusion constant vs time (D vs t) in Gromacs. Is there a direct way to do that? I want to check system equilibration using block averaging of diffusion constant. If there is another way to check equilibrium state, I would be appreciated to tell.

Thank you in advance

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [December 6, 2020, 10:39pm UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-diffusion-constant-vs-time/1204/2 "2020-12-06T22:39:35Z")

</div>

Simply run `gmx msd` on different time blocks from your simulation.

How you measure “equilibrium state” depends on what is important to you from the simulation. For some systems/properties of interest something as simple as the energy may be sufficient, which typically stabilises pretty quickly. However, with others (such as bilayer phase behaviour) the structure and behaviour occurs over much longer time frames.

---

<div class="post-metadata">

**Author:** ![mj.rezayani](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/mj.rezayani/32/3918_2.png) [@mj.rezayani](https://gromacs.bioexcel.eu/u/mj.rezayani)\
**Post date:** [December 7, 2020, 11:06am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-diffusion-constant-vs-time/1204/3 "2020-12-07T11:06:17Z")

</div>

Dear Dr\_DBW

Thank you very much for your reply.

I have a question. Is it possible to check the time that system reaches to equilibrium state using velocity auto correlation function?

Best

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [December 8, 2020, 2:12am UTC](https://gromacs.bioexcel.eu/t/how-to-calculate-diffusion-constant-vs-time/1204/4 "2020-12-08T02:12:32Z")

</div>

Does the velocity of the particles and their correlation with time relate with the property you are interested in? If your answer is yes, then it is likely to provide an indicator. If your answer is no, then you need to find another property to monitor.
