# Velocity of certain region

Hi,

I am a new user of Lammps. I want to calculate velocity of a certain region by following formula, V = const value * z position of atom. Can anyone please suggest, which command should I use to determine the velocity. Thanks.

Do you mean calculate the current velocity, or

set the velocity to some desired value?

You can calculate an average velocity

for a one or more sets of atoms (e.g. a region) via the

compute vcm/chunk command.

You can set the velocity of a group of atoms

via the velocity command.

Steve

Thanks for the reply.I want to set the velocity to some desired value. The main issue for me is to calculate the z position of the atoms, as I want to specify the velocity according to the z position. the formula i want to use is v= const * z position of the velocity.Can u pls suggest how to determine the z poisition and use it for setting the velocity. Thanks.

Sorry the formula is v = Const * z position of the atom.

Sorry the formula is v = Const * z position of the atom.

Thanks for the reply.I want to set the velocity to some desired value. The
main issue for me is to calculate the z position of the atoms, as I want to
specify the velocity according to the z position. the formula i want to use
is v= const * z position of the velocity.Can u pls suggest how to determine
the z poisition and use it for setting the velocity. Thanks.

you should be able to use the velocity ramp command for your case.

axel.