how can I keep the temperature at desired temperature,and make molecule move at the same time

Hi every one

I try to model collision between two molecules in Forcite or DFTB+.The structure has went through geometry optimization and equilibrated through dynamics at  desired temperature 1600k.Then I want to apply a velocity to one of the molecules,so those two molecules can collide at 1600k(at least,the average temperature should be 1600k ).I read  a lot of posts about applying velocity in this community,but if I follow those steps,the temperature will change due to the temperature being calculated by average kinetic energy.

Therefore,I write a script to keep the temperature.My idea is to extract the atom velocity of x,y,z after the structure equilibrated at 1600k.And then I calclate the value by such equation,QQ截图20140714174509.png

and I apply the value of sqrt_velocity to x direction.So the  intial temperature is near the desired temperature 1600k since the average of kinetic energy is the same as it is at 1600k.However,the temperature increased during the dynamics(the average temperature also increased).So I think my idea is infeasible.And my question is:

(1)How can I keep the desired temperature and make molecule move at the same time during dynamics?

Thanks for reading my post and sript

Sincerely

Li