# How to assign random directions to velocities of atoms in a group?

Dear everyone,

In my simulation, velocities of atoms in a certain group should be set to random directions. It seems I can not achieve this directly by the existing options of velocity command. I am trying to find a simple method but can not get a clue. Could you please give me some hints?

BTW, another question of mine is that, if we use ‘velocity all create 300.0 4928459 rot yes dist gaussian’ to create the velocities, the values of the velocity is based on the gaussian distribution, what about the directions of the velocities created?

Any help would be much appreciated!

With My Best Regards,

Liu

You can replace the ‘all’ with the name of your group.

group myGroup …
velocity myGroup create 300.0 4928459 rot yes dist gaussian

With this command, the mean velocity will be close to zero. If you want it to be exactly zero, add the mom yes (like you have rot yes).

Best,
Anders

Dear Anders Hafreager,

I understand that the command ‘velocity myGroup create 300.0 4928459 rot yes dist gaussian’ makes the velocities of atoms in myGroup as a gaussian distribution. My main question is that what about the directions of the velocities? Are they at random direction?

And I also hope I can get some help about how to set the velocities of atoms to random directions.

With My Best Regards,

Liu

Yes the directions are random.

Anders

Dear Annders,

Thanks very much!

If I want the atoms to be assigned with the same absolute value of velocities but with random directions, e.g. all of the atoms’ velocities are 10m/s but with random directions, is that possible to implement it with the existing options of velocity command? Could you please give me some guide? Thanks in advance!

With My Best Regards,

Liu

Dear Annders,

Thanks very much!

If I want the atoms to be assigned with the same absolute value of
velocities but with random directions, e.g. all of the atoms' velocities
are 10m/s but with random directions, is that possible to implement it with
the existing options of velocity command? Could you please give me some