Geometry of Thermodynamic Processes

Since the 1970s contact geometry has been recognized as an appropriate framework for the geometric formulation of the state properties of thermodynamic systems, without, however, addressing the formulation of non-equilibrium thermodynamic processes. In Balian&Valentin (2001) it was shown how the symplectization of contact manifolds provides a new vantage point; enabling, among others, to switch between the energy and entropy representations of a thermodynamic system. In the present paper this is continued towards the global geometric definition of a degenerate Riemannian metric on the homogeneous Lagrangian submanifold describing the state properties, which is overarching the locally defined metrics of Weinhold and Ruppeiner. Next, a geometric formulation is given of non-equilibrium thermodynamic processes, in terms of Hamiltonian dynamics defined by Hamiltonian functions that are homogeneous of degree one in the co-extensive variables and zero on the homogeneous Lagrangian submanifold. The correspondence between objects in contact geometry and their homogeneous counterparts in symplectic geometry, as already largely present in the literature, appears to be elegant and effective. This culminates in the definition of port-thermodynamic systems, and the formulation of interconnection ports. The resulting geometric framework is illustrated on a number of simple examples, already indicating its potential for analysis and control.


Introduction
This paper is concerned with the geometric formulation of thermodynamic systems. While the geometric formulation of mechanical systems has given rise to an extensive theory, commonly called geometric mechanics, the geometric formulation of thermodynamics has remained more elusive and restricted.
Despite this increasing interest, the current geometric theory of thermodynamics still poses major challenges. First, most of the work is on the geometric formulation of the equations of state, through the use of Legendre submanifolds [1][2][3]5,8], while less attention has been paid to the geometric definition and analysis of non-equilibrium dynamics. Secondly, thermodynamic system models commonly appear both in energy and in entropy representation, while in principle, this corresponds to contactomorphic, but different contact manifolds. This is already demonstrated by rewriting Gibbs' equation in energy representation dE = TdS − PdV, with intensive variables T, −P, into the entropy representation dS = 1 T dE + P T dV, with intensive variables 1 T , P T . Thirdly, for reasons of analysis and control of composite thermodynamic systems, a geometric description of the interconnection of thermodynamic systems is desirable, but currently largely lacking.
A new viewpoint on the geometric formulation of thermodynamic systems was provided in [21], by exploiting the well-known result in geometry that odd-dimensional contact manifolds can be naturally symplectized to even-dimensional symplectic manifolds with an additional structure of homogeneity; see [22,23] for textbook expositions. While the classical applications of symplectization are largely confined to time-dependent Hamiltonian mechanics [23] and partial differential equations [22], the paper [21] argued convincingly that symplectization provides an insightful angle to the geometric modeling of thermodynamic systems as well. In particular, it yields a clear way to bring together energy and entropy representations, by viewing the choice of different intensive variables as the selection of different homogeneous coordinates.
In the present paper, we aim at expanding this symplectization point of view towards thermodynamics, amplifying our initial work [24,25]. In particular, we show how the symplectization point of view not only unifies the energy and entropy representation, but is also very helpful in describing the dynamics of thermodynamic processes, inspired by the notion of the contact control system developed in [11][12][13][17][18][19]; see also [16]. Furthermore, it yields a direct and global definition of a metric on the submanifold describing the state properties, encompassing the locally-defined metrics of Weinhold [26] and Ruppeiner [27], and providing a new angle to the equivalence results obtained in [3,5,7,10]. Finally, it is shown how symplectization naturally leads to a definition of interconnection ports; thus extending the compositional geometric port-Hamiltonian theory of interconnected multi-physics systems (see, e.g., [28][29][30]) to the thermodynamic realm. All this will be illustrated by a number of simple, but instructive, examples, primarily serving to elucidate the developed framework and its potential.

Thermodynamic Phase Space and Geometric Formulation of the Equations of State
The starting point for the geometric formulation of thermodynamic systems throughout this paper is an (n + 1)-dimensional manifold Q e , with n ≥ 1, whose coordinates comprise the extensive variables, such as volume and mole numbers of chemical species, as well as entropy and energy [31]. Emphasis in this paper will be on simple thermodynamic systems, with a single entropy and energy variable. Furthermore, for notational simplicity, and without much loss of generality, we will assume: with S ∈ R the entropy variable, E ∈ R the energy variable, and Q the (n − 1)-dimensional manifold of remaining extensive variables (such as volume and mole numbers).
In composite (i.e., compartmental) systems, we may need to consider multiple entropies or energies; namely for each of the components. In this case, R × R is replaced by R m S × R m E , with m S denoting the number of entropies and m E the number of energies; see Example 3 for such a situation. This also naturally arises in the interconnection of thermodynamic systems, as will be discussed in Section 5.
Coordinates for Q e throughout will be denoted by q e = (q, S, E), with q coordinates for Q (the manifold of remaining extensive variables). Furthermore, we denote by T * Q e the (2n + 2)-dimensional cotangent bundle T * Q e without its zero-section. Given local coordinates (q, S, E) for Q e , the corresponding natural cotangent bundle coordinates for T * Q e and T * Q e are denoted by: (q e , p e ) = (q, S, E, p, p S , p E ), (2) where the co-tangent vector p e := (p, p S , p E ) will be called the vector of co-extensive variables.
Following [21], the thermodynamic phase space P(T * Q e ) is defined as the projectivization of T * Q e , i.e., as the fiber bundle over Q e with fiber at any point q e ∈ Q e given by the projective space P(T * q e Q e ). (Recall that elements of P(T * q e Q e ) are identified with rays in T * q e Q e , i.e., non-zero multiples of a non-zero cotangent vector.) The corresponding projection will be denoted by π : T * Q e → P(T * Q e ).
It is well known [22,23] that P(T * Q e ) is a contact manifold of dimension 2n + 1. Indeed, recall [22,23] that a contact manifold is an (2n + 1)-dimensional manifold N equipped with a maximally non-integrable field of hyperplanes ξ. This means that ξ = ker θ ⊂ TN for a, possibly only locally-defined, one-form θ on N satisfying θ ∧ (dθ) n = 0. By Darboux's theorem [22,23], there exist local coordinates (called Darboux coordinates) q 0 , q 1 , · · · , q n , γ 1 , · · · , γ n for N such that, locally: Then, in order to show that P(T * M) for any (n + 1)-dimensional manifold M is a contact manifold, consider the Liouville one-form α on the cotangent bundle T * M, expressed in natural cotangent bundle coordinates for T * M as α = ∑ n i=0 p i dq i . Consider a neighborhood where p 0 = 0, and define the homogeneous coordinates: which, together with q 0 , q 1 , · · · , q n , serve as local coordinates for P(T * M). This results in the locally-defined contact form θ as in (3) (with α = p 0 θ). The same holds on any neighborhood where one of the other coordinates p 1 , · · · , p n is different from zero, in which case division by the non-zero p i results in other homogeneous coordinates. This shows that P(T * M) is indeed a contact manifold. Furthermore [22,23], P(T * M) is the canonical contact manifold in the sense that every contact manifold N is locally contactomorphic to P(T * M) for some manifold M. Taking M = Q e , it follows that coordinates for the thermodynamical phase space P(T * Q e ) are obtained by replacing the coordinates p e = (p, p S , p E ) for the fibers T * q e Q e by homogeneous coordinates for the projective space P(T * q e Q e ). In particular, assuming p E = 0, we obtain the homogeneous coordinates: defining the intensive variables of the energy representation. Alternatively, assuming p S = 0, we obtain the homogeneous coordinates (see [21] for a discussion of p S , or p E , as a gauge variable): defining the intensive variables of the entropy representation.
Example 1. Consider a mono-phase, single constituent, gas in a closed compartment, with volume q = V, entropy S, and internal energy E, satisfying Gibbs' relation dE = TdS − PdV. In the energy representation, the intensive variable γ is given by the pressure −P, and γ S is the temperature T. In the entropy representation, the intensive variable γ is equal to P T , while γ E equals the reciprocal temperature 1 T .
In order to provide the geometric formulation of the equations of state on the thermodynamic phase space P(T * Q e ), we need the following definitions. First, recall that a submanifold L of T * Q e is called a Lagrangian submanifold [22,23] if the symplectic form ω := dα is zero restricted to L and the dimension of L is equal to the dimension of Q e (the maximal dimension of a submanifold restricted to which ω can be zero).

Definition 1.
A homogeneous Lagrangian submanifold L ⊂ T * Q e is a Lagrangian submanifold with the additional property that: (q e , p e ) ∈ L ⇒ (q e , λp e ) ∈ L, for every 0 = λ ∈ R In the Appendix A, cf. Proposition A2, homogeneous Lagrangian submanifolds are geometrically characterized as submanifolds L ⊂ T * Q e of dimension equal to dim Q e , on which not only the symplectic form ω = dα, but also the Liouville one-form α is zero.
Importantly, homogeneous Lagrangian submanifolds of T * Q e are in one-to-one correspondence with Legendre submanifolds of P(T * Q e ). Recall that a submanifold L of a (2n + 1)-dimensional contact manifold N is a Legendre submanifold [22,23] if the locally-defined contact form θ is zero restricted to L and the dimension of L is equal to n (the maximal dimension of a submanifold restricted to which θ can be zero). Proposition 10.16). Consider the projection π : T * Q e → P(T * Q e ). Then, L ⊂ P(T * Q e ) is a Legendre submanifold if and only if L := π −1 (L) ⊂ T * Q e is a homogeneous Lagrangian submanifold. Conversely, any homogeneous Lagrangian submanifold L is of the form π −1 (L) for some Legendre submanifold L.
In the contact geometry formulation of thermodynamic systems [1][2][3]5], the equations of state are formalized as Legendre submanifolds. In view of the correspondence with homogeneous Lagrangian submanifolds, we arrive at the following.

Definition 2.
Consider Q e and the thermodynamical phase space P(T * Q e ). The state properties of the thermodynamic system are defined by a homogeneous Lagrangian submanifold L ⊂ T * Q e and its corresponding Legendre submanifold L ⊂ P(T * Q e ).
The correspondence between Legendre and homogeneous Lagrangian submanifolds also implies the following characterization of generating functions for any homogeneous Lagrangian submanifold L ⊂ T * Q e . This is based on the fact [22,23] that any Legendre submanifold L ⊂ N in Darboux coordinates q 0 , q 1 , · · · , q n , γ 1 , · · · , γ n for N can be locally represented as: for some partitioning I ∪ J = {1, · · · , n} and some function F(q I , γ J ) (called a generating function for L), while conversely, any submanifold L as given in (8), for any partitioning I ∪ J = {1, · · · , n} and function F(q I , γ J ), is a Legendre submanifold. Given such a generating function F(q I , γ J ) for the Legendre submanifold L, we now define, assuming p 0 = 0 and substituting γ J = − p J p 0 , G(q 0 , · · · , q n , p 0 , · · · , p n ) : Then a direct computation shows that: implying, in view of (8), that: In its turn, this implies that G as defined in (9) is a generating function for the homogeneous Lagrangian submanifold L = π −1 (L). If instead of p 0 , another coordinate p i is different from zero, then by dividing by this p i = 0, we obtain a similar generating function. This is summarized in the following proposition.
Any homogeneous Lagrangian submanifold L can be locally represented as in (11) with generating function G of the form (9), and conversely, for any such G, the submanifold (11) is a homogeneous Lagrangian submanifold.
Note that the generating functions G as in (9) are homogeneous of degree one in the variables (p 0 , · · · , p n ); see the Appendix A for further information regarding homogeneity.
The simplest instance of a generating function for a Legendre submanifold L and its homogeneous Lagrangian counterpart L occurs when the generating F as in (8) only depends on q 1 , · · · , q n . In this case, the generating function G is given by: G(q 0 , · · · , q n , p 0 , · · · , p n ) = −p 0 F(q 1 , · · · , q n ), (12) with the corresponding homogeneous Lagrangian submanifold L = π −1 (L) locally given as: A particular feature of this case is the fact that exactly one of the extensive variables, in the above q 0 , is expressed as a function of all the others, i.e., q 1 , · · · , q n . At the same time, p 0 is unconstrained, while the other co-extensive variables p 1 , · · · , p n are determined by p 0 , q 1 , · · · , q n . For a general generating function G as in (9), this is not necessarily the case. For example, if J = {1, · · · , n}, corresponding to a generating function −p 0 F(γ), then q 0 , · · · , q n are all expressed as a function of the unconstrained variables p 0 , · · · , p n .

Remark 1.
In the present paper, crucial use is made of homogeneity in the co-extensive variables (p, p S , p E ), which is different from homogeneity with respect to the extensive variables (q, q S , q E ), as occurring, e.g., in the Gibbs-Duhem relations [31].
The two most important representations of a homogeneous Lagrangian submanifold L ⊂ T * Q e , and its Legendre counterpart L ⊂ P(T * Q), are the energy representation and the entropy representation. In the first case, L is represented, as in (12), by a generating function of the form: yielding the representation: In the second case (the entropy representation), L is represented by a generating function of the form: yielding the representation: Note that in the energy representation, the independent extensive variables are taken to be q and the entropy S, while the energy variable E is expressed as a function of them. On the other hand, in the entropy representation, the independent extensive variables are q and the energy E, with S expressed as a function of them. Furthermore, in the energy representation, the co-extensive variable p E is "free", while instead in the entropy representation, the co-extensive variable p S is free. In principle, also other representations could be chosen, although we will not pursue this. For instance, in Example 1, one could consider a generating function −p V V(S, E) where the extensive variable V is expressed as function of the other two extensive variables S, E.
As already discussed in [1,2], an important advantage of describing the state properties by a Legendre submanifold L, instead of by writing out the equations of state, is in providing a global and coordinate-free point of view, allowing for an easy transition between different thermodynamic potentials. Furthermore, if singularities occur in the equations of state, L is typically still a smooth submanifold. As seen before [21], the description by a homogeneous Lagrangian submanifold L has the additional advantage of yielding a simple way for switching between the energy and the entropy representation.

Remark 2.
Although the terminology "thermodynamic phase space" for P(T * Q e ) may suggest that all points in P(T * Q e ) are feasible for the thermodynamic system, this is actually not the case. The state properties of the thermodynamic system are specified by the Legendre submanifold L ⊂ P(T * Q e ), and thus, the actual "state space" of the thermodynamic system at hand is this submanifold L; not the whole of P(T * Q e ).
A proper analogy with the Hamiltonian formulation of mechanical systems would be as follows. Consider the phase space T * Q of a mechanical system with configuration manifold Q. Then, the Hamiltonian H : T * Q → R defines a Lagrangian submanifold L H of T * (T * Q) given by the graph of the gradient of H. The homogeneous Lagrangian submanifold L is analogous to L H , while the symplectized thermodynamic phase space T * Q e is analogous to T * (T * Q).

The Metric Determined by the Equations of State
In a series of papers starting with [26], Weinhold investigated the Riemannian metric that is locally defined by the Hessian matrix of the energy expressed as a (convex) function of the entropy and the other extensive variables. (The importance of this Hessian matrix, also called the stiffness matrix, was already recognized in [31,32].) Similarly, Ruppeiner [27], starting from the theory of fluctuations, explored the locally-defined Riemannian metric given by minus the Hessian of the entropy expressed as a (concave) function of the energy and the other extensive variables. Subsequently, Mrugała [3] reformulated both metrics as living on the Legendre submanifold L of the thermodynamic phase space and showed that actually, these two metrics are locally equivalent (by a conformal transformation); see also [9]. Furthermore, based on statistical mechanics arguments, [7] globally defined an indefinite metric on the thermodynamical phase space, which, when restricted to the Legendre submanifold, reduces to the Weinhold and Ruppeiner metrics; thus showing global conformal equivalence. This point of view was recently further extended in a number of directions in [10].
In this section, crucially exploiting the symplectization point of view, we provide a novel global geometric definition of a degenerate pseudo-Riemannian metric on the homogeneous Lagrangian submanifold L defining the equations of state, for any given torsion-free connection on the space Q e of extensive variables. In a coordinate system in which the connection is trivial (i.e., its Christoffel symbols are all zero), this metric will be shown to reduce to Ruppeiner's locally-defined metric once we use homogeneous coordinates corresponding to the entropy representation, and to Weinhold's locally-defined metric by using homogeneous coordinates corresponding to the energy representation. Hence, parallel to the contact geometry equivalence established in [3,7,10], we show that the metrics of Weinhold and Ruppeiner are just two different local representations of this same globally-defined degenerate pseudo-Riemannian metric on the homogeneous Lagrangian submanifold of the symplectized thermodynamic phase space.
Recall [33] that a (affine) connection ∇ on an (n + 1)-dimensional manifold M is defined as an assignment: for any two vector fields X, Y, which is R-bilinear and satisfies for any function f on M. This implies that ∇ X Y(q) only depends on X(q) and the value of Y along a curve, which is tangent to X at q. In local coordinates q for M, the connection is determined by its Christoffel symbols Γ a bc (q), a, b, c = 0, · · · , n, defined by: The connection is called torsion-free if: for any two vector fields X, Y, or equivalently if its Christoffel symbols satisfy the symmetry property Γ a bc (q) = Γ a cb (q), a, b, c = 0, · · · , n. We call a connection trivial in a given set of coordinates q = (q 0 , · · · , q n ) if its Christoffel symbols in these coordinates are all zero.
As detailed in [34], given a torsion-free connection on M, there exists a natural pseudo-Riemannian ("pseudo" since the metric is indefinite) metric on the cotangent-bundle T * M, in cotangent bundle coordinates (q, p) for T * M given as: Let us now consider for M the manifold of extensive variables Q e = Q × R 2 with coordinates q e = (q, S, E) as before, where we assume the existence of a torsion-free connection, which is trivial in the coordinates (q, S, E), i.e., the Christoffel symbols are all zero. Then, the pseudo-Riemannian metric I on T * Q e takes the form: Denote by G the pseudo-Riemannian metric I restricted to the homogeneous Lagrangian submanifold L describing the state properties. Consider the energy representation (15) of L, with generating function −p E E(q, S). It follows that 1 2 G equals (in shorthand notation): where: is recognized as Weinhold's metric [26]; the (positive-definite) Hessian of E expressed as a (strongly convex) function of q and S.
On the other hand, in the entropy representation (17) of L, with generating function −p S S(q, E), an analogous computation shows that 1 2 G is given as p S R, with: the Ruppeiner metric [27]; minus the Hessian of S expressed as a (strongly concave) function of q and E. Hence, we conclude that: This is basically the conformal equivalence between W and R found in [3]; see also [7,10]. Summarizing, we have found the following. Theorem 1. Consider a torsion-free connection on Q e , with coordinates q e = (q, S, E), in which the Christoffel symbols of the connection are all zero. Then, by restricting the pseudo-Riemannian metric I to L, we obtain a degenerate pseudo-Riemannian metric G on L, which in local energy-representation (15) for L is given by −2p E W, with W the Weinhold metric (24), and in a local entropy representation (17) by 2p S R, with R the Ruppeiner metric (25).
We emphasize that the degenerate pseudo-Riemannian metric G is globally defined on L, in contrast to the locally-defined Weinhold and Ruppeiner metrics W and R; see also the discussion in [3,5,7,9,10]. We refer to G as degenerate, since its rank is at most n instead of n + 1. Note furthermore that G is homogeneous of degree one in p e and hence does not project to the Legendre submanifold L.
While the assumption of the existence of a trivial connection appears natural in most cases (see also the information geometry point of view as exposed in [35]), all this can be directly extended to any non-trivial torsion-free connection ∇ on Q e . For example, consider the following situation. For the ease of notation, denote q S := S, q E := E, and correspondingly denote (q 0 , q 1 , · · · , q n−2 , q S , q E ) := (q, S, E). Take any torsion-free connection on Q e given by symmetric Christoffel symbols Γ c ab = Γ c ba , with indices a, b, c = 0, · · · , n − 2, S, E, satisfying Γ c ab = 0 whenever one of the indices a, b, c is equal to the index E. Then, the indefinite metric I on T * Q e is given by (again in shorthand notation): It follows that the resulting metric 1 2 G on L is given by the matrix: Here, the (n × n)-matrix at the right-hand side of −p E is the globally defined geometric Hessian matrix (see e.g., [36]) with respect to the connection on Q × R corresponding to the Christoffel symbols Γ c ab , a, b, c = 0, · · · , n − 2, S.

Dynamics of Thermodynamic Processes
In this section, we explore the geometric structure of the dynamics of (non-equilibrium) thermodynamic processes; in other words, geometric thermodynamics. By making crucial use of the symplectization of the thermodynamic phase space, this will lead to the definition of port-thermodynamic systems in Definition 3; allowing for open thermodynamic processes. The definition is illustrated in Section 4.2 on a number of simple examples. In Section 4.3, initial observations will be made regarding the controllability of port-thermodynamic systems.

Port-Thermodynamic Systems
In Section 2, we noted the one-to-one correspondence between Legendre submanifolds L of the thermodynamic phase space P(T * Q e ) and homogeneous Lagrangian submanifolds L of the symplectized space T * Q e . In the present section, we start by noting that there is as well a one-to-one correspondence between contact vector fields on P(T * Q e ) and Hamiltonian vector fields X K on T * Q e with Hamiltonians K that are homogeneous of degree one in p e (see the Appendix A for further details on homogeneity).
Here, Hamiltonian vector fields X K on T * Q e with Hamiltonian K are in cotangent bundle coordinates (q e , p e ) = (q 0 , · · · , q n , p 0 , · · · , p n ) for T * Q e given by the standard expressions: while contact vector fields X K on the contact manifold P(T * Q e ) are given in local Darboux coordinates (q e , γ) = (q 0 , · · · , q n , γ 1 , · · · , γ n ) as: [22,23] for some contact Hamiltonian K(q e , γ). Indeed, consider any Hamiltonian vector field X K on T * Q e , with K homogeneous of degree one in the co-extensive variables p e . Equivalently (see Appendix A, Proposition A1), L X K α = 0, with L denoting the Lie-derivative. It follows, cf. Theorem 12.5 in [23], that X K projects under π : T * Q e → P(T * Q e ) to a vector field π * X K , satisfying: for some function ρ, for all (locally-defined) expressions of the contact form θ on P(T * Q e ). This exactly means [23] that the vector field π * X K is a contact vector field with contact Hamiltonian: Conversely [22,23], any contact vector field X K on P(T * Q e ), for some contact Hamiltonian K, can be lifted to a Hamiltonian vector field X K on T * Q e with homogeneous K. In fact, for K expressed in Darboux coordinates for P(T * Q e ) as K(q 0 , q 1 , · · · , q n , γ 1 , ·, γ n ), the corresponding homogeneous function K is given as, cf. [23] (Chapter V, Remark 14.4), K(q 0 , · · · , q n , p 0 , · · · , p n ) = p 0 K(q 0 , · · · , q n , − p 1 p 0 , · · · , − p n p 0 ), and analogously on any other homogeneous coordinate neighborhood of P(T * Q e ). This is summarized in the following proposition (N.B.: for brevity, we will from now on refer to a function K(q e , p e ) that is homogeneous of degree one in the co-extensive variables p e as a homogeneous function and to a Hamiltonian vector field X K on T * Q e with K homogeneous of degree one in p e as a homogeneous Hamiltonian vector field).

Proposition 3.
Any homogeneous Hamiltonian vector field X K on T * Q e projects under π to a contact vector field X K on P(T * Q e ) with K locally given by (32), and conversely, any contact vector field X K on P(T * Q e ) lifts under π to a homogeneous Hamiltonian vector field X K on T * Q e with K locally given by (33).
Recall, and see also Remark 2, that the equations of state describe the constitutive relations between the extensive and intensive variables of the thermodynamic system, or said otherwise, the state properties of the thermodynamic system. Since these properties are fixed for a given thermodynamic system, any dynamics should leave its equations of state invariant. Equivalently, any dynamics on T * Q e or on P(T * Q e ) should leave the homogeneous Lagrangian submanifold L ⊂ T * Q e , respectively, its Legendre submanifold counterpart L ⊂ P(T * Q e ), invariant. (Recall that a submanifold is invariant for a vector field if the vector field is everywhere tangent to it; and thus, solution trajectories remain on it.) Furthermore, it is natural to require the dynamics of the thermodynamic system to be Hamiltonian; i.e., homogeneous Hamiltonian dynamics on T * Q e and a contact dynamics on P(T * Q e ).
In order to combine the Hamiltonian structure of the dynamics with invariance, we make crucial use of the following properties.

1.
A homogeneous Lagrangian submanifold L ⊂ T * Q e is invariant for the homogeneous Hamiltonian vector field X K if and only if the homogeneous K : T * Q e → R restricted to L is zero.

2.
A Legendre submanifold L ⊂ P(T * Q e ) is invariant for the contact vector field X K if and only if K : The homogeneous function K : T * Q e → R restricted to L is zero if and only the corresponding function K : P(T * Q e ) → R restricted to L is zero.
Item 2 is well known [22,23], and Item 1 can be found in [23,25], while Item 3 directly follows from the correspondence between K and K in (32) and (33).
Based on these considerations, we define the dynamics of a thermodynamic system as being produced by a homogeneous Hamiltonian function, parametrized by u ∈ R m , with K a restricted to L zero, and K c an m-dimensional row of functions K c j , j = 1, · · · , m, all of which are also zero on L. Then, the resulting dynamics is given by the homogeneous Hamiltonian dynamics on T * Q e :ẋ restricted to L. (In [24,25], (35) was called a homogeneous Hamiltonian control system.) By Proposition 3, this dynamics projects to contact dynamics corresponding to the contact Hamiltonian K = K a + K c u on the corresponding Legendre submanifold L ⊂ P(T * Q e ). The invariance conditions on the parametrized Hamiltonian K defining the dynamics on L and L can be seen to take the following explicit form. Since K is homogeneous of degree one, we can write by Euler's homogeneous function theorem (Theorem A1): where the functions f , f S , f E , as well as the elements of the m-dimensional row vectors of functions g, g S , g E are all homogeneous of degree zero. Now, recall the energy representation (15) of the Lagrangian submanifold L describing the state properties of the system: By substitution of (37) in (36), it follows that K restricted to L is zero for all u if and only if: for all p E , or equivalently: This leads to the following additional requirements on the homogeneous function K a . The first law of thermodynamics ("total energy preservation") requires that the uncontrolled (u = 0) dynamics preserves energy, implying that: Furthermore, the second law of thermodynamics ("increase of entropy") leads to the following requirement. Writing out K| L = 0 in the entropy representation (17) of L amounts to: Plugging in the earlier found requirement f E | L = 0, this reduces to: Finally, since for u = 0, the entropy is non-decreasing, this implies the following additional requirement: All this leads to the following geometric formulation of a port-thermodynamic system.

Definition 3 (Port-thermodynamic system).
Consider the space of extensive variables Q e = Q × R × R and the thermodynamic phase space P(T * Q e ). A port-thermodynamic system on P(T * Q e ) is defined as a pair (L, K), where the homogeneous Lagrangian submanifold L ⊂ T * Q e specifies the state properties. The dynamics is given by the homogeneous Hamiltonian dynamics with parametrized homogeneous Hamiltonian K := K a + K c u : T * Q e → R, u ∈ R m , in the form (36), with K a , K c zero on L, and the internal Hamiltonian K a satisfying (corresponding to the first and second law of thermodynamics): This means that, in energy representation (15): and, in entropy representation (17): Furthermore, the power-conjugate outputs y p of the port-thermodynamic system (L, K) are defined as the row-vector: Since by Euler's theorem (Theorem A1), all expressions f , f S , f E , g, g S , g E are homogeneous of degree zero, they project to functions on the thermodynamic phase space P(T * Q e ). Hence, the dynamics and the output equations are equally well-defined on the Legendre submanifold L ⊂ P(T * Q e ). Note that as a consequence of the above definition of a port-thermodynamic system: expressing that the increase of total energy of the thermodynamic system is equal to the energy supplied to the system by the environment.

Remark 3.
In case f , f S , f E , g, g S , g E do not depend on p e (and therefore, are trivially homogeneous of degree zero in p e ), they actually define vector fields on the space of extensive variables Q e (since they transform as vector fields under a coordinate change for Q e ). In this case, the dynamics on T * Q e and L is equal to the Hamiltonian lift of the dynamics on Q e ; see, e.g., [37].

Remark 4.
Whenever the dynamics on L is given as the Hamiltonian lift of dynamics on Q e (see the previous Remark), the properties (44) can be enforced by formulating the dynamics on Q e as the sum of a Hamiltonian vector field with respect to the energy E and a gradient vector field with respect to the entropy S, in such a way that S is a Casimir of the Poisson bracket and E is a "Casimir" of the symmetric bracket; see, e.g., [38,39]. The extension of this to the general homogeneous setting employed in Definition 3 is of much interest.

Remark 5. Definition 3 is generalized to the compartmental situation
corresponding, respectively, to total energy conservation and total entropy increase; see already Example 3.

Remark 6.
An extension to Definition 3 is to consider a non-affine dependence of K on u, i.e., a general function K : T * Q e × R m → R that is homogeneous in p e . See already the damper subsystem in Example 7 and the formulation of Hamiltonian input-output systems as initiated in [40] and continued in, e.g., [37,41,42].
Defining the vector of outputs as being power-conjugate to the input vector u is the most common option for defining an interaction port (in this case, properly called a power-port) of the thermodynamic system. Nevertheless, there are other possibilities, as well. Indeed, a port representing the rate of entropy flow is obtained by defining the alternative output y re as: which is the entropy-conjugate to the input vector u, This leads instead to the rate of entropy balance: where the second, non-negative, term on the right-hand side is the internal rate of entropy production.

Remark 7.
From the point of view of dissipativity theory [43,44], this means that any port-thermodynamic system, with inputs u and outputs y p , y re , is cyclo-lossless with respect to the supply rate y p u and cyclo-passive with respect to the supply rate y re u.
Finally, it is of interest to note that, as illustrated by the examples in the next subsection, the Hamiltonian K generating the dynamics on L is dimensionless; i.e., its values do not have a physical dimension. Physical dimensions do arise by dividing the homogeneous expression by one of the co-extensive variables.

Examples of Port-Thermodynamic Systems
Example 2 (Heat compartment). Consider a simple thermodynamic system in a compartment, allowing for heat exchange with its environment. Its thermodynamic properties are described by the extensive variables S (entropy) and E (internal energy), with E expressed as a function E = E(S) of S. Its state properties (in energy representation) are given by the homogeneous Lagrangian submanifold: corresponding to the generating function −p E E(S). Since there is no internal dynamics, K a is absent. Hence, taking u as the rate of entropy flow corresponds to the homogeneous Hamiltonian K = K c u with: which is zero on L. This yields on L the dynamics (entailing both the entropy and energy balance): with power-conjugate output y p equal to the temperature T = E (S). Defining the homogeneous coordinate γ = − p S p E leads to the contact Hamiltonian K c = E (S) − γ on P(T * R 2 ), and the Legendre submanifold: The resulting contact dynamics on L is equal to the projected dynamics π * X K = X K given as: Here, the third equation corresponds to the energy balance in terms of the temperature dynamics. Note that E (S) = T C , with C the heat capacitance of the fixed volume. Alternatively, if we take instead the incoming heat flow as input v, then the Hamiltonian is given by: leading to the "trivial" power-conjugate output y p = 1 and to the rate of entropy conjugate output y re given by the reciprocal temperature y re = 1 T .

Example 3 (Heat exchanger).
Consider two heat compartments as in Example 2, exchanging a heat flow through an interface according to Fourier's law. The extensive variables are S 1 , S 2 (entropies of the two compartments) and E (total internal energy). The state properties are described by the homogeneous Lagrangian submanifold: corresponding to the generating function −p E (E 1 (S 1 ) + E 2 (S 2 )), with E 1 , E 2 the internal energies of the two compartments. Denoting the temperatures T 1 = E 1 (S 1 ), T 2 = E 2 (S 2 ), the internal dynamics of the two-component thermodynamic system corresponding to Fourier's law is given by the Hamiltonian: with λ Fourier's conduction coefficient. Note that the total entropy on L satisfies: in accordance with (49). We will revisit this example in the context of the interconnection of thermodynamic systems in Examples 8 and 9.
Example 4 (Mass-spring-damper system). Consider a mass-spring-damper system in one-dimensional motion, composed of a mass m with momentum π, linear spring with stiffness k and extension z, and linear damper with viscous friction coefficient d. In order to take into account the thermal energy and the entropy production arising from the heat produced by the damper, the variables of the mechanical system are augmented with an entropy variable S and internal energy U(S) (for instance, if the system is isothermal, i.e., in thermodynamic equilibrium with a thermostat at temperature T 0 , the internal energy is U(S) = T 0 S). This leads to the total set of extensive variables z, π, S, E = 1 2 kz 2 + π 2 2m + U(S) (total energy). The state properties of the system are described by the Lagrangian submanifold L with generating function (in energy representation): This defines the state properties: The dynamics is given by the homogeneous Hamiltonian: where u is an external force. The power-conjugate output y p = π m is the velocity of the mass.
Example 5 (Gas-piston-damper system). Consider a gas in an adiabatically-isolated cylinder closed by a piston. Assume that the thermodynamic properties of the system are covered by the properties of the gas (for an extended model, see [13], Section 4). Then, the system is analogous to the previous example, replacing z by volume V and the partial energy 1 2 kz 2 + U(S) by an expression U(V, S) for the internal energy of the gas. The dynamics of a force-actuated gas-piston-damper system is defined by the Hamiltonian: where the power-conjugate output y p = π m is the velocity of the piston.
Example 6 (Port-Hamiltonian systems as port-thermodynamic systems). Example 4 can be extended to any input-state-output port-Hamiltonian system [28][29][30]: on a state space manifold x ∈ X , with inputs u ∈ R m , outputs y ∈ R m , Hamiltonian H (equal to the stored energy of the system), and dissipation R(e) satisfying e T R(e) ≥ 0 for all e. Including entropy S as an extra variable, along with an internal energy U(S) (for example, in the isothermal case U(S) = T 0 S), the state properties of the port-Hamiltonian system are given by the homogeneous Lagrangian submanifold L ⊂ T * (X × R 2 ) defined as: with generating function −p E (H(x) + U(S)). The Hamiltonian K is given by (using the shorthand notation e = ∂H ∂x (x)): reproducing on L the dynamics (65) with outputs y p = y. Note that in this thermodynamic formulation of the port-Hamiltonian system, the energy-dissipation term e T R(e) in the power-balance d dt H = −e T R(e) + y T u is compensated by the equal increase of the internal energy U(S), thus leading to conservation of the total energy E(x, S) = H(x) + U(S).

Controllability of Port-Thermodynamic Systems
In this subsection, we will briefly indicate how the controllability properties of the port-thermodynamic system (L, K) can be directly studied in terms of the homogeneous Hamiltonians K a and K c j , j = 1, · · · , m, and their Poisson brackets. First, we note that by Proposition A3, the Poisson brackets of these homogeneous Hamiltonians are again homogeneous. Secondly, we recall the well-known correspondence [22,23,33] between Poisson brackets of Hamiltonians h 1 , h 2 and Lie brackets of the corresponding Hamiltonian vector fields: In particular, this property implies that if the homogeneous Hamiltonians h 1 , h 2 are zero on the homogeneous Lagrangian submanifold L and, thus, by Proposition 4, the homogeneous Hamiltonian vector fields X h 1 , X h 2 are tangent to L, then also [X h 1 , X h 2 ] is tangent to L, and therefore, the Poisson bracket {h 1 , h 2 } is also zero on L. Furthermore, with respect to the projection to the corresponding Legendre submanifold L, we note the following property of homogeneous Hamiltonians: where the bracket on the right-hand side is the Jacobi bracket [22,23] of functions on the contact manifold P(T * Q e ). This leads to the following analysis of the accessibility algebra [45] of a port-thermodynamic system, characterizing its controllability.

Proposition 5.
Consider a port-thermodynamic system (L, K) on P(T * Q e ) with homogeneous K := K a + ∑ m j=1 K c j u j : T * Q e → R, zero on L. Consider the algebra P (with respect to the Poisson bracket) generated by K a , K c j , j = 1, · · · , m, consisting of homogeneous functions that are zero on L and the corresponding algebra P generated by K a , K c j , j = 1, · · · , m, on L. The accessibility algebra [45] is spanned by all contact vector fields X h on L, with h in the algebra P. It follows that the port-thermodynamic system (L, K) is locally accessible [45] if the dimension of the co-distribution d P on L defined by the differentials of h, with h in the Poisson algebra P, is equal to the dimension of L. Conversely, if the system is locally accessible, then the co-distribution d P on L has dimension equal to the dimension of L almost everywhere on L.
Similar statements can be made with respect to local strong accessibility of the port-thermodynamic system; see the theory exposed in [45].

Interconnections of Port-Thermodynamic Systems
In this section, we study the geometric formulation of interconnection of port-thermodynamic systems through their ports, in the spirit of the compositional theory of port-Hamiltonian systems [28][29][30]43]. We will concentrate on the case of power-port interconnections of port-thermodynamic systems, corresponding to power flow exchange (with total power conserved). This is the standard situation in (port-based) physical network modeling of interconnected systems. At the end of this section, we will make some remarks about other types of interconnection; in particular, interconnection by exchange of the rate of entropy.
Consider two port-thermodynamic systems with extensive and co-extensive variables: and Liouville one- With the homogeneity assumption in mind, impose the following constraint on the co-extensive variables: This leads to the summation of the one-forms α 1 and α 2 given by: on the composed space defined as: Leaving out the zero-section p 1 = 0, p 2 = 0, p S 1 = 0, p S 2 = 0, p E = 0, this space will be denoted by T * Q e 1 • T * Q e 2 and will serve as the space of extensive and co-extensive variables for the interconnected system. Furthermore, it defines the projectivization P(T * Q e 1 • T * Q e 2 ), which serves as the composition (through E i , p E i , i = 1, 2) of the two projectivizations P(T * Q e i ), i = 1, 2. Let the state properties of the two systems be defined by homogeneous Lagrangian submanifolds: with generating functions −p E i E i (q i , S i ), i = 1, 2. Then, the state properties of the composed system are defined by the composition: with generating function −p E (E 1 (q 1 , S 1 ) + E 2 (q 2 , S 2 )). Furthermore, consider the dynamics on L i defined by the Hamiltonians K i = K a i + K c i u i , i = 1, 2. Assume that K i does not depend on the energy variable E i , i = 1, 2. Then, the sum K 1 + K 2 is well-defined on L 1 • L 2 for all u 1 , u 2 . This defines a composite port-thermodynamic system, with entropy variables S 1 , S 2 , total energy variable E, inputs u 1 , u 2 , and state properties defined by L 1 • L 2 .
Next, consider the power-conjugate outputs y p1 , y p2 ; in the sequel, simply denoted by y 1 , y 2 . Imposing on the power-port variables u 1 , u 2 , y 1 , y 2 interconnection constraints that are satisfying the power-preservation property: yields an interconnected dynamics on L 1 • L 2 , which is energy conserving (the p E -term in the expression for K 1 + K 2 is zero by (76)). This is summarized in the following proposition.

Proposition 6.
Consider two port-thermodynamic systems (L i , K i ) with spaces of extensive variables Q e i , i = 1, 2. Assume that K i does not depend on E i , i = 1, 2. Then, (L 1 • L 2 , K 1 + K 2 ), with L 1 • L 2 given in (75), defines a composite port-thermodynamic system with inputs u 1 , u 2 and outputs y 1 , y 2 . By imposing interconnection constraints on u 1 , u 2 , y 1 , y 2 satisfying (76), an autonomous (no inputs) port-thermodynamic system is obtained.

Remark 8.
The interconnection procedure can be extended to the case of an additional open power-port with input vector u and output row vector y, by replacing (76) by power-preserving interconnection constraints on u 1 , u 2 , u, y 1 , y 2 , y, satisfying: y 1 u 1 + y 2 u 2 + yu = 0 (77) Proposition 6 is illustrated by the following examples.
Example 7 (Mass-spring-damper system). We will show how the thermodynamic formulation of the system as detailed in Example 4 also results from the interconnection of the three subsystems: mass, spring, and damper. I. Mass subsystem (leaving out irrelevant entropy). The state properties are given by: with energy κ (kinetic energy) and dynamics generated by the Hamiltonian: corresponding toπ = u m , y m = π m . II. Spring subsystem (again leaving out irrelevant entropy). The state properties are given by: with energy P (spring potential energy) and dynamics generated by the Hamiltonian: corresponding toż = u s , y s = kz. III. Damper subsystem. The state properties are given by: involving the entropy S and an internal energy U(S). The dynamics of the damper subsystem is generated by the Hamiltonian: with d the damping constant and power-conjugate output: equal to the damping force. Finally, interconnect, in a power-preserving way, the three subsystems to each other via their power-ports (u m , y m ), (u s , y s ), (u d , y d ) as: This results (after setting p κ = p P = p U =: p) in the interconnected port-thermodynamic system with total Hamiltonian K m + K s + K d given as: which is equal to the Hamiltonian for u = 0 as obtained before in Example 4, Equation (63).

Example 8 (Heat exchanger).
Consider two heat compartments as in Example 2, with state properties: The dynamics is given by the Hamiltonians: with v 1 , v 2 the incoming heat flows and power-conjugate outputs y 1 , y 2 , which both are equal to one. Consider the power-conserving interconnection: with λ the Fourier heat conduction coefficient. Then, the Hamiltonian of the interconnected port-thermodynamical system is given by: which equals the Hamiltonian (59) as obtained in Example 3.
Apart from power-port interconnections as above, we may also define other types of interconnection, not corresponding to the exchange of rate of energy (power), but instead to the exchange of rate of other extensive variables. In particular, an interesting option is to consider interconnection via the rate of entropy exchange. This can be done in a similar way, by considering, instead of the variables E i , p E i , i = 1, 2, as above, the variables S i , p S i , i = 1, 2. Imposing alternatively the constraint p S 1 = p S 2 =: p S yields a similar composed space of extensive and co-extensive variables, as well as a similar composition L 1 • L 2 of the state properties. By assuming in this case that the Hamiltonians K i do not depend on the entropies S i , i = 1, 2 and by imposing interconnection constraints on u 1 , u 2 and the "rate of entropy" conjugate outputs y re1 , y re2 leads again to an interconnected port-thermodynamic system. Note however that while it is natural to assume conservation of total energy for the interconnection of two systems via their power-ports, in the alternative case of interconnecting through the rate of entropy ports, the total entropy may not be conserved, but actually increasing.

Example 9.
As an alternative to the previous Example 8, where the heat exchanger was modeled as the interconnection of two heat compartments via power-ports, consider the same situation, but now with outputs y i being the "rate of entropy conjugate" to v i , i.e., equal (cf. the end of Example 2) to the reciprocal temperatures 1 T i with T i = E (S i ), i = 1, 2. This results in interconnecting the two heat compartments as, equivalently to (89), This interconnection is not total entropy conserving, but instead satisfies y 1 v 1 + y 2 v 2 = λ( 1 y 2 − 1 y 1 )(y 1 − y 2 ) ≥ 0, corresponding to the increase of total entropy.

Discussion
While the state properties of thermodynamic systems have been geometrically formulated since the 1970s through the use of contact geometry, in particular by means of Legendre submanifolds, the geometric formulation of non-equilibrium thermodynamic processes has remained more elusive. Taking up the symplectization point of view on thermodynamics as successfully initiated in [21], the present paper develops a geometric framework based on the description of non-equilibrium thermodynamic processes by Hamiltonian dynamics on the symplectized thermodynamic phase space generated by Hamiltonians that are homogeneous of degree one in the co-extensive variables; culminating in the definition of port-thermodynamic systems in Section 4.1. Furthermore, Section 3 shows how the symplectization point of view provides an intrinsic definition of a metric that is overarching the locally-defined metrics of Weinhold and Ruppeiner and provides an alternative to similar results in the contact geometry setting provided in [3,5,7,10]. The correspondence between objects in contact geometry and corresponding homogeneous objects in symplectic geometry turns out to be very effective. An additional benefit of symplectization is the simplicity of the expressions and computations in the standard Hamiltonian context, as compared to those in contact geometry. This feature is also exemplified by the initial controllability study in Section 4.3. As noted in [38], physically non-trivial examples of mesoscopic dynamics are infinite-dimensional. This calls for an infinite-dimensional extension, following the well-developed theory of infinite-dimensional Hamiltonian systems (but now adding homogeneity) of the presented definition of port-thermodynamic systems, encompassing systems obtained by the Hamiltonian lift of infinite-dimensional GENERIC [38] and dissipative port-Hamiltonian [46] formulations; see also Remark 4. From a control point of view, one of the open problems concerns the stabilization of thermodynamic processes using the developed framework.
Geometrically, Euler's theorem can be equivalently formulated as follows. Recall that the Hamiltonian vector field X h on T * M with symplectic form ω = dα corresponding to an arbitrary Hamiltonian h : T * M → R is defined by i X h ω = −dh. It is immediately verified that h : T * M → R is homogeneous of degree r iff: Define the Euler vector field (also called the Liouville vector field) E on T * M as the vector field satisfying: dα(E, ·) = α (A4) In co-tangent bundle coordinates (q, p) for T * M, the vector field E is given as ∑ n i=0 p i ∂ ∂p i . One verifies that h : T * M → R is homogeneous of degree r iff (with L denoting Lie-derivative): In the sequel, we will only use homogeneity and Euler's theorem for r = 0 and r = 1. First, it is clear that physical variables defined on the contact manifold P(T * Q e ) correspond to functions on T * Q e , which are homogeneous of degree zero in p. On the other hand, as formulated in Proposition 3, a Hamiltonian vector field on T * Q e with respect to a Hamiltonian that is homogeneous of degree one in p projects to a contact vector field on the contact manifold P(T * Q). Such Hamiltonian vector fields are locally characterized as follows.
Proposition A1. If h : T * M → R is homogeneous of degree one in p, then X = X h satisfies: Conversely, if a vector field X satisfies (A6), then X = X h for some locally-defined Hamiltonian h that is homogeneous of degree one in p.
Summarizing, Hamiltonian vector fields with Hamiltonians that are homogeneous of degree one in p are characterized by (A6); in contrast to general Hamiltonian vector fields X on T * M, which are characterized by the weaker property L X dα = 0. Similar statements as above can be made for homogeneous Lagrangian submanifolds (cf. Definition 1). Recall [22,23,33] that a submanifold L ⊂ T * M is called a Lagrangian submanifold if the symplectic form ω := dα is zero on L, and dim L = dim M.
proving that {h 1 , h 2 } is homogeneous of degree one. Hence, by Proposition A1, L X {h 1 ,h 2 } α = 0, and thus: where in the fourth equality, we use (A12) for h 1 and h 2 .