Reversible limit of processes of heat transfer

We study a process of heat transfer between a body of heat capacity C(T) and a sequence of N heat reservoirs, with temperatures equally spaced between an initial temperature T_0 and a final temperature T_N. The body and the heat reservoirs are isolated from the rest of the universe, and the body is brought in thermal contact successively with reservoirs of increasing temperature. We determine the change of entropy of the composite thermodynamic system in the total process in which the temperature of the body changes from T_0 to T_N. We find that for large values of N the total change of entropy of the composite process is proportional to (T_N-T_0)/N, but eventually a non-monotonic behavior is found at small values of N.


Introduction
One of the original formulations of the second law of thermodynamics, due to Clausius, states that "no process is possible whose only result is the transfer of heat from a body of lower temperature to a body of higher temperature". As discussed by Fermi in his book [1], since as this statement was made the concept of temperature was empirical, to find out which of two bodies has the higher temperature one had to put them in thermal contact and find out in which sense the heat flows, it will flow spontaneously from the body of higher temperature to the other. So, Clausius's statement could be rephrased into "If heat flows spontaneously from body A to body B, no process is possible whose only result is the transfer of heat from body B to body A". To be more precise, let us isolate the two bodies from the rest of the universe, to assure that they will not exchange heat or other forms of energy with the environment, this is implicit in the term 'only result'. We may notice in this statement that already the idea of irreversibility is present: if heat flows spontaneously from A to B, it will not flow spontaneously from B to A. In other words, the process of transfer of heat between two bodies which are isolated from the environment is irreversible.
The second law off thermodynamics says that not all processes which conserve energy, as required by the first law, occur in nature. In many cases (if not all), if a given process in an isolated system occurs, the inverse process does not. This idea was further formalized by the introduction of the concept of entropy, so that processes in isolated systems which lead to a decrease of the entropy are not allowed. In particular, in the process of heat transfer mentioned above, the entropy of the composite isolated system increases if the heat flows from the body of higher temperature to the one of lower temperature, but would decrease in the inverse process, so that only the further is allowed. It is interesting to recall that in his paper of 1885, Clausius summarized the two first laws of thermodynamics in just two sentences: "The energy of the universe is constant. The entropy of the universe tends to a maximum" [2]. We may notice that the universe is the only composite thermodynamic system which is isolated by definition.
The entropy in equilibrium thermodynamics is a state function, so that it is defined for equilibrium states of the system. When two bodies of different temperatures are brought into thermal contact, the composite system in general will go through a sequence of nonequilibrium states, but if we wait long enough, it will finally reach a new equilibrium state, where both bodies of the composite have the same temperature, and in this state the entropy is larger than it was in the initial state. If we now imagine a process which happens at a very slow rate in time when compared to the relaxation time of the system [3], we may reach a situation close to the one in which all intermediate states of the system are equilibrium states. In this limit the process is called quasi-static, and therefore the whole process may be represented as a path in the space of variables which define the equilibrium states of the system. In the particular case in which the entropy of the final state of the quasi-static process is equal to the entropy of the initial state, and therefore to the entropies of all intermediate states, this process will be reversible.
The process we will study in some detail here is the transfer of heat in isolated systems composed by a heat reservoir (constant temperature) and a body whose heat capacity is described by a function of the temperature C(T ). The initial temperature of the body is T 0 and its final temperature is T N . The change of the temperature of the body is accomplished by putting it in thermal contact with a sequence of N heat reservoirs whose temperatures are equally spaced between T 0 and T N . For a finite number of reservoirs, each of the subprocesses consists of heat transfer between two bodies at different temperatures and is therefore irreversible, leading to an increase of the entropy of the composite isolated system. In the limit N → ∞, however, each sub-process will contribute with a negligible increase of entropy and, what may not be obvious initially, the total variation of entropy vanishes as well, so that this is a concrete example of a limit which leads to a reversible, quasi-static process of heat transfer.
This problem, of considerable pedagogical interest, has been studied before in the literature. For a constant heat capacity, such as is found for ideal gases, Calkin and Kiang [4] have shown for a cyclic process (T 0 → T N → T 0 ), that the total change of entropy vanishes as 1/N in the limit N → ∞ because, although the number of sub-processes increases, the increase of entropy in each of them is proportional to 1/N 2 in this limit. A similar situation is proposed in the exercise 4.4-6 in Callen's book [3]. The same process was studied also by Thomsen and Bers [5], again for the case of constant heat capacity and discussing in detail that it is always possible, given any positive value ϵ, to choose a value of N for which the increase of entropy is smaller than ϵ. This argument is then repeated for the inverse process, thus characterizing the process in the limit N → ∞ as reversible.
Here we generalize the problem in two ways: the heat capacity of the system is no longer constant and we develop the increase of entropy as a series in 1/N , so that we find the corrections to the leading term. We also show that some symmetries in the result which are valid in the asymptotic limit close to reversibility are not longer present for finite values of N . In particular, we show that, although in the large N limit the increase of entropy decreases monotonically with N , this may not happen at lower numbers of heat reservoirs. Also, the increase of entropy for the direct process (T 0 → T N ) may be different of the same quantity for the inverse process (T N → T 0 ). The determination of the change of entropy is given in section 2 and applications to particular cases and final comments may be found in section 3.

Determination of the change of entropy
Let us define the problem in more detail. Our composite system consists of the body, whose heat capacity is C(T ) and which will undergo a temperature change ∆T = T N − T 0 , and a set of N heat reservoirs, at equally spaced temperatures, so that the temperature of the reservoir j (j = 1, 2, 3, . . . , N ) is equal to T j = T 0 + j ∆T /N . The body is brought into thermal contact with the heat reservoirs in order of increasing values of j until its temperature equals the one of the reservoir and therefore is increased bi ∆T /N . In the first sub-process, for example, the body starts with temperature T 0 and ends with temperature T 0 + ∆T /N . After the N 'th process, the body will reach the final temperature T N . This sequence of heat transfer processes is illustrated in Fig. 1. Actually, one could argue that the time required to reach equilibrium for each sub-process of heat transfer would be infinite, and for this reason, Thomsen and Bers, in their discussion of a similar process [5], have chosen the temperature of the j'th reservoir to be T 0 + (j + 1)∆T /N , thus assuring that the equilibration time of the system with each reservoir is finite. Here, for simplicity, we will not use this improved version of the process.  Figure 1 -Illustration of the j'th process of heat transfer, where the system s is in thermal contact with the heat reservoir at temperature T j , so that its temperature is changed from T j−1 to T j .
The pair system-reservoir at T j is isolated, as are all the other reservoirs.
If a the body, at temperature T , receives a quantity of heat dQ b , its temperature will change by dT = dQ b /C(T ). The change of entropy of the body in the whole sequence of heat transfer processes is The change of entropy of all reservoirs in the sequence of processes will be where in the last passage, we recall that in each subprocess, the body and the reservoir are isolated, so that the heat received by the reservoir is given by We thus may write the total change of entropy as If it is possible to perform both integrations, this expression above becomes It is convenient to rewrite the expression for the change of entropy as where κ j (T, N ) = 1 − T /T j and ϕ(T ) = C(T )/T . It is now easy to see that, since stability implies that ϕ(T ) ≥ 0, we must have ∆S ≥ 0, as required by the second law of thermodynamics. Let us show this in some detail. Suppose that T N > T 0 , so that the temperature of the body increases in the process. It is then clear that κ j (T, N ) ≥ 0 and as a consequence the entropy of the composite system increases. The same happens in the inverse process, where the temperature of the body decreases from T N to T 0 . In this case the change if entropy is and since now κ j−1 (T, N ) ≤ 0 in the range of integration, again the entropy increases. It may be worth noticing that the difference of the entropy increases between the processes with raising and lowering of the temperature of the body and the sign of this expression is not defined in general.
Another general property of the entropy increase is its dependence of the number of reservoirs N . As we will see below, it vanishes in the limit N → ∞ of a quasi-static process. The question we will address is if the change of the entropy decreases monotonically with N . For convenience, we will define the function (7) where Θ(T ) is the step function. The function κ(T, N ) is defined in the whole temperature range [T 0 , T N ] and has a sawtooth pattern, with N maxima of decreasing values. The expression for the entropy increase Eq. (4) may then be cast into the following form The difference of entropy increases for two values of N , (9) It is straightforward to see that if N 2 is a multiple of N 1 the difference of κ functions is non-negative, and therefore ∆S(N 1 ) − ∆S(nN 1 ) ≥ 0 for any integer n. For example, we have ∆S(1) > ∆S(2). This, however, is no longer true in general if the ratio N 2 /N 1 is not an integer. As an example, in Fig. 2 we show the difference of κ functions for N 1 = 5 and N 2 = 6, and we notice that this difference assumes negative values in part of the temperature domain. We thus reach the conclusion that, depending on the function ϕ(T ), the entropy increase for N 2 heat reservoirs may be larger than the one for N 1 reservoirs, We now proceed obtaining the general asymptotic behavior of ∆S(N ) for N ≫ 1. Expanding the last integral in the expression for the increase of entropy, Eq. (2), which corresponds to the amount of heat Q j exchanged by the body with reservoir j, in a Taylor series around the temperature T j , we get where a superscript between parenthesis means a derivative of the corresponding function of the order of the superscript. We may now write the total change of entropy as We now proceed transforming the sum over the reservoirs into an integral, using Euler-MacLaurin's expansion [6] n where B 2k are the Bernoulli numbers (B 2 = 1/6, for a list of the numbers). The series in the right hand side is divergent in many cases, since the Bernoulli numbers increase very fast for larger values of k. There are procedures to evaluate the rest R kmax [6] and we will discuss this issue in the appendix. The sum we will convert into an integral is and applying the expansion (12) we find Now we may substitute this last expression into Eq. (11) and collect the terms in the change of entropy of the body in the sequence of processes in powers of 1/N . We notice, as expected, than the term of order 0 cancels, so that, in the limit N → ∞ the whole process becomes reversible. In the appendix, we proceed calculating all coefficients σ i of the expansion but here we we will limit ourselves to the leading term, which is Integrating by parts, we finally obtain the leading term of the expansion valid in the limit N ≫ 1.
Since C(T ) ≥ 0, we notice that the leading term vanishes only in the trivial case where C(T ) = 0 in the whole range of temperatures and there is no heat transfer, so that the asymptotic behavior as 1/N in the increase of entropy, as was found in the particular case of an ideal gas [4], is universal. We also remark that in the asymptotic regime the entropy increase is invariant if the temperatures are interchanged and also monotonically decreasing with N , properties which are not true in general for small values of the number of reservoirs.

Discussions and conclusion
We will now apply the results of the preceding section to some particular cases of physical interest. We start with the ideal gas, which has a constant heat capacity Reversible limit of processes of heat transfer 4306-5 C(T ) = C 0 . Applying Eq. (2) to this particular case, the increase of the entropy will be where f = T N /T 0 . The leading term in this case is In Fig. 3 we show some curves of the entropy increase as a function of 1/N , for different values of the ratio of temperatures f , as well as the dashed straight lines which represent the asymptotic behavior. Notice that, as expected, the same asymptotic behavior is found for f = 2 and f = 1/2. If we consider two processes, one with ratio f 1 > 1 and the other with f 2 = 1/f 1 < 1, that is, related by interchange of the temperatures, both will have the same asymptotic behavior, as may be seen in the particular cases depicted in the figure. Also, the increase of entropy in the second process, where the body is cooled, is always larger than the one in the first process. Another way to state the same property is that, as can be seen in the curves, the increase of entropy is a concave function of 1/N for processes where the body is heated and it is a convex function when the temperature of the body decreases. In the asymptotic regime these properties may be obtained the next term of the Euler-MacLaurin expansion, as will be discussed in the appendix. Also, the increase of entropy for this particular case is a monotonically decreasing function of N . In most cases the variation of entropy decreases monotonically with N , a property which seems also intuitive, since by decreasing the temperature steps in a certain sense the composite process gets closer to a reversible process. For the ideal gas this is always the case. We have seen above, however, that this may not be generally true. If we look at the Eq. (9) for the difference of entropy increases for different values of N , a non-monotonic result is possible if the function ϕ(T ) has one or more peaks at the temperatures where κ(T, N 1 ) − κ(T, N 2 ) is negative. One system which could possibly show a non-monotonic behavior is a twostate system [3], since its heat capacity displays a peak, sometimes called "Schottky hump". However, we found that this is not the case, the reason is that the peak is too wide to produce a non-monotonic behavior.
We turn our attention to a situation where the width of the peak in the heat capacity may be changed by adjusting a parameter. The simple expression we will use for the heat capacity is where τ = T /T c , so that T c is the temperature where the maximum of the heat capacity is located, and C is a constant with the dimension of entropy. Although this heat capacity does not correspond to a particular physical system, it is convenient for analytic calculations and consistent with the third law of thermodynamics.
Of course, at least for odd values of the parameter m, it is valid only if τ is in the range [0, 2], so we will restrict ourselves to this range of temperatures. As the parameter m grows, the peak in C(T ) narrows, and our main interest in this system is that, for sufficiently large values of m, non-monotonic behavior is found in ∆S(N ).
In Fig. 4 we show, in the same graph, the function κ(τ, 2) − κ(τ, 3) and the function ϕ(τ ) = C(τ )/(Cτ ), given by Eq. (20) with m = 16. As is apparent in the graph, with the choices of initial (τ 0 = 0.286) and final (τ N = 2.0) temperatures we made, the maximum of the peak in C(T ) is close to the center of the negative peak in κ(τ, 2)−κ(τ, 3), so that the difference ∆S(2)−∆S (3) is minimized, since this difference is given by Eq. (9). In Table 1 we list the results for [∆S(3) − ∆S(2)]/C for different values of m, with the choices above for τ 0 and τ N , and it is clear that a non-monotonic behavior is found for m ≥ 16. Finally, we found some evidence that a local maximum in the entropy could also be found at N = 4, but if this actually happens for this particular form of heat capacity, it will be at rather large values of m, which lead to numerical problems. We remark that, in order to reduce numerical errors, in all examples we discuss the integrations involved in the calculation of the entropy increase Eq. (2) are performed analytically, as is done in Eq. (3). As discussed before, we expect, qualitatively, the non-monotonic behavior to be enhanced if the peak in the heat capacity is more pronounced. This leads us, in this final example, to a system which undergoes a continuous phase transition, since in this case a singularity at the critical temperature T c is found in the heat capacity, of the form C(T ) ≈ |1 − T /T c | −α , described by the critical exponent α [8]. To the singular behavior of the heat capacity, usually regular contributions should be added, so that we will use the simple expression where we define the reduced dimensionless temperature τ = T /T c and which is compatible with the third law of thermodynamics. It should be mentioned that since the exchange of heat when the temperature of the body crosses the critical temperature has to be finite, we should restrict the critical exponent α to values smaller than 1. It is easy to perform the necessary integrations in this case, so that the entropy increase will be given by Eq. (3) with and We would expect that the non-monotonic behavior of the entropy should be enhanced as the value of the critical exponent α increases. This is actually true, but at variance with what is seen in the preceding example of a peak in the heat capacity, the local maxima of the entropy increase, for lower values of α, appear at larger values of N . In Fig. 5 we see results of the increase of entropy for two values of the exponent, α = 0.7 and α = 0.5. It is apparent that, for α = 0.7 we already have an increase of the change of entropy between N 1 = 2 and N 2 = 3, the segment with a thicker line in the curve. Many other pairs of successive results with the same property are found for larger values of N . For α = 0.5, the first pair where the change of entropy increases is seen at N 1 = 7, N 2 = 8. For a given a value of the critical exponent α, we may find N 1 , the lowest value of N such that ∆S(N 2 ) > ∆S(N 1 ), where N 2 = N 1 + 1. In Fig. 6, the exponent α is plotted as a function of 2/(N 1 + N 2 ), and we notice that, at least for large values of α, that the function shows steps. The results shown are calculated for τ 0 = 0.2 and τ N = 2.2. Thus, for example, if α > 0.555, we notice that the first increase of ∆S(N ) is seen between N 1 = 2 and N 2 = 3, while if α is in the range [0.555, 0.454] this increase is seen at N 1 = 7, N 2 = 8, if α is further decreased the increase shifts to N 1 = 12, N 2 = 13, and so on. This pattern, although qualitatively remaining the same, changes quantitatively for a different temperature range. We notice an interesting behavior for small values of α, which leads to the question if, for any positive α an increase if ∆S(N ) is found for a finite value of N . Due to round-off errors, we could not address this question numerically. However, since the coefficients σ i in the Euler-MacLaurin expansion Eq. (15) diverge in this case for i > 1 and any positive α, the answer to this question should be positive. We discuss this point somewhat more in the appendix.
Finally, we notice that, in opposition to what was found in the first two examples we studied, when the body undergoes a continuous phase transition it is possible that ∆S(N ) > ∆S ′ (N ), that is, the increase of entropy in the heating process is larger than the one in the cooling process, a possibility which was anticipated in the discussion after Eq. (6). In Fig. 7 we present results for the difference in entropy increases ∆S ′ (N ) − ∆S(N ), for α = 0.7 and α = 0.5, as func-tions of 1/N . The temperature interval is τ 0 = 0.2, τ N = 2.2 Although in most cases this difference is positive, for α = 0.7 already for n = 13 we get a negative result, and a set of values of N above this one have the same property. For α = 0.5 the effect is smaller, and the first occurrence of a negative result is for N = 88. Again it would be interesting to study more details of these results at large values of N , but round-off errors prevent this to be done numerically.  A final remark on this example is that, if τ ≪ 1, C(τ ) ≈ Cτ , so that it will show a behavior similar to a gas of non-interacting fermions at low temperature. In this case, if the initial temperature τ 0 approaches 0, the coefficient σ 1 diverges as a logarithm. In other words, in a heating process starting at τ 0 = 0, the tangent to the curve ∆S × 1/N at the origin is vertical. This curve is concave, since σ 2 is negative. The even more unphysical cooling process with vanishing final temperature shows a very uncommon behavior: ∆S(N ) diverges for any finite N and vanishes as N → ∞.
In conclusion, we notice that in general the process of heat transfer between a body and a sequence of heat reservoirs, is a very rich physical situation for understanding of the second law of thermodynamics and the concept of a reversible process. In particular, if the body undergoes a continuous phase transition in the composite process, some curious phenomena appear , which at first seem to defy common sense, but of course none of them violates thermodynamics.

Appendix: Euler-MacLaurin expansion
Here we will develop the terms of the Euler-MacLaurin expansion in some detail. If we substitute Eq. (14) into Eq. (11) and collect the terms in the change of entropy of the body in the sequence of processes in powers of ∆T /N . We notice, as expected, than the term of order 0 cancels, so that, in the limit N → ∞ the whole process becomes reversible. The coefficients we obtain for the change of entropy Eq. (15) are The two first coefficients of this series, after integrating by parts, are:, are and We notice that σ 1 ≥ 0, and vanishes only if the temperature interval is zero or if C(T ) = 0 in the whole interval. In other words, if there is a non-zero heat exchange between the body and the reservoirs, σ 1 is positive. If this coefficient could be negative, the second law would be violated. It is also invariant with respect to a permutation of the temperatures, as was already noted in the examples discussed above. The sign of the second coefficient σ 2 is not fixed, and, as happens with all coefficients of even order, it switches under permutation of the temperatures. The odd order coefficients do not change their sign under this permutation.
In the particular case of an ideal gas, where C(T ) = C 0 , the coefficients are where the last expression is valid for k = 1,2,3,. . . . We notice that, with the exception of the dominant term, only terms with even powers of 1/N appear in the expansion for this particular case. For the heating process T N > T 0 , σ 2 < 0, so that the ∆S is a concave function of 1/N in the limit N → ∞. For the cooling process T N < T 0 , the function is convex. These properties can be verified in the numerical results presented in Fig. 3. Very often the expansion in the Euler-MacLaurin summation (12) does not converge. We find that even for N = 1 the truncated asymptotic values are close to the exact ones at rather low orders. However, truncating at higher orders does not necessarily lead to results closer to the exact ones. For example, for N = 1 the result closest to the exact one is found truncating the series at k max = 6. We notice that higher orders of truncation lead to wrong results, as may be seen in Fig. 8, where the increase of entropy calculated using the expansion Eq. (15), for N = 1 and T N /T 0 = 2, is shown for several orders of truncation. The results oscillate around the exact value at successive orders. The best result is obtained for k max = 6 and if we truncate the expansion at larger orders we observe that they start deviating from the exact value. In the Table 2, we present more results of such calculations. We notice that quite accurate estimates of the entropy change may be obtained if the series is truncated at the most favorable order. The question of determining the order which minimizes the rest R in the Euler-MacLaurin expansion Eq. (12) is rather technical and we refer to the specialized literature for details, but in general it may be assured that, if f (x) in Eq. (12) has always the same sign and if the function and all its derivatives tend monotonically to 0 as x → ∞, which are valid for f (N ) = ∆S(N ), then the rest R kmax is of the same order and has the same sign of the first neglected term [6].