Romain Vullo
email: romain.vullo@univ-rennes1.fr

Nathalie Bardet

Emmanuel Gheerbrant

Nour-Eddine Eddine Jalil

Nour - Eddine Jalil

Multicuspid tooth morphology in a gigantic Palaeocene pycnodont fish: evolutionary and palaeoecological significance

de niveau recherche, publiés ou non, émanant des établissements d'enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Actinopterygii; Pycnodontiformes; Dentition; Trophic specialization; Paleogene; Morocco

Introduction

Multicuspid teeth are known in various, distantly related groups of both extinct and living fishes and are generally indicative of algivorous/herbivorous diets (e.g., [START_REF] Gibson | Evidence of a specialized feeding niche in a Late Triassic ray-finned fish: evolution of multidenticulate teeth and benthic scraping in †Hemicalypterus[END_REF]Davis et al. 2016). Despite a rich fossil record and a high ecomorphological diversity, no true multicuspid teeth have been clearly reported among pycnodont fishes, a widespread group known from the Upper Triassic to the Eocene. The anterior dentition of pycnodonts consists of monocuspid or slightly bifid prehensile teeth, very flattened and fully incisiform in derived taxa [START_REF] Nursall | Abrahão VP and Espíndola VC (2017a) Hyphessobrycon platyodus (Teleostei: Characiformes), a new species from the Rio Madeira basin, Brazil, with comments on how multicuspid teeth relate to feeding habits in Characidae[END_REF][START_REF] Wenz | A new insight into pycnodontiform fishes[END_REF][START_REF] Kriwet | A comprehensive study of the skull and dentition of pycnodont fishes[END_REF][START_REF] Fj | Pycnodont fishes: morphologic variation, ecomorphologic plasticity and a new interpretation of their evolutionary history[END_REF][START_REF]History of two lineages: Comparative analysis of the fossil record in Amiiformes and Pycnodontiformes (Osteichthyes, Actinopterygii)[END_REF]. Nevertheless, Kriwet (2005: fig. 42e) figured dentary teeth of Nursallia with slightly incised crowns. In addition, the possible pycnodontiform genera

Stephanodus and Hadrodus have large, broad incisiform teeth with, respectively, a denticulated occlusal edge (e.g., Zittel, 1888: fig. 310;Cappetta, 1972: pl. 13, figs 1-3) and a bicuspid crown (e.g., Leidy, 1873: pl. 19, figs. 17-20;Bell, 1986: fig. 2.4-6).

The well-known Late Cretaceous (Maastrichtian) and Paleogene (Danian-Ypresian) phosphate deposits of the Ouled Abdoun Basin (Morocco) have yielded abundant and diverse vertebrate remains, including many marine fish taxa [START_REF] Arambourg | Les vertébrés fossiles des gisements de phosphates (Maroc -Algérie -Tunisie)[END_REF][START_REF] Bardet | Les vertébrés des phosphates crétacés-paléogènes (72,1-47,8 Ma) du Maroc[END_REF]).

Among them, pycnodont fishes are well represented, with Phacodus and Eoserrasalmimus in the Maastrichtian, and Pycnodus and Serrasalmimus in the Paleogene [START_REF] Arambourg | Les vertébrés fossiles des gisements de phosphates (Maroc -Algérie -Tunisie)[END_REF][START_REF] Kriwet | A comprehensive study of the skull and dentition of pycnodont fishes[END_REF][START_REF] Vullo | A unique Cretaceous-Paleogene lineage of piranha-jawed pycnodont fishes[END_REF]. In addition, the enigmatic genera Stephanodus and Hadrodus are two other possible pycnodontiforms present in the Maastrichtian beds of the Ouled Abdoun Basin [START_REF] Arambourg | Les vertébrés fossiles des gisements de phosphates (Maroc -Algérie -Tunisie)[END_REF][START_REF] Arambourg | Sur la présence d'un poisson du genre Hadrodus dans les phosphates maestrichtiens du Maroc : H. belinkoi nov. sp[END_REF]. We describe here two large pycnodontid premaxillary teeth from the Thanetian of the Ouled Abdoun Basin. Both specimens show a similar incisor-like morphology; however, while the tooth crown of the first specimen (tentatively referred to Pycnodus cf. praecursor) shows a non-incised occlusal margin, the second specimen is characterized by a multicuspid crown and is assigned to a new species (Pycnodus multicuspidatus sp. nov.). These two specimens illustrate the evolutionary transition between the typical pycnodont morphotype and a new, previously undescribed adaptive form. This discovery suggests that the regulatory pathways that govern tooth shape formation and lead to multicuspid teeth in teleostean fishes may have been present in nonteleost actinopterygians such as pycnodontiforms.

Systematic palaeontology

ACTINOPTERYGII Cope, 1887 NEOPTERYGII Regan, 1923PYCNODONTIFORMES Berg, 1937PYCNODONTIDAE Agassiz, 1833(sensu Nursall, 1996) PYCNODONTINAE [START_REF] Agassiz | Tableau synoptique des familles, des genres et des espèces de l'ordre des Ganoïdes[END_REF](sensu Poyato-Ariza & Wenz, 2002) Pycnodus cf. praecursor Dartevelle & Casier, 1949 (Fig. 1a-d [START_REF] Kocsis | Comprehensive stable isotope investigation of marine biogenic apatite from the late Cretaceous-early Eocene phosphate series of Morocco[END_REF].

Description. MHNM.KHG229 is a nearly complete left premaxilla with one tooth preserved (mesial tooth). A second, lateral tooth, broken at its base, was originally present.

The preserved tooth crown is wider than high (see Table 1 for measurements). It is spatulate, typically incisiform in shape, with a markedly convex and asymmetrical occlusal margin in labiolingual view. The occlusal margin is continuous, i.e. not incised. The labial face is convex and shows a dozen slight subvertical folds. The lingual face is concave and bears three wear facets. There is a high, well-developed tooth neck. The subvertical ascending premaxillary process is broken apically (dorsally). There is no fenestra, but a large mesiolingual olfactory fossa is present; this depression was forming part of the nasal capsule, together with the olfactory fossa of the mesethmoid.

Remarks. Features of the premaxilla (i.e., two teeth originally present, elongated and almost vertical ascending process, large olfactory fossa for the nasal capsule) combined with the typical incisiform shape of the preserved tooth clearly indicate that MHNM.KHG229 belongs to Pycnodontidae [START_REF] Wenz | A new insight into pycnodontiform fishes[END_REF][START_REF] Kriwet | A comprehensive study of the skull and dentition of pycnodont fishes[END_REF]. The well-developed olfactory fossa is similar in size, shape, and position to the pocket described in the premaxilla of Hadrodus marshi (Gregory, 1950: fig. 1a). By its size, MHNM.KHG229 might correspond to the premaxilla of Pycnodus praecursor, a large to gigantic species from the Paleocene of Africa (Angola, Niger) known only by isolated dentitions (Dartevelle & Casier, 1949;[START_REF] Cappetta | Les poissons crétacés et tertiaires du Bassin des Iullemmeden (République du Niger)[END_REF]. MHNM.KHG229 is therefore tentatively assigned to Pycnodus cf.

praecursor. A large fragmentary prearticular dentition from Paleocene of Togo, described as Pycnodus variabilis var. togoensis [START_REF] Stromer | Reptilien-und Fischreste aus dem marinen Alttertiär von Südtogo (Westafrika)[END_REF] Description. MHNM.KHG230 is a fragmentary left premaxilla with one tooth preserved (mesial tooth). The lateral part (originally bearing a second, lateral tooth) of the bone is broken and worn. The labiolingually compressed, spatulate tooth crown is wider that high (see Table 1 for measurements). The crown is multicuspid, with seven well-defined cusps and a pair of poorly-defined lateral cuspules. The cusps are triangular in shape and equally developed, albeit slightly decreasing in size laterally. The cuspidate occlusal margin is markedly convex in labiolingual view. There is a well-developed, lingually inflated tooth neck. The mesiolingual olfactory fossa can be discerned along the poorly preserved ascending premaxillary process. There is no fenestra.

Remarks. With the exception of the well-preserved tooth, MHNM.KHG230 is less complete and more abraded than MHNM.KHG229; although MHNM.KHG230 clearly differs from MHNM.KHG229 by the polycuspidation of teeth, both specimens are similar in size and gross morphology (Fig. 1, Table 1), indicating that they belong to distinct but closely related species.

Discussion

3.a. Tooth shape development and evolution

Several studies have argued that only simple genetic changes were required for the rise of multicuspid teeth in the evolution of fishes [START_REF] Streelman | The cusp of evolution and development: a model of cichlid tooth shape diversity[END_REF][START_REF] Streelman | Evolution of novelty in the cichlid dentition[END_REF][START_REF] Jackman | Manipulation of Fgf and Bmp signaling in teleost fishes suggests potential pathways for the evolutionary origin of multicuspid teeth[END_REF]. In their study on living African cichlids, Albertson et al. (2003a) found that interspecific differences in cusp number are determined by approximately one gene, suggesting that this character has the potential to respond to selection extremely quickly. A similar simple genetic basis of evolutionary novelty in the front dentition of pycnodontids can be assumed here, as suggested by the overall resemblance between specimens MHNM.KHG229 and MHNM.KHG230 as well as by the co-occurrence of the ancestral (MHNM.KHG229) and derived (MHNM.KHG230) morphotypes in the Thanetian strata of the Ouled Abdoun Basin. The peculiar tooth morphotype MHNM.KHG230 appears to be directly derived from the plesiomorphic monocuspid tooth morphotype MHNM.KHG229, and this may represent a case of punctuated equilibrium, with speciation between Pycnodus cf. praecursor and Pycnodus multicuspidatus sp. nov. by "budding cladogenesis" (Wagner, 2000).

Whether multicuspid teeth have arisen during fish evolution either by concrescence, or by differentiation of tooth germs, is still debated [START_REF] Trapani | Ontogenetic transition from unicuspid to multicuspid oral dentition in a teleost fish: Astyanax mexicanus, the Mexican tetra (Ostariophysi: Characidae)[END_REF][START_REF] Jernvall | Tooth shape formation and tooth renewal: evolving with the same signals[END_REF][START_REF] Jackman | Manipulation of Fgf and Bmp signaling in teleost fishes suggests potential pathways for the evolutionary origin of multicuspid teeth[END_REF]). However, this mainly concerns teleost taxa with numerous minute, closely-spaced teeth [START_REF] Trapani | Ontogenetic transition from unicuspid to multicuspid oral dentition in a teleost fish: Astyanax mexicanus, the Mexican tetra (Ostariophysi: Characidae)[END_REF][START_REF] Jackman | Manipulation of Fgf and Bmp signaling in teleost fishes suggests potential pathways for the evolutionary origin of multicuspid teeth[END_REF]). In the fossil record, the oldest evidence of similar increase in cusp number (from mono-or bicuspid to multicuspid small incisiform teeth) is known between two Late Triassic non-teleostean neopterygians, i.e. the dapediids Sargodon [START_REF] Tintori | Hypsisomatic Semionotidae (Pisces, Actinopterygii) from the Upper Triassic of Lombardy (N. Italy)[END_REF][START_REF] Tintori | Fish biodiversity in the marine Norian (Late Triassic) of northern Italy: The first neopterygian radiation[END_REF] and Hemicalypterus [START_REF] Gibson | Evidence of a specialized feeding niche in a Late Triassic ray-finned fish: evolution of multidenticulate teeth and benthic scraping in †Hemicalypterus[END_REF][START_REF] Gibson | Redescription and phylogenetic placement of †Hemicalypterus weiri Schaeffer, 1967 (Actinopterygii, Neopterygii) from the Triassic Chinle Formation, southwestern United States: new insights into morphology, ecological niche, and phylogeny[END_REF].

In pycnodontiform fishes, the number of premaxillary and dentary teeth never exceeds three and five, respectively [START_REF] Wenz | A new insight into pycnodontiform fishes[END_REF]. In Pycnodus and other derived pycnodontids, these bones bear two monocuspid incisiform teeth [START_REF] Nursall | Abrahão VP and Espíndola VC (2017a) Hyphessobrycon platyodus (Teleostei: Characiformes), a new species from the Rio Madeira basin, Brazil, with comments on how multicuspid teeth relate to feeding habits in Characidae[END_REF][START_REF] Wenz | A new insight into pycnodontiform fishes[END_REF], except Polazzodus, Sylvienodus, and Tergestinia, which have a premaxilla bearing a single tooth [START_REF] Capasso | Tergestinia sorbinii gen. nov., sp. nov., del Paleocene inferior di Trebiciano, Trieste (Pisces, Pycnodontiformes)[END_REF][START_REF] Fj | Polazzodus, gen. nov., a new pycnodont fish from the Late Cretaceous of northeastern Italy[END_REF], 2013). Therefore, it is obvious that the nine-cusped tooth of Pycnodus multicuspidatus sp. nov. described here arose from complex folding of a single tooth germ (Differentiation Theory) rather than from early fusion of several tooth germs (Concrescence Theory). This interpretation is clearly supported by the equally-sized premaxillary tooth MHNM.KHG229, which shows a similar overall morphology and differs only by its simple, non-incised crown contour (ancestral condition).

During the development of mammalian teeth, the folding of the enamel epithelium leading to the formation of multicuspid crowns is regulated by signaling centers called secondary enamel knots [START_REF] Jernvall | Evidence for the role of the enamel knot as a control center in mammalian tooth cusp formation: nondividing cells express growth stimulating Fgf-4 gene[END_REF][START_REF] Vaatokari | The enamel knot as a signaling center in the developing mouse tooth[END_REF]. The presence of enamel knot-like signaling centers controlling the cusp number in teleostean fishes has been suggested by several authors [START_REF] Streelman | The cusp of evolution and development: a model of cichlid tooth shape diversity[END_REF][START_REF] Jernvall | Tooth shape formation and tooth renewal: evolving with the same signals[END_REF][START_REF] Fraser | A periodic pattern generator for dental diversity[END_REF][START_REF] Fraser | Common developmental pathways link tooth shape to regeneration[END_REF][START_REF] Atukorala | Spatial and temporal events in tooth development of Astyanax mexicanus[END_REF]Debiais-Thibaud et al. 2015). Recently, [START_REF] Smith | Making teeth to order: conserved genes reveal an ancient molecular pattern in paddlefish (Actinopterygii)[END_REF] showed that the development genes shh and bmp4 operating in the dentition of teleosts are similarly expressed in the dentition of the basal actinopterygian Polyodon, thus extending this conserved developmental pattern within the Actinopterygii. Therefore, the evolutionary transition observed between the monocuspid pycnodont tooth MHNM.KHG229 and the multicuspid pycnodont tooth MHNM.KHG230 may be explained by minor genetic changes leading to the formation of secondary enamel knot-like structures in the derived form, as for the difference in cusp number observed today between the adult teeth of two closely related species of cichlid fishes, i.e. Metriaclima zebra and Labeotropheus fuelleborni (Albertson et al. 2003a,b;[START_REF] Streelman | The cusp of evolution and development: a model of cichlid tooth shape diversity[END_REF]. The symmetrical formation of four lateral cusps on each side of the central cusp of MHNM.KHG230 could be compared with that of the tricuspid teeth of Labeotropheus fuelleborni, which is due to the uniform development of secondary enamel knots (and thus lateral cusps) on both the mesial and distal sides of the central cusp [START_REF] Streelman | The cusp of evolution and development: a model of cichlid tooth shape diversity[END_REF].

3.b. Feeding habits and palaeoecological implications

The large size of MHNM.KHG230 contrasts with the diminutive size characterizing the multicuspid teeth of many modern fish taxa [START_REF] Jernvall | Tooth shape formation and tooth renewal: evolving with the same signals[END_REF]. However, the dental morphology observed in MHNM.KHG230 is strikingly similar to that observed in modern algivorous/herbivorous forms, such the characids Hemigrammus, Hyphessobrycon and Phycocharax [START_REF] Lima | Hemigrammus arua, a new species of characid (Characiformes: Characidae) from the lower Amazon, Brazil[END_REF]Ohara et al. 2017a,b), the acanthurid Acanthurus nigrofuscus (Fishelson & Delarea, 2013), the sparid Crenidens (Fishelson et al. 2014), the terapontid Helotes (Davis et al. 2016) and the cichlid Labeotropheus [START_REF] Fraser | A periodic pattern generator for dental diversity[END_REF]. Interestingly, a similar tooth morphology is also found in various groups of herbivorous reptiles, such as pareiasaurs (e.g., [START_REF] Jalil | Les pareiasaures (Amniota, Parareptilia) du Permien supérieur du Bassin d'Argana[END_REF][START_REF] Tsuji | Anatomy, cranial ontogeny and phylogenetic relationships of the pareiasaur Deltavjatia rossicus from the Late Permian of central Russia[END_REF], ankylosaurian dinosaurs (Ősi et al. 2017), the extinct crocodyliform Simosuchus [START_REF] Kley | Craniofacial morphology of Simosuchus clarki (Crocodyliformes: Notosuchia) from the Late Cretaceous of Madagascar[END_REF], and the algae-eating Galápagos marine iguana Amblyrhynchus [START_REF] Melstrom | The relationship between diet and tooth complexity in living dentigerous saurian[END_REF]. Among mammals, similar fanshaped multicuspid incisors are present in an extinct macroscelidid tentatively referred to Miorhynchocyon gariepensis [START_REF] Senut | The Macroscelididae from the Miocene of the Orange River, Namibia[END_REF] and in some hyracoids (De Blieux & Simons, 2002).

Although the vomerine and prearticular dentitions of Pycnodus multicuspidatus sp. nov. still remain unknown and may have had a crushing function, all these morphological similarities clearly indicate that at least one pycnodontine species have evolved an anterior dentition well suited for benthic macroalgal scraping. Pycnodus multicuspidatus sp. nov. was likely able to feed on the heavily calcified macroalga Halimeda, a chlorophyte abounding in the shallow marine ramp facies of the Paleogene formations of the central High Atlas (Dragastan & Herbig, 2007).

The multicuspid incisiform teeth of Pycnodus multicuspidatus sp. nov. are rather similar to those of the front dentition of Stephanodus splendens and Hadrodus belinkoi, two putative pycnodontiform taxa occurring in the underlying Maastrichtian strata of the Ouled Abdoun Basin [START_REF] Arambourg | Les vertébrés fossiles des gisements de phosphates (Maroc -Algérie -Tunisie)[END_REF][START_REF] Arambourg | Sur la présence d'un poisson du genre Hadrodus dans les phosphates maestrichtiens du Maroc : H. belinkoi nov. sp[END_REF]. However, the incisiform teeth of Stephanodus and Hadrodus can be easily distinguished from those of Pycnodus multicuspidatus sp. nov. The incisiform teeth of Stephanodus have a lower crown with a rectilinear or slightly concave occlusal margin showing numerous (up to 14), smaller cuspules (Zittel, 1888: fig. 310;White, 1934: pl. 10, fig. 11;Cappetta, 1972: pl. 13, fig. 1-3). The incisiform teeth of Hadrodus are usually bifid, with a crown showing two well-separated and well-developed cusps sometimes flanked by one or two additional cuspules in dentary teeth [START_REF] Arambourg | Sur la présence d'un poisson du genre Hadrodus dans les phosphates maestrichtiens du Maroc : H. belinkoi nov. sp[END_REF][START_REF] Bell | A pycnodont fish from the Upper Cretaceous of Alabama[END_REF]. As suggested by the heterodonty observed between premaxillary and dentary teeth of Hadrodus hewletti (Bell, 1986: fig. 2.4-6), teeth of Hadrodus belinkoi and Stephanodus splendens may correspond, respectively, to premaxillary and dentary teeth of the same species (with large hook-shaped branchial teeth originally described under the name Ancistrodon libycus; Dames, 1883;[START_REF] Arambourg | Les vertébrés fossiles des gisements de phosphates (Maroc -Algérie -Tunisie)[END_REF]. A complete systematic revision of this group of putative pycnodonts is clearly needed but is beyond the scope of this paper; therefore, pending further investigation, Hadrodus belinkoi and Stephanodus splendens are considered here as two distinct taxa.

In the Paleocene epicontinental seas of Morocco, Pycnodus multicuspidatus sp. nov. may have occupied, by opportunistic replacement, the trophic niche filled by Stephanodus and Hadrodus before the K/Pg boundary and vacated by the end-Cretaceous extinction of these two taxa (Fig. 2). This case of parallelism emphasizes the high morphological plasticity of pycnodont fishes and their ability to adapt to sudden palaeoenvironmental and palaeoecological changes [START_REF] Fj | Pycnodont fishes: morphologic variation, ecomorphologic plasticity and a new interpretation of their evolutionary history[END_REF]. Pycnodont fishes appear to have been trophically diverse in the Ouled Abdoun Basin ecosystem during the Paleogene, with generalist, shell-crushing forms (Pycnodus spp., including P. cf. praecursor), a macroalgal scraper (Pycnodus multicuspidatus sp. nov.), and a predatory, flesh-eating form (Serrasalmimus secans).

  fig. 2), might correspond to the same taxon. Pycnodus multicuspidatus sp. nov. (Fig. 1e-h) Holotype and only known specimen. MHNM.KHG230, a fragmentary left premaxilla with one tooth preserved, housed at the Muséum d'Histoire naturelle de Marrakech (MHNM). Locality and horizon. Sidi Daoui area, Ouled Abdoun Basin, Province of Khouribga, Morocco. Upper Phosphorite Bed IIa-base of the Intercalary Bed II/I interval, Thanetian (Paleocene) in age (Kocsis et al. 2014). Diagnosis. Large to gigantic species of Pycnodus with incisiform premaxillary teeth characterized by a deeply incised, multicuspid crown showing nine triangular cusps.

Fig. 1 .

 1 Fig. 1. Left premaxillae of Pycnodus cf. praecursor (MHNM.KHG229) (a-d) and P.

Fig. 2 .

 2 Fig. 2. End-Cretaceous extinction of the macroalgal scrapers Stephanodus and Hadrodus

  )

	Locality and horizon. Sidi Daoui area, Ouled Abdoun Basin, Province of Khouribga,
	Morocco. Upper Phosphorite Bed IIa-base of the Intercalary Bed II/I interval, Thanetian
	(Paleocene) in age
	Material. MHNM.KHG229, a left premaxilla with one tooth preserved, housed at the
	Muséum d'Histoire naturelle de Marrakech (MHNM).

Table 1 .

 1 Measurements (in mm) of specimens MHNM.KHG229 and MHNM.KHG230. MHNM.KHG229, left premaxilla of Pycnodus cf.

			MHNM.KHG230, left
			premaxilla of Pycnodus
		praecursor	multicuspidatus sp. nov.
	Total height (as preserved)	50.9	38.1
	Tooth width	15.7	16.6
	Tooth height (crown,	10.4	10.1
	without tooth neck)
	Tooth height (including	17.8	14.6
	tooth neck)
	Tooth thickness	6.3	6.2

Acknowledgements. We would like to thank Patrick Catto for kindly donating the holotype of the new species described in this paper, and Damien Gendry for his help with the photographs of the specimens.


Daniela Yassuda Yamashita

Member, IEEE Jean-Paul Gaubert

Samuel Jupin

Hierarchical Model Predictive Control to Coordinate a Vehicle-to-Grid System Coupled to Building Microgrids

Keywords: Model Predictive Control, Electric Vehicles, Building microgrid, self-consumption, economic analysis I

Aiming to take full advantage of Electric Vehicles' (EVs) batteries, this paper proposes a two-level hierarchical model predictive controller coupled with an innovative charging-discharging scheduler for EVs in Building Microgrids (BMGs). This paper provides a complete framework for the design of this control structure and analyses its performance regarding the state of charge of the EVs at departure time, the self-consumption rate, and the coverage rate, considering a residential BMG equipped with photovoltaic panels and static Li-ion batteries. The results and performance of the proposed control architecture are compared to two other solutions: a hierarchical predictive controller with no scheduler and a rule-based algorithm. A technological and economical study is also performed considering variables such as the dimension of the EV's park, the price of energy, the cost of maintenance, the possibility to discharge or not into the grid, and the execution time of the control architecture. The simulation results conducted in MATLAB Simulink demonstrated that the proposed control structure ensures the full charging of all vehicles at departure time while also improving the self-consumption rate of the BMG with a relatively low stress on the needed computation capacities, even when considering a large fleet of vehicles.

INTRODUCTION

ITH the fast electrification in the transportation sector, Electric Vehicles (EVs) play a critical role in meeting the environmental goals to address climate change [START_REF]Global EV Outlook 0 0 -prospects for electrification in transport in the coming decade[END_REF]. However, without appropriate coordination of EV charging, the sharp increase of EV fleets [START_REF] Muratori | The rise of electric vehicles-2020 status and future expectations[END_REF] can introduce harmful effects on the grid stability, such as overload of transformers and power quality issues [START_REF] Zheng | Integrating plug-in electric vehicles into power grids_ A comprehensive review on power interaction mode, scheduling methodology and mathematical foundation[END_REF]- [START_REF] Gilleran | Impact of electric vehicle charging on the power demand of retail buildings[END_REF]. To adapt the current grid to this new paradigm, EVs in the bidirectional Vehicle-to-Grid (V2G) configuration have emerged as a promising strategy to reduce the negative effects of EV surge [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF]- [START_REF] Van Der | Smart charging of electric vehicles with photovoltaic power and vehicle-to-grid technology in a microgrid; a case study[END_REF]. Variations on this approach also exist, such as Vehicle to Building [START_REF] Barone | Increasing self-consumption of renewable energy through the Building to Vehicle to Building approach applied to multiple users connected in a virtual micro-grid[END_REF], [START_REF] Buonomano | Building to Vehicle to Building concept: A comprehensive parametric and sensitivity analysis for decision making aims[END_REF] and Vehicle to Home [START_REF] Borge-Diez | Combined vehicle to building (V2B) and vehicle to home (V2H) strategy to increase electric vehicle market share[END_REF]. This is because V2G technology enables EVs to be employed as both a flexible load and an Energy Storage System (ESS) [START_REF] Verma | A comprehensive review on energy storage in hybrid electric vehicle[END_REF].

Consequently, while parked, EV's batteries can provide some grid services to assist the integration of Renewable Energy Sources (RES) into the electrical grid that struggles with volatility in the power imbalance. EVs' batteries can be discharged to supply the local demand and can be charged to avoid the injection of RES energy surplus. Particularly, since EVs are parked for more than 90% of their lifetime, their batteries can be coupled to buildings' parking lots equipped with RES such as roof-top photovoltaic (PV) panels [START_REF] Zhou | An energy paradigm transition framework from negative towards positive district energy sharing networks-Battery cycling aging, advanced battery management strategies, flexible vehicles-to-buildings interactions, uncertainty and sensitivity analysis[END_REF]. This grid topology -known as Building Microgrid (BMG)facilitates EVs' owners to charge their vehicles' batteries with clean energy while at the same time reducing the drawbacks created by unpredictable RES energy generation. Nonetheless, the design of a Building Energy Management System (BEMS) is required to properly coordinate the charging-discharging of EVs to improve the BMG's PV selfconsumption and assure that all EVs are completely charged before their departure time [START_REF] Zheng | Integrating plug-in electric vehicles into power grids_ A comprehensive review on power interaction mode, scheduling methodology and mathematical foundation[END_REF].

In the literature, there are many strategies to coordinate the charging-discharging of EVs to promote PV selfconsumption in buildings [START_REF] Barone | Increasing self-consumption of renewable energy through the Building to Vehicle to Building approach applied to multiple users connected in a virtual micro-grid[END_REF], [START_REF] Borge-Diez | Combined vehicle to building (V2B) and vehicle to home (V2H) strategy to increase electric vehicle market share[END_REF], [START_REF] Jin | Hierarchical Management for Building Microgrid Considering Virtual Storage System and Plug-in Electric Vehicles[END_REF]- [START_REF] Farinis | Integrated energy management system for Microgrids of building prosumers[END_REF]. To assure that all EVs are fully charged and to maximise the PV selfconsumption, the BEMS are usually divided twofold [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF], [START_REF] Van Der | Smart charging of electric vehicles with photovoltaic power and vehicle-to-grid technology in a microgrid; a case study[END_REF]: a central unit to optimise the BMG power flow, and a realtime module to charge and discharge each EV according to a priority order [START_REF] Wu | Hierarchical Operation of Electric Vehicle Charging Station in Smart Grid Integration Applications -An Overview[END_REF]. However, the aleatory disconnection of EVs is hardly taken into account. In fact, a variety of algorithms incorporating machine learning and other prediction techniques are emerging to be added to the main energy management system to predict the availability of the EVs [START_REF] Lamedica | An energy management software for smart buildings with V G and BESS[END_REF], [START_REF] Wu | Charging demand forecasting of electric vehicles considering uncertainties in a microgrid[END_REF]. Additionally, when dealing with large EV fleets, the computation burden is the main issue of power flow optimisation [START_REF] Zheng | Integrating plug-in electric vehicles into power grids_ A comprehensive review on power interaction mode, scheduling methodology and mathematical foundation[END_REF], [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF], limiting the BMG power flow to be optimised only once a day. Alternatively, simple on-board strategies to EVs' power allocation exist [START_REF] Liu | A Heuristic Operation Strategy for Commercial Building Microgrids Containing EVs and PV System[END_REF], but they consider neither prediction data nor uncertainty in EVs' disconnection nor the use of another type of ESS. These solutions tackle complex micro-grids with a low computational effort, but they cannot handle their stochastic nature, therefore leading to non-optimal solutions.

Aiming at maximising PV self-consumption in BMG under stochasticity in prediction data, a two-level Model Predictive Controller (MPC) empowered with a light Electric Vehicle Power Allocation (EVPA) module was designed. Contrary to many studies [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF], [START_REF] Tavakoli | A two stage hierarchical control approach for the optimal energy management in commercial building microgrids based on local wind power and PEVs[END_REF], the innovation of the proposed controller is that no parameter needs to be tuned to maximise the self-consumption rate and guarantee the full charging of EV fleets. The capabilities and robustness of the proposed hierarchical controller were assessed through simulations in MATLAB Simulink of a real-sized residential BMG equipped with PV, Li-ion batteries, and an EV parking with 4, 20, or 40 vehicles. Furthermore, this paper quantifies the additional degradation rate of EVs' batteries when they are discharged to supply the building energy demand and identifies a type of remuneration to foster EVs' owners to authorise using their EVs' batteries to promote selfconsumption in BMGs. As extension of the authors' previous work [START_REF] Yamashita | Hierarchical Coordination of a Vehicle-to-Grid System to Improve Selfconsumption in Building MicroGrids[END_REF], a sensitivity analysis on the electricity price and EV batteries price is conducted in order to identify the prices that would be economically advantageous to discharge the EVs batteries on behalf of the building energy demand. A complete economic and energetic study was led on these topics applied to the specific case study of the residential building. The results show two major conclusions: first, the W algorithm proposed and the suggested association of centralized units of control around the main MPC controller is efficient and behaves better than the all-in-one structure often presented in BEMS [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF]- [START_REF] Van Der | Smart charging of electric vehicles with photovoltaic power and vehicle-to-grid technology in a microgrid; a case study[END_REF], [START_REF] Liu | A Heuristic Operation Strategy for Commercial Building Microgrids Containing EVs and PV System[END_REF]. Second, the choice of a residential building with intermittent solar power is not the most optimal one. In fact, a building where EVs park during the day would be much more remarkable when it comes to studying the interests of combining EVs to BMS.

The remainder of this paper is structured as follows. Section II presents the BMG understudy and the design of the hierarchical MPC. Section III details the proposed EVPA algorithm by highlighting its interaction with the two-level MPC. Section IV presents the simulation results with discussions over the system performance, comparing three different control structures with each other, considering the total grid energy exchange, building energy cost, and final EV users' interests. Finally, Section V concludes the paper with a discussion over the main results.

II. HIERARCHICAL MODEL PREDICTIVE CONTROLLER

As shown in Fig. 1, the BMG counts on static Li-ion batteries and a parking with up to 𝑁 𝐸𝑉 EVs to supply its local demand as much as possible with PV energy generated locally. The proposed hierarchical BEMS -designed in C++ language -is composed of three control levels 5) -( 16)

(1)
With this formulation, the BMG uses its ESS to maximise the PV self-consumption (𝜏 𝑠𝑐 ) and coverage (𝜏 𝑐 ) rates defined by [START_REF] Muratori | The rise of electric vehicles-2020 status and future expectations[END_REF] and illustrated in Fig. 2, avoiding importing (𝐸 𝑔𝑟𝑖𝑑,𝑘 𝑖𝑚𝑝𝑜𝑟𝑡 ) and exporting energy (𝐸 𝑔𝑟𝑖𝑑,𝑘 𝑒𝑥𝑝𝑜𝑟𝑡 ). It minimizes the grid energy exchange by defining the setpoints for the batteries SoC and EV energy stored for the next 48 hours. The EMPC is an asynchronous control unit updated every midnight or when the gap between the expected grid exchange calculated by the EMPC internal models and the real one measured by the smart meter is higher than a pre-defined threshold (i.e. 7%).

The errors in the EMPC's prediction states can come from either stochasticity in the power imbalance, imprecisions in the ESS's internal model, or unexpected EVs disconnection. The horizon of the EMPC is 48 hours ahead to consider the daily PV power fluctuations and avoid depleting the static Liion battery. Since the Li-ion batteries were sized to be completed charged and discharged during a day to avoid wasting energy due to self-discharging [START_REF] Ouramdane | Optimal sizing of domestic grid-connected microgrid maximizing self consumption and battery lifespan⋆[END_REF], the daily optimization of (1) will prevent the BMG from ending the day with static batteries completely discharged.

𝜏 𝑠𝑐 = 1 - ∑|𝐸 𝑔𝑟𝑖𝑑,𝑘 𝑖𝑚𝑝𝑜𝑟𝑡 | ∑ 𝐸 𝑝𝑣 ; 𝜏 𝑐 = 1 - ∑|𝐸 𝑔𝑟𝑖𝑑,,𝑘 𝑒𝑥𝑝𝑜𝑟𝑡 | ∑ 𝐸 𝑐𝑜𝑛𝑠 (2)
Fig. 2: Definition of self-consumption and coverage rate for a building microgrid.

Meanwhile, TMPC follows 𝑆𝑜𝐶 𝑏𝑎𝑡 𝑟𝑒𝑓 and 𝐸 𝐸𝑉 𝑟𝑒𝑓 determined by the EMPC. It calculates the power references for batteries (𝑃 𝐵𝐴𝑇 𝑐ℎ and 𝑃 𝐵𝐴𝑇 𝑑𝑖𝑠 ) and for the entire EV parking (𝑃 𝐸𝑉𝑠 𝑐ℎ and 𝑃 𝐸𝑉𝑠 𝑑𝑖𝑠 ) based on the updated prediction data and SoC measurements. Therefore, every hour, TMPC minimizes the error between the actual energy stored in ESSs and the EMPC setpoints, as defined in [START_REF] Sanguesa | A Review on Electric Vehicles: Technologies and Challenges[END_REF]. The tracking of the stored energy in the EV parking and the SoC of Li-ion batteries is implemented within a horizon of 6 hours ahead to reduce the required computation time, while considering reliable prediction data of the building power imbalance (𝑃 𝑃𝑉 -𝑃 𝑐𝑜𝑛𝑠 ). Therefore, before optimising (3), TMPC updates the SoC of Li-ion Batteries, the energy stored in the EV park with last data measurements. Additionally, the cost function expressed in ( 4) is normalised to make the error of each reference tracking between 0 and 1 by dividing each tracking error by its maximum values (𝐸 𝐸𝑉,𝑘 𝑚𝑎𝑥 and 𝑆𝑜𝐶 𝑏𝑎𝑡 𝑚𝑎𝑥 ). This normalization is important to make it independent of manually adjustable parameters, as in [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF]. Additionally, aiming to give more importance to the instantaneous references than the upcoming references, the quadratic errors are multiplied by the term (𝑁 ℎ 𝑇𝑀𝑃𝐶 -𝑘 -1) 2 , where 𝑁 ℎ is the TMPC horizon and 𝑘 is the time within the horizon window. 5) -( 16)

(4)
Both MPC objective functions have the same constraints to keep the safe operation of ESSs and respect the grid code for small prosumers in France [START_REF]Enedis l'électricité en réseau[END_REF]. In the first place, both MPCs must assure the energy balance by considering the equality constraint defined in [START_REF] Gilleran | Impact of electric vehicle charging on the power demand of retail buildings[END_REF], in which 𝑇 𝑠 is the time discretisation of the MPCs. The energy exchange between the external grid and the BMG has to be lower than the maximum supported by the infrastructure (𝐸 𝑔𝑟𝑖𝑑 𝑚𝑎𝑥 ). This limitation is modelled through the constraint expressed in [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF]. Furthermore, the charging and discharging of EV parking are limited by the maximum power rate of the aggregation of EVs ( 𝑃 𝐸𝑉 𝑚𝑎𝑥𝐶ℎ and 𝑃 𝐸𝑉 𝑚𝑎𝑥𝐷𝑖𝑠 ), as defined in [START_REF] Tavakoli | A two stage hierarchical control approach for the optimal energy management in commercial building microgrids based on local wind power and PEVs[END_REF] and [START_REF] Van Der | Smart charging of electric vehicles with photovoltaic power and vehicle-to-grid technology in a microgrid; a case study[END_REF]. The maximum power rate of EV parking is a variable that is updated by the EVPA module every hour.

To avoid taking advantages from fluctuations of electricity price, stationary batteries can be charged only with PV power surplus (𝑃 𝑐𝑜𝑛𝑠 ≤ 𝑃 𝑝𝑣 ) as specified in [START_REF] Barone | Increasing self-consumption of renewable energy through the Building to Vehicle to Building approach applied to multiple users connected in a virtual micro-grid[END_REF]. Meanwhile, they can only be discharged to supply the local power demand (𝑃 𝑐𝑜𝑛𝑠 ) or charge EVs (𝑃 𝐸𝑉,𝑘 𝑐ℎ ), as expressed in [START_REF] Buonomano | Building to Vehicle to Building concept: A comprehensive parametric and sensitivity analysis for decision making aims[END_REF]

The link between battery power and its SoC is defined by the linear equation [START_REF] Verma | A comprehensive review on energy storage in hybrid electric vehicle[END_REF], where the 𝑄 𝑛𝑜𝑚 𝑏𝑎𝑡 is the batteries nominal capacity in Ah, 𝑣 𝑛𝑜𝑚 𝑏𝑎𝑡 is the batteries nominal voltage, and 𝜂 𝑐ℎ 𝑏𝑎𝑡 and 𝜂 𝑑𝑖𝑠 𝑏𝑎𝑡 are the Li-ion batteries efficiency when the batteries are charging or discharging, respectively.

Remarkably, as in [START_REF] Tavakoli | A two stage hierarchical control approach for the optimal energy management in commercial building microgrids based on local wind power and PEVs[END_REF], to reduce computation burden, the two MPCs in cascade estimate the total energy stored in the aggregation of EVs ( 𝐸 𝐸𝑉,𝑘 ) rather than individual EVs. Therefore, only two inequalities constraints are embedded in the MPCs formulation to limit the EV parking SoC, as expressed in [START_REF] Zhou | An energy paradigm transition framework from negative towards positive district energy sharing networks-Battery cycling aging, advanced battery management strategies, flexible vehicles-to-buildings interactions, uncertainty and sensitivity analysis[END_REF]. In this equation, 𝑄 𝐸𝑉 𝑛𝑜𝑚 is the nominal capacity of an EV, 𝑣̅ 𝐸𝑉,𝑘 is the average voltage of EVs connected at instant 𝑘 , and 𝜂 𝑑𝑖𝑠 and 𝜂 𝑐ℎ are the batteries discharging and charging efficiency.

𝐸 𝐸𝑉,𝑘 𝑚𝑖𝑛 = 𝑄 𝐸𝑉 𝑛𝑜𝑚 • 𝑆𝑜𝐶 𝐸𝑉 𝑚𝑖𝑛 • 𝑛 𝐸𝑉,𝑘 ≤ 𝐸 𝐸𝑉,𝑘 - 𝜂 𝑐ℎ •𝑇 𝑠 𝑣 ̅ 𝐸𝑉,𝑘 𝑃 𝐸𝑉,𝑘 𝑐ℎ - 𝑇 𝑠 𝑣 ̅ 𝐸𝑉,𝑘 •𝜂 𝑑𝑖𝑠 𝑃 𝐸𝑉,𝑘 𝑑𝑖𝑠 + 𝐸 𝑘 𝑎𝑟𝑟 -𝐸 𝑘 𝑑𝑒𝑝 ≤ 𝑄 𝐸𝑉 𝑛𝑜𝑚 • 𝑆𝑜𝐶 𝐸𝑉 𝑚𝑎𝑥 • 𝑛 𝐸𝑉,𝑘 = 𝐸 𝐸𝑉,𝑘 𝑚𝑎𝑥 (13)
To assure that all EVs are charged with the request SoC (𝑆𝑜𝐶 𝑡𝑎𝑟𝑔𝑒𝑡 = 80%) before their scheduled departure, EMPC and TMPC modify their SoC boundaries ( 𝑆𝑜𝐶 𝐸𝑉 𝑚𝑖𝑛 and 𝑆𝑜𝐶 𝐸𝑉 𝑚𝑎𝑥 ) to force both to be 80% when any EV is planning to disconnect to the BMG. In other words, the maximum boundary (𝑆𝑜𝐶 𝐸𝑉 𝑚𝑎𝑥 ) is always equal to 80%, whereas the minimum boundary (𝑆𝑜𝐶 𝐸𝑉 𝑚𝑖𝑛 ) is adjusted following equation ( 14), where 𝑛 𝑘 𝑑𝑒𝑝 is the number of EVs that are going to disconnect at hour 𝑘.

𝑆𝑜𝐶 𝐸𝑉 𝑚𝑖𝑛 = { 20%, 𝑖𝑓 𝑛 𝑘 𝑑𝑒𝑝 = 0 𝑆𝑜𝐶 𝐸𝑉 𝑚𝑎𝑥 , 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 (14)
Notably, in equation ( 13), the stochastic arrival and departure of EVs are considered through the variables 𝐸 𝑘 𝑎𝑟𝑟 and 𝐸 𝑘 𝑑𝑒𝑝 , representing the energy arrived with new EVs connection (𝐸 𝑘 𝑎𝑟𝑟 ) and the energy departure with EVs when they are disconnected (𝐸 𝑘 𝑑𝑒𝑝 ). Calculated through equations ( 15) and ( 16), 𝐸 𝑘 𝑎𝑟𝑟 and 𝐸 𝑘 𝑑𝑒𝑝 are estimated based on the total number of EVs plugged (𝑛 𝐸𝑉,𝑘 ), EVs departures (𝑛 𝑘 𝑑𝑒𝑝 ) and EVs arrivals (𝑛 𝑘 𝑎𝑟𝑟 ).

𝐸 𝑘 𝑎𝑟𝑟 = 𝑛 𝑘 𝑎𝑟𝑟 • 𝑄 𝐸𝑉 𝑛𝑜𝑚 • 𝑆𝑜𝐶 ̂𝐸𝑉𝑠,𝑘 𝑎𝑟𝑟 (15)
𝐸 𝑘 𝑑𝑒𝑝 = 𝑛 𝑘 𝑑𝑒𝑝 • 𝐸 𝐸𝑉,𝑘 𝑛 𝐸𝑉,𝑘 ⁄ (16)
These three values can be easily calculated using a simple EV schedule table based only on the current number of EVs connected, the next EV connection, and the disconnection time inputted by EVs' owners. Nevertheless, this mechanism can be improved by including an analysis of EV's behaviour, as proposed in [START_REF] Chung | Ensemble machine learning-based algorithm for electric vehicle user behavior prediction[END_REF]. The EV arrival energy formulation (equation ( 15)) considers that all EVs have the same nominal capacity (𝑄 𝐸𝑉 𝑛𝑜𝑚 ). The SoC of future EVs arrivals (𝑆𝑜𝐶 ̂𝐸𝑉𝑠,𝑘 𝑎𝑟𝑟 ) are estimated through the average SoC of all past EV connections. On the other hand, the total energy lost due to EV departures (𝐸 𝑘 𝑑𝑒𝑝 ) corresponds to a proportion of the average charge of all EVs. This assumption is reasonable because the EVPA algorithm, detailed in section III, assures almost equitable SoC among all EVs.

III. ELECTRIC VEHICLE POWER ALLOCATION ALGORITHM

The EVPA operates in synchronism with the TMPC and it works as a router of energy to assure that all EVs are charged up to 𝑆𝑜𝐶 = 80% before their departure time using as much as possible renewable energy. In this paper, the

Using the margin time ( Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ ) defined by ( 21), the power-sharing weights (𝜔 𝐼𝐷 𝑐ℎ and 𝜔 𝐼𝐷 𝑑𝑖𝑠 ) are determined, as expressed in [START_REF]Enedis l'électricité en réseau[END_REF]. The Boolean variable 𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎 is equal to 1 when the 𝐸𝑉 𝐼𝐷 is waiting for a power reference assignation, and it is equal to 0 when a power reference has already been attributed to it. Since in the first iteration, no EV received a power reference, 𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎 equals 1 for all plugged 𝐸𝑉 𝐼𝐷 . Based on equations [START_REF] Liu | A Heuristic Operation Strategy for Commercial Building Microgrids Containing EVs and PV System[END_REF], when the EV parking is charging, EV power references (𝑃 𝐸𝑉 𝐼𝐷 ,𝑘 𝑐ℎ

) will be more important for EVs that have a small margin time Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ . Conversely, according to [START_REF] Yamashita | Hierarchical Coordination of a Vehicle-to-Grid System to Improve Selfconsumption in Building MicroGrids[END_REF], when discharging, EV power references (𝑃 𝐸𝑉 𝐼𝐷 ,𝑘

𝑑𝑖𝑠

) will be more intense for EVs that have a large margin time Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ .

Once determined the fraction of power that needs to be allocated to each plugged EV, the next step of the EVPA algorithm depends on the accuracy of the power-sharing weight of the previous step. As expressed in [START_REF] Chung | Ensemble machine learning-based algorithm for electric vehicle user behavior prediction[END_REF], if the HMPC power reference is completely allocated, the Boundaries Definition state is implemented; otherwise, the Retry state is executed. Based on equations ( 19) and ( 20), the Retry is executed if there would be EVs fully charged or fully discharged, or if the shared power would be limited by the power rate boundaries (𝑃 𝑝𝑒𝑣 𝐼𝐷 𝑚𝑎𝑥𝐶ℎ and 𝑃 𝑝𝑒𝑣 𝐼𝐷 𝑚𝑎𝑥𝐷𝑖𝑠 ).

Therefore, in the Retry state, the EVs that would be fully charged or fully discharged by applying the power reference calculated in the previous step (𝑃 𝐸𝑉 𝐼𝐷 𝑟𝑒𝑓 through ( 19) and ( 20)

)
are identified by setting the Boolean Variable 𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎 to one, whereas all other EVs are identified to 𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎 = 0 .

Power Allocation Eq. ( 20) -( ), check Eq. ( 24)

Retry

Update

and Eq. ( 25)

Boundaries Definition

Eq. ( 26 Additionally, the power to be reallocated is the difference between the initial power reference calculated by HMPC ( 𝑃 𝐸𝑉,𝑘 𝑟𝑒𝑓 ) and the shared power that has already been well allocated, as expressed in [START_REF]JRC Photovoltaic Geographical Information System (PVGIS) -European Commission[END_REF]. Subsequently, the Power Allocation step is reimplemented. This process is repeated until the condition of equation ( 23) is satisfied, or the number of retries surpasses a maximum threshold (𝑁 𝑟𝑒𝑡𝑟𝑦 𝑚𝑎𝑥 ).

𝑃 𝐸𝑉,𝑘 𝑟𝑒𝑓 = 𝑃 𝐸𝑉,𝑘 𝑟𝑒𝑓 -∑(𝑃 𝐸𝑉 𝐼𝐷 𝑐ℎ + 𝑃 𝐸𝑉 𝐼𝐷 𝑑𝑖𝑠 ) 𝐼𝐷 • (1 -𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎 ) (24)
Afterwards, the fourth and last step -named Power Boundaries Definition -is executed. In this step, the HMPC power boundaries for EV charging and discharging (𝑃 𝐸𝑉 𝑚𝑎𝑥𝐶ℎ and 𝑃 𝐸𝑉 𝑚𝑎𝑥𝐷𝑖𝑠 ) are calculated based on the estimated future SoC (𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ,𝑘+1 ) and the power reference calculated in the Power Allocation step (𝑃 𝐸𝑉 𝐼𝐷 𝑑𝑖𝑠 and 𝑃 𝐸𝑉 𝐼𝐷 𝑐ℎ ). First, the future SoC at 𝑘 + 1 of each plugged EV is calculated through [START_REF] Lee | Electricity Demand Profile of Australian Low Energy Houses[END_REF]. Afterwards, the EV power boundaries are calculated using equations ( 26) and ( 27) and transmitted to HMPC. Remarkably, the EV power boundaries (𝑃 𝐸𝑉 𝑚𝑎𝑥𝐶ℎ and 𝑃 𝐸𝑉 𝑚𝑎𝑥𝐷𝑖𝑠 ) are the sum of maximum power rate that each EV can support for the next hours.

IV. RESULTS

To evaluate the performance of the proposed HMPC coupled with the EVPA algorithm, a real-sized residential BMG with technical specifications shown in Table 1 was simulated. The PV power generation was modelled using real solar profiles [START_REF]JRC Photovoltaic Geographical Information System (PVGIS) -European Commission[END_REF]. Similarly, the building's power consumption refers to a medium-sized residential building scaled from [START_REF] Lee | Electricity Demand Profile of Australian Low Energy Houses[END_REF]. The simulations were conducted to assess three aspects: the potential of the hierarchical BEMS in maximising PV self-consumption using EV parking batteries, the impact of the size of EV parking, and the economic advantages of discharging EVs to supply the building demand. These three main points are investigated in Sections A, B and C, respectively. An additional sensitivity analysis of the electricity price is provided in Section D to consider the electricity price and EV batteries price evolution.

A. Performance of the hierarchical EMS

To assess the performance of the proposed controller in exploiting the EV's batteries to increase the PV selfconsumption, the proposed EVPA was confronted with two types of controllers: a classical MPC in which each EV is treated independently (similar to the controller in [START_REF] Mendes | Energy management of an experimental microgrid coupled to a V G system[END_REF]), and the uncontrolled strategy. The uncontrolled approach charges EVs with their maximum power rate as soon as they are plugged into the BMG. On the other hand, the classical HMPC is also composed of EMPC and TMPC, but it optimises the cost function defined in (28) rather than [START_REF]Global EV Outlook 0 0 -prospects for electrification in transport in the coming decade[END_REF]. In this formulation, the self-consumption and the charging of EVs are weighted through the variable 𝜔 𝑘 , which is higher when the EV departure is imminent (less than 3 hours from the programming departure). Since the classical HMPC does not contain the EVPA algorithm that considers the aggregation of EV park, it requires two inequality constraints (similar to equation ( 13)) per EV charging station. s.t.: Eq. ( 5) - [START_REF] Verma | A comprehensive review on energy storage in hybrid electric vehicle[END_REF] and Eq. ( 13) for each EV [START_REF] Omar | Lithium iron phosphate based battery -Assessment of the aging parameters and development of cycle life model[END_REF] Since the objective is to charge EV's batteries as much as possible from renewable energy, the metrics of comparison are the building self-consumption rate, coverage rate (equation ( 2)), and the number of EVs completed charged. Additionally, to verify the limitations on the real implementations, the execution time of each is compared.

The performance of these three control strategies was assessed under an ideal and a realistic scenario. In the ideal scenario, all EVs connect to the BMG as specified in their schedule table. Furthermore, there is no error in the power imbalance prediction data, and all EVs arrive every day with SoC=40%.

On the contrary, the realistic scenario includes inaccuracies in the power imbalance, the energy that EV batteries have stored when they plug into the BMG, and the planned departure and arrival time. The error introduced into the two day-ahead power imbalance prediction data follows equation [START_REF]la réalisation et l'exploitation d'Installations de production d'électricité à partir d'énergies renouvelables en autoconsommation et situées en métropole continentale[END_REF], where 𝑔 and Δ are calculated through equations ( 30) and (31), respectively. The variable 𝜗 is a standard Gaussian random variable of mean 0 and standard deviation 1, whereas the factor 𝜌 is a uniformly distributed random variable in the interval of [0, 𝑟(𝑘)], where 𝑟(𝑘) is a non-linear function that depends on the instant 𝑘 and it is defined as shown in the left graph in Fig. 4. Consequently, the gain 𝑔 have a shape as shown in the right graph in Fig. 4. Additionally, the real prediction data is shifted in time randomly up to ten times 𝑟(𝑘), i.e. up to 6 hours. The random variable 𝑟(𝑘) was defined as shown in Fig. 4 to mimic the rising of prediction error along the MPC horizon. As a result, the error in the amplitude of the signal increases over time, detaining 0% of errors at the current time and attaining up to 60% of errors 48 hours ahead. It is important to remark that the same two day-ahead prediction data errors are introduced in both EMPC and TMPC layers. The comparison between the real and the predicted two day-ahead power imbalance at instant 𝑘 = 0 is shown in Fig. 5.

𝑃 𝑑𝑖𝑠𝑡𝑢𝑟𝑏𝑒𝑑,𝑘 = 𝑔 • 𝑃 𝑟𝑒𝑎𝑙,𝑘+𝛥 , ∀𝑘 ∈ [1,48] (29) 𝑔 = 1 + 𝑠𝑖𝑔𝑛(𝜗) • 𝜌 𝑘 (30) 𝛥 = 𝑓𝑙𝑜𝑜𝑟(10 • 𝜌 𝑘 • 𝑠𝑖𝑔𝑛(𝜗)) (31)
Additionally, the noise in the initial EV SoC follows a Gaussian distribution of a standard deviation of 5% and a mean that depends on the user behaviour. Four types of users were considered. Consequently, four mean values were used, namely 30%, 40%, 50%, and 60. Finally, the noise in the departure and arrival times has also a Gaussian distribution around typical values bounded by a maximum variation of 4 hours.

The 30-days simulation results in Table 2 show that the proposed hierarchical MPC coupled with EVPA in the realistic scenario assured the self-consumption and coverage rate 7 percent point (p.p.) higher than the uncontrolled strategy. Compared to the classical HMPC, the proposed HMPC coupled with EVPA can assure a self-consumption and a coverage rate up to 1 p.p. higher.

Thanks to the periodic optimisations of TMPC and of EMPC explained in section II, the classical and the proposed HMPC proved robust against power imbalance prediction data, reducing by only 1 p.p. the annual self-consumption. Compared to the classical HMPC, the proposed one demonstrated more robustness because it could also keep the same values of coverage rate, while the classical one reduced it by 2 p.p. Furthermore, Fig. 6 shows that both classical HMPC and HMPC with EVPA can guarantee that all EVs are charged closed to the target SoC (i.e. 80%). However, the HMPC coupled with EVPA could charge all EVs to SoC over 79%, while the classical HMPC charged some EVs to only 76% This is because the classical HMPC depends on weight factors in the cost function (variable 𝜔 in equation ( 28)), while the proposed HMPC guarantees the EV charging by changing an inequalities constraint (equation ( 14)). According to Table 2, even though the uncontrolled approach charged all EVs to SoC=80%, less than 3% were provided by PVs, compared to more than 12% with the proposed EVPA and 6% with the classical HMPC. This result highlights the main goal and main interest of the proposed control structure: the algorithm manages to increase radically the selfconsumption of the building while maintaining a satisfying SoC of the EVs at departure time. With the aim of verifying the differences in the charging and discharging of ESSs when employing each control strategy, the power flow during three sample days were analysed (Fig. 7). By convention, in the graphs in Fig. 7, the charging of ESSs is negative, while the discharging is positive. Additionally, the raw net power imbalance is the difference between the power consumption and the PV power generation. Therefore, it is negative when there is energy surplus, and negative otherwise. Therefore, to reduce the grid energy exchange, it is necessary to charge the Li-ion batteries and EVs preferably when there is energy surplus (negative raw energy imbalance). In the opposite case, ESSs should be discharged to supply the building energy deficit (positive raw energy imbalance). Consequently, to maximise the coverage and self-consumption rates, it is needed to maximize the overlap of raw energy imbalance and the energy bars of ESSs.

Following this reasoning, the power flow shown in Fig. 7b and Fig. 7c for the realistic scenario proves that the classical HMPC and the HMPC with EVPA charge and discharge EV's batteries to avoid energy injection and to reduce electricity purchase, contrary to the uncontrolled strategy in Fig. 7a. Furthermore, both control strategies could charge the EVs to the target SoC (SoC ≥ 80%) before their departure time (SoC equals to zero.). Since the SoC of EVs shown in Fig. 7 are the SoC measurements from the point of view of the BEMS, when an EV leaves the BMG, their SoC is measured as zero.

By observing the power flow in Fig. 7, it is also possible to note that the building storage is sometimes used to charge EVs (indicated by black arrows). Particularly, the classical HMPC sometimes discharges some EVs to charge others (indicated by red arrows in Fig. 7b). However, charging an EV with energy coming from another EV is not optimal due to charging/discharging losses. Therefore, this does not result in better use of energy storage systems, since the selfconsumption and coverage rates of classical HMPC were lower than the proposed HMPC with the EVPA. To improve the classical HMPC, it would be recommended to include additional constraints to impede the controller to charge an EV with energy coming from another EV. This will certainly increase the complexity of the HMPC design. Moreover, large number of inequality constraints and control variables requires more time to the CPLEX solver to find the best solution. Fig. 7 also reveals that EVs can reduce grid energy exchange more actively during weekends than weekdays. This is because EVs stay plugged for longer periods, enabling the controller to discharge EVs without compromising their fully charging. Conversely, during weekdays, EVs are plugged mostly during non-business hours, which is mostly between 5 PM to 8 AM. Consequently, EVs are connected to the BMG during periods of energy deficit (positive) and disconnected from the BMG when there is an energy surplus (negative). Hence, the BMG usually must purchase electricity from the grid to charge EVs. This behaviour is the result of a poor adequation of the PV power production and the EVs' storage availability. In fact, the performance of the three algorithms studied is comparatively impacted. According to Table 2, the HMPC with EVPA can charge the EV batteries using less grid energy than the other two control strategies. However, neither strategy can charge their EVs using only renewable energy. They need to import from the external grid at least 46% of the EVs energy demand, even though the BMG has a surplus of energy (self-consumption is not 100%). Owing to the BMG sizing, the building storage is not large enough to store all PV surplus to charge EVs during the night. The percentage of charging EV with renewable energy would be more important with a larger stationary battery. However, this would drastically increase the installation cost of the BMG.

B. Impact of the size of electric vehicle size

It is important to highlight that these conclusions were drawn from the simulation of the BMG with four EVs. To verify the impact of the EV parking size, scenarios with 0, 20, and 40 EVs were also evaluated by running the BMG with the proposed HMPC with EVPA for one year. As shown in Table 3, with the enlargement of EV parking, the charging of EVs with energy coming directly from PV panels is limited to 6 MWh/year. Likewise, with more EVs, the Li-ion battery pack is discharged more frequently to charge the EV's batteries, but they are limited to discharge up to 7 MWh/year. For this reason, the total energy imported from the main grid tends to increase, and the coverage rate tends to decrease with the enlargement of EV parking. Following the same reasoning, the self-consumption rate can be increased by up to 3 p.p. compared to the case with only batteries (column "0 EV"), but it is limited to around 72%. These results reveal that there is an optimal number of EVs that a BMG can have connected to increase the annual self-consumption rate without reducing drastically the coverage rate.

This saturation is due to the raw net power imbalance and the connection profile of EVs disposal. To increase the charging of EVs from renewable energy, the total energy used to charge PEVs in each daily connection must be matched by the daily surplus of energy. However, as shown in , depending on the raw net power imbalance, complete EV load matching is impossible.

To highlight the effects of the EV park size in the algorithm computation cost, the execution time of the EMPC optimization when using the classical HMPC architecture and the proposed HMPC with EVPA were compared. The execution time of the two methods were measured using an Intel Core i5-6200U CPU at 2.30 GHz. According to Fig. 9, the execution time of the classical HMPC rises exponentially with the number of EVs, while the EVPA keeps a similar algorithm complexity independently of the number of EV charging stations. This result indicates that the proposed HMPC with EVPA can be adapted to larger scales of applications, potentially plug-and-play, without any heavy modification of the hardware specifications, at least when it comes to computational power.

C. Technical-economic analysis of discharging electric vehicles' batteries

To evaluate the economic advantages of discharging EV batteries to support the BMG energy needs, the case where 4 EVs can be discharged was compared to the case where they cannot be discharged. These two scenarios were also confronted with the case where only batteries are installed (named '0 EV') to verify the consequences of having or not EV parking. The graphs in Fig. 10 show some metrics obtained after a one-year simulation, including the battery degradation, the additional income offered by the French government, self-consumption rate, coverage rate, and electricity cost.

The battery degradation cost considers a capital cost of 500 €/kWh [START_REF] Kim | Field study on operational performance and economics of lithium-polymer and leadacid battery systems for consumer load management[END_REF] with end-of-life when it loses 20% of its nominal capacity [START_REF] Li | Data-driven health estimation and lifetime prediction of lithium-ion batteries: A review[END_REF]. The battery capacity loss was estimated using the model of a Li-ion battery that exists in the SimPowerSystem library in Matlab Simulink. This model considers the current intensity, the depth of discharge, and temperature to emulate the battery capacity loss [START_REF] Omar | Lithium iron phosphate based battery -Assessment of the aging parameters and development of cycle life model[END_REF].

On the other hand, the additional income is calculated based on the French energy policy [START_REF]la réalisation et l'exploitation d'Installations de production d'électricité à partir d'énergies renouvelables en autoconsommation et situées en métropole continentale[END_REF] to financially encourage self-consumption in small prosumers. This policy is based on a reward-penalty mechanism to favour the internal load match and avoid grid energy injection. It provides a higher additional income for small annual maximum power injected and an elevated annual selfconsumption rate.

According to the results shown in Fig. 10, from the point of view of the BMG, the discharging of EVs implies a reduction in the annual electricity bill of 1 9 €/year. In this study, a time-of-used tariff of 0.09 €/kWh was used. Although the annual self-consumption rate was higher when allowing the EV discharging, the additional income was lower due to the increase in the maximum power injection. By comparing the degradation cost of batteries, the discharging of EV parking reduces the use of the building batteries pack, decreasing its degradation cost by 114 €/year. This is because the load shaving implemented by stationary batteries is partially covered by EV charging and discharging.

Therefore, the total savings when allowing the EV discharging -being equal to the sum of electricity (ℂ 𝑒𝑙𝑒𝑐 ) and battery degradation costs (ℂ 𝑒𝑙𝑒𝑐 ) minus the additional income (ℂ 𝑠𝑐 ) (equation ( 32)) -are 8 €/year. Compared to the total BMG expenses (more than 21587 €/year), these savings are minimal. Due to the power imbalance profile, EV schedule time and sizing of the battery pack, EVs can be rarely discharged. According to Table 1 and Table 3, EV discharging represents less than 2% of annual building energy consumption for 4 EVs.

𝑇𝑜𝑡𝑎𝑙 𝑐𝑜𝑠𝑡 = ℂ 𝑒𝑙𝑒𝑐 + ℂ 𝑏𝑎𝑡 -ℂ 𝑠𝑐 (32) Fig. 11: Comparison of the level of degradation of batteries when electric vehicles are allowed and not allowed to be discharged.

From the perspective of the EV's owners, the discharging of their EV's batteries increases the degradation rate of EV's batteries. As shown in Fig. 11, the average capacity of EV's batteries (𝑄) at the end of the year is smaller when allowing discharging them than not allowing it. According to the website of Renault, the current price of batteries of Renault Zoe ® costs on average 8100 € depending on the country. Taking this value to estimate the equivalent cost of discharging the EV's batteries, the additional loss of batteries' capacity of 115 mAh/year means 4.5 €/year (or 0.0 5 €/kWh) for each EV's owner.

Considering the hypothesis that the BMG would refund the degradation provoked by the additional degradation cost of EV batteries, the BMG profit would be only about 143.72 €/year. Therefore, the differences between both sides when allowing or not discharging EV batteries are small compared to the annual building expenses. From the perspective of EV users, discharging their EV batteries may be a disadvantage because their batteries would be degraded faster than in normal operating conditions without contributing substantially to the performance of the BMG or the use of renewable energy. Fig. 10 also illustrates that having EV parking installed in the BMG increases the electricity expenses on average of 1516.50 €/year. This is because, despite all, EVs are still a load that consumes energy. With the sizing of the BMG and the connection profile of EVs, the Fig. 10: Key performance indicators when four EVs are allowed (4 EVa) and not allowed (4 EVna) to be discharged, and when no EV exists (0 EV).

BMG must purchase electricity to charge its EVs, which increases the total electricity costs by 8%.

D. Electricity price sensitivity study

To extrapolate the study to other scenarios, a sensitivity analysis on the electricity price and EV battery cost was conducted. Knowing that the EV discharging is profitable, if additional EV battery degradation cost provoked by the discharging is less than the total BMG cost (equation (32)), it is possible to define the condition of profitability (equation (33)). Since the objective is to evaluate the impact of electricity price and EV battery cost variations on the BMG profitability, these two terms are multiplied by an unknown factor, namely 𝛼 𝑒𝑙𝑒𝑐 for the electricity price and 𝛼 𝐸𝑉 for the EV battery cost.

To better visualize the condition of profitability, Fig. 12 shows the combination of the gain in the electricity price and gain in the EV batteries cost that makes discharging EV batteries advantageous. As concluded previously, the EV discharging is profitable, but it is not attractive due to the low margin of benefit. However, as shown in Fig. 12, if the electricity price increases and the EV batteries decreases, the discharging can be more economically advantageous.

V. CONCLUSION

The proposed hierarchical control structure has proved effective in fully charging EVs before their departure time while promoting PV self-consumption. The proposed BEMS increased up to 7 percent point the annual self-consumption compared to the uncontrolled strategy, and up to 1 percent point than the classical HMPC. Besides reducing the execution time compared to the classical HMPC, the EVPA guaranteed EV's state-of-charge over 78% even when subjected to data prediction inaccuracies. Nonetheless, due to the raw net power imbalance, sizing of battery packs, and the daily connection and disconnection profiles of electric vehicles, the charging of electric vehicles from renewable energy (6 MWh from batteries and 6 MWh from PVs) is saturated to 9% of annual photovoltaic energy generation (131 MWh/year). Consequently, with the enlargement of EV parking, the annual self-consumption rate is saturated to 72%. Electric vehicle parking also results in a considerable increase in electricity expenses, increasing the purchased energy by about 8% of the annual building consumption with 4 EVs, and 91% with 40 EVs. Additionally, the economic advantages of discharging EVs to promote self-consumption represents only 1.3% of the annual building expenses. From the point of view of EV's owners, the monetary reward may not be enough to encourage them to authorise the discharge since their batteries would be degraded faster without substantial impact on the use of renewables. However, the economic sensitivity analysis indicates that the increase in the electricity price and the reduction of EV batteries cost could make the EV discharge more attractive. These results have to be mitigated by the choice of the case of study.

As future work, the estimation of the number of plugged EVs could be improved by analysing the user daily behaviour. This would improve the flexibility of the whole hierarchical controller since the users would not need to schedule their arrival and departure time. Additionally, it is needed to extrapolate the analysis conducted in simulation to real systems. Further investigation is required to deal with possible concerns related to communication latency, limitations in the computation resources, noise measurements, and resilience against faults. It is therefore vital that future research considers all the economic and technical peculiarities of real applications to make possible the integration of renewable energy sources in the building environment in the foreseeable future. More specifically, future works will focus on the installation of photovoltaic panels, batteries and electric vehicle in the ESTIA's building. This adequation of the storage availability and the renewable energy source production appears crucial when deciding if a building will profit from EV charging stations installation. The results presented in this article are to be implemented on a real building microgrid using hardware in the loop tools, with special care given to each of the comparison points depicted in this article.

  , namely: Economic MPC (EMPC), Tracking MPC (TMPC), and EVPA. Considering the prediction data of fluctuations in the internal power imbalance, the EMPC determines State-of-Charge (SoC) references of stationary batteries (𝑆𝑜𝐶 𝑏𝑎𝑡,𝑘 𝑟𝑒𝑓 ) and the references for EV parking stored energy (𝐸 𝐸𝑉,𝑘 𝑟𝑒𝑓 ) for each hour 𝑘. Therefore, the time discretization (𝑇 𝑠 𝐸𝑀𝑃𝐶 ) of EMPC is one hour. Before optimizing its cost function (1), the EMPC considers the most recent data predictions concerning the building power imbalance, and the state of charge of static Li-ion batteries and of the EV parking to calculate optimal setpoints for each ESS. These references are determined through the optimisation of the cost function defined in (1) using Mixed Integer Linear Programming of CPLEX framework. .: Eq.(

Fig. 3 :

 3 Fig. 3: Summary of the EVPA module algorithm

Fig. 6 :

 6 Fig.6: Distribution of the state-of-charge of four electric vehicles just before disconnecting from the building microgrid.

Fig. 4 :Fig. 5 :

 45 Fig. 4: Distribution of the time-variant random factors to emulate the error in the two day-ahead prediction data.

Fig. 7 :

 7 Fig. 7: Sample days of the power flow with the three control strategies with 4 electric vehicles with data prediction errors.

Fig. 8 :Fig. 9 :

 89 Fig. 8: Visualisation of the effects the disposal of raw net power imbalance and the connection profile of plug-in vehicles on the charging of electric vehicles batteries with renewable energy.

Fig. 12 :

 12 Fig. 12: Economic analysis of the electricity price and EV battery cost to verify the profitability of discharging EVs batteries.

  SoC was setup as 80%, but the control architecture can operate with other values of SoC. Based on equation (13), neither EMPC nor TMPC have any information about the energy stored in each EV, but only the total energy of the entire EV parking, named 𝐸 𝐸𝑉 . Due to the incomplete information about the SoC of each EV, the full charging of individual EVs cannot be guaranteed with only the Hierarchical MPC (HMPC) power assignation, especially when EVs connect at a different time or with different SoC. As shown in Fig.3, the EVPA algorithm is a recursive algorithm composed of four steps. The first step -named Measurement -processes the three-input data mentioned above to calculate all necessary variables for the next step. Using the user's input departure time (𝑡 𝐸𝑉 𝐼𝐷

	target To tackle this problem without raising the computation cost, HMPC operates synchronously with EVPA algorithm. This light adjunct module determines hourly the portion of EV parking power reference calculated by HMPC (𝑃 𝐸𝑉 𝑟𝑒𝑓 = 𝑃 𝐸𝑉 𝑐ℎ + 𝑃 𝐸𝑉 𝑑𝑖𝑠 ) that must be assigned to each EV. It also updates the maximum charging (𝑃 𝐸𝑉 𝑚𝑎𝑥𝐶ℎ ) and discharging (𝑃 𝐸𝑉 𝑚𝑎𝑥𝐷𝑖𝑠 ) power rate of equations (7) and (8) for the next periods. The sharing of these two variables among the hierarchical control layers avoids losing performance because adjusting the power boundaries according to the real EV parking capacity	𝑡 𝐸𝑉 𝐼𝐷 𝑚𝑖𝑛𝐶ℎ𝑎𝑟𝑔𝑒 = 𝑐𝑒𝑖𝑙 ( 𝑡 𝐸𝑉 𝐼𝐷 𝑐𝑜𝑛 = 𝑡 𝐸𝑉 𝐼𝐷 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥 -𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 |𝑃 𝑝𝑒𝑣 𝐼𝐷 𝑚𝑎𝑥𝐶ℎ | • 𝜂 𝑐ℎ • 𝑇 𝑠 𝑣 𝐸𝑉 𝐼𝐷 𝑑𝑒𝑝 -𝑡 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 In the second step, named Power Allocation, the power ) (17) (18) reference determined by HMPC (𝑃 𝐸𝑉,𝑘 𝑟𝑒𝑓 ) is shared among all EVs plugged at instant 𝑘 following (19) if charging (𝑃 𝐸𝑉,𝑘 𝑐ℎ ≠ 0), and (20) if discharging (𝑃 𝐸𝑉,𝑘 𝑑𝑖𝑠 ≠ 0). In these equations, 𝜔 𝐼𝐷 𝑑𝑖𝑠 are the power-sharing weights to determine the 𝑐ℎ and 𝜔 𝐼𝐷 power reference for each plugged EV (𝑃 𝐸𝑉 𝐼𝐷 ,𝑘 𝑐ℎ or 𝑃 𝐸𝑉 𝐼𝐷 ,𝑘 𝑑𝑖𝑠 ). Remarkably, the equations (19) and (20) limit the power-sharing according to the charging-discharging maximum power rate of each EV (𝑃 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥𝐶ℎ and 𝑃 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥𝐷𝑖𝑠 ). Additionally, by embedding the second term in equations (19) and (20), the EV power assignation is limited to the maximum and minimum SoC (𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥 and 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝑚𝑖𝑛 ) of each EV.
	prevents HMPC from charging EVs that are already fully charged or discharging EVs that are already empty. The EVPA algorithm shares the EV parking power reference (𝑃 𝐸𝑉	𝑃 𝐸𝑉 𝐼𝐷 𝑐ℎ = max (𝑃 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥𝐶ℎ ; 𝑃 𝐸𝑉 𝐼𝐷 𝑑𝑖𝑠 = min (𝑃 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥𝐷𝑖𝑠 ;	𝑚𝑎𝑥 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ,𝑘 -𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ⁄ 𝜂 𝑐ℎ • 𝑇 𝑠 𝑣 𝐸𝑉 𝐼𝐷 𝑚𝑖𝑛 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ,𝑘 -𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝑇 𝑠 (𝜂 𝑑𝑖𝑠 𝑣 𝐸𝑉 𝐼𝐷 ) ⁄	; 𝜔 𝐼𝐷 𝑐ℎ • 𝑃 𝐸𝑉,𝑘 𝑐ℎ ) ; 𝜔 𝐼𝐷 𝑑𝑖𝑠 • 𝑃 𝐸𝑉,𝑘 𝑑𝑖𝑠 ) (20) (19)
				Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ = 𝑡 𝐸𝑉 𝐼𝐷 𝑐𝑜𝑛 -𝑡 𝐸𝑉 𝐼𝐷 𝑚𝑖𝑛𝐶ℎ𝑎𝑟𝑔𝑒	(21)
			𝜔 𝐼𝐷 𝑑𝑖𝑠 =	Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ ∑ Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ 𝐼𝐷	• 𝛿 𝐸𝑉 𝐼𝐷 𝑑𝑖𝑠𝐴 • 𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎 ; 𝜔 𝐼𝐷 𝑐ℎ =	1 Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ ⁄ ∑ 1 Δ𝑡 𝐸𝑉 𝐼𝐷 𝑐ℎ ⁄ 𝐼𝐷	• 𝛿 𝐸𝑉 𝐼𝐷 𝑎𝑣𝑎
	𝑆𝑜𝐶 𝑘+1 𝑏𝑎𝑡 = 𝑆𝑜𝐶 𝑘 𝑏𝑎𝑡 + + 𝑣 𝑛𝑜𝑚 𝜂 𝑐ℎ 𝑏𝑎𝑡 𝑇 𝑠 𝑏𝑎𝑡 • 𝑄 𝑛𝑜𝑚 𝑏𝑎𝑡 • 𝑃 𝑏𝑎𝑡,𝑘 𝑐ℎ 𝑣 𝑛𝑜𝑚 𝑏𝑎𝑡 • 𝑄 𝑛𝑜𝑚 𝑏𝑎𝑡 𝜂 𝑑𝑖𝑠 𝑏𝑎𝑡 • 𝑃 𝑏𝑎𝑡,𝑘 𝑑𝑖𝑠 𝑇 𝑠	(12)

𝑟𝑒𝑓 ) among each plugged EVs identified by an ID number based only on three input values: the current SoC of each EV (𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ), the user's input departure time (𝑡 𝐸𝑉 𝐼𝐷 𝑑𝑒𝑝 ), and the EV discharging authorisation (𝛿 𝐸𝑉 𝐼𝐷 𝑑𝑖𝑠𝐴 ). If the EV's owner has authorised the EV's discharging, 𝛿 𝐸𝑉 𝐼𝐷 𝑑𝑖𝑠𝐴 is worth 1;

otherwise, it is equal to 0. 𝑑𝑒𝑝 ), the minimum time to charge the 𝐸𝑉 𝐼𝐷 up to 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥 = 80% (𝑡 𝐸𝑉 𝐼𝐷 𝑚𝑖𝑛𝐶ℎ𝑎𝑟𝑔𝑒 ) can be calculated through

[START_REF] Wu | Hierarchical Operation of Electric Vehicle Charging Station in Smart Grid Integration Applications -An Overview[END_REF]

. This formulation considers that each 𝐸𝑉 𝐼𝐷 will be charged with its maximum charging power rate ( 𝑃 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥𝐶ℎ ) during the smallest sample time of HMPC, i.e. TMPC sample time (𝑇 𝑠 = 1ℎ ). Similarly, the remain time in which 𝐸𝑉 𝐼𝐷 will stay connected to the BMG ( 𝑡 𝐸𝑉 𝐼𝐷 𝑐𝑜𝑛 ) is calculated through

[START_REF] Wu | Charging demand forecasting of electric vehicles considering uncertainties in a microgrid[END_REF]

, where 𝑡 𝑐𝑢𝑟𝑟𝑒𝑛𝑡 is the current time.

  𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ,𝑘+1 = 𝑆𝑜𝐶 𝐸𝑉,𝑘 -𝑃 𝐸𝑉 𝐼𝐷

	𝑑𝑖𝑠 𝑚𝑎𝑥𝐶ℎ = ∑ max (𝑃 𝐸𝑉 𝐼𝐷 𝑃 𝐸𝑉,𝑘+1 𝑚𝑖𝑛 ; 𝐼𝐷 𝑃 𝐸𝑉,𝑘+1 𝑚𝑎𝑥𝐷𝑖𝑠 = ∑ min (𝑃 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥 ; 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ,𝑘+1 -𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝑇 𝑠 𝑇𝑀𝑃𝐶 𝑣 𝐸𝑉 𝐼𝐷 𝜂 𝑑𝑖𝑠 -𝑃 𝐸𝑉 𝐼𝐷 𝑐ℎ 𝜂 𝑐ℎ 𝑇 𝑠 𝑇𝑀𝑃𝐶 𝑣 𝐸𝑉 𝐼𝐷 𝑚𝑎𝑥 𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 ,𝑘+1 -𝑆𝑜𝐶 𝐸𝑉 𝐼𝐷 𝜂 𝑐ℎ • 𝑇 𝑠 𝑣 𝐸𝑉 𝐼𝐷 ) ⁄ 𝑚𝑖𝑛 𝑇 𝑠 (𝜂 𝑑𝑖𝑠 𝑣 𝐸𝑉 𝐼𝐷 ) 𝑑𝑖𝑠𝐴 ) • 𝛿 𝐸𝑉 𝐼𝐷 ⁄ 𝐼𝐷	(25) (26)

TABLE 1 :

 1 TECHNICAL SPECIFICATION OF THE BUILDING MICROGRID.

	Component	Technical Description
	Photovoltaic panels	Annual energy generation: 131 MWh (100 kWc)
	Building load	Annual energy consumption:307 MWh
	Li-ion batteries	Nominal capacity: 167 Ah
		Maximum power rate: 60 kW
	EV parking (Zoe of	Maximum power rate: 7 kW (slow mode)
	Renault ® )	Nominal capacity (𝑄 𝐸𝑉 𝑛𝑜𝑚 ): 130 Ah
	Grid limit power	100 kWh

TABLE 2 :

 2 30-DAYS SIMULATION RESULTS TO EVALUATE THE PERFORMANCE OF DIFFERENT CONTROL STRATEGIES

	Metrics	Uncontrolled	HMPC with EVPA	Classical HMPC
		Ideal a	Realistic b	Ideal a	Realistic b	Ideal a	Realistic b
	Self-consumption (%)	56.6	50.7	58.6	57.8	57.3	56.4
	Coverage rate (%)	40.0	36.6	43.7	43.7	41.3	43.8
	Discharge EVs (%)	0.0	0.0	21.0	23.5	8.9	8.5
	Charge EVs from PVs (%)	2.6	4.6	12.3	16.4	6.7	9.2
	Charge EVs from building storage (%)	30.8	26.1	15.1	14.4	22.3	19.8
	Charge EVs from grid (%)	66.6	69.3	51.6	45.7	62.29	62.5

Obs: Building microgrid with 4 Electric Vehicles and Li-Ion batteries; a Without data prediction error; b With data prediction error;

TABLE 3 :

 3 ONE-YEAR SIMULATIONS WITH A DIFFERENT NUMBER OF ELECTRIC VEHICLES USING THE HIERARCHICAL MPC WITH EVPA.

	Metrics	0	4	20	40
		EV b	EV b	EV b	EV b
	Self-consumption (%)	69	71	72	72
	Coverage rate (%)	29	30	28	25
	Grid energy import a	217	234	314	416
	Grid energy injection a	41	38	37	37
	Energy to charge EVs a	0	27	127	249
	-from grid a	0	19	114	237
	-from PV panels a	0	4	6	6
	-from batteries a	0	4	7	6
	Energy discharged from EVs a 0	5.4	18.3	32.7

a Annual values in MWh b With Li-ion batteries

VI. ACKNOWLEDGEMENT

The authors would like to thank New Aquitaine Region (Agreement: AAPFO424953) for their financial support.