arXiv:2102.05493v1 [math-ph] 10 Feb 2021 et eetees twssoni 5,adltri 3,2,3] hta that 37], 27, [36, in is later that and view [5], conf of in n are point shown representations this was two it the itself the Nevertheless, since By and lent. flaw major energy system. a the thermodynamic as considered same between 6 the distinction 26, of a 8, representation makes 16, thermodynamics 13, ge Other 11, of survey. 19, includes and 4, thermodynamics introduction of 34, recent s formulation a 33, variational a for 32, the spurred [7] emphasizing 31, and This 30, 12], fo [29, 10, [21]. geometric 39, 1970s the e.g. for early see framework the papers; natural since a thermodynamics as classical relation, recognized thermodynamic been fundamental has Gibbs’ from Starting Introduction 1 n I n h a .WlesCne o ytm n Control, and Systems for Netherlands, the Center AK, Willems 9700 C. 407, Jan Box the PO and AI, and h xeso fcnatmnflsto manifolds contact of extension the a n oedge ffedm aldaguevral n[] rmat variables a intensive From the [5]. replacing in variable to coordinates gauge amounts homogeneous a it called freedom, perspective of symplectic dynamics degree even-dimensional more one this has manifold contact odd-dimensional ewe h xesv n nesv aibe ftethermodynam of the definition of the variables enables dis intensive it clear a and Secondly, yields extensive f it First, in the well. advantag manifolds, between as additional symplectic thermodynamics has of to formulation section, manifolds metric zero contact without of bundles [20]. extension cotangent to the back dating [37], 25]; in [2, geometry differential in well-known rather hroyai ytm htitrc ihterevrnetvaeit via environment their with interact that systems thermodynamic a led rudwti ieeta emtyb rod[,3]. [2, Arnold by geometry differential within argued already was or ∗ nrp flow entropy nteohrhn,a icse n[] h otc-emti form contact-geometric the [5], in discussed as hand, other the On ..vndrShf swt h enul nttt o Mathe for Institute Bernoulli the with is Schaft der van A.J. iuil emtyo classical of geometry Liouville ot.Fnly ypetzto has symplectization Finally, ports. merging thermodynamics nfc,this fact, In . ra a e Schaft der van Arjan h nryadetoyrpeetto soee by offered is representation entropy and energy the eray1,2021 11, February [email protected] symplectic ottemdnmcsystems port-thermodynamic symplectization aiod.Cmae ihthe with Compared manifolds. ∗ computational fcnatmnflsis manifolds contact of ais optrScience Computer matics, nvriyo Groningen, of University otc geometry contact ral equiva- ormally sfrtegeo- the for es mti work ometric mlto of rmulation 7 5 23, 35, 17, , hc are which , attractive n eet;as benefits; e o be not eed csystem. ic sargued As her 2,15]. [28, manifold ytheir by tinction entropy re of eries hermo- ulation c to act power The present paper aims at providing an in-depth treatment of the resulting geometry of thermodynamic systems, continuing the earlier investigations in [36, 37] and building upon [2, 3, 25]. Starting point are cotangent bundles with- out zero section, endowed with their natural one-form; also called the Liouville form1. Instead of considering the symplectic geometry derived from the sym- plectic form ω = dα, where α is the Liouville form, a smaller set of geometric objects will be defined solely based on this Liouville form. The resulting geome- try is called Liouville geometry. In particular, it will be shown how a particular class of Lagrangian submanifolds (called Liouville submanifolds) can be defined as maximal submanifolds on which the Liouville form is zero. Furthermore, a particular type of Hamiltonian vector fields is defined consisting of vector fields which leave the Liouville form invariant. All these geometric objects have the property that they are homogeneous in the cotangent variables. As a result they are in one-to-one correspondence with objects on the underlying contact manifold (of dimension one less). We will study in detail the generating func- tions of Liouville submanifolds and the homogeneous Hamiltonian functions of this special type of Hamiltonian vector fields, and relate them to their contact geometry counterparts. Continuing upon [37] it will be shown how this leads to the definition of a port-thermodynamic system, and its projection to the contact manifold. Finally we will focus on an additional homogeneity structure, present in some thermodynamic systems, corresponding to homogeneity in the exten- sive variables. This leads to a new geometric view on the classical Gibbs-Duhem relation, and a subsequent projection to an even-dimensional space. The rest of the paper is structured as follows. In Section 2 it is discussed, using the example of a simple gas, how thermodynamics leads to the study of cotangent bundles over the base space of extensive variables, with cotangent variables being the homogeneous coordinates for the intensive variables. The resulting Liouville geometry of a general without zero section, and its projection to contact geometry, is studied in Section 3. Then Section 4 provides the definition of port-thermodynamic systems using Liouville geom- etry, and its projection to a contact-geometric description. Section 5 discusses homogeneity with respect to the extensive variables, the Gibbs-Duhem relation, and its geometric formalization. Finally, Section 6 contains the conclusions.

2 From thermodynamics to contact and Liou- ville geometry

In this section we will motivate how classical thermodynamics, starting from Gibbs’ thermodynamic relation, naturally leads to contact geometry, and how by considering homogeneous coordinates for the intensive variables this results in Liouville geometry.

1Sometimes also called the Poincar´e-Liouville form, or tautological form. 2.1 From Gibbs’ fundamental thermodynamic relation to contact geometry Consider a simple thermodynamic system such as a mono-phase, single con- stituent, gas in a confined compartment with volume V and pressure P at tem- perature T . It is well-known that the state properties of the gas are described by a 2-dimensional submanifold of the ambient space R5 (the thermodynamic phase space) with coordinates E (energy), S (entropy), V , P , and T . Such a submanifold characterizes the properties of the gas (e.g., an ideal gas, or a Van der Waals gas), and all of them share the following property. Define the Gibbs one-form on the thermodynamic phase space R5 as

θ := dE − T dS + P dV (1)

Then θ is zero restricted to the submanifold characterizing the state properties. This is called Gibbs’ fundamental thermodynamic relation. It implies that the extensive variables E,S,V and the intensive variables T, P are related in a specific way. Geometrically this is formalized by noting that the Gibbs one- form θ defines a contact form on R5, and that any submanifold L capturing the state properties of the thermodynamic system is a submanifold of maximal dimension restricted to which the contact form θ is zero. Such submanifolds are called Legendre submanifolds of the contact manifold (R5,θ). By expressing the extensive variable E as a function E = E(S, V ) of the two remaining extensive variables S and V , Gibbs’ fundamental relation implies that the Legendre submanifold L specifying the state properties is given as ∂E ∂E L = {(E,S,V,T,P ) | E = E(S, V ),T = , −P = } (2) ∂S ∂V Hence L is completely described by the energy function E(S, V ), whence the name energy representation for (2). On the other hand, there are other ways to represent L. If L is parametrizable by the variables T, V (instead of S, V as in (2)), then one defines the partial Legendre transform of E(S, V ) with respect to S as ∂E A(T, V ) := E(V,S) − TS, T = (S, V ), (3) ∂S

∂E where S is solved from T = ∂S (S, V ). Then L is also described as ∂A ∂A ∂A L = {(E,S,V,T,P ) | E = A(T, V ) − T ,S = − , −P = } (4) ∂T ∂T ∂V A is known as the Helmholtz free energy, and is one of the thermodynamic potentials derivable from the energy function E(S, V ); see e.g. [14]. Two other possible parametrizations of L (namely by S, P , respectively by T, P ) correspond to two more thermodynamic potentials, namely the enthalpy H(S, P ) and the Gibbs’ free energy G(T, P ), resulting in similar expressions for L. In general [2, 25], a contact manifold (M,θ) is an odd-dimensional manifold equipped with a contact form θ. A one-form θ ona(2n+1)-dimensional manifold M is a contact form if and only around any point in M we can find coordinates (q0, q1, ··· , qn,γ1, ··· ,γn) for M, called Darboux coordinates, such that

n

θ = dq0 − γj dqj (5) Xj=1

Equivalently, θ is a contact form if θ ∧ (dθ)n is nowhere zero on M. A Legendre submanifold of a contact manifold (M,θ) is a submanifold of maximal dimension restricted to which the contact form θ is zero. The dimension of any Legendre submanifold of a (2n + 1)-dimensional contact manifold is equal to n. In fact, we will use throughout this paper the slightly generalized definition of a contact manifold as given in e.g. [2], where the contact form θ is only required to be defined locally. What counts is the contact distribution; the 2n- dimensional subspace of the tangent space at any point of M defined by the kernel of the contact form θ at this point. This turns out to be the appropriate concept for the thermodynamic phase space being a contact manifold2. Apart from the above parametrizations of the Legendre submanifold L, cor- responding to an energy function E(S, V ) and its Legendre transforms, there is still another, although very similar, way of describing L. This alternative option is motivated from a modeling point of view. Namely, often thermodynamic sys- tems are formulated by first listing the balance laws for the extensive variables apart from the entropy S, and then expressing S as a function S = S(E, V ). This leads to the entropy representation of the submanifold L ⊂ R5, given as 1 ∂S P ∂S L := {(E,S,V,T,P ) | S = S(E, V ), = , = } (6) T ∂E T ∂V Analogously the case of the energy representation E = E(S, V ), one may consider thermodynamic potentials obtained by partial Legendre transform of S(E, V ). Geometrically the entropy representation corresponds to the modified Gibbs contact form 1 P θ := dS − dE − dV, (7) T T e which is obtained from the original Gibbs contact form θ in (1) by division by −T (called conformal equivalence). In this way the Gibbs fundamental relation 1 P is rewritten as θ|L = 0, and the intensive variables become T , T . e 2.2 From contact to Liouville geometry The contact-geometric view on thermodynamics, directly motivated by Gibbs’ fundamental thermodynamic relation, has two shortcomings:

2Contact manifolds for which the contact form θ is defined globally are sometimes called exact contact manifolds. (1) Switching from the energy representation E = E(S, V ) to the entropy rep- resentation S = S(E, V ) corresponds to replacing the Gibbs form θ by the modified Gibbs form θ in (7), and thus leads to a similar, but different, contact- geometric description. e (2) The contact-geometric description does not make a clear distinction between, on the one hand, the extensive variables E,S,V and, on the other hand, the 1 P intensive variables T, −P (energy representation), or T , T (entropy represen- tation). In fact, given a contact form θ there are many Darboux coordinates 5 q0, q1, q2,p1,p2 for R such that θ = dq0 − p1dq1 − p2dq2, where q0, q1, q2 are not necessarily obtained by a transformation of only the extensive variables E,S,V .

The way to remedy these shortcomings is to extend the contact manifold by one extra dimension to a , in fact a cotangent bundle, with an additional homogeneity structure. This construction is rather well-known in differential geometry [2, 25], but was advocated within a thermodynamics con- text only in [5], and followed up in [36, 37]. For a simple thermodynamic system with extensive variables E,S,V and intensive variables T, −P , the construction amounts to replacing the intensive variables T, −P by their homogeneous coor- dinates pE,pS,pV with pE 6= 0, i.e., p p T = S , −P = V (8) −pE −pE

1 P Equivalently, the intensive variables T , T in the entropy representation are rep- resented as 1 p P p = E , = V (9) T −pS T −pS

This means that the two contact forms θ = dE − T dS + P dV and θ = dS − 1 dE − P dV are replaced by a single symmetric expression, namely by T T e

α := pEdE + pSdS + pV dV, (10)

The one-form α is nothing else than the canonical Liouville one-form on the cotangent bundle T ∗R3, with R3 the space of extensive variables E,S,V . Thus the thermodynamic phase space R5 has been replaced by T ∗R3. More precisely, by definition of homogeneous coordinates the vector (pE ,pS,pV ) is different from the zero vector, and hence the space with coordinates E,S,V,pE,pS,pV is actually the cotangent bundle T ∗R3 minus its zero section; denoted as T ∗R3. Any 2-dimensional Legendre submanifold L ⊂ R5 describing the state prop- erties is now replaced by a 3-dimensional submanifold L ⊂ T ∗R3, given as

∗ 3 pS pV L = {(E,S,V,pE,pS,pV ) ∈ T R | (E, S, V, , ) ∈ L} (11) −pE −pE

It turns out that L is a Lagrangian submanifold of T ∗R3 with symplectic form ω := dα, with an additional property of homogeneity. Namely, whenever (E,S,V,pE,pS,pV ) ∈ L, then also (E,S,V,λpE , λpS, λpV ) ∈ L, for any non- zero λ ∈ R. Such Lagrangian submanifolds turn out to be fully character- ized as maximal manifolds restricted to which the Liouville one-form α = pEdE + pSdS + pV dV is zero, and will thus be called Liouville submanifolds of T ∗R3. As we will see in the next section the extension of contact manifolds to cotangent bundles, replacing the intensive variables by their homogeneous coordinates, also leads to a natural homogeneous Hamiltonian dynamics on the extended space T ∗R3. This does not only facilitate the analysis, but has clear computational advantages as well. In fact, all computations become standard operations on cotangent bundles and in Hamiltonian dynamics. In the words of Arnold [3]: one is advised to calculate symplectically (but to think rather in terms of contact geometry). All of this is immediately extended from the thermodynamic phase space R5 with coordinates E,S,V,T,P to general thermodynamic phase spaces. For instance, in the case of multiple chemical species the Gibbs form θ extends to dE − T dS + P dV − k µkdNk, where Nk and µk, k = 1, ··· , s, are the mole numbers, respectively,P chemical potentials of the k-th species. Correspondingly, the thermodynamic phase R5 ×R2s is replaced by the cotangent bundle without ∗ 3+s zero-section T R , with extensive variables E,S,V,N1, ··· ,Ns and Liouville form

pEdE + pSdS + pV dV + p1dN1 + ··· + psdNs, (12)

p1 ps where µ = , ··· ,µs = . 1 −pE −pE

3 Liouville geometry

This section is concerned with the general definition and analysis of geometric objects on the cotangent bundle without zero section, which project to the underlying contact manifold. Since everything is based on the Liouville form this will be called Liouville geometry. In particular, we will deal with Liouville submanifolds and homogeneous Hamiltonian dynamics.

3.1 Cotangent bundles and the canonical contact manifold In the previous section it was indicated how the thermodynamic phase space can be extended to a cotangent bundle, without its zero section, by the use of homogeneous coordinates for the intensive variables. Furthermore, it was shown how in this way the energy and entropy representation are unified, and how this provides a geometric definition of extensive and intensive variables. Conversely, in this subsection we will start with a general cotangent bundle without zero section, and show how this leads to the canonical contact manifold serving as thermodynamic phase space. Consider a thermodynamic system with total space of extensive variables, including energy E and entropy S, given by the manifold Q. Then consider the cotangent bundle T ∗Q without its zero section. The Liouville one-form α on ∗ ∗ ∗ T Q is defined as follows. Consider η ∈ T Q,X ∈ TηT Q, and define

αη(X) := η(pr∗X), (13) where pr : T ∗Q→Q is the bundle projection. Then ω := dα, with d , is the canonical symplectic form on T ∗Q. Furthermore, the Euler vector field Z is defined as the unique vector field satisfying

dα(Z, ·)= α (14)

This also implies LZ α = α, with L denoting . In coordinates α, ω and Z take the following simple form. Let dim Q = n + 1, with local coordinates q0, ··· , qn, and let p0, ··· ,pn be the corresponding ∗ coordinates for the cotangent spaces Tq Q. Then

n n n ∂ α = pidqi, ω = dpi ∧ dqi,Z = pi (15) ∂pi Xi=0 Xi=0 Xi=0 Based on T ∗Q we may define a canonical contact manifold in the following way ∗ [2]. For each q ∈Q and each cotangent space Tq Q consider the projective space P ∗ ∗ (Tq Q), given as the set of rays in Tq Q, that is, all the non-zero multiples of P ∗ a non-zero cotangent vector. Thus the projective space (Tq Q) has dimension ∗ P ∗ ∗ n, and there is a canonical projection πq : Tq Q → (Tq Q), where Tq Q denotes the cotangent space without its zero vector. The fiber bundle of the projective P ∗ P ∗ spaces (Tq Q), q ∈ Q, over the base manifold Q will be denoted by (T Q). ∗ Furthermore, denote the bundle projection obtained by considering πq : Tq Q → P ∗ ∗ P ∗ (Tq Q) for every q ∈Q by π : T Q → (T Q). As detailed in [2, 3, 37, 36], P(T ∗Q) defines a canonical3 contact manifold of dimension 2n+1. The contact manifold P(T ∗Q) will serve as the thermodynamic phase space for the thermodynamic system with space of external variables Q. ∗ Given natural coordinates q0, ··· , qn,p0, ··· ,pn for T Q, we may select dif- ferent sets of local coordinates for P(T ∗Q) and corresponding different expres- ∗ P ∗ sions of the projection π : Tq Q → (Tq Q). In fact, whenever p0 6= 0 we may ∗ P ∗ express the projection πq : Tq Q → (Tq Q) by the map

(p0,p1, ··· ,pn) 7→ (γ1, ··· ,γn) (16) where

p1 pn γ1 = , ··· ,γn = (17) −p0 −p0 This means that

α = p0dq0 + p1dq1 + ··· + pndqn = p0 dq0 − γ1dq1 ···− γndqn =: p0θ, (18)  3In the sense that any other (2n + 1)-dimensional contact manifold is locally contactomor- phic to P(T ∗Q) [2, 25]. with θ a locally defined contact form on P(T ∗Q). Clearly, the same can be done for any of the other coordinates pi, defining different contact forms. For ∗ P ∗ example, if p1 6= 0 we may express πq : Tq Q → (Tq Q) also by the map

(p0,p1, ··· ,pn) 7→ (γ0, γ2, ··· , γn), (19) where e e e p0 p2 pn γ0 = , γ2 = , ··· , γn = , (20) −p1 −p1 −p1 so thate e e

α = p1 dq1 − γ0dq0 − γ2dq2 ···− γndqn =: p1θ (21)  In the thermodynamicse contexte of Sectione 2, with eq0 = E, q1 = S, and thus p0 = pE,p1 = pS, the first option corresponds to the energy representation and the second to the entropy representation. Importantly, there is a direct correspondence between all geometric ob- jects (functions, Legendre submanifolds, vector fields) on the contact manifold P(T ∗Q) with the same objects on T ∗Q endowed with an additional homogene- ity property in the p variables. A key element in this is Euler’s theorem on homogeneous functions; see e.g. [37]. Definition 3.1. Let r ∈ Z. A function K : T ∗Q → R is called homogeneous of degree r in p if K(q,λp)= λrK(q,p), for all λ 6= 0 (22) Theorem 3.2 (Euler’s homogeneous function theorem). A differentiable func- tion K : T ∗Q → R is homogeneous of degree r in p if and only if n ∂K ∗ pi (q,p)= rK(q,p), for all (q,p) ∈ T Q (23) ∂pi Xi=0 Moreover, if K is homogeneous of degree r in p, then all its derivatives ∂K (q,p),i =0, 1, ··· , n, are homogeneous of degree r − 1 in p. ∂pi Furthemore K : T ∗Q → R is homogeneous of degree 0 in p if and only if LZ K =0, and homogeneous of degree 1 in p if and only if LZ K = K, where Z is the Euler vector field and L denotes Lie derivation. Since until Section 5 homogeneity will always refer to homogeneity in the p-variables we will often simply talk about ’homogeneity’. Obviously, functions K : T ∗Q → R which are homogeneous of degree 0 in p are those functions which project under π to functions on P(T ∗Q), i.e., K = π∗K with K : P(T ∗Q) → R. In the next two subsections we will consider two more classes of objects which project to P(T ∗Q). b b 3.2 Liouville submanifolds Legendre submanifolds of the canonical thermodynamic phase space P(T ∗Q) are in one-to-one correspondence with Liouville submanifolds4 of T ∗Q, defined 4Previously called homogeneous Lagrangian submanifolds in [37]. as follows. Definition 3.3. A submanifold L ⊂ T ∗Q is called a Liouville submanifold if the Liouville form α restricted to L is zero and dim L = dim Q. Recall that L is a Lagrangian submanifold of T ∗Q if ω = dα is zero on L and dim L = dim Q (or, equivalently, ω is zero on L and L is maximal with respect to this property.) The following proposition shows that Liouville submanifolds are actually Lagrangian submanifolds of T ∗Q with an additional homogeneity property. Proposition 3.4. L ⊂ T ∗Q is a Liouville submanifold if and only if L is a Lagrangian submanifold of the symplectic manifold (T ∗Q,ω) with the property that (q,p) ∈ L ⇒ (q,λp) ∈ L (24) for every 0 6= λ ∈ R. Proof. First of all note that the homogeneity property (24) is equivalent to tangency of the Euler vector field Z to L. (Only if) By Palais’ formula (see e.g. [1], Proposition 2.4.15) L L dα(X1,X2)= X1 (α(X2)) − X2 (α(X1)) − α ([X1,X2]) (25) for any two vector fields X1,X2. Hence, for any X1,X2 tangent to L we obtain dα(X1,X2) = 0, implying that L is a Lagrangian submanifold. Furthermore, by (14) dα(Z,X)= α(X)=0, (26) for all vector fields X tangent to L. Because L is a Lagrangian submanifold this implies that Z is tangent to L (since a Lagrangian submanifold is a maximal submanifold restricted to which ω = dα is zero.) (If). If L is Lagrangian and satisfies (24), then Z is tangent to L, and thus (26) holds for all vector fields X tangent to L, implying that α is zero restricted to L.  Remark 3.5. It also follows that L ⊂ T ∗Q is a Liouville submanifold if and only if it is a maximal submanifold on which α is zero. Liouville submanifolds of T ∗Q are in one-to-one correspondence with Leg- endre submanifolds of the canonical contact manifold P(T ∗Q). Recall that a submanifold of a (2n + 1)-dimensional contact manifold is a Legendre subman- ifold [2, 25] if the locally defined contact form θ is zero restricted to it, and its dimension is equal to n (the maximal dimension of a submanifold on which θ is zero). Proposition 3.6 ([25], Proposition 10.16, [37]). Consider the projection π : T ∗Q → P(T ∗Q). Then L ⊂ P(T ∗Q) is a Legendre submanifold if and only if L := π−1(L) ⊂ T ∗Q is a Liouville submanifold. Conversely, any Liouville b submanifold L ⊂ T ∗Q is of the form π−1(L) for some Legendre submanifold L. b b b This implies as well a one-to-one correspondence between generating func- tions of Legendre submanifolds L⊂ P(T ∗Q) and generating functions of Liou- ville submanifolds L ⊂ T ∗Q with π−1(L). Recall from [25, 2] that any Legendre b submanifold L ⊂ P(T ∗Q) with Darboux coordinates q , q , ··· , q ,γ , ··· ,γ b 0 1 n 1 n can be represented as b ∂F ∂F ∂F L = {(q0, q1, ··· , qn,γ1, ··· ,γn) | q0 = F −γJ , qJ = − , γI = } (27) ∂γbJ ∂γbJ ∂qbI b b for some disjoint partitioning I ∪ J = {1, ··· ,n} and some function F (qI ,γJ ), called a generating function for L. Here γJ is the vector with elements γℓ = b b b pℓ ∂F ∂F ,ℓ ∈ J, and γJ is shorthand notation for γℓ . Conversely any −p0 ∂γJ b ℓ∈J ∂γℓ submanifold L as given in (27), for any partitioningPI ∪J = {1, ··· ,n} and func- tion F (q ,γ ), is a Legendre submanifold. This implies that the corresponding I J b Liouville submanifold L = π−1(L) is given as b b ∂F ∂F ∂F L = {(q0, ··· , qn,p0, ··· ,pn) | q0 = − , qJ = − , pI = }, (28) ∂p0 ∂pJ ∂qI where

pJ F (qI ,p0,pJ ) := −p0F (qI , ) (29) −p0 b This is immediately verified by exploiting the identities

b b ∂F pJ ∂F pJ pJ ∂F − = F (qI , − )+ p0 (qI , − ) 2 = F (qI ,γJ ) − γJ ∂p0 p0 ∂γJ p0 p0 ∂γJ b b b (30) ∂F ∂F 1 ∂F ∂F ∂F = −pb · = , = −p b= −p γI = pI ∂pJ 0 ∂γJ −p0 ∂γJ ∂qI 0 ∂qI 0

Thus F (qI ,p0,pJ ) is a generating function of L. Conversely, any Liouville submanifold as in (28) for some p0 (possibly after renumbering the index set {0, 1, ··· ,n}) and generating function F as given in (29) for some F (qI ,γJ ), pJ ∗ with I ∪ J = {1, ··· ,n} and γJ = − defines a Liouville submanifold of T Q. p0 b pJ Note that the generating function F (qI ,p0,pJ ) = −p0F (qI , −p0 ) as in (29) for the Liouville submanifold L is homogeneous of degree 1 in p. The corre- b spondence (29) between the generating function F (qI ,p0,pJ ) of the Liouville −1 submanifold L = π (L) and the generating function F (qI ,γJ ) of the Legendre submanifold L is of a well-known type in the theory of homogeneous functions. b b Indeed, for any function K(q,p) that is homogeneous of degree 1 in p, we can b define

K(q,γ1, ··· ,γn) := K(q, −1,γ1, ··· ,γn), (31) implyingb that

p1 pn K(q,p0,p1, ··· ,pn)= −p0K(q, , ··· , ) (32) −p0 −p0 b Finally note that the correspondence between the Liouville submanifold L and the Legendre submanifold L and their generating functions can be obtained for any numbering of the set {0, 1, ··· ,n}, and thus for any choice of p . This pro- b 0 vides other coordinatizations of the same Legendre submanifold L ⊂ P(T ∗Q). The representation of L either in energy or in entropy representation is an ex- b ample of this. b 3.3 Homogeneous Hamiltonian and contact vector fields

∗ ∗ For any function K : T Q → R the Hamiltonian vector field XK on T Q is defined by the standard Hamiltonian equations ∂K ∂K q˙i = (q,p), p˙i = − (q,p), i =0, 1 ··· , n, (33) ∂pi ∂qi or equivalently, ω(XK, −) = −dK. Note that since dα(Z, ·) = α, we have α(XK )= dα(Z,XK )= LZ K = K. Hence a Hamiltonian K is homogeneous of degree 1 in p if and only if

α(XK )= K (34)

Furthermore Proposition 3.7. If K : T ∗Q → R is homogeneous of degree 1 in p then its Hamiltonian vector field XK satisfies L XK α =0 (35)

Conversely, if the vector field X satisfies LX α = 0, then X = XK where the function K := α(X) is homogeneous of degree 1 in p. Proof. By Cartan’s formula, with L denoting Lie derivative and i contraction,

LX α = iX dα + diX α = iX dα + d (α(X)) (36)

If K is homogeneous of degree 1 in p then by (34) iXK dα +d (α(XK )) = −dK + L L dK = 0, implying by (36) that XK α = 0. Conversely, if X α = 0, then (36) yields iX dα + d (α(X)), implying that X = XK with K = α(X), which by (34) is homogeneous of degree 1 in p.  Thus the Hamiltonian vector fields with a Hamiltonian homogeneous of de- gree 1 in p are precisely the vector fields that leave the Liouville form α invariant. For simplicity of exposition the Hamiltonians K : T ∗Q → R that are homoge- neous of degree 1 in p, and their corresponding Hamiltonian vector fields XK , will be simply called homogeneous in the sequel. Note that by Theorem 3.2 (Euler’s theorem) the expressions ∂K (q,p),i = ∂pi 0, 1 ··· , n, are homogeneous of degree 0 in p since K is homogeneous of degree 1 in p. Hence the dynamics of the extensive variables q in (33) is invariant under scaling of the p-variables, and thus expressible as a function of q and the inten- sive variables γ. In fact, any homogeneous Hamiltonian vector field projects to a contact vector field on the thermodynamic phase space P(T ∗Q), and conversely any contact vector field on P(T ∗Q) is the projection of a homogeneous Hamil- tonian vector field on T ∗Q. This can be seen from the following computations. Consider a homogeneous Hamiltonian vector field XK . Since K is homogeneous p1 pn of degree 1 in p we can write as in (32) K(q,p)= −p0K(q, −p0 , ··· , −p0 ), with K(q,γ) as defined in (31). This means that the equationsb (33) of the Hamilto- nian vector field X take the form b K b b n ∂K pℓ n ∂K q˙0 = −K(q,γ) − p0 (q,γ) ·− 2 = −K(q,γ)+ γℓ (q,γ) ℓ=1 ∂γℓ p0 ℓ=1 ∂γℓ b P b P q˙ = −pb ∂K (q,γ) · 1 = ∂K (q,γ), j =1, ···b ,n j 0 ∂γj −p0 ∂γj b p˙ = p ∂K (q,γ), i =0, ··· ,n i 0 ∂qi (37)

pj where γj = −p0 , j =1, ··· ,n. Combining with

1 pj γ˙j = p˙j + 2 p˙0, j =1, ··· , n, (38) −p0 p0 this yields the following projected dynamics on the contact manifold P(T ∗Q) with coordinates (q,γ)

n ∂Kb q˙ = γℓ (q,γ) − K(q,γ) 0 ℓ=1 ∂γℓ Pb q˙ = ∂K (q,γ),b j =1, ··· ,n (39) j ∂γj

∂Kb ∂Kb γ˙ j = − (q,γ) − γj (q,γ), j =1 ··· ,n ∂qj ∂q0

This is recognized as the contact vector field [25] with contact Hamiltonian

K. Indeed, given a contact form θ the contact vector field XKb with contact 5 Hamiltonianb K is defined through the relations

L b b b XKc θ = ρK θ, −K = θ(XK ) (40) b for some function ρKb (depending on K). The first equation in (40) expresses the condition that the contact vector field leaves the contact distribution (the kernel b of the contact form θ) invariant. Equations (40) for θ = dq0 − γ1dq1 ···− γndqn and K(q,γ) can be seen to yield the same equations as in (39); see [25, 11] for details. Conversely, any contact vector field with contact Hamiltonian K(q,γ) b defines a homogeneous Hamiltonian vector field on T ∗Q with homogeneous p1 pn b Hamiltonian −p0K(q, −p0 , ··· , −p0 ). As before, the coordinate expression (39)

5Here the sign conventionb of [7] is followed. of the contact vector field depends on the numbering of the homogeneous coor- dinates p0,p1, ··· ,pn; i.e., the choice of p0. In the thermodynamics context this is again illustrated by the choice of either the energy or entropy representation (corresponding to choosing p0 = pE or p0 = pS). The projectability of any homogeneous Hamiltonian vector field XK to a P ∗ contact vector field XKb on (T Q) also follows from the following proposition, and the fact that the projection π : T ∗Q → P(T ∗Q) is along the Euler vector field Z.

Proposition 3.8. Any homogeneous Hamiltonian vector field XK satisfies [XK ,Z]=0. Proof. By [1](Table 2.4-1) L L L L i[XK ,Z]dα = XK iZ dα − iZ XK dα = XK α − iZ d XK α =0 − 0=0, (41) L since XK α = 0. Because ω = dα is a symplectic form this implies [XK ,Z] = 0. 

Although homogeneous Hamiltonian vector fields are in one-to-one corre- spondence with contact vector fields, typically computations for homogeneous Hamiltonian vector fields are much easier than the corresponding computations for their contact vector field counterparts. First note the following properties proved in [37, 36].

Proposition 3.9. Consider the {K1,K2} of functions K1,K2 on T ∗Q defined with respect to the symplectic form ω = dα. Then

(a) If K1,K2 are both homogeneous of degree 1 in p, then also {K1,K2} is homogeneous of degree 1 in p.

(b) If K1 is homogeneous of degree 1 in p, and K2 is homogeneous of degree 0 in p, then {K1,K2} is homogeneous of degree 0 in p.

(c) If K1,K2 are both homogeneous of degree 0 in p, then {K1,K2} is zero. Using property (a) we may define the following bracket \ {K1, K2}J := {K1,K2} (42) where Kb isb the contact Hamiltonian corresponding to the homogeneous Hamil- tonian K as in (40). The bracket {K , K } is equal to the Jacobi bracket of b 1 2 J the contact Hamiltonians K , K ; see e.g. [25, 7, 2] for the coordinate expres- 1 2 b b sions of the Jacobi bracket. The Jacobi bracket is obviously bilinear and skew- b b symmetric. Furthermore, since the Poisson bracket satisfies the Jacobi-identity, so does the Jacobi bracket. However, the Jacobi bracket does not satisfy the Leibniz rule; i.e., in general the following equality does not hold

{K1, K2 · K3}J = {K1, K2}J · K3 + K2 ·{K1, K3}J (43) See alsob [39]b forb additionalb informationb b onb the Jacobib b bracket. 3.4 Hamilton-Jacobi theory of Liouville and Legendre sub- manifolds

∗ Recall that any homogeneous Hamiltonian vector field XK on T Q leaves in- variant the Liouville form α and that Liouville submanifolds are maximal sub- manifolds on which α is zero. It follows that for any Liouville submanifold L and any time t ∈ R the evolution of L along the homogeneous Hamiltonian vector field XK given as

φt(L) := {φt(z) | z ∈ L}, (44)

∗ ∗ where φt : T Q → T Q is the flow map at time t ≥ 0 of XK , is also a Liou- ville submanifold. Applied to the Liouville submanifold characterizing the state properties of a thermodynamic system this means that the flow of a homoge- neous Hamiltonian vector field transforms the Liouville submanifold to another Liouville submanifold at any time t ≥ 0. For example, the Liouville subman- ifold corresponding to an ideal gas may be continuously transformed into the Liouville submanifold of a Van der Waals gas. This point of view was explored in [29, 30, 32]. pJ Furthermore, cf. (29), let F (qI ,p0,pJ ) := −p0F (qI , −p0 ), with I ∪ J = {1, ··· ,n}, be the generating function of L, then it follows that for any t ≥ 0 b pJ the generating function G(qI ,p0,pJ ,t) := −p0G(qI , −p0 ,t) of the transformed Liouville submanifold φ (L) satisfies the Hamilton-Jacobi equation t b ∂G ∂G ∂G ∂t + K(q0, qI , − ∂p ,p0, ∂q ,pJ )=0 J J (45) G(qI ,p0,pJ , 0) = F (qI ,p0,pJ )

In case of the evolution of a general Lagrangian submanifold under the dy- namics of a general Hamiltonian vector field this is classical Hamilton-Jacobi theory (see e.g. [1, 2]), which directly specializes to Liouville submanifolds and homogeneous Hamiltonian vector fields. Furthermore, the generating func- \ tions G(qI ,γJ ,t) of the corresponding Legendre submanifolds φt(L) satisfy the Hamilton-Jacobi equation (see also [8]) b ∂Gb ∂Gb ∂Fb ∂Fb ∂t + K(q0 = G − γJ ∂γ , qJ = − ∂γ , γI = ∂q )=0 J J I (46) b b G(qI ,γJ , 0) = F (qI ,γJ ) b b\ Note furthermore that φt(L)= φt(L), where φt is the flow map at time t of the contact vector field X b . This implies as well the following result concerning K b b b invariance of Liouville and corresponding Legendre submanifolds, which will be one of the starting points for the definition of port-thermodynamic systems in the following section. Proposition 3.10. [31, 25, 36] Let K : T ∗Q → R be homogeneous of degree 1 in p, and let K : P(T ∗Q) → R be the corresponding contact Hamiltonian. b Furthermore let L ⊂ T ∗Q be a Liouville submanifold, and L ⊂ P(T ∗Q), with L = π−1(L), the corresponding Legendre submanifold. Then the following state- b ments are equivalent: b 1. The homogeneous Hamiltonian vector field XK leaves L invariant.

2. The contact vector field XKb leaves L invariant. 3. K is zero on L. b 4. K is zero on L. b b 4 Port-thermodynamic systems

So far the geometric description of classical thermodynamics has been concerned with the state properties; starting from Gibbs’ fundamental relation. Since these state properties are intrinsic to any thermodynamic system, they should be re- spected by any dynamics (thermodynamic processes). Hence any dynamics of an actual thermodynamic system should leave invariant the Liouville and Legen- dre submanifold characterizing the state properties [31, 33, 6, 37]. Furthermore, desirably this should be the case for all possible state properties of the thermo- dynamic system, i.e., for all Liouville and Legendre submanifolds. This suggests that the dynamics on the canonical thermodynamic phase space P(T ∗Q) should ∗ be a contact vector field XKb , and the corresponding dynamics on T Q should be a homogeneous Hamiltonian vector field XK . Because of its simplicity, we first focus on the homogeneous Hamiltonian description. Consider a thermodynamic system with constitutive relations (state properties) specified by a Liouville submanifold L ⊂ T ∗Q. Respecting the geometric structure means that the dynamics is a Hamiltonian vector field XK on T ∗Q, with K homogeneous of degree 1 in the p-variables. Furthermore, since the state properties captured by L are intrinsic to the system, the homogeneous Hamiltonian vector field XK should leave L invariant. By Proposition 3.10 this means that the homogeneous Hamiltonian K governing the dynamics should be zero on L. Furthermore, we will split K into two parts, i.e.,

Ka + Kcu, u ∈ Rm, (47) where Ka : T ∗Z → R is the homogeneous Hamiltonian corresponding to the autonomous dynamics due to internal non-equilibrium conditions, while Kc = c c (K1, ··· ,Km) is a row vector of homogeneous Hamiltonians (called control or interaction Hamiltonians) corresponding to dynamics arising from interaction with the surrounding of the system. This second part of the dynamics will be supposed to be affinely parametrized by a vector u of control or input variables (see however [37] for an example of non-affine dependency). This means that all a c c (m + 1) functions K ,K1, ··· ,Km are homogeneous of degree 1 in p and zero on L. By invoking Euler’s homogeneous function theorem (cf. Theorem 3.2) ho- mogeneity of degree 1 in p means

a ∂Ka ∂Ka ∂Ka K = p + p + ··· + pn 0 ∂p0 1 ∂p1 ∂pn c c c (48) Kc = p ∂K + p ∂K + ··· + p ∂K , 0 ∂p0 1 ∂p1 n ∂pn

a where the functions ∂K , as well as the elements of the m-dimensional row vec- ∂pi c tors of partial derivatives ∂K , i =0, 1, ··· ,n, are all homogeneous of degree 0 ∂pi in the p-variables. (Hence, as noted before, the dynamics of the extensive vari- ables can be expressed as a function of the extensive variables and the intensive variables.) The class of allowable autonomous Hamiltonians Ka is further restricted by the First and Second Law of thermodynamics. Since the energy and entropy variables E,S are among the extensive variables q0, q1, ··· , qn, let us denote q0 = E, q1 = S. With this convention, the evolution of E in the autonomous ∂Ka a ˙ dynamics XK arising from non-equilibrium conditions is given by E = ∂p0 . Since by the First Law the energy of the system without interaction with the surrounding (i.e., for u = 0) should be conserved, this implies that necessarily ∂Ka ∂Ka ˙ a ∂p0 |L = 0. Similarly, S in the autonomous dynamics XK is given by ∂p1 . ∂Ka Hence by the Second Law necessarily ∂p1 |L ≥ 0. These two constraints need not hold for the control (interaction) Hamilto- nians Kc. In fact, the analogous terms in the control Hamiltonians may be utilized to define natural output variables. First option is to define the output vector as the m-dimensional row vector (p for power) ∂Kc yp = (49) ∂p0 a c Then it follows that along the complete dynamics XK on L, with K = K +K u, d E = y u (50) dt p

Thus yp is the vector of power-conjugate outputs corresponding to the input vector u. We call the pair (u,yp) the power port of the system. Similarly, by defining the output vector as the m-dimensional row vector (e for ’entropy flow’) ∂Kc ye = (51) ∂p1 it follows that along the dynamics XK on L d S ≥ y u (52) dt e

Hence ye is the output vector which is conjugate to u in terms of entropy flow. The pair (u,ye) is called the flow of entropy port of the system. The above discussion is summarized in the following definition of a port- thermodynamic system. Definition 4.1 ([37]). Consider the manifold of extensive variables Q. A port- thermodynamic system on Q is a pair (L,K), where L ⊂ T ∗Q is a Liouville submanifold describing the state properties, and K = Ka + Kcu,u ∈ Rm, is a Hamiltonian on T ∗Q, homogeneous of degree 1 in p, and zero restricted to L, which generates the dynamics XK . Furthermore, let q = (q0, q1, ··· , qn) a with q0 = E (energy), and q1 = S (entropy). Then K is required to satisfy ∂Ka ∂Ka ∂p0 |L = 0 and ∂p1 |L ≥ 0. The power conjugate output vector of the port- ∂Kc thermodynamic system is defined as yp = ∂p0 , and the entropy flow conjugate ∂Kc output vector as ye = ∂p1 . Note that any port-thermodynamic system on T ∗Q immediately defines a corresponding system on the thermodynamic phase space P(T ∗Q). Indeed, since L ⊂ T ∗Q is a Liouville submanifold it projects to a Legendre submanifold L⊂ P(T ∗Q). Furthermore, since K is homogeneous of degree 1 in p it has the pj a form K(q,p)= −p K(q,γ), γj = , j = 1, ··· ,n, with K(q,γ)= K (q,γ)+ b 0 −p0 c K (q,γ)u the contactb Hamiltonian of the energy representationb . Thisb contact Hamiltonian is zero on L, and the dynamics X projects to the contact vector b K field XKb that leaves invariantb L. Similarly, we can write K(q,p)= −p1K(q, γ˜), pj b γ˜j = −p1 , j = 0, 2 ··· ,n, with bK(q, γ˜) the contact Hamiltonian of the eentropy representation. Furthermore, by Euler’s theorem both the power conjugate be output yp and the entropy flow conjugate output ye are homogeneous of degree 0, and thus project to functions on P(T ∗Q). Finally, in the energy representation we can rewrite the power conjugate output as

c n c ∂K ∂K c yp = = γℓ (q,γ) − K (q,γ) (53) ∂p0 ∂γℓ Xℓ=1 b b b c ∂Kc n ∂Ke Similarly for the entropy flow conjugate output ye = = γ˜ℓ (q, γ˜)− ∂p1 ℓ=0,2 ∂γ˜ℓ c P K (q, γ˜). Finally note that the constraints imposed on Ka by the First and Sec- ond law can be written in contact-geometric terms as be b a n ∂K a b ℓ=1 γℓ ∂γ (q,γ) − K (q,γ) |L =0  ℓ  P b a a (54) n ∂Ke b γ˜ℓ (q,γ) − K (q, γ˜) | b ≥ 0  ℓ=0,2 ∂γ˜ℓ  L P be Example 4.2 (Gas-piston-damper system). Consider a gas in a thermally iso- lated compartment closed by a piston. Assume the thermodynamic properties of the system to be fully covered by the properties of the gas. The extensive variables are given by energy E, entropy S, volume V , and momentum of the piston π. The state properties of the system are described by the Liouville submanifold L π2 with generating function (in energy representation) −pE U(S, V )+ 2m , where 2 π   U(S, V ) is the energy of the gas, and 2m the kinetic energy of the piston with mass m. This defines the state properties

π2 L = {(E,S,V,π,pE,pS,pV ,pπ) | E = U(S, V )+ , 2m (55) ∂U ∂U π pS = −pE ∂S (S, V ),pV = −pE ∂V (S, V ),pπ = −pE m } Assume the damper is linear with damping constant d. The dynamics of the gas-piston-damper system, with piston actuated by a force u, is given by XK , where the homogeneous Hamiltonian K : T ∗R4 → R is given as

π 2 π ∂U π d( m ) π K = pV + pπ − − d + pS ∂U + pπ + pE u, (56) m  ∂V m  ∂S  m π which is zero on L. The power-conjugate output yp = m is the velocity of the piston. In energy representation the description projects to the thermodynamic ∗ 4 phase space P(T R ) = {(E, S, V, π, T, −P, v)}, with γS = T (temperature), γV = −P (pressure), and γπ = v (velocity of the piston) as follows. First note that L projects to the Legendre submanifold

π2 ∂U ∂U π L = {(E, S, V, π, T, −P, v) | E = U(S, V )+ ,T = , −P = , v = } 2m ∂S ∂V m b (57)

Furthermore, K = −pEK with b π 2 π ∂U π d( m ) π K = −P + v − − d + T ∂U + (v − )u (58) m  ∂V m ∂S m b This yields the following dynamics of the extensive variables ˙ π E = m u ˙ π 2 ∂U S = d( m ) / ∂S (≥ 0) ˙ π (59) V = m ∂U π π˙ = − ∂V − d m + u,

˙ ∂Kb ˙ ∂Kb ∂Kb while the intensive variables satisfy T = − ∂S , −P = − ∂V , v˙ = − ∂π . Similarly for the entropy representation. In composite thermodynamic systems, there is typically no single energy or entropy. In this case the sum of the energies needs to be conserved by the autonomous dynamics, and likewise the sum of the entropies needs to be increasing. A simple example is the following; see [37] for further information. Example 4.3 (Heat exchanger). Consider two heat compartments, exchanging a heat flow through a conducting wall according to Fourier’s law. Each heat compartment is described by an entropy Si and energy Ei, i =1, 2, corresponding to the Liouville submanifolds

′ ′ Li = {(Ei,Si,pEi ,pSi | Ei = Ei(Si),pSi = −pEi Ei(Si)}, Ei(Si) ≥ 0 (60) Taking ui as the incoming heat flow into the i-th compartment corresponds to

c 1 Ki = pSi ′ + pEi , (61) Ei(Si) a 1 while Ki =0. This defines the flow of entropy conjugate outputs as yei = ′ Ei(Si) (reciprocal temperatures). The conducting wall is described by the interconnec- tion equations (with λ Fourier’s conduction coefficient) 1 1 −u1 = u2 = λ( − ), (62) ye1 ye2 relating the incoming heat flows ui and reciprocal temperatures yi, i = 1, 2, at both sides of the conducting wall. This leads to (setting E(S1,S2) := E1(S1)+

E2(S2),pE1 = pE2 =: pE, cf. [37]) to the autonomous dynamics generated by the homogeneous Hamiltonian

a c c 1 1 ′ ′ K := K1u1 + K2u2 = λ pS1 ′ + pS2 ′ (E (S2) − E (S1)) (63)  E (S1) E (S2)  Hence the total entropy on the Liouville submanifold

′ ′ L={(E,S1,S2,pE,pS1 ,pS2 )|E = E1+E2,pS1 = −pEE1(S1),pS2 = −pEE2(S2)} (64) satisfies

d 1 1 ′ ′ (S1 + S2)= λ( ′ − ′ )(E2(S2) − E1(S1)) ≥ 0 (65) dt E1(S1) E2(S2) Interestingly, while the Hamiltonians in standard Hamiltonian systems (such as in mechanics) represent energy, the Hamiltonians K in the above examples are dimensionless (in the sense of dimensional analysis). This holds in general. Furthermore, it can be verified that the contact Hamiltonian of its projected dynamics (a contact vector field) has dimension of power in case of the energy representation (with intensive variables T, −P ), and has dimension of entropy 1 P flow in case of the entropy representation (with intensive variables T , T ). To- gether with the fact that the dynamics of a thermodynamic system is captured by the dynamics restricted to the invariant Liouville submanifold, this empha- sizes that the interpretation of the Hamiltonian dynamics XK is rather different from the Hamiltonian formulation of mechanical (or other physical) systems. Finally, let us recall the well-known correspondence [25, 2] between Pois- son brackets of Hamiltonians K1,K2, and Lie brackets of their corresponding Hamiltonian vector fields, i.e.,

[XK1 ,XK2 ]= X{K1,K2} (66)

In particular, this property implies that if the homogeneous Hamiltonians K1,K2 are zero on the Liouville submanifold L, and thus by Proposition 3.10 the ho- mogeneous Hamiltonian vector fields XK1 ,XK2 are tangent to L, then also [XK1 ,XK2 ] is tangent to L, and therefore the Poisson bracket {K1,K2} is also zero on L. Together with Proposition 3.9 this was crucially used in the control- lability and observability analysis of port-thermodynamic systems in [38].

5 Homogeneity in the extensive variables and Gibbs-Duhem relation

In many thermodynamic systems, when taking into account all extensive vari- ables, there is an additional form of homogeneity; now with respect to the extensive variables q. To start with, consider a Liouville submanifold L with generating function −p0F (q1, ··· , qn). Recall that if q0 denotes the energy vari- able, then F (q , ··· , q ) equals the energy q expressed as a function of the other 1 n b 0 extensive variables q , ··· , q . Assume that the manifold of extensive variables b 1 n Q is the linear space6 Q = Rn+1. Homogeneity with respect to the extensive variables means that the function F is homogeneous of degree 1 in q1, ··· , qn. n ∂Fb This implies by Euler’s theorem (Theorem 3.2) that F = qj . Hence b j=1 ∂qj P n on the corresponding Legendre submanifold L = π(L)b we have F = j=1 γj qj , and thus P n n b b dF = γj dqj + qj dγj (67) Xj=1 Xj=1 b By Gibbs’ relation this implies that on L n b qj dγj =0, (68) Xj=1 which is known as the Gibbs-Duhem relation; see e.g. [24, 18]. The relation implies that the intensive variables γj on L are dependent. More generally this can be formulated in the following geometric way. b Definition 5.1. Let Q = Rn+1 with linear coordinates q. A Liouville subman- ifold L ⊂ T ∗Rn+1 is homogeneous with respect to the extensive variables q if

(q0, q1, ··· , qn,p0, ··· ,pn) ∈ L ⇒ (µq0, µq1, ··· , µqn,p0, ··· ,pn) ∈ L (69) for all 0 6= µ ∈ R. Using the same theory as exploited before for homogeneity with respect to the p-variables, cf. Proposition 3.4, homogeneity of L with respect to q is n ∂ equivalent to the vector field W := qi being tangent to L. Hence, i=0 ∂qi using the same argumentation as in PropositionP 3.4, not only the Liouville form n α = i=0 pidqi is zero on L, but also the one-form P n β := qidpi (70) Xi=0 6Homogeneity can be generalized to manifolds using the theory developed in [25]. This could be called the generalized Gibbs-Duhem relation. Proposition 5.2. The Liouville submanifold L is homogeneous with respect n to the extensive variables q if and only if β = i=0 qidpi is zero on L. Let L have generating function −p0F (qI ,γJ ) for someP partitioning {1, ··· ,n} = I ∪J. Then L is homogeneous with respect to the extensive variables q if and only if b if I is non-empty and F (qI ,γJ ) is homogeneous of degree 1 in qI . Furthermore, if L is homogeneous with respect to the extensive variables q, then b n qipi =0, for all (q,p) ∈ L (71) Xi=0 Proof. As mentioned above, the first statement follows from the same reasoning as in Proposition 3.4, swapping the p and q variables. Equivalence of homo- geneity of L with respect to q to F (qI ,γJ ) being homogeneous of degree 1 in qI directly follows from the expression of L in (27) in case I 6= ∅, while clearly ho- b n n mogeneity of L fails if I = ∅. Finally, if both α = i=0 pidqi and β = i=0 qidpi n n are zero on L, then d( i=0 qipi) is zero on L. HenceP i=0 qipi is constantP on n ∂ L. Since Z = pi is tangent to L necessarily this constant is zero.  i=0 ∂pPi P P Remark 5.3. In a contact-geometric setting, an identity similar to (71) was noticed in [22]. A related scenario, explored in [9], is the case that L is a La- grangian submanifold which is non-mixing: there exists a partitioning {0, 1, ··· n} = I ∪ J such that qJ = qJ (qI ), pI = pI (pJ ) for all (qI , qJ ,pI ,pJ ) ∈ L. Then L being Lagrangian amounts to

∂q ∂p ⊤ J = − I (72) ∂qI ∂pJ 

Since the left-hand side only depends on qI and the right-hand side only on pJ , ⊤ this means that both sides are constant, implying that qJ = AqI ,pI = −A pJ for some matrix A. Hence L is obviously satisfying (71), and is actually the product of two orthogonal linear subspaces; one in Q = Rn+1 and the other in the dual space Q∗ = Rn+1. Homogeneity of L with respect to q has the following classical implication. Consider again the case of a generating function F (q,p)= −p0F (q1, ··· , qn) for L, with q being the energy variable. Since F is homogeneous of degree 1 we 0 b may define for q 6=0 1 b

q2 qn 1 qj F¯(ǫ2, ··· ,ǫn) := F (1, , ··· , )= F (q1, ··· , qn), ǫj := , j =0, 2, ··· ,n q1 q1 q1 q1 b b (73)

Equivalently, F (q1, ··· , qn) = q1F¯(ǫ2, ··· ,ǫn), where the function F¯ is known as the specific energy [24]. b Geometrically this means the following. By homogeneity with respect to the p-variables the Liouville submanifold L ⊂ T ∗Rn+1 is projected to the Leg- endre submanifold L ⊂ Rn+1 × P(Rn+1), where P(Rn+1) is the n-dimensional projective space. Subsequently, by homogeneity with respect to the q-variables b L⊂ Rn+1 × P(Rn+1) is projected to a submanifold L⊂¯ P(Rn+1) × P(Rn+1). In coordinates the expression of L¯ is given as follows. Start from the expression of b L as given in (27). Using the identities b q0 = q1F¯(ǫ2, ··· ,ǫn) ⇔ ǫ0 = F¯(ǫ2, ··· ,ǫn) b ∂F n ∂F¯ qℓ n ∂F¯ γ1 = = F¯(ǫ2, ··· ,ǫn) − q1 2 = F¯(ǫ2, ··· ,ǫn) − ǫℓ ∂q1 ℓ=2 ∂ǫℓ q1 ℓ=2 ∂ǫℓ b ¯ ¯ P P γ = ∂F = ∂(q1F ) = ∂F , j =2, ··· ,n j ∂qj ∂qj ∂ǫj (74) the description (27) amounts to

L¯ = {(ǫ0,ǫ2, ··· ,ǫn,γ1, ··· ,γn) | ǫ0 = F¯(ǫ2, ··· ,ǫn), (75) n ∂F¯ ∂F¯ ∂F¯ γ = F¯(ǫ , ··· ,ǫn) − ǫℓ , γ = , ··· ,γn = }, 1 2 ℓ=2 ∂ǫℓ 2 ∂ǫ2 ∂ǫn P where

qj F (q,p)= −p0F (q)= −p0q1F¯(ǫ2, ··· ,ǫn), ǫj := , j =0, 2, ··· ,n (76) q1 b Similar expressions hold in the general case that the generating function for L is given by F (q ,γ ) for some partitioning {1, ··· ,n} = I ∪ J. I J b Furthermore,b if the state properties captured by L are homogeneous with respect to q, it is natural to require the dynamics to be homogeneous with respect to q as well. Thus one requires the Hamiltonian K(q,p) governing the dynamics to be homogeneous of degree 1, not only with respect to p, but also with respect to q, i.e.,

K(µq,p)= µK(q,p), for all 0 6= µ ∈ R (77)

Equivalently (analogously to Proposition 3.7) one requires XK to satisfy L XK β =0 (78)

Similarly to Proposition 3.8, this implies

n ∂ [XK , W ]=0, W = qi (79) ∂qi Xi=0

Hence the flow of XK commutes both with the flow of the Euler vector field n ∂ n ∂ Z = pi and with the vector field W = qi . i=0 ∂pi i=0 ∂qi WeP have seen before that projection along ZPyields the contact vector field pj n b R +1 XK , with K(q,p)= −p0K(q,γ), γj = −p0 , j =1, ··· ,n, where (q,γ) ∈ × b P(Rn+1). Subsequent projection along W to the reduced space P(Rn+1) × P(Rn+1) can be computed as follows. First write as above

qj K(q,γ)= q1K¯ (ǫ,γ), ǫj = , j =0, 2, ··· ,n (80) q1 b Then compute, analogously to (30),

∂Kb n ∂K¯ = K¯ − ǫℓ ∂q1 ℓ=0,2 ∂ǫℓ b ¯ P ∂K = ∂K , j =0, 2 ··· ,n (81) ∂qj ∂ǫj b ¯ ∂K = q ∂K , j =1, ··· ,n ∂γj 1 ∂γj Combining, analogously to (38), with the expression

q˙j qj ǫ˙j = − 2 q˙1, (82) q1 q1 this yields the following 2n-dimensional dynamics on the reduced thermodynamic phase space P(Rn+1) × P(Rn+1)

∂K¯ n ∂K¯ ǫ˙j = − ǫj γℓ − K¯ , j =0, 2, ··· ,n ∂γj ℓ=1 ∂γℓ P  (83) ∂K¯ n ∂K¯ γ˙ j = − + γj ǫℓ − K¯ , j =1, 2 ··· , n, ∂ǫj ℓ=0,2 ∂ǫℓ P  where K¯ is determined by

q0 q2 qn p1 pn K(q,p)= −p0q1K¯ (ǫ,γ), ǫ = , ··· , , γ = , ··· , (84) q1 q1 q1  −p0 −p0 

Obviously, if q0 represents entropy the same expressions hold with different interpretation of ǫ0,ǫ2, ··· ,ǫn. Note that the 2n-dimensional dynamics (83) consists of standard Hamilto- nian equations with respect to the Hamiltonian K¯ , together with extra terms. In view of (54), the first part of these extra terms for the autonomous term K¯ a, n ∂K¯ a a i.e., γℓ − K¯ , is zero on L. ℓ=1 ∂γℓ AsP a final remark it can be noted that while the above reduction from L and ¯ XK to L and the dynamics (83) was done via L and XKb (the contact-geometric description on the thermodynamic phase space), the same outcome is obtained b by instead first projecting onto P(Rn+1) × Rn+1 along W , and then projecting onto P(Rn+1)×P(Rn+1) along Z. Said otherwise, this alternative route involves a different intermediate contact geometric description on the contact manifold n+1 n+1 P(R ) × R with coordinates ǫ0,ǫ2, ··· ,ǫn,p0, ··· ,pn.

6 Conclusions

The geometric formulation of classical thermodynamics gives rise to a specific branch of symplectic geometry, coined as Liouville geometry, which is closely related to contact geometry. A detailed treatment of Liouville submanifolds and their generating functions has been provided. The same has been done for ho- mogeneous Hamiltonian vector fields, extending the treatment in e.g. [2, 3, 25]. For the formulation of the Weinhold and Ruppeiner metrics in this setting we refer to [37]. The interpretation of the resulting Hamiltonian formulation of port-thermodynamic systems turns out to be rather different from Hamiltonian formulations of other parts of physics, such as mechanics. In particular, the state properties of the thermodynamic system define a Liouville submanifold, which is left invariant by the Hamiltonian dynamics. Furthermore, the Hamiltonian is dimensionless, while its corresponding contact Hamiltonians have dimension of power (energy representation) or entropy flow (entropy representation). An open modeling problem concerns the determination of the Hamiltonian govern- ing the dynamics. A partial answer is given in [37], where it is shown how the Hamiltonian of a thermodynamic system can be derived from the Hamiltonians of the constituent thermodynamic subsystems. In Section 5 another type of homogeneity has been considered; this time with respect to the extensive vari- ables, corresponding to the classical Gibbs-Duhem relation. It has been shown how this gives rise to a further projected dynamics on the product of the n- dimensional projective space with itself. The precise geometric interpretation and properties of the reduced dynamics (83) deserve further study.

Acknowledgements

I thank Bernhard Maschke, Universit´ede Lyon-1, France, for ongoing collabo- rations that stimulated the writing of the present paper.

References

[1] R.A. Abraham, J.E. Marsden, Foundations of Mechanics, 2nd ed., Ben- jamin/Cummings, Reading, MA, 1978. [2] V.I. Arnold, Mathematical Methods of Classical Mechanics, Springer, 2nd edition, 1989. [3] V.I. Arnold, Contact Geometry and Wave Propagation, Lectures at the University of Oxford under the sponsorship of the International Mathe- matical Union, L’Enseignement Math´ematique, 1989. [4] V.I. Arnold, Contact geometry: the geometrical method of Gibbs’s ther- modynamics, Gibbs Symposium, AMS, 1989. [5] R. Balian, P. Valentin, Hamiltonian structure of thermodynamics with gauge, Eur. J. Phys. B, 21:269–282, 2001. [6] A. Bravetti, Contact Hamiltonian dynamics: The concept and its use, Entropy, 19(12):535, 2017. [7] A. Bravetti, Contact geometry and thermodynamics, Int. J. Geometric Methods in Modern Physics, 16(1), 1940003 (51 pages), 2019. [8] A. Bravetti, C.S. Lopez-Monsalvo, F. Nettel, Contact symmetries and Hamiltonian thermodynamics, Annals of Physics, 361:377 – 400, 2017. [9] R. K. Brayton, Nonlinear reciprocal networks, pp. 1–12, Proc. Symp. in Applied Mathematics of AMS and SIAM, eds. H.S. Wilf, F. Harary, 1969. [10] M. de Leon, M. Lainz Valcazar, Contact Hamiltonian systems, Journal of Mathematical Physics, 60(10):102902, 2019. [11] D. Eberard, B.M. Maschke, A.J. van der Schaft, An extension of pseudo- Hamiltonian systems to the thermodynamic space: towards a geometry of non-equilibrium thermodynamics, Reports in Mathematical Physics, 60(2), 175–198, 2007. [12] S.C. Farantos, Hamiltonian classical thermodynamics and chemical kinet- ics, Physica D (2020), doi: https://doi.org/10.1016/j.physd.2020.132813. [13] A. Favache, D. Dochain, B.M. Maschke. An entropy-based formulation of irreversible processes based on contact structures,. Chemical Engineering Science, 65, 5204–5216, 2010. [14] E. Fermi, Thermodynamics, Prentice-Hall, 1937 (Dover edition, 1956). [15] F. Gay-Balmaz, H. Yoshimura, A Lagrangian variational formulation for nonequilibrium, thermodynamics. Part i: Discrete systems, Journal of Geometry and Physics, 111, 169 – 193, 2017. [16] M. Grmela. Contact geometry of mesoscopic thermodynamics and dynam- ics. Entropy, 16(3), 1652, 2014. [17] D. Gromov, F. Castanos, The geometric structure of interconnected thermo-mechanical systems, IFAC World Congress, Toulouse, France, IFAC-Papers OnLine, 50(1), 582–587, 2017. [18] D. Gromov, A. Toikka, Towards formal analysis of thermody- namic stability: Le Chatelier-Brown principle, Entropy, 22, 1113; doi:10.3390/e22101113, 2020. [19] H.W. Haslach, Jr., Geometric structure of the non-equilibrium thermo- dynamics of homogeneous systems, Reports in Mathematical Physics, 39, 147–162, 1997.

[20] G. Herglotz, Ber¨uhrungstransformationen. In Lectures at the University of G¨ottingen, G¨ottingen, 1930. English edition: The Herglotz Lectures on Contact Transformations and Hamiltonian Systems, by R. B. Guenther, H. Schwerdtfeger, G. Herglotz, C.M. Guenther, J.A. Gottsch, Julius Schauder Center for Nonlinear Studies, Nicholas Copernicus University, Torun, 1996. [21] R. Hermann, Geometry, physics and systems, Marcel Dekker, New York, 1973. [22] N.H. Hoang, T.K. Phung, T.T. Hong Phan, D. Dochain, On contact Hamil- tonian functions in open irreversible thermodynamic systems, preprint 2020. [23] N. Hudon, M. Guay, D. Dochain, Control design for thermodynamic sys- tems on contact manifolds, IFAC-Papers OnLine, 50(1), 588–593, 2017. [24] D. Kondepudi, I. Prigogine, Modern Thermodynamics; From Heat Engines to Dissipative Structures, 2nd edition, Wiley, 2015. [25] P. Libermann, C.-M. Marle, Symplectic geometry and analytical mechan- ics, D. Reidel Publishing Company, Dordrecht, Holland, 1987. [26] B. Maschke, About the lift of irreversible thermodynamic systems to the thermodynamic phase space, IFAC-Papers OnLine, 49(24), 40–45, 2016. [27] B. Maschke, A. van der Schaft, Homogeneous Hamiltonian control systems, Part II: Applications to thermodynamic systems, IFAC-Papers OnLine 51(3), 7 – 12, 2018. [28] J. Merker, M. Kr¨uger, On a variational principle in thermodynamics. Con- tinuum Mechanics and Thermodynamics, 25(6), 779–793, 2013. [29] R. Mrugala, Geometric formulation of equilibrium phenomenological ther- modynamics. Reports in Mathematical Physics, 14(3), 419–427, 1978. [30] R. Mrugala. Submanifolds in the thermodynamic phase space. Reports in Mathematical Physics 21, 197, 1985. [31] R. Mrugala, J.D. Nulton, J.C. Sch¨on, P. Salamon, Contact structure in thermodynamic theory, Reports in Mathematical Physics, 29(1), 109–121, 1991. [32] R. Mrugala, Continuous contact transformations in Thermodynamics. Re- ports in Mathematical Physics, 33(1/2), 149–154, 1993. [33] R. Mrugala, On a special family of thermodynamic processes and their invariants, Reports in Mathematical Physics, 46(3), 461–468, 2000. [34] R. Mrugala, On contact and metric structures on thermodynamic spaces, RIMS, Kokyuroku, 1142, 167–181, 2000. [35] H. Ramirez, B. Maschke, D. Sbarbaro, Partial stabilization of input-output contact systems on a Legendre submanifold, IEEE Trans. Aut. Contr., 62(3), 1431–1437, 2017. [36] A. van der Schaft, B. Maschke, Homogeneous Hamiltonian control systems, Part I: Geometric formulation, IFAC-Papers OnLine, 51(3), 1 – 6, 2018. [37] A. van der Schaft, B. Maschke, Geometry of thermodynamic processes, Entropy, 20(12), 925–947, 2018. [38] A.J. van der Schaft, B. Maschke, About some system-theoretic properties of port-thermodynamic systems, pp. 228–238 in Geometric Science of In- formation, 4th Int. Conf., Toulouse, 2019, eds. F. Nielsen, F. Barbaresco, Lect. Notes in Computer Science, Springer, 2019. [39] A. Anahory Simoes, D. Martin de Diego, M. Lainz Valcazar, M. de Leon, The geometry of some thermodynamic systems, arXiv:2012.07404, 2020.