How to set velocity to particular particles?

Hello there! My program is a 2d simulation about several particles, which have velocity in x an y directions and angular velocity in z direction. I need to give different velocities to them according to particles’ ID after some operations. How to achieve that?
I have read the “velocity” command and it seems that this command will give velocity to a group of particles instead of specfic one.
I can not write a data file to realize it because I need do some operations first and then reset the velocities of every particles.

Have looked at the set command?

much thanks, it helps!