nve with two langevin thermostat

Dear Lammps users,

I am running a molecular Dynamics simulation in NVE enssemble.

Since I want some part of my polymer chain to be cold, and some other part to be hot.

I use two Langevin thermostat with different temperature.
My problem is, the output mean temperature does not give mes 0.5*(Tcold+Thot) it is closed but not quite.
My system is confined within a spherical shell.

My question is, what should I do? to fix the problem?

I printed out the cold and hot temperature, but the sum of the two does not give the sum of the set temperatures. That suggests that my system is loosing some energy. But how? I don’t see.

Any help will be appreciate.
Thank you,
Stanard MP

There is my script.


How do you know this based on the temperature alone? should energy be conserved for the system you are simulating with those thermostats? The temperature being close to a parameter is not an uncommon sighting in numerical simulation with thermostats and heat baths; exactitude is more along the lines of a surprising result.

Adrian Diaz

Dear Adrian,

Thank you for your repply and help.
Yes i wanted the energy to be conserved.
But yesterday I talked to somebody about the issue. And the person said exactly the same thing you just said.

In conclusion, it will be difficult and unprobable for my system to give me exactly the exact result i am expecting… so I think the system is fine so far.

Thank you very much.

Stanard MP