7
HYBRID THERMODYNAMIC CONTROL SYSTEMS WITH PHASE TRANSITIONS Dmitry Gromov and Peter E. Caines Department of Electrical and Computer Engineering and Centre for Intelligent Machines, McGill University, Montreal, Canada, {gromov,peterc}@cim.mcgill.ca. Abstract: This paper describes a modelling framework for the description of thermodynamic systems with phase transitions. It is shown that these systems can be conveniently described within the framework of (regional) hybrid systems. A hybrid optimal control problem for a particular class of van der Waals type systems with the liquid-gas phase transition is analized in detail. Keywords: Thermodynamics, Hybrid Systems, Hybrid Optimal Control, Phase Transitions 1. INTRODUCTION During last decades, there has been constant interest in the application of (geometric) control theory methods to thermodynamics. Since the pioneering work of Hermann [Hermann, 1973] there has been extensive research in geometric foundations of thermodynamic systems (see, e.g., [Mruga la et al., 1991, Grmela and ¨ Ottinger, 1997, Eberard et al., 2007, Favache et al., 2009]). However, these studies do not address phase transitions which are of particular interest due to their wide applicability in a number of industrial applications. In this paper, we apply system-theoretic methods to the modelling of thermodynamic systems with phase transi- tions and hence continue the research program initiated in [Gromov and Caines, 2010]. It turns out that these systems can be conveniently described within the framework of hybrid systems [Shaikh and Caines, 2007]. This contribution is organized as follows: in Section 2, we present the basic facts from equilibrium thermodynamics, review contact geometry and its relation to equilibrium thermodynamics and define the evolutionary equation of a controlled system on the equilibrium manifold. In Section 3, the Legendre transformation as well as the notion of a phase transition are described. In Section 4 is devoted to the hybrid modelling of a thermodynamic system with a phase transition. Furthermore, in Section 4 a hybrid optimal control framework for this class of models is formulated. 2. THERMODYNAMIC ESSENTIALS 2.1 Properties of a Physical Thermodynamic System A(physical) thermodynamic system Σ is a physical sub- stance separated from its environment that interacts with that environment through energy and material exchange. We assume that a thermodynamic system Σ can always be (physically) decomposed in a number of connected subsys- tems Σ i such that their (physical) aggregation constitutes the overall system Σ. Henceforth, we consider a special class of thermodynamic systems satisfying the following physical assumptions: P1. The system consists of a single component substance. P2. The system (substance) does not undergo any chemi- cal transformations [McNaught and Wilkinson, 1997]. The theory developed in this paper is completely set within the framework of equilibrium thermodynamics. The main notion of equilibrium thermodynamics is the notion of an equilibrium state (which, however, should not be confused with a mechanical equilibrium) that we first introduce in an informal way. In an equilibrium state, a thermodynamic system can be completely described by a number of thermodynamic parameters which can be intensive or extensive. Definition 1. Let {Σ i } be an arbitrary decomposition of Σ. A parameter X characterizing the system Σ is said to be extensive if it is equal to the sum of parameters X i characterizing the respective subsystems Σ i . This is often referred to as the additivity property. A parameter Y characterizing Σ is said to be intensive if it takes on the same value for each subsystem Σ i . In an equilibrium state, the thermodynamic system Σ is described by the internal energy U , the entropy S, the volume V , and the mole number N . All these are extensive parameters. Furthermore, there are three intensive param- eters associated with S, V , and N , namely the temperature T , the pressure p, and the chemical potential μ. P1 and P2 lead us to the formal description of a thermo- dynamic system based on the internal energy function U = U (S,V,N ). (1) Definition 2. An equilibrium state of a thermodynamic system Σ is an element (i.e. a four-tuple) of the graph

Hybrid Thermodynamic Control Systems with Phase Transitions

Embed Size (px)

Citation preview

HYBRID THERMODYNAMICCONTROL SYSTEMS WITH PHASE

TRANSITIONS

Dmitry Gromov and Peter E. Caines

Department of Electrical and Computer Engineering and Centre forIntelligent Machines, McGill University, Montreal, Canada,

{gromov,peterc}@cim.mcgill.ca.

Abstract: This paper describes a modelling framework for the description of thermodynamicsystems with phase transitions. It is shown that these systems can be conveniently describedwithin the framework of (regional) hybrid systems. A hybrid optimal control problem for aparticular class of van der Waals type systems with the liquid-gas phase transition is analizedin detail.

Keywords: Thermodynamics, Hybrid Systems, Hybrid Optimal Control, Phase Transitions

1. INTRODUCTION

During last decades, there has been constant interest inthe application of (geometric) control theory methods tothermodynamics. Since the pioneering work of Hermann[Hermann, 1973] there has been extensive research ingeometric foundations of thermodynamic systems (see,

e.g., [Mruga la et al., 1991, Grmela and Ottinger, 1997,Eberard et al., 2007, Favache et al., 2009]). However,these studies do not address phase transitions which areof particular interest due to their wide applicability in anumber of industrial applications.

In this paper, we apply system-theoretic methods to themodelling of thermodynamic systems with phase transi-tions and hence continue the research program initiated in[Gromov and Caines, 2010]. It turns out that these systemscan be conveniently described within the framework ofhybrid systems [Shaikh and Caines, 2007].

This contribution is organized as follows: in Section 2, wepresent the basic facts from equilibrium thermodynamics,review contact geometry and its relation to equilibriumthermodynamics and define the evolutionary equationof a controlled system on the equilibrium manifold. InSection 3, the Legendre transformation as well as thenotion of a phase transition are described. In Section 4is devoted to the hybrid modelling of a thermodynamicsystem with a phase transition. Furthermore, in Section 4a hybrid optimal control framework for this class of modelsis formulated.

2. THERMODYNAMIC ESSENTIALS

2.1 Properties of a Physical Thermodynamic System

A (physical) thermodynamic system Σ is a physical sub-stance separated from its environment that interacts withthat environment through energy and material exchange.We assume that a thermodynamic system Σ can always be

(physically) decomposed in a number of connected subsys-tems Σi such that their (physical) aggregation constitutesthe overall system Σ.

Henceforth, we consider a special class of thermodynamicsystems satisfying the following physical assumptions:

P1. The system consists of a single component substance.P2. The system (substance) does not undergo any chemi-

cal transformations [McNaught and Wilkinson, 1997].

The theory developed in this paper is completely setwithin the framework of equilibrium thermodynamics. Themain notion of equilibrium thermodynamics is the notionof an equilibrium state (which, however, should not beconfused with a mechanical equilibrium) that we firstintroduce in an informal way. In an equilibrium state, athermodynamic system can be completely described bya number of thermodynamic parameters which can beintensive or extensive.

Definition 1. Let {Σi} be an arbitrary decomposition ofΣ. A parameter X characterizing the system Σ is said tobe extensive if it is equal to the sum of parameters Xi

characterizing the respective subsystems Σi. This is oftenreferred to as the additivity property.

A parameter Y characterizing Σ is said to be intensive ifit takes on the same value for each subsystem Σi.

In an equilibrium state, the thermodynamic system Σ isdescribed by the internal energy U , the entropy S, thevolume V , and the mole number N . All these are extensiveparameters. Furthermore, there are three intensive param-eters associated with S, V , andN , namely the temperatureT , the pressure p, and the chemical potential µ.

P1 and P2 lead us to the formal description of a thermo-dynamic system based on the internal energy function

U = U(S, V,N). (1)

Definition 2. An equilibrium state of a thermodynamicsystem Σ is an element (i.e. a four-tuple) of the graph

E = (S, V,N,U) of the admissible values of entropy,volume, molar number and energy of Σ such that thereis a functional relation between U and (S, V,N). U isreferred to as the energy function of Σ, and the locus ofall equilibrium states E = (S, V,N,U(S, V,N)) is referredto as the equilibrium energy manifold.

The function U(·) is assumed to be sufficiently smooth,such that all required partial derivatives exist. Moreover,the partial derivatives of the energy function with respectto the extensive parameters determine the associated in-tensive parameters: the temperature, T = ∂U

∂S ; the internal

pressure (note the minus sign), p = − ∂U∂V , and the chemical

potential, µ = ∂U∂N .

Finally, all the intensive and extensive variables are re-stricted to take on only positive values.

One consequence of the additivity property of extensivevariables is that the internal energy function (1) is ahomogeneous function of degree 1, i.e., for each α ≥ 0the following condition is satisfied:

αU(S, V,N) = U(αS, αV, αN).

This means that one can set α to be equal to 1/N . Thefunction U(S/N, V/N, 1) is denoted by u(s, v), where u,s, and v are referred to as the molar energy, the molarentropy and the molar volume. The molar energy is relatedto the internal energy function by U(S, V,N) = Nu(s, v).It worth noting that the intensive variables T and p canbe equally well defined for both the molar energy and theinternal energy:

T =∂

∂SU(S, V,N) =

∂su(s, v),

p = − ∂

∂VU(S, V,N) = − ∂

∂vu(s, v),

assuming the molar energy to be defined for the samemolar number N .

2.2 Quasi-static processes

We consider the special class of thermodynamic processesoccurring in thermodynamic systems which are calledquasi-static (QS) processes and defined as a sequence ofequilibrium states. This represents an idealization which,however, turns out to be close to the real processes if

P3. The rate of change of the thermodynamic parame-ters is sufficiently small that the system admits thedescription in terms of equilibrium thermodynamics.

As a result, a quasi-static process can be defined as a mapψ : T → E , where T = [t0, tf ) ⊂ R≥0. In the following wewill identify T with the positive semi-axis: T = R≥0.

Henceforth, we restrict our attention to the closed ther-modynamic systems (that is to say, no material exchange,i.e., N = const)

The behaviour of a closed thermodynamic system is gov-erned by the First and the Second Law of Thermodynamics[Callen, 1985, Kondepudi and Prigogine, 1998]. The FirstLaw states that the change of energy in a quasi-staticprocess can be written as

dU = W +Q, (2)

where W and Q are the differential forms describingthe work done on the system, and the amount of heattransferred to the system. In general, W and Q cannotbe written as exact differentials. In particular, for thecase of the work associated with a change in volume, itfollows from first principles that W = −pdV . The natureof the second term is addressed by the Second Law. Itsays that the inverse temperature 1

T can be used as anintegrating factor which turns Q into an exact differential,i.e., Q

T = dS. Therefore, (2) can be written in differentialform as

dU = TdS − pdV, (3)

which conforms with Def. 2.

Furthermore, the set of all meaningful thermodynamictrajectories Γ is characterized by the following physicalassumption:

P4. In a thermodynamic system, any trajectory γ12 ∈Γ satisfies the following inequality (known as theClausius inequality):∫

γ12

Q

T≤∫γ12

dS, (4)

which implies∫γ12

dS ≥ 0 for each adiabatic trajectory,

that is to say for each trajectory not accompanied byheat transfer between the system and its environment(i.e., Q = 0).

By definition, a reversible trajectory γ12 ∈ Γ ⊂ Γ is theone for which

∫γ34

dS = 0 for any γ34 ⊂ γ12. Thus, for any

reversible trajectory γ12:∫γ34

QT = 0 for any γ34 ⊂ γ12.

One consequence of the Clausius inequality is that thetotal entropy of an adiabatic system strictly increases inan irreversible process and remains constant in a reversibleone (see [Kondepudi and Prigogine, 1998] for a detaileddiscussion).

2.3 Geometry of an Equilibrium Manifold

Let M be a smooth (2n + 1)-dimensional manifoldequipped by a special 1-form ω ∈ T ∗M which satisfythe condition ω ∧ (dω)n 6= 0. Such 1-forms are calledmaximally non-integrable, or contact forms [Geiges, 2008].Correspondingly, the pair (M, ω) is called the contactmanifold. An integral manifold of the contact form ω hasthe least possible dimension which is equal to n for a(2n+1)-dimensional manifoldM. These submanifolds arecalled Legendre (sub)manifolds.

In the following we will consider a specific contact form:

Definition 3. Let (x0, x1, . . . , xn, p1, . . . , pn) be the localcoordinates on M. The fundamental thermodynamic con-tact 1-form is defined as

ω = dx0 − pidxi, 1 ≤ i ≤ n. (5)

One can check that this 1-form indeed satisfies themaximal non-integrability condition. Note that here andthroughout the paper we adopt the Einstein summationconvention: the terms are summed over all indices whichappear both in a lower and an upper position.

The following lemma provides a way to characterize Leg-endre manifolds.

Lemma 4. ([Arnold, 1989, Kushner et al., 2007]). LetN ={1, . . . , n} be the set of indices. Given the contact form (5),a disjoint partitioning I, J ⊂ N , I∩J = ∅, I∪J = N withnI and nJ components, and a smooth function ζ(xI , pJ),the following equations define a Legendre manifold on(M, ω):

pI =∂ζ

∂xI, xJ = − ∂ζ

∂pJ, x0 = ζ − pJ

∂ζ

∂pJ. (6)

Conversely, every Legendre manifold is defined in a neigh-bourhood of every point by these formulae for at least onechoice of the subset I.

The function ζ is called a generating function of theLegendre manifold L.

It turns out (see [Gromov and Caines, 2011a]) that theequilibrium manifold E in an (n + 1)-dimensional spacecan be described as a Legendre manifold on a (2n + 1)-dimensional contact manifold. We denote this manifold byLU and call it the Legendre equilibrium energy manifold.

The equilibrium manifold Leq can be represented asφ(x) = 0, where φ : R2n+1 → Rn+1 is a smooth vector-valued function with the following components:

φ0 = x0 − U(x), φi = pi −∂U

∂xi(x).

2.4 Equations of Motion on the Equilibrium Manifold

The following theorem characterizes the generic vectorfield on the equilibrium energy manifold LU .

Theorem 5. ([Gromov and Caines, 2011a]). Let LU be theLegendre equilibrium energy manifold given by (6) withthe generating function U = U(x1, . . . , xn). Then thegeneric smooth vector field X describing the evolution ofthe system on the manifold LU is

X = piΛ[i] ∂

∂x0+ Λ[i] ∂

∂xi+ Λ[i] ∂2U

∂xi∂xj∂

∂pj, (7)

where Λ[i] are smooth functions, which are referred to asthermodynamic forces.

For X, (7), the corresponding differential equations havethe following form:

x0 = piΛ[i]

xi = Λ[i]

pi =∂2U

∂xi∂xjΛ[j].

It was shown in [Gromov and Caines, 2011b,c] that themeaningful thermodynamic forces Λ[i] must have a specialstructure which is defined below.

Definition 6. A continuous function f : R → R is said tobe of class S if

i. x · f(x) ≥ 0, x ∈ R,

ii. {f(x) = 0} ⇒ {x = 0}.Definition 7. A thermodynamic force Λ[i] is a class Sfunction of (pi−pi), where pi is the value of the respective

intensive thermodynamic parameter of the external systemwith which the considered system is in contact.

In practice, this implies that the change in the extensiveparameter xi is driven by the gradient in the respectiveintensive variable, which conforms with the physical prin-ciples.

In our case the external system is the environment andhence the respective intensive parameters correspond thethose of the environment. Their variation represents thecontrol action and the parameters themselves are consid-ered as thermodynamic controls.

3. PHASE TRANSITIONS

3.1 Legendre Transformation

In the previous section, the generating function ζ wasidentified with the total energy function U and thusdepended on the extensive variables x. However, in certaincases it is more advantageous to have a generating functionthat (partially) depends on intensive parameters pi. Thiscan be done by transforming ζ(x) in a particular way. Letthe contact structure on M be defined by the 1-form (5)and let I and J define a partition of the set of indices Nas described above. The transformation

ζ(pI , xJ) = −min

xI

[ζ(xI , xJ)− pIxI

](8)

defines a new generating function ζ(pI , xJ). We will call

this the Legendre transformation of ζ(pI , xJ) with respect

to xI and denote by ζ(pI , xJ) = T(xI)ζ(xI , xJ).

Below, we briefly outline a number of results on theLegendre transform paying particular attention to thetransformation of non-convex functions. More details canbe found in [Rockafellar, 1997, Gromov and Caines, 2011a].

Definition 8. The function f(xI , xJ), where (I, J) is apartitioning of the set of indices, is said to be locally convexat (xI , xJ) w.r.t. xI if the matrix of partial derivatives

DxIf(xI , xJ) =∂2f

∂xI∂xI(xI , xJ)

is positive definite. Furthermore, f(xI , xJ) is said to beglobally convex w.r.t. xI if for each xJ the restrictionf(xI , xJ)

∣∣xJ has a supporting hyperplane at each point

xI .

Definition 9. Let f(xI , xJ) be bounded from below andnon-convex w.r.t. xI . The convex hull of f(xI , xJ) w.r.t.xI , denoted by conv(xI)(f(xI , xJ)), is defined as the func-

tion f c(xI , xJ) such that for each xJ , epif c(xI , xJ) =conv

(epif c(xI , xJ)

), where epif(xI , xJ) is the epigraph of

f(xI , xJ), and the set conv(epif c(xI , xJ)

)is the intersec-

tion of all convex sets containing epif c(xI , xJ).

The next two results are devoted to the Legendre transfor-mation of non-convex functions, an important topic whichplays an important role in the study of phase transitions.All functions are continuous, f ∈ C(M); I and J denotethe partitioning of the set of variables. Note that either Ior J can be empty.

Proposition 10. Let f(xI , xJ) be non-convex w.r.t. xI .The Legendre transformation of f(xI , xJ) w.r.t. xI , i.e.,

Fig. 2. The energy surface of a van der Waals gas witha = 0.544, b = 30.5e− 6, c = 3.1, and N = 1.

f(pI , xJ), is non-differentiable w.r.t. pI at points (pI , x

J)if pI is the slope of a hyperplane which touches the graphof f(xI , xJ)

∣∣xJ=xJ at more than one point.

We note that a hyperplane with the slope pI is defined as〈xI , pI〉 = c, where 〈·, ·〉 is the scalar product and c ∈ R.

Proposition 11. Let f(xI , xJ) be non-convex w.r.t. xI .The Legendre transform w.r.t. xI applied twice to f(xI , xJ)results in the convex hull of f(xI , xJ) w.r.t. xI , i.e. T(pI) ◦T(xI)(f(xI , xJ)) = conv(xI)(f(xI , xJ)).

We illustrate the above mentioned statements with help ofthe following example.

Example 12. Consider the function f(x) = 0.5x2(1 +

2e−(x−2)2) shown in Fig. 1(a). This function is not convex,therefore its Legendre transformation f(p) has a non-differentiable point at p∗ ≈ 2.5, which corresponds to theslope of the supporting line touching the graph of f(x) attwo points (Fig. 1(b)). Furthermore, the abscissae of thosepoints correspond to the slopes of the tangent lines to f(p)at p→ (p∗ − 0) and p→ (p∗+).

When applied to the function f(x) twice, the Legendretransformation produces the convex hull of f(x), i.e.,conv(f(x)), as shown in Fig. 1(c).

Application of the transformation (8) to the state equa-tion (1) results in a number of functions which are re-ferred to as the thermodynamic potentials. The most com-mon are the enthalpy H(S, p,N), defined as the neg-ative Legendre transformation of U(S, V,N) w.r.t. V ,i.e., H(S, p,N) = −TV U(S, V,N) and the Gibbs poten-tial G(T, p,N), defined as the negative Legendre trans-formation of U(S, V,N) w.r.t. (S, V ), i.e., G(T, p,N) =−T(S,V )U(S, V,N).

It was shown in [Gromov and Caines, 2011a] that in theregion of the state space where the internal energy functionU is globally convex all thermodynamic potentials gener-ate the same Legendre manifold Leq. However, for mostphysical substances, there are regions of the phase spacewhere the convexity condition is violated. For instance, thevan der Waals model of a fluid gives a qualitative descrip-tion of such a substance (see Fig. 2). In this case, a phasetransition occurs, as described in the next subsection.

3.2 Phase Transitions

The discontinuous transformation of a thermodynamicsystem at which the extensive parameters undergo abruptchanges is referred to as the first order phase transition.First order phase transitions are manifested in in the

Fig. 3. A schematic view of a pT phase diagram. S, L, andV denote solid, liquid, and gas states. t.p. is the triplepoint.

everyday world in the transitions between the three statesof matter: solid, liquid and gas, e.g., vaporisation of wateror condensation of steam.

Consider a thermodynamic system Σ with the internalenergy function U = U(S, V,N) at the point (S∗, V ∗, N∗).Assuming N∗ to be fixed and using the homogeneityproperty of the energy function (see Sec. 2.1) we may goover to the molar energy u(s, v), where s = S/N∗, andv = V/N∗. Hence we will consider the point (s∗, v∗) =(S∗/N∗, V ∗/N∗). The advantage of this formulation isthat it gives a scale invariant characterization.

Phase transitions are closely related to the Legendretransformation, as the following proposition shows.

Proposition 13. A phase transition occurs at the pointswhere the molar Gibbs energy g(T, p) = Ls,vu(s, v) hasdiscontinuous first derivatives.

These can be conveniently represented by a pT (pressure-temperature) phase diagram (see Fig. 3). It shows theregions of phase space corresponding to the single phasesand the so called coexistence curves representing the statesin which two phases are in equilibrium. We refer to [Callen,1985] for a detailed account.

4. THERMODYNAMIC HYBRID OPTIMALCONTROL

In this section, we present a hybrid model of a controlledthermodynamic system undergoing a phase transition. Tofacilitate analysis, we restrict our scope to a system with aliquid-gas phase transition. This kind of phase transitionsplays a central role in most energy transfer related appli-cations such as power generation plants, heating/coolingsystems and so on.

4.1 Problem Statement and Assumptions

We consider a cylinder filled with a fluid and closed bya piston (see Fig. 4). The external pressure pe as well asthe external temperature Te characterize the environmentin contact with the piston. The heat is transfer throughan embedded heat exchanger. We assume that there isno heat transfer through the cylinder walls and throughthe piston. Moreover, we assume that the system is closed,i.e., there is no transfer of matter. Therefore, all respectiveenergy functions are considered to be the functions of S

a) b) c)

Fig. 1. An illustration of the Legendre transformation of a non-convex function

Fig. 4. A schematic view of the experimental setup.

and V only. To simplify the notation, we assume the molarnumber N to be equal to 1.

The area of the cylinder cross-section is equal to A andthe area of the working surface of the heat exchanger isequal to Ah.

4.2 Hybrid Optimal Control Problem

Below, the definition of a hybrid system is given. For moredetails, the interested reader is referred to [Riedinger et al.,2003, Shaikh and Caines, 2007].

Definition 14. The hybrid system HS is defined as a tuple

HS = (Q,X,U, f, γ,Φ, q0, x0),

where

• Q = {1, . . . , N} is the set of discrete states, X ⊂ Rlis the continuous state space, Uq ⊂ Rm, q ∈ Q arethe admissible control sets, which are compact andconvex, and

Uq := {u(·) ∈ Lm∞(0, tf ) : u(t) ∈ Uq, a.e. on[0, tf ]}represent the sets of admissible control signals.• q0 ∈ Q and x0 ∈ X are the initial conditions.• fq : X × U → X is the function that associates to

each discrete state q ∈ Q a differential equation ofthe form

x(t) = fq(x(t), u(t)). (9)

• γq,q′ : X → R is the function that triggers thechange of discrete state. Let q ∈ Q be the currentdiscrete state and x(t) be the state trajectory evolvingaccording to the corresponding differential equation(9). The transition to the discrete state q′ ∈ Q occursat the moment χ when γq,q′(x(χ)) = 0. The setΓq,q′ = {x ∈ X|γq,q′(x) = 0} is referred to as theswitching manifold.• When the discrete state changes from q to q′, the

continuous state might change discontinuously. Thischange is described by the jump function Φq,q′ : X →

X. Let χ be the time at which the discrete statechanges from q to q′, then the continuous state att = χ is described as x(χ) = Φq,q′(x(χ−)), wherex(χ−) = lim

t→χ−0x(t).

Definition 15. A hybrid trajectory of HS is a triple X =(x, {qi}, τ), where x(·) : [0, T ]→ Rn, {qi}i=1,...,r is a finitesequence of locations and τ is the corresponding sequenceof switching times 0 = t0 < . . . < tr = T .

Using the introduced notation we can state a hybrid opti-mal control problem and characterize an optimal solutionto this problem. Let the overall performance of HS beevaluated by the following functional criterion:

J(x0, q0, u) =

r∑i=1

ti∫ti−1

Lqi(xi(t), ui(t), t)dt, (10)

where Lqi : X × U × R≥0, qi ∈ Q, are twice continuouslydifferentiable functions. Assume that the sequence of dis-crete states q∗ is given. Then the necessary conditions fora solution (x∗, q∗, τ, u∗) to HS to minimize (10) is givenby the theorem presented below.

This result, obtained by Riedinger et al. [2003], containsan extension of the Hybrid Minimum Principle [Sussman,1999, Shaikh and Caines, 2003, 2007] to the case ofcontinuous valued state jumps at autonomous switchingsof the discrete state (see [Taringoo and Caines, 2011] forfurther extensions). In the present context this gives thefollowing result.

Theorem 16. ([Riedinger et al., 2003]). If (x∗(t), q∗(t), τ)and u∗(t) are the hybrid trajectory and the correspond-ing hybrid optimal control for HS, then there exists apiecewise absolutely continuous curve p∗(t) and a constantp∗0 ≥ 0, (p∗, p∗0)(·) 6= (0, 0) such that

• The tuple (x∗(t), q∗(t), p∗(t), u∗(t), τ) satisfies the as-sociated Hamiltonian system

x(t) =∂Hqi

∂p(x(t), p(t), u(t)),

p(t) = −∂Hqi

∂x(x(t), p(t), u(t)),

t ∈ [ti−1, ti), i = 1, . . . , r

(11)

where

Hqi(x∗(t), p∗(t), u∗(t)) =

= p∗0Lqi(xi(t), ui(t), t) + p∗(t)fqi(xi(t), ui(t)).

• At any time t ∈ [ti−1, ti), the following maximizationcondition holds:

Hqi(x∗(t), p∗(t), u∗(t)) =

= supu(t)∈U

Hqi(x∗(t), p∗(t), u(t)). (12)

• At the switching time ti, there exists a vector π ∈ Rnsuch that the following transversality conditions aresatisfied:

p∗j (t−i ) =

n∑k=1

pk(ti)∂Φkqi,qi+1

∂xj(t−i ) +

n∑k=1

πik∂γki,i+1

∂xj(t−i ),

Hqi−1(t−i ) = Hqi(ti)−

n∑k=1

pk(ti)∂Φki,i+1

∂t(t−i )−

−n∑k=1

πik∂γki,i+1

∂t(t−i )

(13)

4.3 Hybrid Model of a van der Waals Type System withthe Liquid-Gas Phase Transition

All results in this section are illustrated by a particularthermodynamic system which has the energy functions ofthe following form:

U = − aV

+ (V − b)−1c exp

(S

cR

), (14)

where R = 8.314 is the gas constant, a, b, and c are dimen-sionless constants. The energy function (14) correspondsto the state equation of the van der Waals fluid.

In the hybrid model of a thermodynamic system eachphase correspond to a discrete state. In the followingwe will restrict ourselves to the case of liquid-gas phasetransition. Therefore, this model will have two discretestates denoted by ql and qg for the liquid and gas phases,respectively.

This setup can be easily extended by including new dis-crete states corresponding to further possible states of thethermodynamic system. However, the number of possiblediscrete states is bounded. In a simple system, for instance,there can be maximally 3 phases and thus maximally 3discrete states.

The vector field corresponding to each discrete state iswritten as a set of first-order differential equations:

U = TΛS + pΛV

S = ΛS

T =exp

(ScR

)c2R2(V − b) 1

c

ΛS −exp

(ScR

)c2R(V − b) 1+c

c

ΛV

V = ΛV

p =exp

(ScR

)c2R(V − b) 1+c

c

ΛS +

[(c+ 1) exp

(ScR

)c2(V − b) 2c+1

c

− 2a

V 3

]ΛV

(15)

The differential equations (15) do not change with thechange of discrete state. However, the system’s dynamicschanges as the continuous state undergoes an abruptchange (defined below) which shifts the operating point.

The thermodynamic forces ΛS and ΛV are defined as

ΛS =AhγtT

(Te − T ), ΛV = −Aγp(pe − p),

where γt is the heat permeability coefficient, and γp is thecoefficient corresponding to the piston inertia. Hence, theexternal temperature and pressure Te(t) and pe(t) are thecontrols. We denote this by u(t) = (Te(t), pe(t)) and theset of admissible controls by U ⊂ L2

2(R).

The phase transition begins when the pT-trajectorycrosses the coexistence curve. There are many analyticaldescription for this curve. In particular, an analyticalexpression for a liquid-vapour coexistence curve can beobtained from the Clayperon equation [Callen, 1985]:

dp

dT=

hv(T, p)

T (vg − v`),

where hv(T, p) is the molar enthalpy of vaporisation, andvg and v` are the molar volumes of the gas and liquidphases. Assuming that vg >> v` and approximating themolar volume of the gas by the ideal gas equation pvg =RT , we obtain the Clayperon-Clausius approximation:

pcc(T, p) = p− p0 exp

(hv(T, p)

RT0− hv(T, p)

RT

)= 0, (16)

where the triple point can be taken as the reference point,i.e., (p0, T0) = (611.73[Pa], 273.16[K]).

Let τ denote the time instant at which the system trajec-tory crosses the coexistence curve. This crossing is accom-panied by a continuous state jump defined asU

S

T

V

p

(τ) = Φ(x(τ−)) =

U(τ−) + hv(T (τ−), p(τ−))

S(τ−) +hv(T (τ−), p(τ−))

T (τ−)T (τ−)

V (τ−) + v∆(T (τ−), p(τ−))

p(τ−)

(17)

where v∆(T, p) is the difference between the molar volumesof the gas and the liquid at given temperature and pressure(T, p).

4.4 Optimization Problem

Normally there are fixed ranges of temperature and pres-sure of the steam which allow for a proper operation of thesteam driven electrical generator. Therefore, one possibleoptimization problem could be formulated in the followingway. Let the system’s state at time t0 be ξ(t0) = ξ0. Onehas to determine functions Te(t) and pe(t) which solve thefollowing optimization problem:

J(u) = infu∈U

tf∫t0

dS = infu∈U

tf∫t0

AhγtT

(Te − T )dt

s.t. T (tf ) ∈ [T ∗min, T∗max], p(tf ) ∈ [p∗min, p

∗max],

tf ≤ T, q(tf ) = ql,

(18)

Note that for a liquid-gas phase transition, Tmin > T0

as well as pmin > p0. Furthermore, the system dynamicshas to satisfy the equations (15)-(17) as described in Sec.4.3. In this way one computes the profiles of the externaltemperature and pressure which drive the system to thethe prescribed region of the state space in time tf < Twhile minimizing the entropy growth within the system.

The optimization of J(u) is equivalent to the followingproblem:

J(u) = infu∈U

tf∫t0

TeTdt−∆t, (19)

where ∆t = tf − t0.

According to Theorem 16 the optimal solution is foundas a solution to the system of differential equations (11)along with additional constraints on the state and adjointvariables at the end points and at the switching pointτ . We consider the conditions imposed at the switchingpoint τ . The state variables change according to thejump condition (17), while the conditions on the adjointvariables are determined from (13):

pU (τ−i ) = pU (ti),

pS(τ−i ) = pS(ti),

pT (τ−i ) = pU (ti)∂hv(τ

−)

∂T+ pS(ti)

∂T

(hv(τ

−)

T (τ−)

)+

+pV (ti)∂v∆(τ−)

∂T+ π1

∂pcc(τ−)

∂T,

pV (τ−i ) = pV (ti),

pp(τ−i ) = pU (ti)

∂hv(τ−)

∂p+ pS(ti)

∂p

(hv(τ

−)

T (τ−)

)+

+pV (ti)∂v∆(τ−)

∂p+ π2

∂pcc(τ−)

∂p,

(20)

where π1 and π2 are two constants to be determined fromthe solution of the two-point boundary value problem.

Since both the switching curve and the jump function donot depend on t, the Hamiltonian does not undergo a jumpat the switching time τ , i.e., Hql(τ

−) = Hqv (τ).

With this, we have set up a framework for the solutionof a particular hybrid optimal control problem for a ther-modynamic system with phase transitions. The solutionof this problem requires an analytical description of themolar enthalpy of vaporisation as well as of the volumetricexpansion associated with a phase transition. In mostcases, these data are presented as tables, therefore anapproximation would be required.

5. CONCLUSION

The modelling of thermodynamic systems with phase tran-sitions has been analyzed. It was shown that these systemscan be conveniently described within the framework of(regional) hybrid systems [Caines et al., 2007].

REFERENCES

V. I. Arnold. Mathematical Methods of Classical Mechan-ics. Springer, 2nd edition, 1989.

P. E. Caines, M. Egerstedt, R. Malhame, and A. Schoellig.A hybrid bellman equation for bimodal systems. InA. Bemporad, A. Bicchi, and G. Butazzo, editors, HSCC2007, LNCS 4416, pages 656–659. Springer, 2007.

H. B. Callen. Thermodynamics and an Introduction toThermostatistics. Wiley, 2nd edition, 1985.

D. Eberard, B. M. Maschke, and A. J. van der Schaft. Anextension of hamiltonian systems to the thermodynamic

phase space: towards a geometry of nonreversible pro-cesses. Reports on Mathematical Physics, 60(2):175–198,2007.

A. Favache, V. S. dos Santos Martins, D. Dochain, andB. M. Maschke. Some properties of conservative portcontact systems. IEEE Transactions on AutomaticControl, 54(10):2341–2350, 2009.

H. Geiges. An Introduction to Contact Topology. Cam-bridge University Press, 2008.

M. Grmela and H. C. Ottinger. Dynamics and thermody-namics of complex fluids. I. Development of a generalformalism. Physical Review E, 56(6):6620–6632, 1997.

D. Gromov and P. E. Caines. Initial investigations of hy-brid thermodynamic control systems with phase transi-tions. In Proc. 10th International Workshop on DiscreteEvent Systems, pages 63–68, 2010.

D. Gromov and P. E. Caines. Interconnection of thermody-namic control systems. In Proc. IFAC World Congress2011, pages 6091–6097, 2011a. Paper TuC14.5.

D. Gromov and P. E. Caines. Stability of interconnectedthermodynamic systems. In Proc. 50th IEEE CDC-ECC, pages 6730–6735, 2011b.

D. Gromov and P. E. Caines. Composite thermodynamicsystems with interconnection constraints. submitted toSystems & Control Letters, 2011c.

R. Hermann. Geometry, Physics and Systems. M. Dekker,1973.

D. Kondepudi and I. Prigogine. Modern Thermodynamics:From Heat Engines to Dissipative Structures. Wiley,1998.

A. Kushner, V. Lychagin, and V. Rubtsov. Contact Geom-etry and Nonlinear Differential Equations. CambridgeUniversity Press, 2007.

A. D. McNaught and A. Wilkinson, editors. IU-PAC. Compendium of Chemical Terminology. Black-well Scientific Publications, 2nd edition, 1997. doi:10.1351/goldbook.C01033. XML on-line corrected ver-sion: http://goldbook.iupac.org.

R. Mruga la, J. D. Nulton, J. C. Schon, and P. Salamon.Contact structure in thermodynamic theory. Reports onMathematical Physics, 29(1):109–121, 1991.

P. Riedinger, C. Iung, and F. Kratz. An optimal controlapproach for hybrid systems. European Journal ofControl, 9(5):449–458, 2003.

R. T. Rockafellar. Convex Analysis. Princeton UniversityPress, 1997.

M. S. Shaikh and P. E. Caines. On the optimal con-trol of hybrid systems: Optimization of trajectories,switching times and location schedules. In O. Malerand A. Pnueli, editors, Hybrid Systems: Computationand Control. Proceedings of the 6th International HSCCWorkshop, LNCS 2623, pages 466 – 481. Springer, 2003.

M. S. Shaikh and P. E. Caines. On the hybrid optimalcontrol problem: Theory and algorithms. IEEE Trans-actions on Automatic Control, 52(9):1587–1603, 2007.Corrigendum: IEEE TAC, Vol. 54 (6), 2009, p. 1428.

H. Sussman. A maximum principle for hybrid optimalcontrol problems. In Proc. 38th IEEE Conference onDecision and Control, pages 425 – 430, 1999.

F. Taringoo and P. E. Caines. On the optimal control ofimpulsive hybrid systems on riemannian manifolds. sub-mitted to SIAM Journal of Control and Optimization,2011.