Running ave

Hi,

I have a question regarding running ave in lammps. I found the following in the manual

"“For example, if Nevery=2, Nrepeat=6, and Nfreq=100, then values on timesteps 90,92,94,96,98,100 will be used to compute the final average on timestep 100. Similarly for timesteps 190,192,194,196,198,200 on timestep 200, etc. If Nrepeat=1 and Nfreq = 100, then no time averaging is done; values are simply generated on timesteps 100,200,etc.”

I used
a) Nevery=10, Nrepeat=1, and Nfreq=10 in order to output the output every 10 steps.

Time-averaged data for fix 5b

TimeStep c_1 c_4

0 -4.00762 3.9928
10 -4.00839 3.99734
20 -4.00771 4.00058
30 -4.0054 4.0026
40 -4.00357 4.00495
50 -4.00125 4.00772

b) Nevery=1, Nrepeat=1, and Nfreq=1

Time-averaged data for fix 5

TimeStep c_1 c_4

0 -4.00762 3.9928
1 -4.00774 3.9934
2 -4.0078 3.99394
3 -4.0079 3.99445
4 -4.00798 3.99492
5 -4.00805 3.99535
6 -4.00812 3.99571
7 -4.0082 3.99602
8 -4.0083 3.99629
9 -4.00839 3.99681
10 -4.00846 3.99727

and I compared the values lammps gives me in the set (b) at step 10 with the data in the set (a) and they were slightly different values. I don’t understand the reason. Does lammps still do some averaging?

I really appreciate if you can help me with this issue.

Best,

Shahzad

In the 2nd case the output on step 10 is only the
info from step 10. In the 1st case the output on
step 10 is averaged from steps 1,2,…10. Why
should they be the same?

Steve

Hi Steve,

According to Lammps Manual, . If Nrepeat=1 and Nfreq = 100, then no time averaging is done; values are simply generated on timesteps 100,200,etc."

In the first case, I have Nevery=10, Nrepeat=1, and Nfreq=10, so I assume that it has to give me raw data every 10 steps and no time averaging!

Shahzad

sorry, I misread your first email and thought
you were averaging in one of the runs. Can
you print a dump file for both runs, on timestep 10,
and verify that the 2 dump snapshots are identical?

If they are, then please post as simple an input
script as possible (for a small problem) that shows the difference in
fix ave/spatial outputs, and we can take a look
at why there is a difference.

Steve