Judy Najnudel

Thomas Hélie

David Roze

Rémy Müller

From Equilibrium Statistical Physics Under Experimental Constraints to Macroscopic Port-Hamiltonian Systems

Keywords: equilibrium statistical physics, macroscopic port-Hamiltonian Systems, statistical entropy, experimental conditions

This paper proposes to build a bridge between microscopic descriptions of matter with internal energy, composed of many fast interacting particles inside an environment, and their port-Hamiltonian (PH) descriptions at macroscopic scale. The environment, assumed to be slow, is modeled through experimental constraints on macroscopic quantities (e.g. energy, particle number, etc), with a partitioning into two classes: non fluctuating and fluctuating values. The method to derive the PH macroscopic laws is detailed in several steps and illustrated on two standard cases (ideal gas, Ising ferromagnets). It revisits equilibrium statistical physics with a focus on this partitioning. First, the Boltzmann's principle is used to provide the statistic law of the matter. It defines a macroscopic equilibrium characterized by a scalar value, the entropy, together with thermodynamic quantities emerging from each constraint. Then, the port-Hamiltonian system is derived. The Hamiltonian (macroscopic energy) is derived as a function of the macroscopic state (entropy and the macroscopic quantities associated with the fluctuating class). The ports (flows/efforts) are related to the time-derivative of the state and the Hamiltonian gradient in a conservative way. This open system defines the reversible laws that govern standard thermodynamic quantities. Lastly, this paper presents a strategy to extend this PH system to an irreversible conservative one, given a macroscopic dissipative law.

Introduction

A macroscopic system (of size 10 -2 m or bigger) is constituted of matter, that is, billions of microscopic particles (of size 10 -9 m or smaller) which are collectively responsible for the system's behavior. However, studying a single particle tells nothing about the macroscopic system, just as following the trajectory of a single person is not sufficient to predict a crowd movement. Yet, solving exhaustive equations with billions of variables would be all at once much too complex and irrelevant: at a high enough scale, individual behaviors do not matter. Indeed, one is usually not interested in the particular trajectories of water molecules in one's glass, but rather in the volume, on average, that they take. Likewise, one is not only interested in the day's weather report, but rather in the global tendency .

Averages and tendencies belong to the domain of statistics, which aims to describe complex systems with a reduced number of variables. Thus, Statistical Physics (SP) computes averages on (fast) fluctuations of complex systems in order to derive (slower) macroscopic quantities, given some experimental conditions. Statistical arguments for the description of a system transitioning towards thermodynamic equilibrium were introduced by Ludwig Boltzmann in 1877 [START_REF] Boltzmann | Über die Beziehung zwischen dem zweiten Hauptsatze des mechanischen Wärmetheorie und der Wahrscheinlichkeitsrechnung, respective den Sätzen über das Wärmegleichgewicht[END_REF]. This framework allows the prediction of macroscopic thermodynamic phenomena such as temperature, entropy creation, and phase transitions [START_REF] Landsberg | Thermodynamics and statistical mechanics[END_REF].

Thermodynamics has been broadly studied in the context of port-Hamiltonian system (PHS), as well as their modeling and their control (see e.g. [START_REF] Eberard | Port-Hamiltonian systems extended to irreversible systems: The example of the heat conduction[END_REF][START_REF] Eberard | An extension of Hamiltonian systems to the thermodynamic phase space: Towards a geometry of nonreversible processes[END_REF][START_REF] Ramirez | Irreversible port-Hamiltonian systems: A general formulation of irreversible processes with application to the CSTR[END_REF][START_REF] Delvenne | Finite-time thermodynamics of port-Hamiltonian systems[END_REF][START_REF] Ramirez | On the passivity based control of irreversible processes: A port-Hamiltonian approach[END_REF][START_REF] Van Der | Classical thermodynamics revisited: A systems and control perspective[END_REF][START_REF] Van Der Schaft | Liouville geometry of classical thermodynamics[END_REF]). However, the proper derivation of macroscopic thermodynamic PHS from complex systems with numerous degrees of freedom is seldom addressed. As it happens, the choice of a system representation for this kind of model reduction is all but inconsequential, and must be handled with care [START_REF] Gorban | Model reduction and coarse-graining approaches for multiscale phenomena[END_REF][START_REF] Öttinger | Systematic coarse graining:"Four Lessons and A Caveat" from nonequilibrium statistical mechanics[END_REF]. In this paper, we propose a series of systematical steps in order to construct a simplified yet physically-based structured macroscopic PHS from a system that can be described by SP.

Note that in the scope of this work, we limit ourselves to equilibrium SP, in the sense that average quantities are determined for a system at thermodynamic equilibrium, given some experimental conditions. It is compatible with studying the system dynamics, assuming that thermodynamic relaxation (the process of reaching thermodynamic equilibrium) is infinitely faster than the rate of change of experimental conditions. Based on this assumption, a macroscopic trajectory is to be understood as a succession of thermodynamic equilibrium states.

This paper is structured as follows. In Section 2, we formalize the description of the microscopic configurations of a system through the choice of (i) an ad hoc particle representation and (ii) a set of characterization functions that evaluate macroscopic quantities . Section 3 addresses the experimental conditions at the macroscopic level and their influence on the system configuration space. In section 4, we introduce a stochastic description for microscopic configurations . Then, in Section 5, we determine the conditional probability distribution according to the Boltzmann principle for a system at thermodynamic equilibrium. This allows the derivation of relevant macroscopic variables as expectations for this probability distribution. In Section 6, we introduce the ports and relates them to those macroscopic variables, leading to the macroscopic PHS model. Finally, section 7 summarizes the practical sequence of these steps to derive the macroscopic PHS model from the microscopic description. In addition, it presents how to derive a conservative irreversible PHS model from an additional macroscopic dissipation law. All the steps are detailed in the following sections, as recapped in Fig. 1.

Microstate of a system

Particle representation (p ∈ P)

In order to describe a system at a microscopic level, each of its particles must be described in a relevant way. Depending on the system under study, one may choose to represent a particle by its position, momentum, charge, magnetic moment, etc. Definition 1 (Particle set P). Given a chosen representation to encode a particle state, we denote P the set of all its possible values.

F j ↔ ẋ ↔ u, λj ↔ ∇E(x) ↔ y
Example 1 (Particle represented by its position and momentum). For a particle chosen to be represented by its position in space r ∈ R 3 and momentum p ∈ R 3 , such as in a gas, the particle set is defined as

P = R 3 × R 3 .
Example 2 (Particle represented by its magnetic moment). For a particle chosen to be represented by its magnetic moment s ∈ {-1, 1} such as in the Ising model [START_REF] Ising | Beitrag zur theorie des ferromagnetismus[END_REF][START_REF] Strecka | A brief account of the Ising and Ising-like models: Mean-field, effective-field and exact results[END_REF], the particle set is defined as P = {-1, 1}.

Configuration space (m ∈ M)

As an element of P represents the state of one particle, a natural way to represent a configuration of particles is to concatenate elements of P. By analogy with formal language theory [START_REF] Hopcroft | Introduction to automata theory, languages, and computation[END_REF], a particular configuration of particles is chosen to be encoded as a word over the alphabet P (see remark 1 for other choices) .

Definition 2 (Encoding space W). We denote W := P ⋆ the space of encodable configurations (or, for short, the encoding space) , where ⋆ is the Kleene operator defined by

P = {ǫ}, P i+1 = p 1 • p 2 | (p 1 , p 2 ) ∈ P i × P ∀i ≥ 0, (1a)
P ⋆ = i≥0 P i , (1b)
with ǫ the empty configuration and • the concatenation operation.

Property 1 (W is a monoid). By construction, the encoding space W is a monoid (see Def. (3)) with associative binary operation • (concatenation) and identity element ǫ (empty configuration).

• 1 • 2 • 1 • 2 • 1 • 2 • 1 • 2 (a)
Examples of microstates for a system of two particles described by their spin s ∈ {-1 (blue) , 1 (red)}.

(b) Examples of microstates for a system with three particles described by their position (circle) and momentum (arrow). Definition 3 (Monoid). A set S is a monoid if it is equipped with an associative binary operation • : S × S → S and identity element ǫ, such that for all (s 1 , s 2 , s 3 ) ∈ S 3 , the following properties hold

1. s 1 • (s 2 • s 3 ) = (s 1 • s 2 ) • s 3 , 2. ǫ • s 1 = s 1 • ǫ = s 1 .
Based on the chosen representation, some configurations may not be physically admissible1 , therefore we introduce the set of microstates as follows.

Definition 4 (Admissible configuration set M and microstate m ∈ M). We denote M ⊆ W the set of encodable configurations that are also physically admissible . An element m ∈ M is called a microstate of the system.

In the following, we choose M = W (see remark 1(i) for an interpretation and (ii-iii) for examples with M = W) . Figure 2a shows examples of microstates for a system of particles described by their spin, and Fig. 2b shows a system of particles described by their position and momentum.

Property 2 (M is measurable). The pair M, P(M) where P(M) denotes the powerset of M is a measurable space, that is, it verifies 1. M ∈ P(M), 2. P(M) is closed under complements: M\P ∈ P(M), ∀P ∈ P(M), 3. P(M) is closed under countable unions:

∞ i=1 P i ∈ P(M) ∀P 1 , P 2 , . . . ∈ P(M).
As mentioned above, the set M could be defined on encoding spaces generated with operators other than the concatenation. Examples are outlined in the following remark 1.

Remark 1 (Examples of combinatorial structures and interpretations). The monoid W provides a simple and natural way to encode microscopic configurations, which consists in choosing a prioritized and distinguishable representation of particles (see specification (i) below). But the configuration encoding can be addressed by using any appropriate combinatorics of particles, possibly choosing other specifications (see e.g. [15, § I.2] for details on operators Seq, Mset, Pset, etc., mentioned below):

(i) Distinguishability with prioritization. A word

p i • p i-1 • • • • • p 1 ∈ P i ⊂ W can be
interpreted as describing the state values p n ∈ P of particles number n = 1, . . . , i.

In this sense, definition 2 encodes a physics with distinguishable particles and with a priority ordering on involved particles (particle 1 can be encoded alone, particle 2 only if 1 is involved, etc). From the combinatorics point of view, the encoding space W = P ⋆ corresponds to the sequence construction, also denoted Seq(P) in [START_REF] Flajolet | Analytic combinatorics[END_REF].

(ii) Undistinguishability. A natural encoding of a physics described with undistinguishable particles is the multiset W (ii) =Mset(P) composed of all the finite sets of P (the order between elements does not count), in which arbitrary finite repetitions of elements are allowed. Examples of admissible configuration sets M (ii) are W (ii) , or the powerset Pset(P) ⊂Mset(P) (no repetition allowed) if the physics under consideration forbids two particles of a microstate to be excited by the same state value.

(iii) Distinguishability without priorization. A means other than (i) to encode configurations with distinguishable particles is to add a distinct label to each particle such as its number n ∈ L ⊆ N. In this case, the encoding space can be the powerset W (iii) =Pset(P labeled ), where the set of labeled particles P labeled is the cartesian product L × P. An admissible configuration set that forbids the particle ubiquity or replication is a subset M (iii) of W (iii) for which all the elements make the number of occurrences of each label n ∈ L be 0 or 1.

(iv) Complex structures. More generally, the encoding space can be composed of complex elements, with structures involving sequences, cycles (for e.g. aromatic molecules), trees (etc.) and their combination according to precise combinatorial specifications (see [15, I.2.3].

Characterizing functions (F i ∈ F)

In order to characterize the system at a microscopic level, one may choose to equip M with a finite set of characterizing functions, labeled by i ∈ I, denoted

F i : M → F i . Definition 5 (Extensivity). A function F i is extensive if F i is a R + -semimodule (see Def.

6) and if it verifies

m 3 = m 1 • m 2 ⇒ F i (m 3 ) = F i (m 1 ) + F i (m 2 ) ∀(m 1 , m 2 , m 3 ) ∈ M 3 .
(2)

Definition 6 (R + -semimodule). A set S is a R + -semimodule if for all (r 1 , r 2 ) ∈ R + 2
and (s 1 , s 2 ) ∈ S 2 , the following properties hold

2. (r 1 + r 2 ) s 1 = r 1 s 1 + r 2 s 1 , 3. (r 1 r 2 ) s 1 = r 1 (r 2 s 1 ), 4. 1 s 1 = s 1 , 5. 0 s 1 = 0.
Example 1 (Continued). For a gas of N identical, non-interacting particles, the function F e : M → R + defined as

F e : m -→ F e (m) = N i=1 p i (m) 2 2 m (3)
gives the energy of the system in microstate m, where p i (m) is the momentum of particle i, and m is the mass of a particle. It fulfills the extensivity property defined in Eq. ( 2).

Example 2 (Continued). In the Ising model [START_REF] Liechtenstein | Exchange interactions and spin-wave stiffness in ferromagnetic metals[END_REF] , the function F e : M → R defined as

F e : m -→ F e (m) = - 1 2 m ⊺ J ex m (4)
gives the energy of the system in microstate m, where each coefficient J exi,j is the exchange energy between atom i and atom j. It does not fulfill the extensivity property defined in Eq. ( 2).

Example 3. The function F n : M → N + defined as

F n : m -→ F n (m) (5)
where F n (m) is the number of particles of the system in microstate m is extensive .

Example 4. The function F r defined as

F r (m) = r i 1≤i≤Fn(m) , (6)
where r i ∈ R 3 is the position of particle i, gives the set of all particle positions for the system in microstate m. It is not extensive.

Example 5. The function F v : M → R + defined as

F v : m -→ F v (m) (7)
where F v (m) is the volume occupied by the system in microstate m. The choice of such function F v is hardly unique (see remark 2 below). Here, we propose to define F v (m) as the minimal bounding volume enclosing all particle positions of microstate m that accounts for the container geometry and its degrees of freedom. For instance, for a cylindrical container of fixed base A closed by a piston moving freely along axis z, we can define the volume as

F v (m) = A × h(m), with h(m) = max{r i z | r i ∈ F r (m)}. (8)
This function does not fulfill the extensivity property defined in Eq. ( 2).

Remark 2 (Volume). The mathematical conceptualization of the volume is a challenging issue2 . In the context of SP, its physical conceptualization is also an issue:

(i) a possible choice could be the volume occupied by the particles, e.g. that delimited by the 3D simplicial envelope of all the particle positions, (ii) an alternative is to consider the volume of a container, in which the particle are authorized to evolve.

The case (i) allows the definition of a characterizing function F v , the volume being intrinsically related to the microstate. In (ii), the microstate does not encode the information of the container volume: its set of particles in contact with the container boundary can even be empty. This information is an "experimental constraint" (presented in section 3 below). Note also that example 5 corresponds to a hybrid description in between (i) and (ii).

In the following, we denote F = {F i } i∈I the set of characterizing functions on M.

Experimental conditions and accessible microstates (m ∈ M a )

Experimental conditions may constrain characterizing functions to take values that are compatible with these experimental conditions. Thus, under experimental conditions, the configuration space becomes restricted to a set of accessible microstates M a ⊂ M.

M a θ fixed = m ∈ M | F i (m) ∈ F fixed i ∀i ∈ I fixed . ( 9
)
Remark that I fixed = I defines an isolated system with respect to the chosen characterizing functions.

Example 1 (Continued). Consider a gas of N particles in a closed tank. The system cannot exchange particles with the environment, therefore the number of particles Intermediate point. At this step, the physics is described through: M (microscopic representation of physical particles, i.e. microstates), M a ⊆ M (microstates accessible under fixed macroscopic experimental constraints), F (links to quantities that can be observed at the macroscopic scale). This is not sufficient to derive an autonomous physical law at macroscopic scale. This issue can be solved by: (i) completing F with a single new function, namely, the surprisal, which is elaborated from a stochastic description, giving rise to the entropy; and (ii) applying the fundamental principle introduced by Boltzmann [START_REF] Boltzmann | Über die Beziehung zwischen dem zweiten Hauptsatze des mechanischen Wärmetheorie und der Wahrscheinlichkeitsrechnung, respective den Sätzen über das Wärmegleichgewicht[END_REF] to derive a microstate probability that physically makes sense.

F n (m) is fixed to N . Denote F fixed n = {N }. The set of accessible microstates is M a (N ) = m ∈ M | F n (m) ∈ F fixed n . Example 1 (Continued). Consider a gas of N particles in a closed tank occupying a space Π ⊂ R 3 . Denoting F fixed n = {N } and F fixed r = Π N , the set of accessible microstates is M a (N, Π) = m ∈ M | F n (m) ∈ F fixed n , F r (m) ∈ F fixed
The following sections revisit this approach, focusing on the propensity of macroscopic quantities to communicate with their peer in an external environment. To this end, we assume that all characterizing functions that are not explicitly fixed by experimental conditions can still depend on microstate m, and we denote I free := I\I fixed the set of labels of characterizing functions not fixed by experimental conditions.

Stochastic representation and measure of uncertainty

Microstate stochastic description

The system fluctuates from one accessible microstate to another. It is considered to be impossible to predict these fluctuations in a deterministic fashion at the macroscopic level: SP adopts a stochastic framework that model their random description. Indeed, from Prop. (2), M, P(M) is measurable, therefore so is M a , Tr P(M) Ma , where Tr P(M) Ma denotes the trace of P(M) on M a [START_REF] Plachky | An ideal theoretic characterization of finite sets, finite algebras, and σ-algebras of countably generated type[END_REF]. Assuming that M a is countable and that the distribution p is discrete3 , we can define a probability distribution p . | θ fixed : M a θ fixed → [0, 1], denoted p for short below, which assigns to each microstate m ∈ M a θ fixed a probability p(m) to be the actual microstate of the system (the Boltzmann principle in section 5 will provide a tool to determine this probability).

The average of a random quantity F (m) is given by its expectation E p [F ], defined as

E p [F ] = m∈Ma(θ fixed ) p(m) F (m). (10)

Statistical entropy

Given some basis of information units b > 1, a microstate m with probability p(m) has a surprisal S b p (m) defined as

S b p (m) = log b 1 p(m) with log b = 1 ln(b) ln . (11)
The surprisal, or information content, quantifies how much the occurrence of microstate m is surprising. For example, if some microstate m is the state of the system for certain, it has probability 1 and surprisal 0.

As the probability of two independent events m 1 and m 2 verifies

p (m 1 • m 2 ) = p(m 1 ) p(m 2 ), (12)
the surprisal function S b p verifies the extensivity property defined in Eq. ( 2). The surprisal allows the definition of a measure of lack of information on average for a probability distribution p and a basis b, namely, the statistical entropy S b (p) [START_REF] Gray | Entropy and information theory[END_REF] defined as

S b (p) = E p [S b p ]. (13)
The statistical entropy can be interpreted of as "the average number of questions to ask with b possible answers per question" in order to know the actual microstate for certain.

Example 6. Consider the outcomes of tossing a coin twice. The coin can come up heads or tails after each toss, hence 2 × 2 = 4 possible outcomes (Fig. 4). If all outcomes are equiprobable, one needs at least two questions with two possible answers each to know the exact outcome:

1. Did the coin come up heads or tails after the first toss? 2. Did the coin come up heads or tails after the second toss?

As it happens, taking p 1 : m → p 1 (m) = 1 4 and b = 2 in Eq. ( 13) yields S b (p 1 ) = -log 2 1 4 = 2. However, if the probability distribution is not uniform, some outcomes are more probable than others, and the uncertainty is lower; ditto the entropy. For instance, with a probability distribution p 2 assigning 1 2 to outcome (A), 1 4 to outcome (B), and 1 8 to outcomes (C) and (D), the entropy becomes S b (p 2 ) = 1.75 < S b (p 1 ) = 2.

In information theory, statistical entropy relates to optimal encoding of information. Suppose you repeat the coin toss experiment of Ex. ( 6) for a long period of time, and wish to record every outcome on a computer. For a sequence of two tosses with distribution p 1 , an outcome cannot be encoded in less than two bits; while with distribution p 2 , outcome (A) can be encoded on one bit, outcome (B) on two, and outcomes (C) and (D) on three, that is, 1

× 1 2 + 2 × 1 4 + 6 × 1 8 = 1.
75 bits on average. The most frequent outcome takes the least encoding space; conversely, the comparatively large encoding space taken by outcomes (C) and (D) is compensated by the rarity of their occurrence. On the whole, exploiting the knowledge underpinned by distribution p 2 reduces the encoding cost. This principle underlies Morse code (and, more generally, lossless entropy encoding like Huffman coding [START_REF] Knuth | Dynamic Huffman coding[END_REF]): very common letters such as "e" or "i" take much fewer dots than less common letters like "j" or "q". For compacity, the statistical entropy becomes in the following

S k (p) := S b=exp( 1 /k) (p) = -k m∈Ma(θ fixed ) p(m) ln p(m), (14)
for all p defined on M a (θ fixed ).

Remark 3 (Random structures). Following remark 1, the cases of microstates involving combinatorial structures based on elaborated specifications (such as molecules and chemical reaction processes) require elaborate tools addressing random structures (see e.g. [15, part. C]) that are out of the scope of this paper.

Microstate probability distribution at equilibrium and partition function

Thermodynamic equilibrium

A system is at thermodynamic equilibrium when its statistics stops evolving. At this point, the ergodic hypothesis postulates that over a "sufficiently long" period of time t, the system explores all its accessible microstates. Assuming that a microstate m can be measured at a time τ through M : R + → M a , this means that at thermodynamic equilibrium, the temporal mean of a quantity F i coincides with its expectation E p [F i ]:

F i := lim t→+∞ 1 t t 0 (F i • M) (τ ) dτ = E p [F i ]. (15)
Therefore, for a given set θ free of mean values (F i ) i∈I free , the ergodic hypothesis translates into a set of hypotheses H θ free defined as

H θ free = E p [F i ] = F i i∈I free . ( 16
)
While still discussed [START_REF] Patrascioiu | The ergodic-hypothesis: A complicated problem in mathematics and physics[END_REF] (especially regarding the definition of "sufficiently long"), this hypothesis is the foundation of equilibrium statistical physics, and we assume its validity in the following.

Boltzmann principle: maximum entropy at thermodynamic equilibrium (reminder)

By definition, a system at equilibrium does not evolve. Since change is new information, the information given by a system at equilibrium is minimal. As statistical entropy is a measure of lack of information, it follows that at equilibrium, the entropy is maximal: this is the Boltzmann principle.

It follows that the microstate probability distribution at thermodynamic equilibrium p ⋆ is

p ⋆ = arg max p S k (p) subject to m∈Ma(θ fixed ) p(m) = 1 = arg p max p,λ S k (p) + λ    m∈Ma(θ fixed ) p(m) -1    , (17)
where the second line specifies the constraint using a Lagrange multiplier λ.

Boltzmann principle in a macroscopic external environment

The macroscopic quantities (F i∈I free (m)) whose fluctuation is experimentally allowed are prone to communicate with the external environment (for example, through exchanges of particle, energy, etc). Assuming ergodicity and an infinite ratio between macroscopic and microscopic time scales, this means that the expectation of these fluctuating quantities (with value F i∈I free ) can change over time (at the slow macroscopic scale), while the thermodynamic equilibrium is satisfied (at the fast microscopic scale) and continuously updated (at the slow macroscopic scale).

As a main step of this paper, this issue is addressed by deriving the conditional probability p ⋆ m | H θ free that maximizes entropy (Boltzmann principle) constrained by the given macroscopic values θ free = (F i ) i∈I free , namely,

p ⋆ =arg max p S k (p) subject to          m∈Ma(θ fixed ) p(m) = 1, H θ free , =arg p max p,λ0,λ i∈I free S k (p) + λ 0    m∈Ma(θ fixed ) p(m) -1    + i∈I free λ i E p [F i ] -F i , (18)
where H θ free accounts for the experimental conditions (see Eq. ( 16)). Note that, by definition, this probability naturally restores that of [START_REF] Grothendieck | Récoltes et Semailles (Réflexions et témoignage sur un passé de mathématicien[END_REF], if the values F i∈I free are the expectations of F i∈I free computed for probability [START_REF] Grothendieck | Récoltes et Semailles (Réflexions et témoignage sur un passé de mathématicien[END_REF].

Theorem 1. Let θ free := F i i∈I free ∈ × i∈I free F i , where × i∈I free F i denotes the Cartesian product of the (F i ) i∈I free .
Then for all m ∈ M a θ fixed ,

p ⋆ m | H θ free = exp i∈I free λi Fi(m) k Z λ free , ( 19a
)
where

Z λ free := m∈Ma(θ fixed ) exp i∈I free λ i F i (m) k (19b)
is the partition function of the system, and, for all i ∈ I free , λ i verifies

∂ ∂λ i k ln Z λ free = F i . ( 19c
)
The proof is in Appendix A.

Definition 8 (Thermodynamic entropy). The thermodynamic entropy S k θ free is defined as the statistical entropy for the probability distribution at equilibrium given θ free :

S k θ free = S k p ⋆ • | H θ free . ( 20
)
Property 3. The thermodynamic entropy function S k is a Legendre transform of k ln Z and we have

S k θ free = k ln Z λ free - i∈I free λ i F i . (21)
Proof.

S k θ free (a) = S k p ⋆ • | H θ free (b) = -k m∈Ma(θ fixed ) p ⋆ m | H θ free ln p ⋆ m | H θ free (c) = -k m∈Ma(θ fixed ) p ⋆ m | H θ free ln    exp i∈I free λi Fi(m) k Z λ free    = -k m∈Ma(θ fixed ) p ⋆ m | H θ free i∈I free λ i F i (m) k -ln Z λ free (d) = - i∈I free λ i F i + k ln Z λ free ,
using (a) Eq. ( 20), (b) Eq. ( 14), (c) Eq. (19a), and (d) Eqs. ( 10)- [START_REF] Flajolet | Analytic combinatorics[END_REF]. We deduce that S k is a Legendre transform of k ln Z (see also [START_REF] Zia | Making sense of the Legendre transform[END_REF]).

Property 4. It follows from Prop. ( 3) that for all i ∈ I free , the Lagrange multiplier λ i is the derivative of the thermodynamic entropy function with respect to average F i

λ i = - ∂ S k ∂F i θ free . ( 22
)
Example 7. In particular, this defines the system temperature T , chemical potential µ, and pressure P as

1 T := ∂ S k ∂F e θ free , µ T := - ∂ S k ∂F n θ free , P T := ∂ S k ∂F v θ free . ( 23
)
Adiabatic process. For a system going through an adiabatic process (no thermal exchange with the environment), the surprisal is independent of m so that

S b p ⋆ (m) = S ∀m. ( 24
)
That implies that for such systems, all microstates have the same probability

p ⋆ (m) = 1 Ω , with Ω = card M a θ fixed . ( 25
)
From Eq. (19a), it follows that for such a system, we have

i∈I free λ i F i (m) = C, ( 26
)
where C is independent of m.

Example 8. In particular, a system that can only exchange volume with its environment verifies F e (m) + P F v (m) = C, where C is independent of m.

Identification of Boltzmann constant

To ensure that the statistical entropy does coincide with the thermodynamic entropy at equilibrium, the constant k must be chosen as the Boltzmann constant4 k B = 1.38 × 10 -23 J.K -1 . Indeed, consider an ideal gas of N non-interacting atoms in a box of volume V at temperature T , represented by their position and momentum. The partition function Z is given by

Z(T | N, V ) = V N 2 π m k T h 2 3 N /2 , ( 27
)
where here m denotes the mass of an atom, and h is the Planck constant. From Prop. (3), the thermodynamic entropy S k (F e , N, V ) is given by

S k (F e , N, V ) = k ln Z(T | N, V ) + F e T . ( 28
)
Moreover, from Eq. ( 23), the pressure P is given by

P = T ∂ S k ∂V (F e , N, V ) = N k T V . (29)
Therefore, k must be identified with k B so that the ideal gas law P V = N k B T is verified.

Final PHS model

The macrosopic description of open system can be achieved by using balanced equations of variations of entropy, energy, mass, etc. Port-Hamiltonian systems provide an adapted framework for such physical descriptions. This section addresses this issue by using a standard formulation (recalled in section 6.1), in which the energy is expressed as a function of entropy and state variables: this requires to invert S : (E, . . . ) → S(E, . . . ) w.r.t. E, to introduce the hamiltonian H = E : (S, . . . ) → H(S, . . . ) in a first step. Note that this inversion is a technical step that could be avoided (to still use the entropy function) by considering contact forms as in [START_REF] Van Der Schaft | Geometry of thermodynamic processes[END_REF] (see also [START_REF] Öttinger | Beyond Equilibrium Thermodynamics[END_REF] for the alternative GENERIC formulation).

Reminder on port-Hamiltonian systems

The PHS formalism provides a unified formalism for the modeling of multiphysical systems, in the sense that it recognizes energy as a universal currency. Indeed, any physical system can be divided into parts that interact with each other via energy exchanges.

Detailed presentations of PHS are available in [START_REF] Duindam | Modeling and control of complex physical systems: The port-Hamiltonian approach[END_REF][START_REF] Van Der Schaft | Port-Hamiltonian systems theory: An introductory overview[END_REF]. In this paper, we rely on a differential-algebraic formulation adapted to multiphysical systems [START_REF] Falaize | Passive guaranteed simulation of analog audio circuits: A port-Hamiltonian approach[END_REF][START_REF] Müller | Time-continuous power-balanced simulation of nonlinear audio circuits: Realtime processing framework and aliasing rejection[END_REF]. This formulation allows the representation of a dynamical system as a network of 1. storage components of state x and energy E(x); 2. passive memoryless components described by an effort law z : w → z(w), such as the dissipated power P d = z (w) ⊺ w is non-negative for all flows w; 3. connection ports conveying the outgoing power P ext = u ⊺ y where u are inputs and y are outputs.

The system flows f and efforts e are coupled through a (possibly dependent on x) skewsymmetric interconnection matrix S = -S ⊺ , so that   ẋ w y

  f = S   ∇E(x) z(w) u   e . (30)
Such systems satisfy the power balance

P s + P d + P ext = 0 (31)
where P s = ∇E(x) ⊺ ẋ denotes the stored power.

Proof.

P s + P d + P ext = ∇E(x) ⊺ ẋ + z (w) ⊺ w + u ⊺ y = e ⊺ f = e ⊺ Se = (e ⊺ Se) ⊺ = -e ⊺ Se = 0
due to the skew-symmetry of S.

Note that in this paper, we adopt the passive sign convention (also called receiver convention) for all components, including external sources. This means that a flow is defined positive when entering the component [START_REF] Bigelow | Power and energy in electric circuits[END_REF].

Macroscopic state and energy

In the previous sections, we derived the thermodynamic entropy as a function of the energy and other macroscopic variables. In order to obtain a port-Hamiltonian formulation such as Eq. ( 30), we choose to express the energy as a function of the thermodynamic entropy and other macroscopic variables instead.

Denote S := S k θ free , and θ x := θ free \F e the set of macroscopic quantities that are not the energy, with corresponding set of labels I x . We choose to define the (extensive) macroscopic state x as

x = S, θ x ⊺ , (32)
so that the flow ẋ accounts for the time variation of extensive quantities. Assuming that the entropy function S k is invertible with respect to F e , we define the macroscopic energy function E as

E : x -→ E S k (F e , θ x ), θ x = F e , (33)
so that the effort ∇E accounts for intensive quantities. Otherwise, the macroscopic energy function can be defined implicitly via Eq. ( 21) and contact forms [START_REF] Van Der Schaft | Geometry of thermodynamic processes[END_REF][START_REF] Van Der | Classical thermodynamics revisited: A systems and control perspective[END_REF].

Remark: the energy function E should be homogeneous of degree 1, so that it verifies for all γ E(γ x) = γ E(x).

(34)

Connection to ports

Ext Sys (isolated) {Sys + ext} f sys f ext e sys = e ext Figure 5: Flows f and efforts e of a system and its environment. The considered system and its environment as a whole form an isolated system.

The environment acts on the system flow so that at thermodynamic equilibrium, the flows are balanced, and the effort is shared at the system interface (Fig 5 ):

∂E sys ∂F sys i = ∂E ext ∂F ext i ∀i ∈ I x . (35)
(see Appendix B for proof).

Adopting the notations of Eq. ( 30), together with Eq. ( 22), we obtain the relations between flows, efforts and external ports in Table 1.

Table 1: Port variables and their relations.

State x

S, F i u + ẋ = 0 Effort ∇E(x) [T, T λ i ] y = ∇E(x)

Conservative, reversible PHS

Denoting σ ext the outgoing entropy flow, the conservative PHS interconnection matrix of an open system is found to be This section first summarises the main steps to derive a reversible conservative macroscopic PHS from a microscopic description of matter in an experimental context. Second, a process is proposed to complete this modelling under a macroscopic irreversible conservative form, given a dissipation law.

∇E(x) u T µ -P σ ext Ṅext Vext                 Ṡ . . . - 1

Reversible conservative macroscopic PHS

In summary, the macroscopic PHS can be described from the microscopic description by completing the following steps: For common experimental constraints (i.e., constraints on F = F e , F n , F v , S b p ), we obtain the results in Table 2 (see also [START_REF] Graben | Unified treatment of adiabatic ensembles[END_REF]).

Note that if there is no analytic solution for F e → S k (F e , . . . ) and its inverse (note that ∂ S k ∂F e is monotonic), approximation strategies can be used (see [START_REF] Najnudel | From statistical physics to macroscopic port-Hamiltonian systems: A roadmap[END_REF] for an example).

1 Ω k B ln Ω Gas in an isolated tank Isoenthalpic-isobaric (N, S) F e , F v 1 Ω k B ln Ω

Gas in a closed tank

No with a piston, thermally insulated

thermal contact Unnamed (V, S) F e , F n 1 Ω k B ln Ω Gas in a porous tank, thermally insulated Unnamed S F e , F n , F v 1 Ω k B ln Ω
Gas in a porous tank with a piston, thermally insulated

Thermal contact

Canonical

-canonical V F e , F n exp -Fe (m)-µ Fn (m) k B T Z(T, µ) k B ln Z(T, µ) + Fe-µ F n T
Gas in a porous tank, in contact with a thermostat Unnamed F e , F n , F v exp -Fe(m)+P Fv(m)-µ Fn(m) kB T Fe+P Fv -µ Fn T

Gas in a porous tank with a piston, in contact with a thermostat 7.2. Irreversible conservative macroscopic PHS from a macroscopic dissipative law

The system (36) models some conservative reversible physics at macroscopic scale. In some cases, dissipative phenomena can be observed, for which laws are available only at this scale.

In this part, we assume that such a dissipative phenomenon is described by (i) a flow-to-effort mapping law

z d : f d → e d = z d (f d ) such that for all f d , z d (f d ) ⊺ f d =: P d ≥ 0, (37)
(ii) interconnected to the conservative part according to matrix given by

∇E(x) z(w) u T e s e d σ ext e ext           ẋ Ṡ . . . -1 . f s . J x -K . -G x w f d . K ⊺ J w . -G w y T ext 1 . . . . f ext . G ⊺ x G ⊺ w . J y , (38)
(iii) the dissipated power P d being totally converted into an entropy rate

σ i = P d/T d ≥ 0 where T d > 0, (39)
denotes the instantaneous macroscopic temperature at which the phenomenon is experienced. The positivity of σ i reflects the irreversible nature of dissipation.

From z d , we form the irreversible thermodynamic converter with law

z : w = f ⊺ d , T d ⊺ -→   zd(fd) ⊺ , -z d (f d ) ⊺ f d /T d -σi    ⊺ (40)
where -σ i ≤ 0 accounts for the entropy rate incoming into the converter. This law is conservative as z(w) ⊺ w = 0. Due to irreversibility (σ i ≥ 0), it naturally fulfills the second principle of thermodynamics.

Finally, from (iii), the irreversible conservative thermodynamic macroscopic PHS is given by ∇E

(x) z(w) u T e s -σ i e d σ ext e ext               ẋ Ṡ . . -1 . -1 . f s . J x . -K . -G x w T d 1 . . . . . f d . K ⊺ . J w . -G w y T ext 1 . . . . . f ext . G ⊺ x . G ⊺ w . J y . (41)

Conclusion

In this paper, we revisited equilibrium SP in order to model complex systems with numerous degrees of freedom as macroscopic PHS with a reduced number of variables.

Starting from the choice of a particle's description and ad hoc characterizing functions, we recalled how to derive the probability of a configuration of particles at equilibrium based on given experimental conditions. In the end, macroscopic variables are revealed to be expectations of the chosen characterizing functions for this probability, and the thermodynamic entropy to be a function of these macroscopic variables. Provided that the energy has been chosen as a characterizing function from the start, the macroscopic energy can in turn be expressed as a function of the thermodynamic entropy and other macroscopic variables. Through the PHS formalism, experimental conditions are represented as an input flow that acts on the system so that the resulting output is an effort shared with the system. With this formulation, the externality of the environment, as well as its interactions with the system via exchanges of energy and entropy, are made explicit.

As a result, we proposed two PHS formulations for conservative open systems, a reversible one (with no entropy creation), and an irreversible one (with entropy creation).

An immediate perspective would be to extend this work to non-equilibrium SP [START_REF] Öttinger | Beyond Equilibrium Thermodynamics[END_REF], so that a macroscopic trajectory would not only be a succession of equilibrium states, and experimental conditions could change faster.

Appendix A. Proof of Theorem 1

Proof. To solve Eq. ( 18), we introduce Lagrange multipliers λ 0 and λ free := (λ i ) i∈I free , and optimize [START_REF] Jaynes | On the rationale of maximum-entropy methods[END_REF] the Lagrangian L defined by L : p, λ 0 , λ free -→ S k (p) + λ 0 (A.1) A necessary condition to optimize L is to solve δL δp = 0, where δ denotes the functional derivative. From Eq. (A.1)-( 14)-( 10 A third necessary necessary condition is to solve ∂ L ∂λ i = 0 for all i ∈ I free , which, combined with Eq. (A.3), yields

∂ L ∂λ i = 0 ⇒E p [F i ] = F i ⇒ m∈Ma(θ fixed ) F i (m) exp i∈I free λi Fi(m) k Z λ free = F i ⇒ ∂ ∂λ i k ln Z λ free = F i .
We deduce that the optimal distribution p ⋆ is p ⋆ m | H θ free = p ⋆ m | H θ free , λ free , with λ free such that ∂ ∂λ i k ln Z λ free = F i ∀i ∈ I free .

Appendix B. Proof of effort equality at the system interface Proof. Consider the isolated total system constituted by the system under study and its environment. For all i ∈ I free , we have

F total i = F sys i + F ext i .
The entropy is extensive, therefore, S k total θ free total = S k sys θ free sys + S k ext θ free ext .

(B.1)

The total system is isolated, therefore the total entropy is maximal with respect to any variable, so that for all i ∈ I free , Moreover, for all i ∈ I x ∂E ∂F i = T λ i , since

S k E(S, F i ), F i = S ⇒ ∂ S k ∂F e ∂ E ∂F i + ∂ S k ∂F i = 0 ⇒ 1 T ∂ E ∂F i -λ i = 0.
We deduce that ∂E sys

A) 13 .

 13 . Microscopic description -Section 2 1. P-valued particle representation 2. Particle configuration m ∈ M = P ⋆ 3. Set of characterizing functions F B. Experimental conditions -Section 3 4. F = F fixed ∪ F free 5. Fixed values θ fixed 6. Set of accessible configurations Ma(θ fixed ) C. Stochastic setting -Section 4 7. Probability distribution p 8. Surprisal S b p (m) (in base b) 9. Statistical entropy S k (p), k = 1 /ln b D. Boltzmann principle -Section 5 10. Ergodicity Ep Fi ∈ F free = F i 11. Maximum entropy given experimental conditions (B.) → Thermodynamic entropy S k (F i) and Lagrange mult. λi E. Macroscopic PHS -Section 6 12. Entropy to energy representation S k (E, F j ) ↔ E(S, F j x Connection to ports (effort u, flow y)

Figure 1 :

 1 Figure1: from equilibrium statistical physics to macroscopic port-Hamiltonian systems (PHS): method recap with the labels of the main mathematical objects introduced in each step.

Figure 2 :

 2 Figure 2: Examples of microstates for different systems.

Definition 7 (

 7 Set of accessible microstates M a ). Denote I fixed ⊆ I the set of labels of characterizing functions that are experimentally constrained. Due to the constraints, a function F i , i ∈ I fixed can only take admissible values in F fixed i ⊆ F i . Denote θ fixed := F fixed i i∈I fixed . The set of accessible microstates M a θ fixed is

r.

  Note that the constraint on F fixed r corresponds to the case (ii) in remark 2, the container being described by Π. Other examples of experimental conditions are shown on Fig. 3.

  (a) Fixed number of particles and fixed volume. (b) Fixed number of particles.(c) Fixed volume.

Figure 3 :

 3 Figure 3: Examples of experimental conditions for a gas in a tank.

Figure 4 :

 4 Figure 4: Possible outcomes for a coin tossed twice.

1 . 3 . 1 p 4 .

 1314 Microstate representation Define P, W = P ⋆ and M ⊆ W equipped with characterizing functions F = {F i : M → F i } i∈I . 2. Experimental conditions and accessible microstates (a) Partition F = F fixed ∪ F free into the set F fixed of functions the values of which are physically constrained by the experiment and its complement F free , with corresponding sets of indices I fixed and I free . (b) Denote θ fixed ⊂ × i∈I fixed F i the set of experimentally admissible values for functions in F fixed . (c) Denote M a θ fixed the corresponding set of admissible microstates. Stochastic description For all probability distributions p : M a θ fixed -→ [0, 1], (a) Derive the surprisal S b p : m ∈ M a θ fixed -→ log b (m) ∈ R + . (b) Derive the statistical entropy function S k : p -→ E p S b=exp( 1 /k) p ∈ 0, 1 Ω . Boltzmann principle for ergodic systems at thermodynamic equilibrium (a) Introduce θ free := F i i∈I free the values of functions in F free observed at a macroscopic scale. (b) Define p ⋆ m | H θ free according to Th. 1. (c) Define the thermodynamic entropy function S k : θ free → S k p ⋆ . | H θ free .

k

  B ln Z(T ) + Fe T Gas in a closed tank, in contact with a thermostat Isothermal-isobaric N F e , F v exp -Fe (m)+P Fv (m) k B T Z(T, P ) k B ln Z(T, P ) + Fe+P Fv T Gas in a closed tank with a piston, in contact with a thermostat Grand

  i E p [F i ] -F i .

exp λ 0 k - 1

 1 ln p(m) + 1 + λ 0 + i∈I free λ i F i (m)   = 0. This is true in particular if p verifies -k ln p(m) + 1 + λ 0 + i∈I free λ i F i (m) = 0 ∀m ∈ M a θ fixed ⇒p(m) = exp i∈I free λ i F i (m) k ∀m ∈ M a θ fixed .A second necessary condition is to solve ∂ L ∂λ 0 = 0, which, combined to the first condition, yields∂ L ∂λ 0 = 0 ⇒ m∈Ma(θ fixed ) p(m) = 1 ⇒ m∈Ma(θ fixed ) exp i∈I free λ i F i (m) k = exp 1 -λ 0 k , so that for all m ∈ M a θ fixed , p ⋆ (m) is of the form p ⋆ m | H θ free , λ free = exp i∈I free λiFi(m) k Z λ free , (A.2)with Z λ free := m∈Ma(θ fixed ) exp i∈I free λ i F i (m) k . (A.3)

Table 2 :

 2 Statistical ensembles and associated constraints for usual experimental conditions. Ω denotes the cardinal of Ma (set of accessible microstates).

	Ensemble	θ fixed	θ free	p ⋆ (m)	Entropy	Example
	Micro-canonical	(E, N, V, S)

For instance, if the chosen representation assigns a unique label to each particle, configurations in which several particles share the same label are not admissible (see remark 1(iii) for more more details) .

r 1 (s 1 + s 2 ) = r 1 s 1 + r 2 s 2 ,

In[START_REF] Grothendieck | Récoltes et Semailles (Réflexions et témoignage sur un passé de mathématicien[END_REF] Chap.

3,p.3], Grothendieck mentions the absence (in most textbooks) of any "serious" definition of the notion of length (of a curve), of area (of a surface), of volume (of a solid).

Extensions to continuous measurable spaces are available and similar, replacing the sum by an integral with a Lebesgues measure and using distributions in[START_REF] Gorban | Model reduction and coarse-graining approaches for multiscale phenomena[END_REF].

Note that, from definition[START_REF] Hopcroft | Introduction to automata theory, languages, and computation[END_REF], choosing the unit USI reference k 0 = 1 J.K -1 as a unit information quantity, this value corresponds to the question number base b B = exp(k 0 /k B ) = exp(10 23 /1.38) ≈ 10 3.147e+22 ≈ 2 9.4736e+21 . This means that explaining +1 J.K -1 requires about 10 22 bits for a gas.

Acknowledgments

The authors would like to thank Bernhard Maschke for his comments and helpful discussion.


domain: spi phys

text:
Nazari Zahra

Chaleshtori

Stanislav Zvanovec
email: xzvanove@fel.cvut.cz

Zabih Ghassemlooy

Mohammad-Ali Khalighi

Investigation of VLC with OLEDs for D2D Communications Considering User's Movement and Receiver Orientations

With the increasing use of organic light emitting diodes (OLED) in lights, smart phones, wearables smartwatches and computers, visible light-based device-to-device (D2D) communications become more and more relevant. This paper proposes D2D communications using the smart phone's display pixels and their built-in cameras. We investigate the impact of receiver orientation and user's mobility on the link performance. We derive a Gaussian model for the probability density function of the delay spread and optical path loss (OPL), and show that the channel delay spread decreases for a typical furnished room compared with an empty room, whereas the former has an increased OPL. In addition, we show that for the case of a furnished room and considering user mobility, the peak OPL values are about 64 and 62 dB, with and without considering the receiver's random orientation, respectively.

Introduction

In visible light communications (VLCs), inorganic and organic light emitting diodes (LEDs) and laser diodes (LDs) could be used as the light sources to provide illumination and data communications simultaneously [START_REF] Ghassemlooy | Visible Light Communications: Theory and Applications[END_REF][START_REF] Ghassemlooy | Optical wireless communications: system and channel modelling with Matlab®[END_REF]. Note, inorganic LD-based lights should be diffused to meet the eye-safety. Organic LEDs (OLEDs), which use polymers or small organic molecules as their optically active element, offer unique features such as wide emission spectrum, high output, transparent display, high colour purity, low power consumption, compact, flexible substrates, and higher response rates (by 200 times), compared with the liquid crystal display (LCD) devices. These make OLEDs ideal in a number of applications including panels, displays of wearable smartwatches, computers, smartphones, and televisions [START_REF] Kalinowski | Organic Light-Emitting Diodes: Principles, Characteristics & Processes[END_REF][START_REF] Haigh | VLC with Organic Photonic Components[END_REF]. In smart devices, OLED displays together with the built in cameras could facilitate device-to-device (D2D) communications as part of the Internet of everything.

In VLC systems, in line with wireless communications, the channel impulse response (CIR) is mostly characterized in terms of the root-mean-square (RMS) delay spread 𝜏RMS and the average optical path loss (OPL). The former determines how susceptible the channel is to intersymbol interference (ISI), which leads to reduced data rate Rb (if no post transmission channel equalization is to be done) [START_REF] Ghassemlooy | Visible Light Communications: Theory and Applications[END_REF][START_REF] Long | Investigating channel frequency selectivity in indoor visible light communication systems[END_REF]. In [START_REF] Chun | Visible light communication using OLEDs: Illumination and channel modeling[END_REF], the CIR of an empty room of dimension 5×5×3 m 3 was evaluated using Monte Carlo (MC) ray tracing at the visible wavelength range. However, reflectance for surface materials was assumed to be wavelength-independent. The wavelengthdependent reflectance from surfaces was characterized for the first time in [START_REF] Lee | Indoor channel characteristics for visible light communications[END_REF], where it was shown that the total diffuse power and 𝜏RMS for the VLC system were lower compared with the infrared transmission system. However, the effect of reflectance from furniture/objects in typical indoor environments on the CIR was not investigated. In recent years we have seen a growing use of software-based simulation packages in VLC. For instance, in [START_REF] Rodríguez | Simulation of impulse response for indoor visible light communications using 3D CAD models[END_REF] a three-dimensional computer-aided design (CAD) model was used for estimating the CIR of indoor VLC links based on Monte Carlo simulation approach. Opticstudio software from Zemax [9] has also been utilized for channel modelling in [START_REF] Miramirkhani | Channel modeling and characterization for visible light communications[END_REF] that investigated the effect of reflectance from furniture in indoor environments on the CIR ; these results were later used in the IEEE 802.15.7r1 Task Group [START_REF] Uysal | IEEE 802.15. 7r1 reference channel models for visible light communications[END_REF]. More recently, a new expression was developed for the CIR of an indoor VLC by considering the positions, sizes, and shapes of obstacles [START_REF] Nan | A novel VLC channel model based on beam steering considering the impact of obstacle[END_REF]. In [START_REF] Nan | A novel VLC channel model based on beam steering considering the impact of obstacle[END_REF], the LED illumination area was divided into independent solid angles and beam steering was used for the ray transmission in every solid angle. The impact of using flexible OLED in VLC was studied and compared with the case of Lambertian sources, where lower 𝜏RMS and the average OPL values of ~9% and 3 dB, were reported [START_REF] Chen | OLED panel radiation pattern and its impact on VLC channel characteristics[END_REF]. In [START_REF] Nazari Chaleshtori | Utilization of an OLED-Based VLC System in Office, Corridor, and Semi-Open Corridor Environments[END_REF], the use of OLED-based VLC (OVLC) for some indoor environments (i.e., office, shopping mall, corridor and semi-open corridor) were investigated, a data rate of 4 Mb/s was reported for the office environment using both curved and flat OLEDs at the transmitter's (Tx) half-angle within the range of ±90° and ±53°, respectively. Additionally, the authors showed that, for a semi-open corridor, the OPL values for the empty corridor and for a 10 m link span were lower by 6 dB compared with the furnished corridor. In [START_REF] Younus | Multi-user high data rate indoor VLC systems[END_REF], an indoor multi-user VLC system based on the angle diversity Tx was proposed that could achieve a higher data rate. Therein, the non-sequential ray-tracing method was used for estimating the CIR, where the authors also introduced an algorithm to eliminate the effect of interference from the different LOS links. Next in [START_REF] Wei | Channel Modeling and Signal Processing for Array-based Visible Light Communication System in Misalignment[END_REF], the ray-tracing model was used to estimate the channel characteristics for an indoor MIMO VLC system using arrays of LEDs and PDs as well as two aspheric convex and concave lenses. Signal combination at the Tx and successive interference cancellation at the receiver (Rx) were adopted to improve the channel capacity. In [START_REF] Eldeeb | Distributed MIMO for Li-Fi: Channel Measurements, Ray Tracing and Throughput Analysis[END_REF], the good match between the simulation (using Opticstudio) and experimental results of channel characteristics was demonstrated for a MIMO VLC system in a furnished conference room.

Organic-based light sources are being widely used in a number of applications including shopping malls, offices, airports, etc., because of their flexibility, smooth lighting, etc. The eyesafety studies of OLED compared with non-organic LED light have revealed that retinal pigment epithelium (RPE) and photoreceptors can be damaged by the latter [START_REF] Jun | Comparison of ophthalmic toxicity of light-emitting diode and organic light-emitting diode light sources[END_REF]. Typically, the so-called white phosphor LEDs (WPLEDs) use a blue LED, which has a Cerium-doped Yttrium Aluminum Garnet (Ce:YAG) yellowish phosphor encompassing the photoactive area. The blue wavelength is in fact the main reason of the functional damage. On the other hand, OLEDs are made by combining their emitting colors (i.e., wavelengths), which are more eye-safe than the non-organic LEDs, as the blue light intensity is not as high as that for WPLEDs for the same overall luminance level [START_REF] Jun | Comparison of ophthalmic toxicity of light-emitting diode and organic light-emitting diode light sources[END_REF][START_REF] Nazari Chaleshtori | Comprehensive optical and electrical characterization and evaluation of organic light-emitting diodes for visible light Communication[END_REF]. Indeed, thanks to their higher brightness levels, wider color ranges, transparency, and improved durability, there has recently been a growing use of the organic technology in the applications such as display or in mobile and smart devices screens. Given these wide spread use of OLEDs, it is quite relevant to consider them as optical Txs for use in the Internet-of-things applications, in particular for short range and low data rate scenarios. In fact, there has been a limited amount of research reported on the utilization of OLED-based VLC (OVLC) in D2D communication systems, which has been the motivation behind this work.

In this paper, an OVLC scheme for D2D communications is considered for a typical office environment with furniture. We consider two static users that face each other and investigate the impact of the Rx's random orientations and the user's movement on the RMS delay spread and the OPL.

The rest of the paper is organized as follows. In section 2, the simulation environment is described, which includes the adopted scenarios and system modelling of Rx orientation and mobility. In section 3, the results are discussed. Finally, conclusions are given in section 4.

Simulation Environment

Here, we consider a three-dimensional indoor environment with a specific geometry including furniture, as depicted in Fig. 1. Also defined are the types and reflection coefficients of materials with respect to the wavelength and specifications of the both Tx and Rx. For the considered scenario, we have used the non-sequential ray tracing method to determine the detected optical power and the path lengths between the Tx and the Rx. Note, the CIR is expressed as [START_REF] Nazari Chaleshtori | Coverage of a shopping mall with flexible OLED-based visible light communications[END_REF]: [START_REF] Ghassemlooy | Visible Light Communications: Theory and Applications[END_REF] where Pi and ti are the power and the propagation time of the ith optical ray, respectively. d is Dirac delta function, and N is the number of rays received at the Rx.

Scenarios

As shown in Fig. 1, two users are communicating with each other, where the display and the camera of the mobile phones are considered as the Tx and the Rx, respectively. Next, we consider three scenarios as specified in the following: I. Case 1: two static users (with no mobility) positioned in the centre of the room are facing each other. For this case, we investigate the impact of Rx's orientation on the channel; II.

Case 2: Same as Case 1 above, but while considering mobility for the user holding the Rx; III.

Case 3: combined Cases 1 and 2, i.e., the simulation includes Rx's orientation and mobility of the user holding Rx. All the key system parameters adopted are given in Table 1.

System modelling

We adopt the Rx's orientation about the device coordinate system, see Fig. 2, which is based on the model driven in [START_REF] Soltani | Modeling the random orientation of mobile devices: Measurement, analysis and LiFi use case[END_REF], where the Rx orientation is represented in the spherical coordinates, which follows the polar angle q with Gaussian distribution with the mean µG = 29.7 and standard deviation sG = 7.8, and the azimuth angle ω with a uniform distribution (ω ∼ U[-π, π)). Note, a 3D body can be rotated about the three orthogonal axes and in this case q, which is related to the pitch and roll rotations with the angles of β and γ around the x-and y-axis, respectively that are associated with the user's wrist movements. The polar and azimuth angles are given, respectively by:

q = cos -1 (cosβ cosγ), (2)
ω = tan -1 (sinα sinγ -cosα cosγ sinβ /cosγ sinα sinβ + cosα sinγ).

(

) 3
Using the model given in [START_REF] Soltani | Modeling the random orientation of mobile devices: Measurement, analysis and LiFi use case[END_REF], we have obtained the probability density function (PDF) of the tilt angle values around the x-and y-axis in the Cartesian coordinates, which unlike the values in [START_REF] Soltani | Modeling the random orientation of mobile devices: Measurement, analysis and LiFi use case[END_REF] can be imported in the simulator, see Fig. 3. We observe the following from Fig. 3: (i) the tilt angles around the x-and y-axis are in the range of -50° to 50°; (ii) the symmetrical peaks of 24° and 22° for the x-and y-axis, respectively; and (iii) higher PDF probability by about 0.126 for the y-axis at zero tilt angle compared with x-axis. The statistics of Rx's orientation might be characterized for the case where the user knows the location of the Tx and, therefore, intentionally orients the Rx towards the Tx. In the simulator, the rotation values for 30 configurations were imported. Rayleigh distribution with the scale parameter σ = 0.5 was assumed in modelling the user's mobility, see Fig. 4(a) [START_REF] Eroğlu | Impact of random receiver orientation on visible light communications channel[END_REF]. Further, using Rayleigh distribution, the locations of the Rx in the room with respect to the Tx's location were obtained. Fig. 4(b) shows the map of Rx's locations for 30 positions adopted in the simulation.

Results and Description

The proposed system performance is investigated in terms of the RMS delay spread 𝜏RMS and OPL. The delay spread provides a good estimate of how susceptible the system is to multipathinduced ISI, which leads to reduced Rb. Note, 𝜏RMS is commonly used to define the delay dispersion along the propagation path. The channel mean excess delay 𝜏 and the 𝜏RMS are given as [START_REF] Nazari Chaleshtori | Coverage of a shopping mall with flexible OLED-based visible light communications[END_REF]:

(4) (5)
The optical signal attenuation caused by reflections and transmission in the free space is quantified by OPL, which is given as [START_REF] Nazari Chaleshtori | Coverage of a shopping mall with flexible OLED-based visible light communications[END_REF]: [START_REF] Chun | Visible light communication using OLEDs: Illumination and channel modeling[END_REF] Figs. 5 and6 show the PDFs of the channel delay spread 𝜏RMS and OPL for the empty and furnished rooms for Cases 1 and 2. The PDF profiles change with considering user's mobility. A comparison of Cases 1 and 2 in the empty room shows a drop in OPL in Case 2 due to the potential of having lower values of dTx-Rx. For Case 2, there is a range of probability of OPL from 56 to 64 dB. However, in Case 1, the probability of OPL is restricted to values between 59 to 62 dB. It can be seen that, the range of 𝜏RMS are from 6 to 9 ns, and 5 to 12 ns for Cases 1 and 2, respectively. Tx Fig. 7 shows the comparison of empty and furnished rooms for Case 2. For a furnished room, we can observe a decrease in 𝜏RMS compared with the empty room. However, OPL increases because of increased shadowing and lower values of reflection coefficients for the objects and furniture, compared with the reflection coefficients of the walls. For instance, in Case 2 and for the furnished room, the OPL distribution is risen by 1.5 dB compared with the empty room. For Case 2, in both empty and furnished rooms, 𝜏RMS can reach the maximum value of 12 ns while the delay spread is decreased by 3 ns in the furnished compared with the empty room. It can be seen that the peak of 𝜏RMS are 6.5 and 9.5 ns for the furnished and empty rooms, respectively. Fig. 8 depicts the normalized PDF for 𝜏RMS and OPL for Cases 2 and 3 for a furnished room. A numerical fitting method was used to estimate the PDF of 𝜏RMS and OPL for D2D communications where the user mobility and the Rx orientation are considered. Note, Gaussian model provides the best fit to describe the channel characteristics in D2D communications, which is given by: [START_REF] Lee | Indoor channel characteristics for visible light communications[END_REF] where q is 𝜏RMS or OPL, a1, b1, and c1 are the parameters estimated by the curve fitting, which are further summarized in Tables 2 and3 for 𝜏RMS or OPL, respectively. The root mean square error (RMSE) value of the statistical model is less than a standard error limit of 0.05 to assess the accuracy of the model. i.e., RMSE =#∑(𝑃 ! -𝑃 " ) # /𝑛, where Ps and Pm are the values obtained from simulation and statistical model, respectively and n is the number of modelled samples. We can see, OPL increases for Case 3, e.g., the mean value of Gaussian model is 62 dB; however, it drops to 60 dB for Case 2. In addition, for Case 3 the delay spread is also increasing, e.g., the mean of Gaussian distribution is 6.99 ns, however, it drops to 6.78 ns for Case 2. For Case 3, the increase in 𝜏RMS and OPL for Gaussian model compared with Case 2 is due to considering the Rx's orientation. However, the results show that even for the worst-case scenario i.e., including the Rx's mobility and its orientation, the achieved PDF of 𝜏RMS demonstrates the feasibility of OVLC for D2D communications. Table 4 shows the comparison of the highest PDF values for 𝜏RMS and OPL for three cases.

Using Gaussian distribution model for OPL, see Fig. 8, the normalized PDF for the channel capacity was obtained for Cases 2 and 3 for a furnished room as shown in Fig. 9. The channel capacity has the mean values of 15 and 7 Mb/s for Cases 2 and 3, respectively. However, the PDF plot shows that the channel capacity reaches up to 50 Mb/s with the PDF values of 0.11 and 0.41 for Cases 2 and 3, respectively.

Conclusion

An OVLC-based D2D communications scheme was considered in this paper, with the aim of investigating the impact of Rx random orientations on the channel characteristics. In addition, to demonstrate the feasibility of D2D communications in more realistic application scenarios, the user's mobility was investigated by means of simulation. We showed that, considering random Rx's orientation, the maximum values of OPL for the empty and furnished rooms were about 62 and 64 dB, respectively. However, there was a drop in 𝜏RMS for the furnished room compared with the empty room. When including user mobility, the peak 𝜏RMS in the empty room was about 9.5 ns, which dropped to 6.5 ns for the case of furnished room. Additionally, to evaluate the accuracy of the model we approximated the PDFs of 𝜏RMS and OPL by Gaussian distributions, where the RMSE value was less than a standard error limit of 0.05. We showed that in the case of Rx's orientation and including user mobility, OPL can be found as a Gaussian model with the mean value of 62 dB which expresses the feasibility of OVLC-based D2D communications in indoor environments.

Fig. 1 .Case 2 ,

 12 Fig. 1. The three-dimensional indoor environment and proposed scenario showing the locations of the Tx and the Rx.

Fig. 2 .

 2 Fig. 2. A model for mobile phone orientation: (a) normal position, (b) around z axis with angle of α, (c) around x axis with angle of β, and (d) around y axis with angle of γ (Ref. [21]).

Fig. 3 .

 3 Fig. 3. The PDF of tilt angle values around: (a) x, and (b) y axis in the cartesian coordinates, obtained from the model in [18].

Fig. 4 .

 4 Fig. 4. Modelling of user mobility: (a) Rayleigh distribution with σ = 0.5 assumed to be comparable with Case 1 where dTx-Rx = 0. 5 m, and (b) the map of user movement in the office for 30 positions.

Fig. 5 .Fig. 6 .

 56 Fig. 5. The normalized PDF for the Cases 1 and 2 for an empty room: (a) 𝜏RMS, and (b) OPL.

Fig. 7 .

 7 Fig. 7. The normalized PDF for Cases 2 for the empty and furnished rooms: (a) 𝜏RMS, and (b) OPL.

Fig. 8 .

 8 Fig. 8. The normalized PDF for the cases 2 and 3 for : (a) 𝜏RMS , and (b) OPL.

Table 1 . The system parameters

 1

		N
	( )	i	(	i	),
	i	1

Table 2 .

 2 Numerical modelling parameters for𝜏RMS.

	Scenario	Parameter
	Case 2-furnished
	a1	0.22
	b1	6.78
	c1	2.55
	Case 3-furnished
	a1	0.24
	b1	6.99
	c1	2.41

Table 3 . Numerical modelling parameters for OPL.

 3

	Scenario	Parameter
	Case 2-furnished
	a1	0.17

Table 4 . A comparison of the maximum PDF values for 𝜏RMS and OPL for all three cases.

 4

	Scenario	Maximum PDF
		OPL (dB)	𝜏RMS (ns)
	Case 1-empty	60.5	7.5
	Case 1-furnished	61	7.5
	Case 2-empty	59	9.5
	Case 2-furnished	60	6.78
	Case 3-furnished	62	6.99

Acknowledgement

This work is supported by the European Union's Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement no 764461 (VISION), and COST Action CA19111 NEWFOCUS. The work of Zahra Nazari Chaleshtori was supported by CTU project SGS20/166/OHK3/3T/13.