Next Article in Journal
Cosmic and Thermodynamic Consequences of Kaniadakis Holographic Dark Energy in Brans–Dicke Gravity
Next Article in Special Issue
Restricted Phase Space Thermodynamics of Einstein-Power-Yang–Mills AdS Black Hole
Previous Article in Journal
Universal Causality
Previous Article in Special Issue
Symplectic Geometry Aspects of the Parametrically-Dependent Kardar–Parisi–Zhang Equation of Spin Glasses Theory, Its Integrability and Related Thermodynamic Stability
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Geometric Modeling for Control of Thermodynamic Systems

by
Arjan van der Schaft
Bernoulli Institute for Mathematics, Computer Science and Artificial Intelligence, Jan C. Willems Center for Systems and Control, University of Groningen, 9747 AG Groningen, The Netherlands
Entropy 2023, 25(4), 577; https://doi.org/10.3390/e25040577
Submission received: 28 February 2023 / Revised: 22 March 2023 / Accepted: 23 March 2023 / Published: 27 March 2023
(This article belongs to the Special Issue Geometric Structure of Thermodynamics: Theory and Applications)

Abstract

:
This paper discusses the way that energy and entropy can be regarded as storage functions with respect to supply rates corresponding to the power and thermal ports of the thermodynamic system. Then, this research demonstrates how the factorization of the irreversible entropy production leads to quasi-Hamiltonian formulations, and how this can be used for stability analysis. The Liouville geometry approach to contact geometry is summarized, and how this leads to the definition of port-thermodynamic systems is discussed. This notion is utilized for control by interconnection of thermodynamic systems.

1. Introduction

Since the early 1970s [1] contact geometry has been recognized as underlying macroscopic thermodynamics, starting from Gibbs’ fundamental thermodynamic relation. This has spurred a series of papers on the geometry of thermodynamics; including [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]; see [28] for an introduction and survey. Nevertheless, this literature points to major differences with, for example, the geometric theory of classical mechanics (using symplectic geometry), and hints at aspects which have not yet been addressed. First, the thermodynamic phase space (which is formulated as a contact manifold) comprises the extensive and intensive variables, and thus, its dimension is more than twice the minimal number of variables to describe the thermodynamic system at any moment of time. Second, most of the theory is about thermostatics, and the proper geometric formulation of the dynamics is much less clear. Third, the contact geometric approach to thermodynamics is usually based on the energy representation of thermodynamic systems and its corresponding Gibbs one-form. On the other hand, there is also the entropy formulation which corresponds to another (although conformally equivalent) one-form. This led [29] to the use of homogeneous coordinates for the intensive variables, and thus to extend the thermodynamic phase space by one more degree of freedom. This was followed up in [25,26] by emphasizing the formulation of the thermodynamic phase space as the projection of the cotangent bundle over the space of extensive variables. Thus contact geometry is approached from the vantage point of the geometry of cotangent bundles with their Liouville one-form. Fourth, until now, not much work has been performed regarding the geometry of irreversible thermodynamics, based on the factorization of the irreversible entropy production. Fifth, how to use these geometric frameworks for the control of thermodynamic systems has not yet been addressed.
The present paper continues the investigation of all of these aspects. In Section 2, a systems and control perspective on macroscopic thermodynamics is emphasized by primarily regarding thermodynamic systems as systems interacting with their surroundings via heat, mechanical work, exchange of chemical species, etc. A classical example is, of course, the heat engine. A summary of how dissipativity theory provides a natural framework for interpreting and formulating the first and second laws of thermodynamics, Clausius’ inequality, and eventually entropy is provided. Indeed, energy and entropy reveal themselves to be the storage functions corresponding to two supply rates involving the thermal and mechanical ports of the thermodynamic system. Finally, this leads to Gibbs’ fundamental relation and to the definition of the thermodynamic phase space. Section 3 focuses on geometric descriptions of irreversible thermodynamic systems. The way that the classical factorization of the irreversible entropy production suggests quasi-Hamiltonian formulations (somewhat resembling GENERIC [30]) based on energy conservation and the increase of entropy of the autonomous part of the dynamics are discussed. This paper also indicates how such formulations may be used for stability analysis. Section 4 starts with the geometry of the thermodynamic phase space from the point of view of the Liouville geometry of the cotangent bundle over the space of extensive variables. Identifying the constitutive relations (‘thermostatics’) of the thermodynamic system as a Liouville submanifold, and the dynamics as homogeneous Hamiltonian dynamics lead to the definition of a port-thermodynamic system. Such systems interact with their environment via power ports and/or entropy flow ports. In Section 5, this is used for ‘control by interconnection’ of port-thermodynamic systems, where the dynamics of the system are sought to be controlled by interconnection with a suitable controller port-thermodynamic system. Finally, Section 6 contains conclusions and a discussion of venues for further research.
The sections are illustrated by three running examples: the gas-piston-damper system, chemical reaction networks, and the heat exchanger. Overall, the paper heavily builds upon previous papers [25,26,31,32,33,34], in which further details and background can be found.

2. The First and Second Law from the Point of View of Dissipativity Theory

The first law of thermodynamics expresses two fundamental properties: (1) the different types of interaction of a thermodynamic system with its surroundings (e.g., heat flow, mechanical work, flow of chemical species, etc.) all result in an exchange of a common quantity called energy, (2) there exists a function of the macroscopic thermodynamic variables that represents the energy stored in the system, and the increase of this function during any time interval is equal to the sum of the energies supplied to the system during this time interval by its surroundings (conservation of energy). Thus, energy manifests itself in different physical forms, which are equivalent and to a certain extent exchangeable. ‘To a certain extent’ because, as expressed by the second law of thermodynamics, there are limitations to the conversion of heat to other forms of energy.
The first law can be mathematically formulated through the use of dissipativity theory as formulated in [35]; see also [31,36,37]. Consider a simple thermodynamic system such as a gas, described by three variables: volume V, pressure P, and temperature T. Then, mechanical power (rate of mechanical work) provided by the surroundings to the thermodynamic system is given by P u V , where u V : = V ˙ is the rate of volume change. (In the physics convention for the pressure P, P u V is the rate of mechanical work exerted by the system on the surroundings). The second type of interaction with the surroundings comes from heat delivered to the system (for instance, from a heat source). Let us denote, using q, the heat flow (heat per second) from the heat source into the system. Then the first law is expressed by the existence of a function E ( x ) of the thermodynamic state x (e.g., ( V , P , T ) satisfying the equation of state), expressing the energy of the system and satisfying, at all times, t
d d t E ( x ( t ) ) = q ( t ) P ( t ) u V ( t )
That is, the increase of the total energy E of the thermodynamic system is equal to the incoming heat flow (through the thermal port) minus the mechanical work performed by the system on its surroundings (through the mechanical port). Equivalently, in the terminology of dissipativity theory, the first law amounts to the system being cyclo-lossless for the supply rate  q P u V , with storage functionE. This is directly extended to more involved thermodynamic systems. For example, suppose that apart from mechanical and thermal interaction with the surroundings, there is additional mass inflow of chemical species. Then, the supply rate q P u V is extended to q P u V + k μ k ν k . Here, ν k = d N k d t , with N k the mole number of the k-th chemical species, and μ k its chemical potential.
The first law emphasizes the role of thermodynamic systems as devices for energy conversion; energy from one physical domain is converted into energy in another domain. ‘Optimal’ conversion of heat into mechanical work, motivated by the design of steam engines in the beginning of the 19th century, was one of the starting points of thermodynamic theory. Electro-chemical devices such as batteries, and electro-mechanical systems including electrical motors and generators, are among the many other classical examples of energy-converting devices [38]. On the other hand, almost from the very start of thermodynamic theory, it was realized that there are intrinsic limitations to energy conversion. In particular, heat cannot just be converted into mechanical work. This is the origin of the second law of thermodynamics. The second law also admits a dissipativity interpretation; however, more involved than that of the first law. Let us start with the formulation of the second law, as given by Lord Kelvin (see [39]):
A transformation of a thermodynamic system whose only final result is to transform into work heat extracted from a source which is at the same temperature throughout is impossible.
Since the work done during a time interval [ t 1 , t 2 ] is equal to t 1 t 2 P ( t ) d V ( t ) = t 1 t 2 P ( t ) u V ( t ) d t , Kelvin’s formulation immediately implies that for each constant temperature T, any thermodynamic system is cyclo-passive with respect to the supply rate P u V . However, the second law is stronger than that. Namely, Kelvin’s formulation also forbids the conversion into work of heat from a source at constant temperature for all transformations in which the system interacts as well with a second heat source at another temperature, as long as the net heat taken from this second heat source is zero. As demonstrated by Carnot, the interaction with heat sources at different temperatures is crucial for the conversion of heat into mechanical energy. This led to the famous Carnot cycle which can be described as follows: consider a simple thermodynamic system, in particular, a fluid or gas in a confined space of a certain volume. Control of the system functions in two ways: (1) via isothermal transformations, where heat is supplied to, or taken from, the system at a constant temperature (classically described as the interconnection of the thermodynamic system with an infinite heat reservoir at the temperature of the isothermal process), (2) via adiabatic transformations, where the only interaction with the surroundings is via work supplied to, or taken from, the system (classically described by the movement of a piston that changes the volume of the system, with a pressure equal to the pressure of the gas). A cycle consists of two isothermal transformations and two adiabatic transformations: first, an isothermal transformation at temperature T h (‘hot’) takes the system from an initial state to another state, secondly, an adiabatic transformation lowers the temperature of the system to T c (‘cold’), thirdly, an isothermal transformation at temperature T c takes the system to a state from which, fourthly, an adiabatic transformation takes the system back to the original initial state; see Figure 1.
The cycle is called a Carnot cycle if it is reversible; i.e., can be traversed in the opposite direction as well.
Remark 1. 
In the exposition of the Carnot cycle, often terminologies such as ‘infinitesimally slow’, ‘quasi-reversible’, ‘quasi-static’, etc., are used. This is largely with regard to the interaction of a system with its surroundings as being implemented by actual physical devices. For example, an isothermal transformation is viewed as the result of the ‘real’ physical action of a force exerted by a piston on the gas (implying that the pressure delivered by the piston could be different from the pressure of the gas). Furthermore, the system is considered to be in ‘real’ physical contact with a heat reservoir at a certain temperature (which could differ from that of the gas). In contrast in, e.g., electrical network theory and control theory the concept of an ‘ideal’ control action is employed, where, for instance, the pressure and the temperature are directly controlled.
The heat delivered to the system during the first isothermal at temperature T h is denoted by Q h , and during the second isothermal at T c by Q c (generally Q c is negative). Then, by the first law, since the final state is equal to the initial state, Q h + Q c = W , where W = P d V is the mechanical work that is done by the thermodynamic system on its surroundings.
By an intricate reasoning from [39], see also [31], Kelvin’s formulation of the second law yields for any cycle the fundamental inequality
Q h T h + Q c T c 0 ,
with equality in the case of a Carnot cycle. Furthermore, the reasoning can be extended to complex cycles, consisting of n isothermals at temperatures T i and absorbed heat quantities Q i , i = 1 , 2 , , n , interlaced by n adiabatics, leading to
i = 1 n Q i T i 0 ,
with equality in the case of reversibility. Finally, a slight extension (approximating continuous heat flow time-functions q ( · ) by step functions with step values Q 1 , , Q n ) yields the celebrated Clausius inequality
q ( t ) T ( t ) d t 0
for all cyclic processes q ( · ) , T ( · ) (where q is the heat flow into the thermodynamic system, and T is the temperature of the system), with equality
q ( t ) T ( t ) d t = 0
holding for all reversible cyclic processes (see [31] for details and refinements).
From the point of view of dissipativity theory [31,35] the Clausius inequality (4) is the same as cyclo-dissipativity of the thermodynamic system with respect to the supply rate  q T . Thus, assuming reachability from and controllability from some ground state x * this means, see [40], that there exists a storage function F for the supply rate q T , that is d d t F q T . Hence S : = F satisfies
d d t S q T
The function S was called ‘entropy’ by Clausius, from the Greek word τ ρ o π η for ‘transformation’.
From the point of view of dissipativity theory, the storage function F need not be unique. In order to guarantee the uniqueness of F (modulo a constant), and therefore of the entropy S, we additionally assume [31,40] that, given some ground state, for every thermodynamic state there exists a reversible cyclic transformation through this state and the ground state satisfying
q ( t ) T ( t ) = 0
This uniqueness of S is, explicitly or implicitly, always assumed in expositions of macroscopic thermodynamics, and also in this paper.
Remark 2. 
The dissipativity theory formulation of the second law already appears in [35], but under the additional assumption that F is nonnegative. In fact, in [35,37] there exists a nonnegative storage function for the supply rate q T (and thus the system is dissipative instead of merely cyclo-dissipative) if and only if for all initial conditions x
F a ( x ) = sup 0 τ q ( t ) T ( t ) d t < ,
where the supremum is taken over all τ 0 and all heat flow functions q ( · ) on the time interval [ 0 , τ ] , and corresponding temperature profiles T ( · ) resulting from x ( 0 ) = x . Furthermore, if (8) holds, then F a 0 is minimal among all nonnegative storage functions. It follows that S a = F a 0 given by
S a ( x ) = inf 0 τ q ( t ) T ( t ) d t >
is maximal among all nonpositive storage functions. Since an arbitrary constant may be added to S while still satisfying (6), the assumption that S is nonpositive is equivalent to S being bounded from above. However, in many thermodynamic systems the entropy is not bounded from above. Thus thermodynamic systems are generally only cyclo-dissipative with respect to the supply rate q T , and not dissipative.

The Thermodynamic Phase Space and Gibbs’ Relation

The next step is now to add the energy and entropy as extra extensive variables to the description of the thermodynamic system. In order to illustrate this, consider a simple thermodynamic system, with extensive variable V (volume) and intensive variables P , T (pressure and temperature). The equation of state is an equation f ( V , P , T ) = 0 for some scalar function f. (For example, for an ideal gas P V = R T with R the universal gas constant.) Any ( V , P , T ) satisfying f ( V , P , T ) = 0 is called a state of the thermodynamic system. Hence, under regularity conditions the set of states of the thermodynamic system is a 2-dimensional submanifoldM of R 3 . Then, consider the functions E : M R (energy) and S : M R (entropy) as obtained from dissipativity theory. Then, we may equally well represent the set of states M R 3 by the 2-dimensional submanifold L R 5 comprising the total set of extensive and intensive variables R 5 :
L : = { ( E , S , V , T , P ) f ( V , P , T ) = 0 , E = E ( V , P , T ) , S = E ( V , P , T ) }
(With some abuse of notation, the extra variables  E , S , are denoted by the same letters as used for the functions defined before.) The space R 5 of all extensive and intensive variables is called the thermodynamic phase.
Furthermore, by the first law d d t E = P d d t V + q , while for any state there exists a path through this state and the ground state such that d d t E = P d d t V + T d d t S . Taken together, this implies that the Gibbs one-form on the thermodynamic phase space R 5 defined as
d E T d S + P d V , G i b b s o n e f o r m ,
is zero restricted to L. This is called Gibbs’ fundamental thermodynamic relation. The thermodynamic phase space, together with the Gibbs one-form, defines a contact manifold. Furthermore, a submanifold of the thermodynamic phase space R 5 restricted to which the Gibbs one-form (11) is zero, and moreover has maximal dimension (in this case 2), is called a Legendre submanifold. Gibbs’ fundamental relation implies that any Legendre submanifold L is actually given as
L : = { ( E , S , V , T , P ) E = E ( S , V ) , T = E S ( S , V ) , P = E V ( S , V ) }
for some energy functions E ( S , V ) . Thus, L is completely described by expressing the energy E as a function E ( S , V ) of the other two extensive variables S , V , hence the name energy representation. Instead of relying on such an energy function (or its partial Legendre transforms), there is still an alternative way of describing L. This is to start, not with E ( S , V ) , but instead with the expression of the entropy as a function S ( E , V ) . For a simple thermodynamic system this leads to the entropy representation of the submanifold L R 5 given as
L : = { ( E , S , V , T , P ) S = S ( E , V ) , 1 T = S E ( E , V ) , P T = S V ( E , V ) }

3. Irreversible Thermodynamics

Clausius interpreted the term q T in the inequality (6) as the part of the infinitesimal transformation d d t S that is compensated by the opposite rate of change q T of the entropy of the surroundings; that is, of the reservoir supplying the heat to the thermodynamic system. The remaining part
σ : = d d t S q T 0
was called the ‘uncompensated transformation’ by Clausius, and later the irreversible entropy production [38]. Irreversible thermodynamics is concerned with thermodynamics where σ is different from zero, implying an autonomous (independent from external heat flow) increase of the entropy S. Sometimes it is also referred to as non-equilibrium thermodynamics, because the entropy increase is resulting from (internal) non-equilibrium conditions.
The standard postulate of irreversible thermodynamics (see e.g., [38]) is that σ can be factorized as
σ = k = 1 s F k J k 0 ,
where F k are called the thermodynamic forces and J k are the thermodynamic flows (or fluxes), in such a way that
σ = 0 if   and   only   if   F k = 0 , k = 1 , , s
In linear irreversible thermodynamics [38] it is furthermore assumed that the vectors F and J with components F k and J k , k = 1 , , s , are related by a symmetric linear map
J = L F , L = L
These are the celebrated Onsager reciprocity relations [38], corresponding to the symmetric factorization σ = F L F .
Example 1 
(The heat exchanger). The perhaps simplest example of irreversible dynamics and irreversible entropy production is offered by the heat exchanger. Consider two heat compartments, having temperatures T h and T c (‘hot’ and ‘cold’), connected by a heat-conducting wall. In the absence of the conducting wall (and thus, without irreversible entropy production), these are two separate systems with entropies S h and S c , each satisfying
d d t S h = q h T h , d d t S c = q c T c
Due to the conducting wall, there is a heat flow q from the hot to the cold compartment, which is given by Fourier’s law for heat conduction as q = λ ( T h T c ) for some positive constant λ . Furthermore, in view of the first law q = q h = q c . Hence, the total entropy S : = S h + S c satisfies
d d t S = q T h + q T c = 1 T c 1 T h q
This yields the following expression for the irreversible entropy production σ = d d t S due to heat conduction (non-equilibrium conditions)
σ = 1 T c 1 T h λ ( T h T c ) = λ T h T c 2 T h T c 0
In this example the thermodynamic force is F = 1 T c 1 T h , while the thermodynamic flow is J = q = λ ( T h T c ) . Indeed σ = 0 if, and only if, F = 0 . Despite its simplicity, this is an example of nonlinear irreversible thermodynamics, since the thermodynamic flow q = λ ( T h T c ) cannot be expressed as a linear function of the thermodynamic force F = 1 T c 1 T h .
Example 2 
(The gas-piston-damper system). Another simple example is the gas-piston-damper system. Consider a cylinder containing a gas whose volume can be controlled by a piston actuated by an external force u, and is subject to linear damping. The total energy E of the system can be expressed as a function of the other extensive variables as
E ( S , V , π ) = U ( S , V ) + π 2 2 m ,
with S representing entropy, V volume, π momentum of the piston with mass m, and U ( S , V ) representing the internal energy of the gas. Assuming that the heat as produced by the damping of the piston is fully absorbed by the gas in the cylinder, the dynamics are given as
V ˙ = A π m π ˙ = A U V d v + u S ˙ = d v 2 T
with v = π m the velocity of the piston, A its area, d the damping constant, T = U S the temperature, and u the external force on the piston. The thermodynamic force F is identified as d v T and the thermodynamic flow as J = v . Clearly Onsager relations J = L F are satisfied with L = T d .
Example 3 
(Chemical reaction network). A third, more involved, example of irreversible thermodynamics are the dynamics of chemical reaction networks [34,41]. Consider an isolated (no incoming or outgoing chemical species, and no external heat flow) reaction network, with m chemical species and r reactions. Disregarding volume and pressure, consider the vector x R m of concentrations of the chemical species. The dynamics take the form
x ˙ = N v ( x ) ,
where v R r is the vector of reaction fluxes. The m × r stoichiometric matrixN, which consists of positive and negative integer elements, captures the structural balance laws of the reactions. Chemical reaction network theory, as originating from [42,43,44], identifies the edges of the underlying directed graph with the r reactions, and the nodes with the ccomplexes of the chemical reactions, i.e., the different left- and right-hand sides of the reactions in the network. This means that the stoichiometric matrix N is factorized as N = Z B , with B denoting the c × r incidence matrix of the graph of complexes, and Z denoting the m × c complex composition matrix (a matrix of nonnegative integers), whose ρ -th column captures the expression of the ρ -th complex in the m chemical species. It is shown in [45] that the dynamics x ˙ = N v ( x ) of a large class of chemical reaction networks (including detailed-balanced mass action kinetics networks) can be written into the compact form
x ˙ = N v ( x ) = Z L Exp 1 R T Z μ ( x ) ,
where Exp is the vector exponential mapping Exp ( z ) = ( exp z 1 , , exp z c ) , R is the gas constant, T is the temperature, and μ is the m-dimensional vector of chemical potentials of the chemical species (for which e.g., in the case of detailed-balanced mass action kinetics explicit expressions are available). Furthermore, the matrix L : = B K B in (24) defines a weighted Laplacian matrix for the graph of complexes, with the diagonal elements κ 1 , , κ r of the diagonal matrix K , depending on the temperature T and the reference state. We have the following fundamental property [45]
γ L Exp γ 0 for   all   γ R c , γ L Exp γ = 0 iff B γ = 0
Expressing the entropy S as a function of x and the total energy E, Gibbs’ fundamental relation yields S x ( x , E ) = μ T , S E ( x , E ) = 1 T . This implies
d d t S = 1 T μ Z L Exp ( Z μ R T ) = : σ 0 ,
with equality if, and only if, B Z μ = N μ = 0 , i.e., if and only if the chemical affinities N μ of the reactions are all zero. Hence the equilibria of the system correspond to states of minimal (i.e., zero) entropy production σ , in accordance with the theory of irreversible thermodynamics [38].
The vectors of thermodynamic forces F and thermodynamic flows J are given as
F = 1 T N μ , J = K B Exp Z μ R T ,
and indeed by (25) σ = 0 if and only if F = 0 . Note that Jcannot be expressed as a linear function of F and thus, in general, chemical reaction networks define nonlinear irreversible thermodynamics.

3.1. Quasi-Hamiltonian Formulation of Irreversible Thermodynamic Systems

Conservative mechanical systems are well-known to admit a Hamiltonian formulation. The same holds for many other physical systems. The Hamiltonian formulation of the dynamics of thermodynamic systems is, however, much more elusive. This has already studied and elaborated upon in, e.g., [16,24,41,46]. The present formulation emphasizes the factorization (15) of the irreversible entropy production.
Consider an isolated thermodynamic system with entropy S and energy E. Collect all other extensive variables in a vector denoted by z. The energy E can be expressed as a function E = E ( z , S ) of z and S. Now consider the irreversible entropy production S ˙ = σ = J F , with J the vector of thermodynamic flows and F the vector of thermodynamic forces. Often (as illustrated by the examples to be discussed), the thermodynamic force F can be expressed as C E z for some matrix C, whose elements are possibly depending on E z , E S , as well as on z , S . Note that E z equals the vector of intensive variables associated with the extensive variables z, while the intensive variable E S equals the temperature T.
Energy conservation d d t E ( z , S ) = 0 together with d d t S ( z , E ) = J F suggests writing the dynamics of z and S into the form
z ˙ S ˙ = J C J J C 0 J e E z E S ,
for some skew-symmetric matrix J , possibly depending on E z , E S and z , S . This implies that the extended matrix J e is also skew-symmetric, and thus indeed d d t E ( z , S ) = 0 . Note however, that since the matrix J e may depend on the intensive variables E z , E S , it does not define a Poisson bracket on the state space with coordinates z , S . Therefore (28) will be called a quasi-Hamiltonian formulation.
This is illustrated by the previously discussed examples of the gas-piston-damper system, chemical reaction network, and heat exchanger as follows.
Example 4 
(Gas-piston-damper system continued). The dynamics of the gas-piston-damper system (22) can be written into the quasi-Hamiltonian form as (see also [41])
V ˙ π ˙ S ˙ = 0 A 0 A 0 d v T 0 d v T 0 J e E V E π E S + 0 1 0 u
with v = E π = π m as the velocity of the piston and T = E S the temperature. The thermodynamic flow and force are J = v and F = d T v , respectively. Hence, J e is of the form as given in (28) with C = 0 d T . J e depends on the intensive variables T and v, therefore, it does not define a Poisson bracket.
Example 5 
(Chemical reaction network continued). In the case of chemical reaction networks, the vector of thermodynamic forces is given as F = 1 T N μ = C E x with C = 1 T N , and E x = μ the vector of chemical potentials. Furthermore, according to (27) the vector of thermodynamic flows is given as J = K B Exp Z μ R T . This leads to the quasi-Hamiltonian representation
x ˙ S ˙ = 0 1 T N J 1 T J N 0 E x E S
Example 6 
(Heat exchanger continued). The quasi-Hamiltonian formulation of the heat exchanger is slightly different. This caused by the fact that, in this example, we have two entropies, S 1 and S 2 , corresponding to the two compartments (and not a total entropy as in the previous two examples). In fact, the quasi-Hamiltonian formulation of the heat exchanger is given as (see [41])
S ˙ 1 S ˙ 2 = q T 1 q T 2 = 0 λ 1 T 1 1 T 2 λ 1 T 1 1 T 2 0 T 1 T 2
since E S i = T i , i = 1 , 2 , and the heat flow from compartment 1 to 2 is given by q = λ ( T 1 T 2 ) . Here, we recognize 1 T 1 1 T 2 as the thermodynamic force.
A further structured form of quasi-Hamiltonian modeling of irreversible thermodynamic systems, called irreversible port-Hamiltonian systems, was introduced in [24]; see [41,46,47] for more developments and references.
A special case occurs if the total energy E ( z , S ) splits as
E ( z , S ) = H ( z ) + U ( S ) ,
for some thermal energy U ( S ) and remaining energy H ( z ) . In this case, one obtains the equations
z ˙ = J H z ( z ) T C J , S ˙ = J C H z ( z ) , F = C H z ( z )
If, furthermore, J = L F with L = L (Onsager’s reciprocity relations) then the dynamical equations for the extensive variables z can be combined into
z ˙ = J H z ( z ) T C L C H z ( z ) = J T C L C H z ( z )
This is the standard internal dynamics of a port-Hamiltonian system with state vector z; see e.g., [37,48,49]. In this case, irreversibility means that, even though the total energy E ( z , S ) = H ( z ) + U ( S ) is preserved, the part of the energy given by H ( z ) is continuously transformed (by the resistive power flow T S ˙ ) into the thermal energy U ( S ) . Conversely, one can show [31] that any port-Hamiltonian system can be embedded into an energy-conserving thermodynamic system.
Example 7 
(Mass-spring-damper system). A simple example is the ubiquitous mass-spring-damper system. Its dynamics are very similar to that of the gas-piston-damper system, the difference being that the internal energy U ( V , S ) of the gas is replaced by the sum 1 2 k x 2 + U ( S ) , where 1 2 k x 2 is the potential energy of the spring (with x denoting the elongation of the spring), and U ( S ) is the thermal energy of the system. This leads to the dynamics (compare with (29))
x ˙ π ˙ S ˙ = 0 1 0 1 0 d π m T 0 d π m T 0 k x π m T + 0 1 0 u ,
as well as the following port-Hamiltonian formulation of the mass-spring-damper system
x ˙ π ˙ = 0 1 1 d k x π m + 0 1 u

3.2. Stability Analysis

The quasi-Hamiltonian formulation can be readily used for stability analysis. Note, however, that the conditions E z = 0 , E S = 0 for E having a minimum often do not correspond to equilibria of interest. This is illustrated by the gas-piston-damper system, where these conditions correspond to pressure, velocity, and temperature all being equal to zero. Instead, in such cases it is of much more interest to consider the stability of steady states ( V ¯ , π ¯ = 0 , S ¯ ) corresponding to a non-zero force u ¯ delivered by the piston. In view of (29) and the energy expression E ( V , π , S ) = π 2 2 m + U ( V , S ) , this corresponds to the steady state condition
A U V ( V ¯ , S ¯ ) = u ¯
(Note that S ˙ = 0 is ensured by π ¯ = 0 implying that v ¯ = π ¯ m = 0 , and thus corresponds to a singularity in the skew-symmetric matrix J e , instead of a vanishing of all the partial derivatives of E. In particular, the temperature T = E S at steady state will not be zero.) Instead of using E ( z , S ) as a candidate Lyapunov function which leads to the consideration of the availability function [50] (also called Bregman divergence or shifted Hamiltonian [37])
E ^ ( V , π , S ) : = π 2 2 m + U ( V , S ) + P ¯ ( V V ¯ ) T ¯ ( S S ¯ ) E ( V ¯ , π ¯ , S ¯ ) ,
where P = U V ( S ¯ , V ¯ ) and T ¯ = U S ( S ¯ , V ¯ ) are the pressure and temperature at steady state, for some arbitrary value S ¯ . Indeed, using the steady state condition (37), a direct computation yields
d d t E ^ = T ¯ T d v 2 0
for all values of the temperature T > 0 and the steady state temperature T ¯ > 0 . Furthermore, given that for thermodynamic systems the internal energy U ( V , S ) (and therefore E ( V , π , S ) ) is a convex function, E ^ ( V , π , S ) is also convex with minimum at V ¯ , π ¯ = 0 , S ¯ . Hence, if E ^ ( V , π , S ) is strictly convex (which is often the case), then this proves the asymptotic stability of the steady state. The use of the availability function for stability analysis and stabilization was already advocated for in [51]; see also, e.g., [47,52] for related work using the availability function in the context of passivity-based control of irreversible port-Hamiltonian systems.
This is extended to general quasi-Hamiltonian systems
z ˙ S ˙ = J e E z ( z , S ) E S ( z , S ) + G u ,
where the skew–symmetric matrix J e and the input matrix G may both depend on the extensive variables z , S and the intensive variables E z ( z , S ) , E S ( z , S ) = T . The steady state condition for u = u ¯ is given as
J ¯ e E z ( z ¯ , S ¯ ) E S ( z ¯ , S ¯ ) + G ¯ u ¯ = 0 ,
where J ¯ e and G ¯ denote the values of J e and G at steady state, i.e.,
J ¯ e = J e z ¯ , S ¯ , E z ( z ¯ , S ¯ ) , E S ( z ¯ , S ¯ ) , G ¯ = G z ¯ , S ¯ , E z ( z ¯ , S ¯ , E S ( z ¯ , S ¯ )
Assuming the energy function E ( z , S ) to be convex (which is normally the case in thermodynamic systems), then the availability function is given as the convex function
E ^ ( z , S ) : = E ( z , S ) E z ( z ¯ , S ¯ ) ( z z ¯ ) E S ( z ¯ , S ¯ ) ( S S ¯ ) E ( z ¯ , S ¯ ) ,
having a minimum at ( z ¯ , S ¯ ) . A key property of the availability function E ^ is that
E ^ ( z , S ) = E ( z , S ) E ( z ¯ , S ¯ )
where E ^ ( z , S ) denotes the gradient vector of E ^ (written as a column vector). The computation of d d t E ^ ( z , S ) yields, exploiting the steady state condition (41),
d d t E ^ ( z , S ) = ( E ^ ( z , S ) ) J e E ( z , S ) J ¯ e E ( z ¯ , S ¯ )
It follows that d d t E ^ ( z , S ) 0 if, and only if
E ( z , S ) E ( z ¯ , S ¯ ) J e E ( z , S ) J ¯ e E ( z ¯ , S ¯ ) 0
(This condition is similar to the condition for asymptotic stability of steady states of port-Hamiltonian systems as derived in [53]; see also [37].) Hence if (46) is satisfied and E ^ ( z , S ) is not only convex but even strictly convex, then E ^ ( z , S ) serves as a Lyapunov function for assessing the (asymptotic) stability of the steady state ( z ¯ , S ¯ ) .
Instead of expressing the energy E as a function E ( z , S ) of the remaining extensive variables z , S and writing the dynamics as a quasi-Hamiltonian system with Hamiltonian given by E, one may also write the entropy S as a function S ( z , E ) and try to express the dynamics as being generated by the gradient of this entropy function. However, since (in the isolated case) d d t S 0 , this constitutes quite a different scenario. An example where it is possible is a chemical reaction network as mentioned before. Instead of the quasi-Hamiltonian formulation (30), one rewrites the dynamics as (with z replaced by the vector of concentrations x)
x ˙ E ˙ = T 0 N J J N T J F F e S x ( x , E ) S E ( x , E ) ,
where S x ( x , E ) = μ T and S E ( x , E ) = 1 T . Consequently
E ˙ = J N μ + T J F = 0 ,
because of F = 1 T N μ . Since d d t S 0 , the availability function corresponding to V ( z ) : = S ( x , E ¯ ) , with E ¯ the constant total energy of the system, can be used as a Lyapunov function for stability analysis; cf. [34] for details. Note that the matrix F e , in the right-hand of (47), is not a skew-symmetric matrix anymore. In fact, the formulation (47) resembles the formulation of thermodynamic systems as used in the GENERIC formalism; see, e.g., [30].
Another interesting case are isothermal chemical reaction networks. In this case [45] one considers the Gibbs free energy (Legendre transform of E ( z , S ) with respect to S)
G ( z , T ) = E ( z , S ) T S , T = E S
for constant T. By the properties of the Legendre transform G z = E z = μ (the vector of chemical potentials). Hence, in view of (47) one obtains for constant T
d d t G = μ z ˙ = μ N J = T F J = T σ
with σ the irreversible entropy production. Alternatively expressed, whenever the temperature T is constant, d d t G = d d t E T d d t S , while d d t E = q (with q the heat flow needed to keep the temperature constant) and d d t S = q σ . Taken together this indeed yields d d t G = T σ .

4. Thermodynamic Phase Space and Liouville Geometry

A typical feature of thermodynamic systems modeling is the use of many more variables than the minimal number of variables to describe the ‘state’ of the system. For example, a simple thermodynamic system is described by a 2-dimensional submanifold L of the 3-dimensional space of macroscopic quantities V , P , T ; one extensive, and two intensive. Then, based on the first and second laws of thermodynamics, two extra extensive variables E , S are introduced. As a result, the system is described as a 2-dimensional submanifold L of R 5 ; the thermodynamic phase space is generated by the three extensive variables E , S , V , and the two intensive variables T , P . This is immediately extended to the general thermodynamic case, where L is an n-dimensional submanifold of the ( 2 n + 1 ) -dimensional thermodynamic phase space (comprising n + 1 extensive variables and n intensive variables).

4.1. Constitutive Relations and Liouville Submanifolds

The Legendre submanifold L only defines the constitutive relations of the thermodynamic system, i.e., its thermostatics. The first and second laws impose constraints on any possible dynamics of the thermodynamic system, but do not define it. On the other hand, two requirements for any dynamics on the full thermodynamic phase space are natural: (1) the dynamics should respect the ‘structure’ of the thermodynamic phase space, (2) it should respect the constitutive relations; i.e., should leave the submanifold L invariant. The proper geometry to address this is contact geometry. However, in order to unify the energy and entropy representation we will take one more abstraction step; from contact geometry to Liouville geometry. This will have the additional benefit of making a clear separation between extensive and intensive variables, and of being computationally more easy; see [25,26,54,55] for further details and ramifications.
For a simple thermodynamic system with extensive variables E , S , V and intensive variables T , P , the step from contact to Liouville geometry amounts to replacing the intensive variables T , P (in the energy representation) with their homogeneous coordinates p E , p S , p V with p E 0 , i.e.,
T = p S p E , P = p V p E ,
and thereby to express the intensive variables 1 T , P T in the entropy representation as
1 T = p E p S , P T = p V p S
In this way, the two Gibbs one-forms d E T d S + P d V and d S 1 T d E P T d V are replaced by a single symmetric expression, namely by the Liouville one-form
p E d E + p S d S + p V d V ,
on the cotangent bundle T * R 3 , with R 3 the space of extensive variables E , S , V . By definition of homogeneous coordinates, the vector ( p E , p S , p V ) is always different from the 0-vector. Hence, the space { ( E , S , V , p E , p S , p V ) } is actually the cotangent bundle T * R 3  minus its zero section. Using homogeneous coordinates, the 2-dimensional Legendre submanifold L is now replaced by the 3-dimensional submanifold L T * R 3 , given as
L = { ( E , S , V , p E , p S , p V ) ( E , S , V , p S p E , p V p E ) L , ( p E , p S , p V ) 0 }
It turns out that L is a Lagrangian submanifold [56,57,58], which is moreover homogeneous, in the sense that whenever ( E , S , V , p E , p S , p V ) L then also ( E , S , V , λ p E , λ p S , λ p V ) L , for any non-zero λ R . Such submanifolds are fully characterized as maximal manifolds restricted to which the Liouville form p E d E + p S d S + p V d V is zero, and are therefore called homogeneous Lagrangian submanifolds or Liouville submanifolds [25].
In general, one considers the ( n + 1 ) -dimensional manifold Q of all the extensive variables (including E and S), and its ( 2 n + 2 ) -dimensional cotangent bundle without zero section, denoted by T * Q . The constitutive properties of the thermodynamic system are defined by a ( n + 1 ) -dimensional Liouville submanifold L . Conversely, starting from T * Q we may define a contact manifold in the following way [57]. For each q Q and cotangent space T q * Q consider the projective space P ( T q * Q ) , given as the set of rays in T q * Q , that is, all the non-zero multiples of a non-zero cotangent vector. Thus, the projective space P ( T q * Q ) has dimension n, and there is the canonical projection π q : T q * Q P ( T q * Q ) , where T q * Q denotes the cotangent space without its zero vector. The fiber bundle of the projective spaces P ( T q * Q ) , q Q , over the base manifold Q will be denoted by P ( T * Q ) . Furthermore, the bundle projection obtained by considering π q : T q * Q P ( T q * Q ) for every q Q is denoted by π : T * Q P ( T * Q ) . As detailed in [26,57,58], P ( T * Q ) defines a contact manifold of dimension 2 n + 1 , and will serve as the canonical thermodynamic phase space for the thermodynamic system with space of external variables Q . In the case of a simple thermodynamic system the bundle projection π is given in coordinates as
( p E , p S , p V ) ( p S p E = T , p V p E = P )
whenever p E 0 (energy representation), or as
( p E , p S , p V ) ( p E p S = 1 T , p V p S = P T )
whenever p S 0 (entropy representation). The cotangent bundle T * Q , and therefore also T * Q , are endowed with the natural one-form α , called the Liouville form, which in natural cotangent bundle coordinates ( q , p ) = ( q 1 , , q n + 1 , p 1 , , p n + 1 ) is given as α = i = 1 n + 1 p i d q i . A submanifold L T * Q is a Liouville submanifold if α restricted to L is zero, and furthermore L is maximal with respect to this property. It turns out that maximality of L is equivalent to dim L = n + 1 .
For any point in a Liouville submanifold L there exists a neighborhood of this point, a splitting of the index set { 1 , , n + 1 } = I J and a function F ( q I , p J ) that is homogeneous of degree 1 in p J (in particular J ), where q I denotes the vector of coordinates q i with i I and p J denotes the vector of coordinates p j with j J , such that on this neighborhood
L = { ( q , p ) T * Q p i = F q i , i I , q j = F p j , j J }
By homogeneity of F in p J it follows that for any j J we can write, whenever p j 0 ,
F ( q I , p J ) = p j F ^ ( q I , p p j ) , J , j )
for some function F ^ . The choice of j J corresponds to a choice of the coordinates for the contact manifold P ( T * Q ) (for example, corresponding to the energy or the entropy representation).
The Liouville submanifold L projects under π to a Legendre submanifold L P ( T * Q ) , and conversely any Legendre submanifold L P ( T * Q ) is the projection of a Liouville submanifold L T * Q . Furthermore, the function F ^ serves as a generating function for the Legendre submanifold L. Although the close relation of contact geometry with the Liouville geometry of cotangent bundles is well-known in differential geometry [57,58], the use of homogeneous coordinates for thermodynamics was first advocated for in [29].

4.2. Homogeneous Hamiltonian Dynamics and Port-Thermodynamic Systems

The dynamics of the thermodynamic system should now satisfy the following two basic requirements. First, it should respect the structure of T * Q , and therefore of the contact manifold P ( T * Q ) . Second, it should leave invariant the Liouville submanifold L specifying the constitutive relations. The first requirement amounts to a requirement that the dynamics are Hamiltonian on T * Q , with the additional property that the Liouville forms on T * Q is preserved. This can be seen to correspond to Hamiltonian dynamics with a Hamiltonian K that is homogeneous of degree 1 in the p-variables. Thus, if q are coordinates for Q and ( q , p ) are corresponding cotangent bundle coordinates for T * Q (such that the Liouville form is α = i = 1 n + 1 p i d q i ), then we consider Hamiltonians K ( q , p ) satisfying K ( q , λ p ) = λ K ( q , p ) for all λ R different from zero. Equivalently, by Euler’s theorem, the Hamiltonian K ( q , p ) should satisfy
K ( q , p ) = i = 1 n + 1 p i K p i ( q , p ) ,
with the functions K p i ( q , p ) homogeneous of degree 0 in p, i = 1 , , n + 1 . The second requirement is equivalent to K being such that K restricted to L is zero. Finally, we will split K into two parts, i.e.,
K a + K c u , u R m
Here K a : T * Z R is the Hamiltonian corresponding to the autonomous dynamics due to internal non-equilibrium conditions, while K c = ( K 1 c , , K m c ) is a row vector of Hamiltonians corresponding to dynamics arising from interaction with the surroundings of the system, parameterized by a vector u of control or input variables. (However, as we will notice in the context of the damper system (81), there are cases where the dependence on u is not affine.) Thus all these Hamiltonians K a , K 1 c , , K m c are zero on L . This implies that the dynamics of the extensive variables are given as
q ˙ i = K a p i ( q , p ) + j = 1 m K c j p i ( q , p ) , i = 1 , , n + 1 ,
where the right-hand side is homogeneous of degree 0 in p. (Note that this does not mean that the right-hand side is necessarily independent of p; it may depend on degree 0 variables p i p E ; i.e., on the intensive variables!)
Finally, there are two important extra constraints on K a (the Hamiltonian governing the autonomous dynamics corresponding to u = 0 ) which are directly imposed by the first and second laws. By the first law 0 = E ˙ = K a p E on L . Furthermore, by the second law necessarily K a p S | L 0 . In fact, using the postulate of factorization of the irreversible entropy production as discussed in Section 3 one has
K a p S | L = σ = k = 1 s F k J k 0
where σ = 0 if and only if F k = 0 , k = 1 , , s .
Such constraints do not hold for the control (interaction) Hamiltonians K c . In fact, the corresponding terms of the control Hamiltonians define natural outputs conjugated to the inputs u. The first option is to define the m-dimensional row vector
y p = K c p E ,
with the subscript p in y p standing for power. Then, it follows that d d t E = y p u , and thus, y p is the vector of power-conjugate (passive) outputs corresponding to the input vector u. Similarly, by defining the m-dimensional row vector
y e = K c p S
it follows that d d t S y e u . Hence y e is the output vector which is conjugate to u in terms of entropy flow. This is summarized in the following definition of a port-thermodynamic system as given in [25,26].
Definition 1. 
Consider a manifold Q of extensive variables. A port-thermodynamic system on Q is defined by a Liouville submanifold L T * Q specifying the constitutive relations of the system, together with a Hamiltonian K a + K c u , u R m , homogeneous of degree 1 in p, which is zero on L for every u and satisfying K a p E = 0 on L , and K a p S 0 on L . Its power port is defined by u together with the output y p = K c p E , and its entropy flow port by u and y e = K c p S .
Remark 3. 
The Hamiltonian K generates the dynamics, but does not have an interpretation in terms of energy. In fact, K is dimensionless; see [25,26] for further information.
Remark 4. 
Through the use of entropy flow ports, one could express the irreversible entropy production σ = k = 1 s F k J k 0 as being the result of the interconnection of the system with a pure entropy producing element. This is especially clear if the vector of thermodynamic flows J can be expressed as a function of the vector of thermodynamic forces F, like in Onsager’s relations J = L F , L = L . Namely, in this case one may consider u = J and entropy conjugate outputs y e = F , and then ‘close’ the loop by setting u = L y e .
Because of the homogeneity of the Liouville submanifold L and of the Hamiltonian K, the port-thermodynamic system defined on T * Q , including its power and entropy flow ports, projects to a system on the thermodynamic phase space P ( T * Q ) with Legendre submanifold L; see [25] for details. In fact, the resulting class of systems on P ( T * Q ) is very close to the classes of input–output contact systems and conservative control contact systems on contact manifolds as introduced and studied in [7,8,9,59,60].
The definition of port-thermodynamic systems (Definition 1) is illustrated by the examples of the gas-piston-damper system, chemical reaction network, and heat exchanger as follows.
Example 8 
(Gas-piston-damper system continued [26]). As discussed before, the extensive variables are E (energy), S (entropy), V (volume), and π (momentum of the piston). For simplicity we will take A = 1 . The constitutive properties are given by the Liouville submanifold
L = { ( E , S , V , π , p E , p S , p V , p π ) E ( S , V , π ) = U ( S , V ) + π 2 2 m , p S = p E U S , p V = p E U V , p π = p E π m }
with generating function p E U ( S , V ) + π 2 2 m . The dynamics are given by the Hamiltonian (homogeneous of degree 1 in p)
K = p V π m + p π U V d π m + p S d ( π m ) 2 U S + p π + p E π m u ,
which obviously is zero on L . The power-conjugate output y p = π m is the velocity of the piston. One could also add an extra control Hamiltonian p S T + p E v , where T = U S is the temperature, and v is the heat flow from an external heat source into the cylinder. The corresponding entropy conjugate output is y e = 1 T .
Example 9 
(Chemical reaction network continued [33]). Consider a chemical reaction network in entropy representation, with the entropy S represented as a function S = S ( E , x ) of the vector of chemical concentrations x and energy E. Then the Liouville submanifold describing the state properties of the reaction network is given as
L = { ( x , S , E , p x , p S , p E ) S = S ( E , x ) , p x = p S S x ( E , x ) , p E = p S S E ( E , x ) }
with generating function p S S ( x , E ) and S x ( E , x ) = μ T , S E ( E , x ) = 1 T . The internal dynamics of the chemical reaction network are generated by the Hamiltonian
K a = p x Z L Exp Z R S x ( E , x ) p S S x ( E , x ) Z L Exp Z R S x ( E , x )
Furthermore, the control Hamiltonian
K c = p S S E ( E , x ) + p E ,
corresponds to a heat flow input, and an entropy flow conjugate output y e = S E ( x , E ) | L equal to the reciprocal temperature. Another possible choice is
K c = p S S x i ( E , x ) + p x i ,
corresponding to material in/outflow of the i-th chemical species, with entropy flow conjugate output y e = S x i ( E , x ) | L equal to the chemical potential μ i of the i-th chemical species divided by the temperature T.
Example 10 
(Heat exchanger continued [26]). 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 Liouville submanifold
L = { ( S 1 , S 2 , E , p S 1 , p S 2 , p E ) E = E 1 ( S 1 ) + E 2 ( S 2 ) , p S 1 = p E E 1 ( S 1 ) , p S 2 = p E E 2 ( S 2 ) } ,
corresponding to the generating function p E E 1 ( S 1 ) + E 2 ( S 2 ) , with E 1 , E 2 as 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 corresponding to Fourier’s law is given by the Hamiltonian
K a = λ ( 1 T 1 1 T 2 ) ( p S 1 T 2 p S 2 T 1 ) ,
with λ Fourier’s conduction coefficient.

5. Control by Interconnection

Control by interconnection is the paradigm of controlling a system by interconnecting it (through its inputs and outputs) to an additional controller system. The aim is to influence the dynamics of the original system by shaping the dynamics of the interconnected system by a proper choice of the controller system. Applied to port-thermodynamic systems, this means that given a plant thermodynamic system we interconnect it to a controller port-thermodynamic system such that in the closed-loop port-thermodynamic system the plant states converge to the desired set-point values. Port-thermodynamic systems can be interconnected, either by their power ports or by their entropy flow ports; cf. [26] for details. For example, the power port interconnection of two systems with variables
( E i , S i , q i , p E i , p S i , p i ) T * Q i , i = 1 , 2 ,
is defined as follows. With the homogeneity assumption in p in mind, impose the following constraint
p E 1 = p E 2 = : p E
This leads to the summation of the Liouville one-forms α 1 and α 2 given by
α sum : = p E d ( E 1 + E 2 ) + p S 1 d S 1 + p S 2 d S 2 + p 1 d q 1 + p 2 d q 2
on the composed space  T * Q 1 T * Q 2 defined as
T * Q 1 T * Q 2 : = { ( E , S 1 , S 2 , q 1 , q 2 , p E , p S 1 , p S 2 , p 1 , p 2 ) }
Let the constitutive relations of the two port-thermodynamic systems be defined by the Liouville submanifolds L i T * Q i , i = 1 , 2 . Then, the constitutive relations of the interconnected system are defined by the composition
L 1 L 2 : = { ( E , S 1 , S 2 , q 1 , q 2 , p E , p S 1 , p S 2 , p 1 , p 2 ) E = E 1 + E 2 , ( E i , S i , q i , p E i , p S i , p i ) L i , i = 1 , 2 }
Furthermore, consider the dynamics on L i defined by Hamiltonians K i = K i a + K i c u i , i = 1 , 2 , where K i c is the row vector of control Hamiltonians of system i , i = 1 , 2 . Additionally assume that the functions K i do not depend on the energy variables E i , i = 1 , 2 . Then K 1 + K 2 is well-defined on L 1 L 2 for all u 1 , u 2 . Next, consider the power conjugate outputs y p 1 , y p 2 . By imposing interconnection constraints on the power port variables u 1 , u 2 , y p 1 , y p 2 satisfying the power preservation property
y p 1 u 1 + y p 2 u 2 = 0
one obtains an interconnected port-thermodynamic system with constitutive relations described by L 1 L 2 . Similarly, interconnecting the inputs u 1 , u 2 to the entropy flow outputs y e 1 , y e 2 in such a way that
y e 1 u 1 + y e 2 u 2 0 ,
leads again to a port-thermodynamic system.
A basic control problem concerns the stabilization of a system to a desired set-point value (regulation). How can we use control by interconnection to address this problem? Suppose we want to stabilize the system at some set-point value ( z * , S * ) . If E ( z , S ) already has a strict minimum at ( z * , S * ) then one may asymptotically stabilize ( z * , S * ) by the interconnection with a damper system [32]. In fact, assume for simplicity of exposition that m = 1 (scalar output y p ). Then, consider an additional linear damper system (cf. [26]), whose Liouville submanifold is given as
L d = { ( U d , S d ) U d = U d ( S d ) , p S d = p U d U d ( S d ) } ,
with entropy as S d , internal energy as U d ( S d ) , and U d ( S d ) its temperature. The dynamics of this damper system are generated by the Hamiltonian (see [26])
K = ( p U d + p S d 1 U d ( S d ) ) d u d 2
(note the quadratic dependence on the input u d ), with power conjugate output y d = d u d (damping force). Then interconnect the plant port-thermodynamic system ( L , K = K a + K c u ) to this damper system by setting
u = y d , u d = y
This results (after setting p U d = p E ) in the interconnected port-thermodynamic system with total Hamiltonian given as
K a ( E , S , z , p E , p S , p z ) K c ( E , S , z , p E , p S , p z ) d y + ( p U d + p S d 1 U ( S d ) ) d y 2
with total energy E ( S , z ) + U d ( S d ) . This implies
d d t E ( S , q ) = d d t U d ( S d ) = U d ( S d ) S d ˙ = d y 2 0
Hence, by an application of LaSalle’s invariance principle, the system converges to the largest invariant set within the set where the power conjugate output y p is zero. Note that y = 0 corresponds to zero entropy production S d ˙ = 0 ; in accordance with irreversible thermodynamics. If the largest invariant set where y is zero equals the singleton ( E * , S * , q * ) then asymptotic stability of ( E * , S * , q * ) results; for some limiting value S d * of the entropy S d of the damper system; see also [32].
What can be done if E ( S , z ) does not have a strict minimum at ( S * , z * ) ? This can be approached via the (generalized) Energy-Casimir method; similar to the theory of control by interconnection for port-Hamiltonian systems, see e.g., [37,61]. Consider a port-thermodynamic system with Liouville submanifold L T * Q with the generating function (in the energy representation) p E E ( S , z ) . A classical tool in the stability analysis of ordinary Hamiltonian dynamics is to consider additional conserved quantities; see e.g., [56,57,58]. In order to extend this idea to the present case, let us strengthen our assumption on K a by requiring that K a p E = 0 everywhere on T * Q ; i.e., not just on L . Next, consider additional conserved quantities for the dynamics X K a that are only depending on the extensive variables S , z ; i.e., functions C ( S , z ) such that { K a , C } = 0 , where { · , · } is the standard Poisson bracket on T * Q . Hence, also { K a , E + C } = 0 . Subsequently, note that [32]
α = p E d E + p S d S + p z d z = p E d ( E + C ( S , z ) ) + ( p S p E C S ) d S + ( p z p E C z ) d z
Hence, the transformation
( E , S , z , p E , p S , p z ) ( E + C , S , z , p E , p S p E C S , p z p E C z ) = : ( E ˜ , S ˜ , z ˜ , p ˜ E , p ˜ S , p ˜ z )
is a point transformation (that is, leaving the Liouville form invariant). Note that in the new coordinates the intensive variables p S p E , p z p E are transformed into the new intensive variables
p ˜ S p E = p S p E C S p E = p S p E + C S p ˜ z p E = p z p E C z p E = p p E + C z
In these new coordinates the generating function for L in entropy representation is given by E ˜ ( S , z ) = E ( S , z ) + C ( S , z ) . Furthermore, since { K a , E + C } = 0 , the transformed Hamiltonian
K a ˜ ( E ˜ , S ˜ , q ˜ , p ˜ E , p ˜ S , p ˜ ) : = K a ( E , S , q , p E , p S , p )
satisfies { K a ˜ , E ˜ } = 0 . Hence, in the new coordinates we are back to the situation considered before: if E ˜ ( S , z ) has a strict minimum at ( S * , z * ) , then E ˜ is a Lyapunov function for the dynamics restricted to L , and the equilibrium ( E * , S * , z * ) with E * = E ( S * , z * ) , is stable with respect to the dynamics on L .
Finally, note that the row vector K c in the new coordinates transforms to K c ˜ ( E ˜ , S ˜ , z ˜ , p ˜ E , p ˜ S , p ˜ z ) , leading to the transformed power conjugate outputs
y ˜ p : = K ˜ c p ˜ E ,
and the transformed entropy flow conjugate outputs
y ˜ e : = K ˜ c p ˜ S
All this is illustrated by the stabilization of the gas-piston system in the following example.
Example 11 
(Regulation of gas-piston system). Consider the gas-piston system (without a damper) with extensive variables ( E , S , V , π ) , as before. The constitutive properties of the system are given by the Liouville submanifold as in (65) with energy expression E p ( S , V , π ) : = U ( S , V ) + π 2 2 m (‘p’ for plant). Without damping ( d = 0 ) the dynamics are generated by the Hamiltonian
K = p V π m p π U V + p π + p E π m u p ,
with power conjugate output y p = π m (velocity of the piston). A scalar controller system with extensive variables ( E c , z c ) is given by the port-thermodynamic system ( L c , K c ) , with energy E c = E c ( z c ) , and dynamics
K c = p c + p E c E c ( z c ) u c
with output y c = E c ( z c ) . The function E c ( z c ) is a design parameter, specifying the controller system.
The closed-loop system is obtained by the negative feedback (with v a new external input)
u p = y c + v = E c ( z c ) + v , u c = y p = π m ,
together with
E : = E p + E c , p E p = p E c = : p E
This leads to the closed-loop Hamiltonian
K = p V π m p π U V + p π + p E p π m E c ( z c ) + v + p z c + p E c E c ( z c ) π m
It is immediately seen that C ( V , π , z c ) = Φ ( V z c ) for any function Φ : R R is a conserved quantity. This motivates a consideration of new canonical coordinates ( E ˜ , V ˜ , π ˜ , q ˜ c , p ˜ E , p ˜ V , p ˜ π , p ˜ c ) , where
E ˜ = E + Φ ( w = V z c ) , p ˜ V = p V p E Φ w , p ˜ z c + p E Φ w ,
while V ˜ = V , π ˜ = π , z ˜ c = z c , p ˜ E = p E , p ˜ π = p π . In the new coordinates we compute K ˜ as
K ˜ = p ˜ V + p ˜ E Φ w π ˜ m p ˜ π U V p ˜ π + p ˜ E π ˜ m E ¯ c ( z ˜ c ) + p ˜ z c p ˜ E Φ w + p ˜ E E ¯ c ( z ˜ c ) π ˜ m + p ˜ π + p ˜ E π ˜ m v ,
leading to the same power conjugate output y ˜ p = y p = π m (velocity of the piston). For any set-point V * the functions Φ and E c should be chosen in such a way that the function E S , V , π , Φ ( V z c ) has a strict minimum at ( S * , V * , π * = 0 , z c * ) for some value of S * and state z c * of the controller system. As discussed before, this can be turned into asymptotic stabilization by additionally interconnecting the obtained closed-loop system with a damper system through the power port ( v , y ˜ p ) .

6. Conclusions and Outlook

Ever since the fundamental contributions of Gibbs and Maxwell to thermodynamics, geometry has played an essential role. Nevertheless, the development of the geometric theory of macroscopic thermodynamics still poses fundamental questions, especially when it comes to thermodynamics instead of thermostatics. In this paper, the focus has been on quasi-Hamiltonian formulations based on the factorization of the irreversible entropy production, and on the contact-geometric approach using Liouville geometry. The first topic is intimately related to the GENERIC framework, as well as to the theory of irreversible port-Hamiltonian systems. With respect to the second topic, Liouville geometry offers a versatile framework for dealing with the general thermodynamic phase space, in particular by providing a unification of the energy and entropy representation. Although in this approach the necessary conditions for the dynamics on the thermodynamic phase space are clear, natural specifications of the dynamics are still somewhat lacking. In this regard, a combination of the quasi-Hamiltonian and GENERIC formulations with contact and Liouville geometry should be promising.
Finally, it should not be forgotten that thermodynamics started as an engineering subject (dealing with the efficiency of the steam engine). The interaction of thermodynamic systems with their surroundings is key to the theory. This has been demonstrated in this paper through a discussion of the definitions of the energy and entropy as storage functions with respect to supply rates corresponding to the thermal and the (mechanical) power port, and through the definition of port-thermodynamic systems. Furthermore, it naturally leads to control of thermodynamic systems, including the theory of ‘control by interconnection’.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Hermann, R. Geometry, Physics and Systems; Marcel Dekker: New York, NY, USA, 1973. [Google Scholar]
  2. Simoes, A.A.; de Diego, D.M.; Valcazar, M.L.; de Leon, M. The geometry of some thermodynamic systems. Geometric Structures of Statistical Physics, Information Geometry, and Learning, (SPIGL’20), Les Houches, France; Springer: Berlin/Heidelberg, Germany, 2021; pp. 247–275. [Google Scholar]
  3. Arnold, V.I. Contact Geometry: The Geometrical Method of Gibbs’s Thermodynamics. In Proceedings of the Gibbs Symposium, New Haven, CT, USA, 15–17 May 1989. [Google Scholar]
  4. Bravetti, A.; Lopez-Monsalvo, C.S.; Nettel, F. Contact symmetries and Hamiltonian thermodynamics. Ann. Phys. 2015, 361, 377–400. [Google Scholar] [CrossRef] [Green Version]
  5. Bravetti, A.; Lopez-Monsalvo, C.S.; Nettel, F. Conformal gauge transformations in thermodynamics. Entropy 2015, 17, 6150–6168. [Google Scholar] [CrossRef] [Green Version]
  6. de Leon, M.; Valcazar, M.L. Contact Hamiltonian systems. J. Math. Phys. 2019, 60, 102902. [Google Scholar] [CrossRef]
  7. Eberard, D.; Maschke, B.M.; van der Schaft, A.J. An extension of pseudo-Hamiltonian systems to the thermodynamic space: Towards a geometry of non-equilibrium thermodynamics. Rep. Math. Phys. 2007, 60, 175–198. [Google Scholar] [CrossRef] [Green Version]
  8. Favache, A.; Maschke, B.M.; Santos, V.D.; Dochain, D. Some properties of conservative control systems. IEEE Trans. Autom. Control. 2009, 54, 2341–2351. [Google Scholar] [CrossRef]
  9. Favache, A.; Dochain, D.; Maschke, B.M. An entropy-based formulation of irreversible processes based on contact structures. Chem. Eng. Sci. 2010, 65, 5204–5216. [Google Scholar] [CrossRef]
  10. Gay-Balmaz, F.; Yoshimura, H. A Lagrangian variational formulation for nonequilibrium thermodynamics. Part I: Discrete systems. J. Geom. Phys. 2017, 111, 169–193. [Google Scholar] [CrossRef] [Green Version]
  11. Grmela, M. Contact geometry of mesoscopic thermodynamics and dynamics. Entropy 2014, 16, 1652. [Google Scholar] [CrossRef] [Green Version]
  12. Gromov, D. Two approaches to the description of the evolution of thermodynamic systems. IFAC-PapersOnLine 2016, 49, 34–39. [Google Scholar] [CrossRef]
  13. Gromov, D.; Castanos, F. The geometric structure of interconnected thermo-mechanical systems. IFAC-PapersOnLine 2017, 50, 582–587. [Google Scholar] [CrossRef]
  14. Haslach, H.W., Jr. Geometric structure of the non-equilibrium thermodynamics of homogeneous systems. Rep. Math. Phys. 1997, 39, 147–162. [Google Scholar] [CrossRef]
  15. Hudon, N.; Guay, M.; Dochain, D. Control design for thermodynamic systems on contact manifolds. IFAC-PapersOnLine 2017, 50, 588–593. [Google Scholar] [CrossRef]
  16. Maschke, B. About the lift of irreversible thermodynamic systems to the thermodynamic phase space. IFAC-PapersOnLine 2016, 49, 40–45. [Google Scholar] [CrossRef]
  17. Merker, J.; Krüger, M. On a variational principle in thermodynamics. Contin. Mech. Thermodyn. 2013, 25, 779–793. [Google Scholar] [CrossRef]
  18. Mrugała, R. Geometric formulation of equilibrium phenomenological thermodynamics. Rep. Math. Phys. 1978, 14, 419. [Google Scholar] [CrossRef]
  19. Mrugała, R. On equivalence of two metrics in classical thermodynamics. Physica 1984, 125A, 631–639. [Google Scholar] [CrossRef]
  20. Mrugała, R. Submanifolds in the thermodynamic phase space. Rep. Math. Phys. 1985, 21, 197. [Google Scholar] [CrossRef]
  21. Mrugała, R. On contact and metric structures on thermodynamic spaces. RIMS, Kokyuroku 2000, 1142, 167–181. [Google Scholar]
  22. Mrugała, R. On a special family of thermodynamic processes and their invariants. Rep. Math. Phys. 2000, 3, 46. [Google Scholar] [CrossRef]
  23. Mrugała, R.; Nulton, J.D.; Schön, J.C.; Salamon, P. Contact structures in thermodynamic theory. Rep. Math. Phys. 1991, 29, 109–121. [Google Scholar] [CrossRef]
  24. Ramirez, H.; Maschke, B.; Sbarbaro, D. Irreversible port-Hamiltonian systems: A general formulation of irreversible processes with application to the CSTR. Chem. Eng. Sci. 2013, 89, 223–234. [Google Scholar] [CrossRef] [Green Version]
  25. van der Schaft, A.J. Liouville geometry of classical thermodynamics. J. Geom. Phys. 2021, 170, 104365. [Google Scholar] [CrossRef]
  26. van der Schaft, A.; Maschke, B. Geometry of thermodynamic processes. Entropy 2018, 20, 925. [Google Scholar] [CrossRef] [Green Version]
  27. Weinhold, F. Metric geometry of equilibrium thermodynamics. J. Chem. Phys. 1975, 63, 2479. [Google Scholar] [CrossRef]
  28. Bravetti, A. Contact geometry and thermodynamics. Int. J. Geom. Methods Mod. Phys. 2019, 16, 1940003. [Google Scholar] [CrossRef]
  29. Balian, R.; Valentin, P. Hamiltonian structure of thermodynamics with gauge. Eur. J. Phys. B 2001, 21, 269–282. [Google Scholar] [CrossRef] [Green Version]
  30. Öttinger, H.C. Beyond Equilibrium Thermodynamics; Wiley: Hoboken, NJ, USA, 2005. [Google Scholar]
  31. van der Schaft, A.J. Classical thermodynamics revisited: A systems and control perspective. IEEE Control. Syst. Mag. 2021, 41, 32–60. [Google Scholar] [CrossRef]
  32. van der Schaft, A.J. Towards control by interconnection of port-thermodynamic systems. IFAC-PapersOnLine 2021, 54, 25–31. [Google Scholar] [CrossRef]
  33. van der Schaft, A.J.; Maschke, B. On the geometric formulation of non-isothermal mass action chemical reaction networks. IFAC-PapersOnLine 2019, 52, 1–6. [Google Scholar] [CrossRef]
  34. Wang, L.; Maschke, B.; van der Schaft, A.J. Port-Hamiltonian modeling of non-isothermal chemical reaction networks. J. Math. Chem. 2018, 56, 1707–1727. [Google Scholar] [CrossRef] [Green Version]
  35. Willems, J.C. Dissipative dynamical systems. Part I: General theory. Arch. Rat. Mech. Anal. 1972, 45, 321–351. [Google Scholar] [CrossRef]
  36. Hill, D.J.; Moylan, P.J. Dissipative dynamical systems: Basic input-output and state properties. J. Frankl. Inst. 1980, 309, 327–357. [Google Scholar] [CrossRef]
  37. van der Schaft, A.J. L2-Gain and Passivity Techniques in Nonlinear Control, 3rd ed.; Springer: Berlin/Heidelberg, Germany, 2017. [Google Scholar]
  38. Kondepudi, D.; Prigogine, I. Modern Thermodynamics; From Heat Engines to Dissipative Structures, 2nd ed.; Wiley: Hoboken, NJ, USA, 2015. [Google Scholar]
  39. Fermi, E. Thermodynamics; Prentice-Hall: Hoboken, NJ, USA, 1937. [Google Scholar]
  40. van der Schaft, A.J. Cyclo-dissipativity revisited. IEEE Trans. Autom. Control. 2021, 66, 2920–2924. [Google Scholar] [CrossRef]
  41. Ramirez, H.; Le Gorrec, Y. An overview on irreversible port-Hamiltonian systems. Entropy 2022, 24, 1478. [Google Scholar] [CrossRef]
  42. Feinberg, M. The existence and uniqueness of steady states for a class of chemical reaction networks. Arch. Ration. Mech. Anal. 1995, 132, 311–370. [Google Scholar] [CrossRef]
  43. Horn, F.J.M. Necessary and sufficient conditions for complex balancing in chemical kinetics. Arch. Ration. Mech. Anal. 1972, 49, 172–186. [Google Scholar] [CrossRef]
  44. Horn, F.J.M.; Jackson, R. General mass action kinetics. Arch. Ration. Mech. Anal. 1972, 47, 81–116. [Google Scholar] [CrossRef]
  45. van der Schaft, A.J.; Rao, S.; Jayawardhana, B. On the mathematical structure of balanced chemical reaction networks governed by mass action kinetics. SIAM J. Appl. Math. 2013, 73, 953–973. [Google Scholar] [CrossRef] [Green Version]
  46. Ramirez, H.; Maschke, B.; Sbarbaro, D. Modelling and control of multi-energy systems: An irreversible port-Hamiltonian approach. Eur. J. Control. 2013, 19, 513–520. [Google Scholar] [CrossRef] [Green Version]
  47. Ramirez, H.; Gorrec, Y.L.; Maschke, B.; Couenne, F. On the passivity based control of irreversible processes: A port-Hamiltonian approach. Automatica 2016, 64, 105–111. [Google Scholar] [CrossRef] [Green Version]
  48. van der Schaft, A.J.; Maschke, B.M. The Hamiltonian formulation of energy conserving physical systems with external ports. Arch. Elektron. Ubertragungstechnik 1995, 49, 362–371. [Google Scholar]
  49. van der Schaft, A.J.; Jeltsema, D. Port-Hamiltonian Systems Theory: An Introductory Overview. Found. Trends Syst. Control. 2014, 1, 173–378. [Google Scholar] [CrossRef]
  50. Keenan, J.H. Availability and irreversibility in thermodynamics. British J. Appl. Phys. 1952, 2, 183. [Google Scholar] [CrossRef]
  51. Alonso, A.A.; Ydstie, B.E. Stabilization of distributed systems using irreversible thermodynamics. Automatica 2001, 37, 1739–1755. [Google Scholar] [CrossRef]
  52. Hoang, H.; Couenne, F.; Jallut, C.; Gorrec, Y.L. The port Hamiltonian approach to modeling and control of Continuous Stirred Tank Reactors. J. Process. Control. 2011, 21, 1449–1458. [Google Scholar] [CrossRef] [Green Version]
  53. Ferguson, J.; Middleton, R.H.; Donaire, A. Disturbance rejection via control by interconnection. In Proceedings of the 2015 54th IEEE Conference on Decision and Control (CDC), Osaka, Japan, 15–18 December 2015; pp. 507–512. [Google Scholar]
  54. Maschke, B.M.; van der Schaft, A.J. Homogeneous Hamiltonian control systems, Part II: Application to thermodynamic systems. In Proceedings of the 6th IFAC Workshop on Lagrangian and Hamiltonian Methods in Nonlinear Control, Valparaiso, Chile, 1–4 May 2018; Volume 51, pp. 7–12. [Google Scholar]
  55. van der Schaft, A.J.; Maschke, B.M. Homogeneous Hamiltonian control systems, Part I: Geometric formulation. In Proceedings of the 6th IFAC Workshop on Lagrangian and Hamiltonian Methods in Nonlinear Control, Valparaiso, Chile, 1–4 May 2018; Volume 51, pp. 1–6. [Google Scholar]
  56. Abraham, R.A.; Marsden, J.E. Foundations of Mechanics, 2nd ed.; Benjamin/Cummings: Reading, MA, USA, 1978. [Google Scholar]
  57. Arnold, V.I. Mathematical Methods of Classical Mechanics, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 1989. [Google Scholar]
  58. Libermann, P.; Marle, C.-M. Symplectic Geometry and Analytical Mechanics; D. Reidel Publishing Company: Dordrecht, The Netherlands, 1987. [Google Scholar]
  59. Ramirez, H.; Maschke, B.; Sbarbaro, D. Feedback equivalence of input-output contact systems. Syst. Control. Lett. 2013, 62, 475–481. [Google Scholar] [CrossRef] [Green Version]
  60. Ramirez, H.; Maschke, B.; Sbarbaro, D. Partial stabilization of input-output contact systems on a Legendre submanifold. IEEE Trans. Autom. Control. 2017, 62, 1431–1437. [Google Scholar] [CrossRef]
  61. Ortega, R.; van der Schaft, A.J.; Maschke, B.; Escobar, G. Interconnection and damping assignment passivity-based control of port-controlled Hamiltonian systems. Automatica 2002, 38, 585–596. [Google Scholar] [CrossRef] [Green Version]
Figure 1. The Carnot cycle.
Figure 1. The Carnot cycle.
Entropy 25 00577 g001
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

van der Schaft, A. Geometric Modeling for Control of Thermodynamic Systems. Entropy 2023, 25, 577. https://doi.org/10.3390/e25040577

AMA Style

van der Schaft A. Geometric Modeling for Control of Thermodynamic Systems. Entropy. 2023; 25(4):577. https://doi.org/10.3390/e25040577

Chicago/Turabian Style

van der Schaft, Arjan. 2023. "Geometric Modeling for Control of Thermodynamic Systems" Entropy 25, no. 4: 577. https://doi.org/10.3390/e25040577

APA Style

van der Schaft, A. (2023). Geometric Modeling for Control of Thermodynamic Systems. Entropy, 25(4), 577. https://doi.org/10.3390/e25040577

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop