[Physics] For change in entropy dS = dq/T, is T the temperature of system or surrounding or both

entropythermodynamics

For change in entropy dS = dqrev/T, is T the temperature of system or surrounding or both?

I am confused about Thot, Tcold, Tsys and Tsurr.
If qrev, are we talking about the reversible cycle such as the carnot engine?

Best Answer

If the heat is transferred reversibly, the temperatures of the two bodies have to be the same. Transfer of heat from hotter to colder body is irreversible.