# [lammps-users] changing fix langevin

Hello every one!
the random force that acts in the fix langevin is proportional to sqrt (kb T m/(damp dt) )
where T is the temperature of the entire system,i wish to change the proportionality to (kb T_{n} m/(damp dt) )
where T_{n} is the temperature kinetic energy of the particle on which the force acts .
but there are some things that i don’t understand in the original file and in lammps in general that will help me a lot
the prefactor of the random force is calculated by
gamma2 = sqrt(rmass[i]) * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v;

1. is mvv2e the temperature of the entire system (the sum of the kinetic energy) can i simply change it to v[i][0]*v[i][0]*0.5 ?
2. is ftm2v responsible for the units ?
3. doesn’t sqrt(24.0boltz/t_period/dt/mvv2e) =(kb/(dampdt*T))
4. what does the ratio variable stands for ?

any help on how to accomplish this change in the fix will really help me
sorry for the long post and thanks in advance!!
Tal

# is mvv2e the temperature of the entire system (the sum of the
kinetic energy) can i simply change it to v[i][0]*v[i][0]*0.5 ?

mvv2e is a constant - a conversion factor that changes mvv to units of
energy (e)

# is ftm2v responsible for the units ?

ditto for ftm2v, a constant that converts force-time-mas to units of velocity

# doesn't sqrt(24.0*boltz/t_period/dt/mvv2e) =(kb/(damp*dt*T))

not sure what you are asking here

# what does the ratio variable stands for ?

the command has a "scale" option - this ratio factor applies it

Steve

Hi Steve
thanks for the quick answers !
then i am a bit baffeld where does the temperature enter in the code ? or am i even mistaken that the temperature in the random force is that of the entire system ?

Tal
Steve Plimpton wrote:

The Langevin thermostat does not use the current temperature,
if that's what you're asking. Only the target temperature. Other
thermostats, like Nose/Hoover, use both.

Steve

Hi Steve
i think i understand it then if i wanna implement what i asked about i.e that the the random force that each particle receives is
proportional to (kb T_{n} m/(damp dt) ) where T_{n} is the kinetic energy of the particle which the force belongs to then i need to change the t_target variable right ?
thanks a lot for all the help !
Tal
Steve Plimpton wrote:

That sounds right - but you have the code and formulas in front
of you.

Steve

Tal, I recommend reading the original Langevin thermostat paper - T. Schneider and E. Stoll, Phys. Rev. B 17, 1302 (1978). It explains in detail what the thermostat actually does and why you have the square roots and such. It has to do with satisying the fluctuation-dissipation theorem. It’s not the easiest thing to modify without breaking.

Best,
Rob