# How can we calculate energy input/output from multiple thermostats in a system?

**URL:** <https://gromacs.bioexcel.eu/t/how-can-we-calculate-energy-input-output-from-multiple-thermostats-in-a-system/10795>\
**Category:** User discussions\
**Tags:** analysis-tools\
**Created:** [December 12, 2024, 7:03am UTC](https://gromacs.bioexcel.eu/t/how-can-we-calculate-energy-input-output-from-multiple-thermostats-in-a-system/10795 "2024-12-12T07:03:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gusten](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Gusten](https://gromacs.bioexcel.eu/u/Gusten)\
**Post date:** [December 12, 2024, 7:03am UTC](https://gromacs.bioexcel.eu/t/how-can-we-calculate-energy-input-output-from-multiple-thermostats-in-a-system/10795/1 "2024-12-12T07:03:17Z")

</div>

GROMACS version: 2024.4  
GROMACS modification: No  
We are trying to run some NEMD simulations to calculate thermal conductivity. By setting two thermostats with different temperatures on different groups in the system we have created a thermal gradient, but we have yet to find the energy going in and out of the system at the different groups. For the Berendsen thermostat there is a clear expression, based on the group-lambda in the .edr-file, but since it doesn’t produce the canonical ensemble, using it for this purpose seems less than ideal.

Instead we would like to use something like v-rescale or Nosé-Hoover, but for the latter we couldn’t find any group specific energy data except for temperature in the file, and for former group-lambda are listed, but it’s unclear what they express, since no lambda exists in the expression for the thermostat in the documentation or the paper.

Is this group-lambda from v-rescale somehow equivalent to the one for Berendsen(since v-rescale is essentially a Berendsen thermostat with some added noise), a fault in the output from the simulation, or something else?

Thanks!

---

<div class="post-metadata">

**Author:** ![Gusten](https://avatars.discourse-cdn.com/v4/letter/g/a88e57/32.png) [@Gusten](https://gromacs.bioexcel.eu/u/Gusten)\
**Post date:** [December 12, 2024, 7:45am UTC](https://gromacs.bioexcel.eu/t/how-can-we-calculate-energy-input-output-from-multiple-thermostats-in-a-system/10795/2 "2024-12-12T07:45:08Z")

</div>

I suppose from a statistical point of view, we can ignore the stochastic term in the V-rescale, since the expected value is zero, which does leave a simple expression. It’s still unclear what the group-lambda are supposed to be though.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [December 12, 2024, 7:54am UTC](https://gromacs.bioexcel.eu/t/how-can-we-calculate-energy-input-output-from-multiple-thermostats-in-a-system/10795/3 "2024-12-12T07:54:40Z")

</div>

Yes, the group-lambda for V-rescale should be the same velocity scaling factor as in Berendsen.
