I want to compute the value of in lammps. Zi means the each atom’s coordinate in z direction of a certain region and Zave menas the average coordinate in z direction of the same region. The value of Zave is easy to obtain. However, I cannot get access to the value of every atom’s coordinate, and cannot use it to compute |Zi-Zave|. Actually, I want to know whether there is an instruction in lammps to calculate |Zi-Zave|, or how to output the value to logfile through defining variables. And I will be very grateful if you can send me some examples about the use of variable.
Look forward to your reply and thanks in advance.