S Lèbre

G David

C Negrell

A Battimelli

H Carrère

E Ruiz

L Vachoud

C Wisniewski

Optimisation de la séparation des phases solide et liquide de digestats de boues de stations d'épuration par ajout d'un coagulant-floculant biosourcé en vue de valorisations ciblées

Keywords: Digestat, chitosane fonctionnalisé, coagulation-floculation, filtration, décantation

Introduction

En station de traitement d'eaux usées (STEU), la digestion anaérobie des boues résiduaires conduit à la production de digestats riches en azote, phosphore, potassium et matières organiques. Ces digestats subissent des post-traitements afin de faciliter leur transport, stockage et épandage, et notamment une séparation de phase mécanique permettant d'obtenir une phase liquide et une phase solide, dont une valorisation ciblée peut être recherchée. Ainsi, les digestats liquides peuvent subir divers traitements visant à isoler l'azote et/ou le phosphore, tels qu'un stripping, une précipitation… Cependant, ces post-traitements nécessitent préalablement une optimisation de la séparation liquide/solide afin que la phase liquide soit quasi-totalement exempte de solides. Bien que très souvent accompagnée d'un ajout de coagulantsfloculants, l'élimination des matières en suspension (par décantation ou filtration) des phases liquides reste imparfaite. Ainsi, développer des coagulants-floculants spécifiquement adaptés aux propriétés et caractéristiques physico-chimiques des digestats est essentiel à l'optimisation de la séparation. Les biopolymères fonctionnalisés peuvent s'avérer prometteurs de par l'utilisation de produits naturels peu onéreux et possédant une innocuité environnementale. Leur fonctionnalisation permet d'augmenter la spécificité des interactions avec les solides ciblés. Le chitosane est le deuxième biopolymère le plus abondant dans le monde. Les applications du chitosane sont limitées à des utilisations en conditions acides en raison de sa faible solubilité dans l'eau ; la quaternisation est une des diverses méthodes pouvant améliorer cette solubilité, en assurant biodégradabilité, biocompatibilité et faible toxicité. L'objectif de ce projet est d'étudier et d'optimiser l'efficacité de chitosane quaternaire sur la décantabilité et filtrabilité de digestats liquides.

Matériel et méthodes

Le chitosane quaternaire (CHF) est synthétisé à partir de chitosane (CS) de masse molaire moyenne fixe (≈ 150 kg/mol) modifié par le chlorure de glycidyltriméthylammonium (GTMAC) afin de générer des charges positives sur toute la gamme de pH et donc d'obtenir une bonne solubilité à tout pH. Le protocole de synthèse [1], simple et peu onéreux, a permis d'obtenir des CHF de différents degrés de fonctionnalisation (DQ). L'efficacité de l'ajout de CHF (DQ de 11, 45 et 80 %), pour deux doses de 10 et 25 mg/g MS, a été évaluée sur un digestat (teneur en matières sèches MS de 24 g/kg) issu du méthaniseur d'une STEU de 470 000 EH, et comparée à celle d'un polyacrylamide cationique commercial (PC) à dose préconisée (7 mg/g MS). Avant et après ajout du coagulant-floculant (sous conditions de température, temps et mélange définies) ont été analysés : la répartition granulométrique, le comportement rhéologique, l'aptitude à la décantation (estimée par le ratio Vsurnageant/Vtotal après 2 h de décantation) et l'aptitude à la filtration (estimée par la résistance spécifique à la filtration SRF sous 1 bar). Chaque combinaison floculant/dose est associée à une série de 2 chiffres correspondant respectivement à son DQ et dose.

Résultats et discussion

Les analyses granulométriques ont montré que l'ajout de CHF, indépendamment du DQ et de la concentration, aboutit à une uniformisation en taille des matières en suspension autour de 40-70 µm (Figure 1a). L'ajout de PC aboutit non pas à une uniformisation mais à une agglomération (Figure 1b). L'étude du comportement rhéologique a montré que le digestat, avec ou sans coagulantfloculant, a un comportement rhéofluidifiant (Figure 2). L'ajout de PC aboutit à des viscosités plus élevées que celles mesurées sur le digestat brut, alors que l'ajout de CHF fait considérablement diminuer les viscosités, notamment pour des doses de 25 mg/g MS, et ce indépendamment du DQ. Les ratios Vsurnageant/Vtotal obtenus (Figure 3a) indiquent que les ajouts améliorent fortement la décantabilité. L'ajout de PC ou de chitosane fonctionnalisé, CHF 8025, donne les meilleures performances en décantation. Notons que, pour CHF, l'efficacité semble améliorée au fur et à mesure que DQ et dose de produit augmentent. En ce qui concerne l'aptitude à la filtration, l'ajout de PC et CHF diminue d'un facteur 10 à 100 la SRF du digestat brut (Figure 3b). On note une diminution de la SRF en augmentant la dose et le DQ du chitosane.

Conclusions et perspectives

Les résultats obtenus dans ce projet ont montré que l'ajout de CHF uniformise la taille des solides en suspension dans le digestat et améliore leur décantabilité et leur filtrabilité. L'efficacité est meilleure en augmentant le DQ et la dose. Si le floculant commercial s'avère performant, il n'aboutit cependant pas aux meilleures filtrabilités du digestat. Des analyses complémentaires (suivi de la déstabilisation par Turbiscan, visualisation des agrégats par microtomographie et microscopie) permettront de mieux appréhender les mécanismes d'action des produits testés. Une ACV réalisera enfin un bilan environnemental et aidera à les choisir. Remerciements : Agence de l'eau RMC Convention N° 2019 0754

Références :

[1] E. Loubaki, M. Ourevitch, et S. Sicsic, « Chemical modification of chitosan by glycidyl trimethylammonium chloride. characterization of modified chitosan by 13C-and 1H-NMR spectroscopy », Eur. Polym. J., vol. 27, n o 3, p. 311-317, janv. 1991, doi: 10.1016/0014-3057(91)90111-Z.

Figure

  Figure 1 : Analyses granulométriques


Francis Pardal

Vincent Lapinte

Jean-Jacques Robin

Modification of Silica Nanoparticles by Grafting of Copolymers Containing Organosilane and Fluorine Moities

Keywords: cotelomerization, grafting onto, hybrid nanoparticle, perfluoroacrylate, silica nanocomposite

The free-radical cotelomerization of 3-(trimethoxysilyl)propyl methacrylate (TMSPMA) with perfluorodecylacrylate (PFDA) in the presence of 2-mercaptoethanol was performed at 80°C in acetonitrile. Hydroxy end-groups of the cotelomers were reacted with 2-isocyanatoethyl methacrylate (IME) to give macromonomers. The P(TMSPMA-stat-PFDA) cotelomers, containing fluoro and silane groups, were then grafted onto silica nanoparticles. Optimal grafting conditions were found with TMSPMA monomer alone in toluene at 110°C. The structure of the modified silica was analyzed by FTIR and 29 Si solid-state NMR. The amount of grafted TMSPMA or P(TMSPMA-stat-PFDA) was calculated by thermogravimetric and elemental analyses. The grafting yield increased with the copolymer/silica weight ratio until a maximum value of 2.26 μmol.m -2 .

Introduction

Organic polymer / inorganic hybrid nanocomposites are of current research interest because of their improved mechanical, electrical and optical properties. 1 Among the inorganic nanoparticles, silica is extensively used as a filler or reinforcement agent in polymeric matrixes. The chemical modification of the silica particles by a polymer improves the solubility, the stability and the dispersion in various solvents. Processing techniques are based on either physicochemical routes or polymerization methods. Chemical grafting techniques include "grafting onto" and "grafting from" methods. 2,3 "Grafting from" method begins by the fixation of initiating groups on the surface of the particles followed by in situ polymerization.

Organofunctional silanes such as 3-(trimethoxysilyl)propyl methacrylate) (TMSPMA) are widely used for "grafting from" processes since it contains simultaneously a silicon-alcoxy function and a double-bond end-group. So, free double bonds can be fixed at the surfaces of particles using a condensation step of Si(OMe) 3 with Si-OH groups. [4][5][6][7] A variety of polymerization techniques, including conventional free radical, 8 cationic, 9 anionic, 10 ringopening 11 and controlled radical polymerizations (CRPs) [12][13][14][15] have been used for the growth of polymer chains from the solid surface of different inorganic particles. "Grafting onto" route is another effective method. It involves the reaction of functional end groups of polymers onto the silica nanoparticles bearing reactives goups. 2 In this paper, we propose a new method to obtain fluorinated silica nanoparticles bearing free double bond making them reactive in a polymerization process. Most often, fluorinated silica nanoparticles are obtained either by a sol-gel process using a perfluoroalkyl di-or trialkoxysilane 16 or by condensation of perfluoroalkyl di-or tri-alkoxysilane onto preformed silica nanoparticles. 17 In our process, cotelomers bearing one unsaturation were condensed onto silica nanoparticles. So, new poly[ (3-(trimethoxysilyl)propyl methacrylate)-stat-(perfluorodecylacrylate)] P(TMSPMA-stat-PFDA) were synthesized by cotelomerization leading to oligomers with α-functional end-group. As already said in a previous paper, 18 only perfluoroacrylate polymers which short chains can be obtained due to the insolubility of longer ones in most organic solvents. The telomerization of perfluorodecylacrylate with 2mercaptoethanol has been explored and the efficiency of this transfer agent has been outlined in several previous investigations. [18][19][20][21][22]

Experimental Section

Materials

Nanosized silica (AEROSIL TT 600, Evonik) with an average diameter of 40 nm and a specific area of 200 m 2 .g -1 was used as received. Perfluorodecyl acrylate (PFDA) (Fluorochem, 98%) was distilled under vacuum (8 mmbar, 130°C). 13 C NMR (300 MHz, CDCl 3 , δ, ppm): 63.41 (HO-CH 2 ),

(HS-CH 2 ).

Characterization 1 H NMR spectra were recorded using a Bruker AC 200 with CDCl 3 as solvent. Chemical shifts were referenced to the peak of residual CHCl 3 at 7.26 ppm. 13 C NMR spectra were recorded using a Bruker AC 300 with CDCl 3 as solvent. Chemical shifts were referenced to CDCl 3 at 77 ppm. 2D NMR was recorded on a Bruker AC 400. 29 Si cross-polarization magicangle-spinning (CP/MAS) NMR spectra were recorded using a Bruker AC 400 operating at 99 MHz. Magic-angle spinning was performed at a spinning rate of 6 kHz. Fourier Transform Infrared (FTIR) spectra were recorded with a Perkin Elmer Spectrum 100 spectrometer equipped with an attenuated total reflectance (ATR) crystal. Thermogravimetric measurements were performed using a TGA51 TA Instruments apparatus. Samples were heated in a nitrogen flow (60 mL/min) at 20°C/min from room temperature to 800°C. Carbon elemental analysis was performed on a homemade microanalyzer by combustion of the sample at 1050°C in a stream of oxygen followed by infrared detection.

Synthesis of P(TMSPMA-stat-PFDA) statistical copolymer

Cotelomerization of TMSPMA with PFDA was performed in acetonitrile at 80°C with 2mercaptoethanol as transfer agent. Special care was needed for handling TMSPMA because it was easily hydrolyzed. In a 100 mL flask 11.175 g (0.045 mol) of TMSPMA, 2.590 g (0.005 mol) of PFDA, 0.390 g (5.10 -3 mol) of 2-mercaptoethanol and 0.041 g (2.5.10 -4 mol) of 2,2'-azobisisobutyronitrile (AIBN) (n initiator /n monomer =0.5%) were diluted to 50 mL with anhydrous acetonitrile. The solution was bubbled with nitrogen for 30 min before heating at 80°C. To avoid any foaming phenomenon during the evaporation of acetonitrile, anhydrous heptane was added at the end of reaction. Then, polymer was washed three times with anhydrous n-hexane and dried under vacuum. The obtained copolymer was a colorless viscous liquid.

Functionnalization of cotelomer by isocyanatoethyl methacrylate (IME)

3 g (1.36 mmol, 2200 g.mol -1 ) of P(TMSPMA-stat-PFDA), 276 mg (1.78 mmol) of 2isocyanatoethyl methacrylate (IEM), 0.2 wt% (6 mg) of triethylamine and 50 mL of dried toluene were introduced in a round-bottom flask fitted with a condenser. The reaction was stirred and heated at 60°C for 20h. The solvent was removed under vacuum and the polymer was washed three times with anhydrous n-hexane and dried under vacuum.

Grafting of TMSPMA onto silica nanoparticles

Grafting of TMSPMA onto silica nanoparticles was performed with three different experimental methods: A-method: 1.9 g of silica were mixed with 2.15 g of TMSPMA, while vigorously stirring in boiling acetone. [23][24][25][26][27] 30 mg of maleic anhydride diluted in 0.2 mL of water and 30 mL of acetone were added as catalyst. The mixture was refluxed for 2h. B-method: 1.9 g of silica were dispersed in 30 mL of ethanol-water solution (4/1 weight ratio) by sonication to give a suspension of particles. 28 2.15 g of TMSPMA were hydrolyzed while vigorously stirring in 60 mL of ethanol-water solution (4/1 weight ratio) at room temperature and pH condition was controlled at 4.5 by acetic acid. After this step the hydrolyzed silane was added to the particle suspension and this mixture was stirred continuously for 2h at room temperature and then followed by refluxing for 4h at 70°C. C-method: 2.15 g of TMSPMA was added to a suspension of silica (1.9 g) in toluene (48 g) and stirred for 30 min at room temperature. 29 The mixture was heated to 110°C for 24h.

Finally, in each method, the TMSPMA-grafted silica nanoparticlesr were washed three times by centrifugation with acetone and dried under vacuum.

Grafting of copolymer onto silica nanoparticles

Grafting of copolymers onto silica nanoparticles was performed in toluene with different initial amounts of copolymer. As an example, a solution of 2.26 g of P(TMSPMA-stat-PFDA) in 7 g of toluene was added to a suspension of silica (1 g) in toluene (22 g). The mixture was stirred for 30 min at room temperature and then heated to 110°C for 24h. Finally the copolymer-grafted silica nanopowder was washed three times with acetone, separated by centrifugation and dried under vacuum.

Results and Discussion Section

Cotelomerization of TMSPMA with PFDA Statistical copolymers of TMSPMA and PFDA were prepared by telomerization with 2mercaptoethanol as transfer agent and AIBN as initiator in acetonitrile at 80°C. The characteristics of the copolymer are summarized in Scheme 1. The efficiency of 2mercaptoethanol was demonstrated in a previous publication by the determination of the transfer constant (C T ). 18 The corresponding value reveals a good control of the numberaverage polymerization degree ( n DP =8). The incorporation of PFDA moieties was limited to 10% initial content because of the poor solubility of the fluorine groups in organic solvents.

Moreover, no hydrolysis of the -Si(OCH 3 ) 3 groups was confirmed by the signals integration of 9H m than 2H j as shown in Figure 1. Thus, telomerization appears to be a good method for synthesizing oligomers containing fluorine groups.

The monomer reactivity ratios were determined by Jaacks (r TMSPMA =0.67) and Macret (r TMSPMA =0.66 and r PFDA =1.51) methods. 18 The obtained values illustrated that the copolymer was statistical (r TMSPMA × r PFDA =0.99) and that PFDA reacts preferentially than TMSPMA. At the early stage of the polymerization (first hour), the resulting chains were enriched in PFDA whereas at higher conversion, they were enriched in less reactive TMSPMA monomer.

Scheme 1: Synthesis of P(TMSPMA-stat-PFDA) copolymer. comparing signals integration: H e , H j and H b which appear at 4.2, 3.9 and 2.7 ppm respectively (Figure 1). The final composition of the cotelomer was also deduced following equations (2) and (3). The ratio between the integration of PFDA unit proton (H e ) and that of end-group ones (H b ) gave the number of PFDA units n in the cotelomer. The same equation was used with H j and to determine the TMSPMA units m in the cotelomer.

     ppm) 2.7 (at H ppm) 3.9 (at H ppm) 4.2 (at H DP b j e n (1)    ppm) 2.7 (at H ppm) 4.2 (at H n b e (2)    ppm) 2.7 (at H ppm) 3.9 (at H m b j (3)
1 H NMR and two-dimensional 1 H-1 H COSY spectral analysis unambiguously reveal the microstructure of P(TMSPMA-stat-PFDA). 1 H NMR analysis shows the tacticity of TMSPMA units with three signals: isotactic H h(i) , atactic H h(a) and syndiotactic H h(s) between 1.4 and 0.7 ppm as previously reported Chen et al. 30 However H h(a) overlapped H h(s) protons and prevented from the calculation of syndio-, iso-and atacticity ratios (Figure 1). Moreover in the two-dimensional 1 H-1 H COSY spectral analysis, the peak at 3.7 ppm was correlated to the proton peak at 2.7 ppm (H a ,H b ) and proved the incorporation of the telogen agent in the backbone of the copolymer while the other correlations concern both PFDA and TMSPMA units (Figure 2). Two serial correlations between H j , H k and H l as well as the interaction between further protons H g and H h demonstrated the presence of TMSPMA units in the copolymer. Moreover PFDA unit was detected by the correlation between the protons on the backbone H c to H d in the region of 2.5 ppm.

Figure 2: 1 H-1 H COSY NMR spectrum of P(TMSPMA-stat-PFDA) copolymer in CDCl 3 .

Functionnalization of P(TMSPMA-stat-PFDA) by isocyanatoethyl methacrylate (IME)

Telomers are good precursors for the synthesis of macromonomers by conversion of the terminal function coming from the telogen into unsaturation. 19 The reaction of isocyanate functions from IME onto alcohol ones was performed with triethylamine as catalyst (Scheme 2). Usually this reaction can be monitored by FTIR since the large and intense isocyanate band at 2250 cm -1 disappears after few hours of reaction at 60°C. 20 In our case, IME was used in excess so, FTIR analysis could not be used due to the high absorption band of the unreacted NCO groups. The structure of the purified macromonomer was checked by 13 C NMR (Figure 3). The appearance of two peaks was observed at 156.02 ppm (-NH-COO-) and at 39.97 ppm (-CH 2 -NH-) which prove the formation of urethane groups. Peaks at 135.87 and 126.20-125.70 ppm corresponding to the terminal unsaturation was also observed. Thus, this study showed that the terminal alcohol function of P(TMSPMA-stat-PFDA) is enough reactive to give a macromonomer. So various NMR studies permitted to characterize P(TMSPMA-stat-PFDA) cotelomer. Its chemical composition in PFDA and TMSPMA units was calculated from 1 H NMR study and the microstructure was determined by additional two-dimensional 1 H-1 H COSY analysis.

Finally the reactivity of the hydroxy end-group of the cotelomer was proved by 13 C NMR analysis.

Macromonomer

Grafting of cotelomers onto silica nanoparticles

Preliminary experiments were performed with TMSPMA monomer in order to determine the optimal conditions to graft organosilane molecules on silica nanoparticles. Hydrolyzed silanes react by condensation with the silica surface bearing significant concentration in silanol groups. Three experimental methods named A, B and C differing by the natures of the solvent and of the catalyst, the temperature, were compared. 21,28,29 Experiments were performed in a mixture of acetone and water with maleic anhydride as catalyst at 60°C for A-method, in a mixture of ethanol and water with acetic acid as catalyst at 70°C for B-method and in toluene at 110°C for C-method. In all cases, silane was in excess in respect to silica and the targeted silane grafting density was arbitrarily fixed at 22.80 μmol.m -2 . C-method provided the best results (Table 2 runs 1, 2 and 3) and thus was used for the grafting of the cotelomer.

Herein, we report the grafting results for TMSPMA and P(TMSPMA-stat-PFDA) on silica nanoparticles (Scheme 3). The grafting was qualitatively evidenced by FTIR spectroscopy and 29 Si NMR solid state analysis. Figure 4 shows the infrared spectra of untreated silica and silica after grafting with the cotelomer. In both spectra a peak appearing around 3400 cm -1 was characteristic of O-H stretching. Infrared spectra of cotelomer grafted silica revealed new absorptions at 1700 cm -1 which could be assigned to carbonyl group (C=O) and 2900 cm -1 corresponding to aliphatic carbons of silane moieties. These FTIR analysis disclose the presence of cotelomer with silica even if the formation of covalent bonds between silica and hydrolyzed silanes could not be proved by this analytical method. Figure 4: FTIR spectra of untreated silica and copolymer grafted silica. 29 Si cross-polarization magic-angle-spinning (CP/MAS) NMR investigations were used to determine the structure of silane grafted onto silica. Organosilane can theoretically react with one (monodental structure), two (bidental structure) or three silanols (tridental structure). A previous work detailed the chemical shifts of the silanol and siloxane functions of silica and silyl grafted. 23 The spectrum of the cotelomer modified silica revealed two groups of signals as shown in Figure 5. The first group is characteristic of unreactive silica and the signals at -92 (Q 2 ), -102 (Q 3 ) and -110 (Q 4 ) ppm are assigned to geminal silanols, free silanols and siloxane groups, respectively. The second group is only observed for modified silica. The signals at -43 (T 1 ), -48 (T 2 ) and -57 (T 3 ) ppm are attributed to organosilane condensates and show that various species are formed onto silica surface. This observation is of great importance for the calculation of the grafting density which depends on the number of formed bonds. The silane grafting onto silica was also quantified by elemental analysis and thermogravimetric analysis. These two methods permitted the determination of the silane coverage of silica surface. First, the organosilane grafting density was determined by elemental analysis from the carbon content using the Berendsen equation ( 4). 31 Grafting density (μmol.m

-2 )=    S 1 M ΔC N M 100 ΔC 10 silane c c 6       ( 4
)
where ΔC is the difference of carbon content (wt %) between the sample and the unreactive silica C silica =0.23%, M c and N c are the atomic mass (M c =12 g.mol -1 ) and the number of carbon atoms of the grafted silane, respectively. M silane is the molecular weight of the silane and S is the specific area of the silica (S=200 m 2 .g -1 ). N c and M silane are function of the number (1, 2 or 3) of formed bonds between the three methoxy groups of the silane and the silica surface. As 29 Si CP/MAS NMR demonstrates that the three types of anchoring (mono-, bi-and tri-dental) exist, one can considers a bidental average anchoring of silanes. N c and M are easily calculated for TMSPMA (Table 1). For the P(TMSPMA-stat-PFDA) copolymer one needs to consider a molar mass and average carbon number since a chain contains many silane groups

(Equations 5-6). units silane of number copolymer grafted the of number carbon N PFDA) - stat - P(TMSPMA C  silane n group) - (end C PFDA n (PFDA) C silane n (silane) C PFDA) - stat - P(TMSPMA C f DP N f DP N f DP N N         (5) silane n group) - (end PFDA n (PFDA) silane n ) (silane PFDA) - stat - P(TMSPMA f DP M f DP M f DP M M         (6)
where f silane and f PFDA are the molar ratio of the silane (92%) and of the fluorine (8%) moieties respectively, determined by 1 respectively. These precisions appear to be important since these details of calculations are slightly detailed in the literature and thus confusion can occur.

Table 1: Carbon numbers and molecular weights of the grafted P(TMSPMA-stat-PFDA)

supposing average bidental anchoring and TMSPMA.

Moreover, the grafting yield, which corresponds to the fraction of silane grafted onto silica, can be calculated using following equation:

Grafting yield (%) = 100 [silane] density grafting x  (7)
where [silane] x (μmol.m -2 ) is the initial concentration of silane, which is not hydrolyzed yet, and can be calculated using the following equation:

N C (
                   mol g ( 8
)
where m x and m silica are the weight of TMSPMA or P(TMSPMA-stat-PFDA) and the weight of silica added before reaction. M x corresponds to the molecular weight of TMSPMA with their three OMe groups. The grafting density was also determined by thermogravimetric analysis using equation ( 9):

Grafting density (μmol.m -2 ) =

                (9)
where W 60-730 is the weight loss from 60 to 730°C, corresponding to the degradation of the silane and W silica is the weight loss of silica before grafting (W silica =2.51%). All the results of TGA and elemental analysis on silane grafting are summarized in Table 2.

For TMSPMA, the grafting density ranged from 0.07 to 1.37 and from 0.10 to 0.90 μmol.m -2 by elemental and thermogravimetric analysis respectively. In a previous study of Bourgeat-Lami et al. similar results were obtained for a silane concentration of 20 μmol.m -2 using silica with a specific area of 228 m 2 .g -1 . 14 Although, it is difficult to compare these values since hypothesis made for calculation differs regarding to the authors (i.e. molar mass and number of carbon atoms of the grafted silane). Moreover different silica grades are commercially available and bear different specific area. The solvent nature has a greater influence on TMSPMA grafting reaction than temperature and catalyst, meaning that good dispersion of silica favors the reaction onto silica surface. Indeed, among the three experimental protocols, the highest weight loss of 5.52% and the highest carbon content were observed in toluene using the C-method (Table 2, run 3). Thus, this experimental protocol was selected for the grafting of P(TMSPMA-stat-PFDA). TGA studies provided informations on the relative amounts of grafted copolymer (Table 2, runs 4-8). The weight loss was caused by the decomposition of P(TMSPMA-stat-PFDA) with degradation temperature close to 400°C. For example, for P(TMSPMA-stat-PFDA)/silica weight ratio=0.77 the weight loss was about 6% (W P(TMSPMA-stat-PFDA) (60-730) -W silica = 8.65-of the low grafting density because in the same grafting experimental conditions similar results were observed in the case of TMSPMA which didn't contain fluorinated part (Table 2, run 3 and 6). In our case, steric hindrance effects cannot explain this partial grafting since monomers and cotelomers with low molecular weights were used. Consequently the main explanation could be that the grafting is kinetically limited by chain diffusion with this type of particle.

Conclusions

P(TMSPMA-stat-PFDA) cotelomers were successfully synthesized by radical telomerization controlling the molecular weight and incorporating around 10% of fluorinated monomer. The latter provides hydrophobic property whereas the further grafting onto silica nanoparticles was realized from TMSPMA. In a preliminary study the optimal conditions of grafting were calculated and some details were explained on the calculations of silane/silica weight ratio which were little explained in the literature. Modification of silica surface by cotelomers was qualitatively checked by FTIR and 29 Si solid-state NMR analyses and various organosilane species were detected. Moreover grafting density in cotelomers was quantified by thermogravimetric and elemental analyses with similar values. A maximum grafting density value has been observed while increasing the silane/silica weight ratio. As to the potential uses, such hydride nanocomposites can be considered as building blocks to fabricate more complexe nanomaterials using the reactive polymer end-chains.

Graphical Abstract

After the free-radical cotelomerization of 3-(trimethoxysilyl)propyl methacrylate (TMSPMA)

with perfluorodecylacrylate (PFDA) in the presence of 2-mercaptoethanol, the P(TMSPMAstat-PFDA) cotelomers, containing fluoro and silane groups, were grafted onto silica nanoparticles. The article focuses on the characterization of the structure of the modified silica by FTIR and 29 Si solid-state NMR as well as the detailed calculations of the amount of grafted P(TMSPMA-stat-PFDA) from thermogravimetric and elemental analyses.

Figure 1 : 1 H

 11 Figure 1: 1 H NMR spectrum in CDCl 3 of P(TMSPMA-stat-PFDA) after precipitation in nhexane.

1 H

 1 NMR spectrum of P(TMSPMA-stat-PFDA) allows the determination of n DP (eq. 1) by

2 :

 2 Scheme 2: Chemical modification of P(TMSPMA-stat-PFDA) hydroxyl end-group by IME.

Figure 3 :

 3 Figure 3: 13 C NMR spectra of a) IME compound, b) P(TMSPMA-stat-PFDA) before chemical modification and c) P(TMSPMA-stat-PFDA) after chemical modification.

  (TMSPMA-stat-PFDA) before modification c) P(TMSPMA-stat-PFDA) after modification

l y m e r c h a i n p o l y m e r c h a i n p o l y m e r c h a i n Scheme 3 :

 3 Scheme 3: Schematic grafting routes to prepare: (a) P(TMSPMA) grafted silica nanoparticles, (b) P(TMSPMA-stat-PFDA) grafted silica nanoparticles.

Figure 5 :

 5 Figure 5: 29 Si CP/MAS NMR spectrum of P(TMSPMA-stat-PFDA) grafted silica.

Figure 6

 6 Figure6represents the TGA curves of initial silica and of copolymer grafted silica with various silane concentrations. The TGA measurement of unreacted silica with a weight loss of around 2.51% was due to the loss of water molecules absorbed onto the surface. Different

Figure 7 :

 7 Figure 7: Grafting density and grafting yield versus cotelomer/silica weight ratio.

Figure 8 :

 8 Figure 8: Comparison of copolymer grafting density values obtained by elemental analysis and thermogravimetric analysis.

  , 1 H NMR (200 MHz, CDCl 3 , δ, ppm): 6.09 and 5.54 (s, CH 2 =C), 4.11 (t, O-CH 2 ), 3.57 (s, Si-O-CH 3 ), 1.93 (s, C-CH 3 ), 1.86-1.63 (m, O-CH 2 -CH 2 ), 0.69 (m, CH 2 -CH 2 -Si). 13 C NMR (300 MHz, CDCl 3 , δ, ppm): 166.95 (COO), 136.23 (C=CH 2 ), 124.78 (CH 2 =C), 66.19

	2.2'-
	Azobisisobutyronitrile (AIBN) was purified by recristallization in methanol and dried under
	vacuum. 3-(Trimethoxysilyl)propyl methacrylate (TMSPMA) (Aldrich, 98%), 2-
	mercaptoethanol (Aldrich, 99%), 2-isocyanatoethyl methacrylate (IME) (Aldrich, 98%),
	triethylamine (Acros), acetonitrile (Acros), toluene (Acros), acetone (Fluka) and CDCl 3
	(Aldrich, 99.8%) were used as received.
	(O-CH 2 ), 50.15 (Si-O-CH 3 ), 27.80 (C-CH 3 ), 17.95 (CH 2 -CH 2 -CH 2 ), 166.95 (CH 2 -Si). FTIR
	(cm -1 ): 2944 (CH), 2841 (OCH 3 ), 1717 (C=O), 1638 (C=C), 1100 (Si-O).
	PFDA, 1 H NMR (200 MHz, CDCl 3 , δ, ppm): 6.50-6.40 (dd, H t -CH=CH), 6.19-6.05 (dd,
	CH 2 =CH), 5.91-5.85 (dd, H c -CH=CH), 4.47 (t, O-CH 2 ), 2.52 (m, CH 2 -CH 2 -CF 2 ). 13 C NMR
	(300 MHz, CDCl 3 , δ, ppm): 165.63 (COO), 131.41 (CH 2 =CH), 127.78 (CH=CH 2 ), 125-108
	((CF 2 ) 7 -CF 3 ), 56.37 (O-CH 2 ), 27.80 (CH 2 -CF 2 ). FTIR (cm -1 ): 2944 (CH), 1735 (C=O), 1200-
	1000 (C-F).
	2-Mercaptoethanol, 1 H NMR (200 MHz, CDCl 3 , δ, ppm): 3.71 (dt, HO-CH 2 ), 2.70 (dt, HS-
	CH 2 ), 2.18 (s, OH), 1.38 (t, SH).

TMSPMA

  H NMR (see composition of the copolymer in Scheme 1). M PFDA (C 13 H 7 O 2 F 17 ) and M ext (sum of C 2 H 5 OS and H end-chains) values are 518 and 78 g.mol -1

Table 2 :

 2 TGA and elemental analysis of TMSPMA and of copolymer grafted silica nanoparticles using different experimental methods.

	Elemental analysis	Thermogravimetric analysis

c

) in toluene at 110°C.

Acknowledgements:

The authors would like to thank Gilles Silly and Philippe Gaveau for help in 29 Si NMR measurements. We are grateful to Evonik for a generous gift of silica.

2.51) (Table

 2, run 5) corresponding to a grafting yield of 11.38 %. The highest weight loss of 9.82 % was measured for a silane concentration of 33.83 µmol.m -2 (Table 2, run 7). To find optimum grafting conditions, increasing amounts of copolymer were added to the silica (Table 2, runs 4-8). Figure 7 represents the grafting density (determined by elemental analysis) and the grafting yield as a function of the copolymer/silica weight ratio. The grafting density increases while increasing the copolymer/silica weight ratio until a plateau value at 2.26 µmol.m -2 . In parallel the grafting yield coherently decreased due to steric effects appearing on the silica surface. Beyond this limit, the supplementary added silane enhanced the unreacted reactant amount and decreased the grafting yield. Although, grafting density values were probably overestimated since one cannot quantify precisely the quantity of unreacted silane groups. In the case of P(TMSPMA-stat-PFDA) the low chemical compatibility of hydrophobic PFDA with silica particles doesn't seem to be the main reason


Rémy Rigo-Mariani

Arif Ahmed

Smart Home Energy Management with Mitigation of Power Profile Uncertainties and Model Errors

Keywords:

The paper proposes a two-stage home energy management system accounting for optimal energy dispatch, power profiles predictability, and building thermal behaviour. The first look-ahead stage aims at minimizing the energy exchanges with the upstream grid based on load and weather predictions. The second step adapts the controls in real-time in order to mitigate forecast errors while remaining as close as possible to the look-ahead commitments. The originality of the paper lies on the use of different granularities of the building models. Especially, this allows to account for the approximations in the system equations embedded in the predictive controllers. Furthermore, a real-time tuning of those model equations is performed based on the deviations observed on the state variableserrors between controller predictions and measurements. Ultimately the proposed approach allows to cope with two generic drawback of traditional model predictive control: i) environment forecast errors and ii) models approximations. Several simulations are carried out to under different weather conditions, demonstrating an average energy exchange reduction of at least 25% and better system predictability. The work is completed with sensitivities analysis of the controller settings, the system parameters and the quality of weather/load forecasts.

Below is the nomenclature of the main used symbols in the proposed management strategy

Introduction

Over the past decades, the necessity to cope with limited fossil fuels and the need for reduced carbon emissions led to the increasing penetration of renewable based energy sources in power and energy systems [START_REF] Farooq | Smart grid-energizing towards a greener future[END_REF]. Especially, greater numbers of systems are connected at the end-users levels, behind-the-meter, consisting then in small-scale units widely spread over the distribution networks [START_REF] Vasiliev | Recent Developments in Solar Energy-Harvesting Technologies for Building Integration and Distributed Energy Generation[END_REF]. Such renewable-based distributed energy resources (DERs) allows reduced system losses with generation closer to the points of consumption and reduced energy bills for the usershigher ratios of self-consumption and self-sufficiency [START_REF] Klingler | Self-consumption with PV+Battery systems: A market diffusion model considering individual consumer behaviour and preferences[END_REF]. More efficient performances can be achieved when considering other types of DERsas battery storage systems [START_REF] Zupančič | Genetic-programming-based multi-objective optimization of strategies for home energy-management systems[END_REF] , fuel cells [START_REF] Sharma | Robustly Coordinated Bi-Level Energy Management of a Multi-Energy Building Under Multiple Uncertainties[END_REF] or local generation units [START_REF] Gruber | Two-stage Optimization for Building Energy Management[END_REF] for a better match between the local generation and consumption. At the building or household level, it is possible to uptake more flexibilities and reach higher energy efficiency while actively controlling appliances (e.g. shiftable loads) [START_REF] Huy | Multi-objective framework for a home energy management system with the integration of solar energy and an electric vehicle using an augmented ε-constraint method and lexicographic optimization[END_REF]. Another possibility is to account for thermal comfort constraints and make use of the buildings, thermal inertia as additional storage capabilities [START_REF] Mir | Energy Management in Smart Buildings and Homes: Current Approaches, a Hypothetical Solution, and Open Issues and Challenges[END_REF] -considering the Heating Ventilation and Air Conditioning (HVAC) system, its consumption and its impact on the house temperature. Indeed, such multi-energy approaches allow the best performances while taking advantage of the interaction between energy carriers and their respective demandperformances can be further enhanced while considering combined heat and power units and/or thermal storages [START_REF] Sharma | Robustly Coordinated Bi-Level Energy Management of a Multi-Energy Building Under Multiple Uncertainties[END_REF].

In order to enable the aforementioned system performances, Energy Management Strategies (EMS) have long been investigated in the framework of smart grid and renewable energy integration for small-scale systems such as 'smart homes' [START_REF] Mir | Energy Management in Smart Buildings and Homes: Current Approaches, a Hypothetical Solution, and Open Issues and Challenges[END_REF]. Those management schemes typically rely on Model Predictive Control (MPC) where the DERs setpoints are computed based on prediction of the system environment (i.e. load/generation profiles) and models of the system itselfi.e. potentially including the model of the building/household when thermal comfort is considered [START_REF] Sharma | Robustly Coordinated Bi-Level Energy Management of a Multi-Energy Building Under Multiple Uncertainties[END_REF] [7] [START_REF] Duman | A home energy management system with an integrated smart thermostat for demand response in smart grids[END_REF]. In most cases the control takes the form of a cost-driven optimization (i.e. minimization of the energy bill [START_REF] Duman | A home energy management system with an integrated smart thermostat for demand response in smart grids[END_REF] [10] [START_REF] Dadashi-Rad | Modeling and planning of smart buildings energy in power system considering demand response[END_REF]), with potential environmental objectives such as carbon emissions [START_REF] Zupančič | Genetic-programming-based multi-objective optimization of strategies for home energy-management systems[END_REF], [START_REF] Mansouri | Energy management in microgrids including smart homes: A multi-objective approach[END_REF], and/or technical criteria -e.g. Peak to Avera Ratio (PAR) of the power profile exchanged with the upstream grid [START_REF] Huy | Multi-objective framework for a home energy management system with the integration of solar energy and an electric vehicle using an augmented ε-constraint method and lexicographic optimization[END_REF], [START_REF] Mansouri | Energy management in microgrids including smart homes: A multi-objective approach[END_REF]. Deterministic optimizations are then performed on a look-ahead basis, typically along a 24 h window and the considered algorithms depend on the type of models considered. Mixed Integer Linear Programming (MILP) is widely used, especially when binary variables/constraints are necessary to account for the operation of shiftable/interruptible load (i.e. on/off status) [START_REF] Duman | A home energy management system with an integrated smart thermostat for demand response in smart grids[END_REF], [START_REF] Ghayour | Optimal scheduling of electrical and thermal resources and appliances in a smart home under uncertainty[END_REF], [START_REF] Zamanloo | Optimal two-level active and reactive energy management of residential appliances in smart homes[END_REF]. Mixed Integer Non-Linear Programming (MINLP) is applied when nonlinearities occur in the modeling of storage degradation [START_REF] Sharma | Time-Coordinated Multienergy Management of Smart Buildings Under Uncertainties[END_REF], electrical grid [START_REF] Mansouri | Energy management in microgrids including smart homes: A multi-objective approach[END_REF], or HVAC system [START_REF] Anvari-Moghaddam | Optimal Smart Home Energy Management Considering Energy Saving and a Comfortable Lifestyle[END_REF]. Heuristics [START_REF] Li | Ensemble Nonlinear Model Predictive Control for Residential Solar-Battery Energy Management[END_REF] and metaheuristics as genetic algorithms [START_REF] Zupančič | Genetic-programming-based multi-objective optimization of strategies for home energy-management systems[END_REF] or particle swarm optimization [START_REF] Dadashi-Rad | Modeling and planning of smart buildings energy in power system considering demand response[END_REF] are also used when multi-objectives or strong nonlinearities are considered.

Most of the studies previously commented refer to MPC run in a somewhat single stage in the sense that the control performances are assessed in an offline mode assuming perfect forecast. In actual implementations, uncertainties of renewable generation and/or load profile degrade the performances of the controller. Redispatching and adaptive strategies, closer to real-time (typically at the resolution of some minutes), are then necessary to cope with uncertainties and well-identified MPC shortcomings [START_REF] Gholamzadehmir | Adaptive-predictive control strategy for HVAC systems in smart buildings -A review[END_REF]. Two-stage management can then be considered with near real-time phases that consider updated forecasts for power and/or price profiles [START_REF] Gruber | Two-stage Optimization for Building Energy Management[END_REF]. Another potential of two-stage approaches is that they can allow two mitigate uncertainties from the upstream grid perspective and thus improve both its operational and long-term planning [START_REF] Gruber | Two-stage Optimization for Building Energy Management[END_REF]. In practice, the near real-time phase adapts the actual controls so that the power profile at the house level (i.e. grid power profile) remains as close as possible to a scheduled predefined in the look-ahead phase. This can be done through the use of fast heuristics [START_REF] Rigo-Mariani | Off-line and On-line Power Dispatching Strategies for a Grid Connected Commercial Building with Storage Unit[END_REF], [START_REF] Aznavi | Two-Stage Energy Management of Smart Homes in Presence of Intermittencies[END_REF] or traditional MILP [START_REF]Two-stage Optimization for Building Energy Management[END_REF], [START_REF] Di Piazza | A two-stage Energy Management System for smart buildings reducing the impact of demand uncertainty[END_REF].

Mitigation of forecast errors has since been noticeably investigatedload/generation prediction, energy prices, and/or environmental factors such as ambient temperature or solar radiation. However, MPC approaches also suffer from a lack of perfect accuracy of the models embedded in the controllers. Indeed, most of the equations are convex in order to avoid prohibitive computational times of the MPC. Due to those model approximations, the actual system may not respond accordingly to the predictions. It is then deemed important to assess the performances of the proposed controls after they are sent to the system, which is not done in any of the aforementioned references. Validation on more accurate building models (e.g. EnergyPlus software) can still be found in the literature while applying reinforcement learning [START_REF] Pinto | Data-driven district energy management with surrogate models and deep reinforcement learning[END_REF], [START_REF] Wang | Data-driven model predictive control for building climate control: Three case studies on different buildings[END_REF] or traditional MILP [START_REF] Knudsen | Economic model predictive control of space heating and dynamic solar shading[END_REF] for cost reduction. Some studies with experimental results on real-life systems over a sample of actual rooms [START_REF] Wang | Field test of Model Predictive Control in residential buildings for utility cost savings[END_REF] or an entire house [START_REF] Gomes | MILP-based model predictive control for home energy management systems: A real case study in Algarve, Portugal[END_REF]. However, the proposed management strategies focus on cost reduction with comfort constraints with no real-time correction to mitigate power profile uncertainties. This paper then investigates a two-stage home energy management and takes advantage of different model granularities in order to validate the controls on a system that is mathematically different from the equations embedded in the MPC controllers. The first stage based on traditional MILP aims at minimizing the energy exchanges with the main electrical grid. This objective is deemed more generic than traditional cost reduction criteria that depend on the countries, and power providers. The second stage (based either on MILP or a heuristic) allows to adapt the controls in order to stick to the committed profiles following the first look-ahead stage and while mitigating load/generation uncertainties. Also, the models in the near real-time controls are adapted online based on the observed deviations between the predicted system state values and the measurements. This allows to assess and improve the performances of the proposed controls once they are sent to a validation model (i.e. more accurate). Appendix B summarizes the paper scope with regards to the investigated references and the main contributions of the paper are as follows:

▪ A two-stage management strategy to reduce energy exchanges and enhance system predictability at a household level -> 25 % fewer exchanges compared to a baseline scenario.

▪ The consideration of different model granularities to compensate for the lack of accuracy of model-based controllers and real-time tuning of the models based on observed deviations. Ultimately, the proposed management allows to mitigate both forecast errors and model approximations for predictive control.

▪ The simulation/validation of the proposed approach over different controller settings, and system parameters while accounting for different weather/load forecast qualities.

Building Model Granularities

Controlled System

The considered case study accounts for the thermal behavior of the system while considering the electricity needed for heating/cooling with respect to the ambient temperature (T t a ), solar irradiation (Gt,) and numerous building parameters. Ultimately, for a given electrical load value (p t l ) and solar generation (p t pv ), the electrical power exchanged with the grid (p t gd ) is impacted by the two degrees of freedom in the systemi.e. the battery charge/discharge powers (p t bat+ ,p t bat-) and the zone temperature setpoint set by the user (T t s ) that impacts the electrical load for heating/cooling (p t h /p t c ). Figure 1 displays the generic layout of the single-house system behind the meter. Note that the weather conditions, which are inputs for simulation, embed the solar radiation (Gt) that is used (with the ambient temperature T t a ) to compute the generated solar power (p t pv ) based on a standard single-diode solar model [START_REF] Shongwe | Comparative Analysis of Different Single-Diode PV Modeling Methods[END_REF].

Building Thermal Models

Reference Model

As previously mentioned, the simulation accounts for the thermal behavior of the house/building by modeling the dynamic thermal nature of the house/building and considering the impact of HVAC power for heating (p t h ) and cooling (p t c ). A reference system model is then established based on prior works carried out in the context of multi-energy system modeling [START_REF] Troitzsch | kaiATtum, tomschelo, and arifa7med, mesmo[END_REF]. The model serves as a reference to evaluate the HVAC electrical power required for heating/cooling and output corresponding dynamic zone temperature (T t z ) of the house/building. The house/building model equations embed major building characteristics such as its surface/volume, orientation, widow area, the thermal resistance of walls, etc. For numerical stability purposes, an internal time resolution of one minute is set for the house/building model simulation. The heating/cooling HVAC power is then estimated based on the weather conditionsi.e. ambient temperature and solar radiation while accounting for the orientation of the walls with regard to the solar position, and the zone temperature setpoint (T t s ). The zone temperature setpoint is a user-defined controllable input, which serves to fulfill the temperature comfort level inside the house/building. The zone temperature setpoint here is considered as an actual degree of freedom in the system control and a PID controller is added to the original model equations in order to adapt the heating/cooling power based on measured errors between the actual zone temperature (T t z ) and the reference setpoint (T t s ). Various time-varying parameters from the reference system model are then used as inputs to a lower resolution (e.g. 5 min and 30 min) model that depends on the control horizon. Figure 2 summarizes the input/outputs of the considered reference system model, detailed equations can be referred to in the documentation on prior projects [START_REF] Troitzsch | kaiATtum, tomschelo, and arifa7med, mesmo[END_REF], and are not presented here as it is outside the scope of the paper.

Simplified Models

The energy management strategy proposed in this paper is based on model predictive control (MPC). The equations of the original model, and especially the need for fine temporal resolutions, are not compatible with look-ahead approaches. Especially, considering fine resolutions over longer periods of time (e.g. day-ahead) in optimization-driven solutions leads to increased complexity and heavy computational burden. Thus, in our proposed approach, simplified HVAC power models are developed from the reference model based on least square minimization fitting and an experimental perturbation of the reference model with various temperature setpoints (in the range 18 °C -24 °C), ambient temperature values (in the range ₋20°C -40 °C), and initial room temperature (in the range 18 °C -24 °C) to capture the dynamics of the reference system in the simplified model. More specifically, two distinct simplified HVAC power models are generated corresponding to the two control horizons considered that will be presented in the following sectioni.e. a 30 min and a 5 min model for dayahead and near real-time control, respectively. The first simplified HVAC power model at 30 min resolution is set up based on the linear dependency of the heating/cooling power with the temperature setpoint (T t s ) and ambient temperature (T t a ). At 30 min time steps, results showed that the average HVAC power depends marginally on the initial zone temperature provided that it is already controlled in the range corresponding to the desired setpoints i.e. within 18 °C to 24 °C. For every investigated data sample in the fitting process, the original system model is run over a 30 min period with an internal one-minute resolution loop. A distinction is made whenever the system operates in cooling mode (i.e. temperature setpoints lower than ambient temperature) or heating (i.e. temperature setpoints higher than ambient temperature). This results in two sets of fitting coefficients for the 30 min resolution model in Eq. (1) (lower script '30'). Similarly, the fitting at 5 min resolution is performed with two distinct operating modes (cooling and heating). However, in this case, the initial zone temperature proved to have a significant impact on the average heating/cooling power over five minutes with different temperature setpoints and ambient temperature values. Thus, additional terms and coefficients relating to the zone temperature (𝑇 𝑡 𝑧 ) are included in the fitting model in Eq. ( 2).

 =  +  +  +   =  +  +  +   (2)
3 Energy Management Strategy

Two-Stage Control

The proposed energy management strategy consists of a two-stage approach with i) an optimization on a look-ahead phase that computes the predicted (commitment) grid power profile for the next day and ii) a near real-time correction of the controls in order to fulfill as much as possible the commitment i.e. minimize the deviation of actual power from the predicted power profile. Figure 3 describes the proposed methodology with both look-ahead and near real-time phases relying on the developed simplified models discussed in the previous section. • grid profile :

• state of charge :

• temperature setpoints : All the outputs from the day-ahead phase denote the commitments (upperscript "*") in terms of predicted grid power profile (p t gd* ), temperature setpoints (T t s* ) and state of charge of the battery (soc t * ). The near real-time stage minimizes the errors with those commitments with a set of weighting factors (𝛼, 𝛽, 𝛾)priority is given to the errors with the committed grid power profile (𝛼). The near real-time stage is run every 5 min and computes the controls ultimately sent to the system which is then simulated over the next time-step. As already mentioned, once the actual system is emulated, actual HVAC power is estimated and is used for online tuning of the model integrated into the 5 min MPC. (see section 2.4). The following subsections detail the operations of the successive phases.

HVAC

Day-Ahead Commitment

The day-ahead stage consists of an MPC problem, which is based on forecasted values for the load (p t l ), the generation (p t pv ), and the ambient temperature (T t a ). The main objective of the day-ahead stage is to generate the commitment grid power profile and schedules for the controls (i.e. battery charge/discharge and temperature setpoints) for the next 24 hours. This stage takes the form of an optimization problem whose objective function is to smooth the grid power profiles over the optimization window T (i.e. 24 hours here) (Eq. ( 3)). From the mathematical perspective, this continuously differentiable objective has the advantage of convexity. More importantly, from the user's point of view (i.e. the building/house owner), it allows to reduce at the same time the imported energy and the peak power which have the greatest impact on the electricity bill. Finally, for power system applications, this objective is somewhat representative of the losses minimization due to the line power flow and is also consistent with typical cost-driven optimizations that assume quadratic generation cost (i.e. increasing marginal costs in unit commitment problems [START_REF] Zhu | Optimization of Power System Operation[END_REF]).

( )

2 : min gd t tT obj p   (3)
The first set of constraints (Eq. 4 -Eq. 8) in the day-ahead problem refers to the operating limits for the battery in terms of power and energy (i.e. state of charge soct). Especially, bounds for charging/discharging 𝑝 𝑡 𝑏𝑎𝑡+ , 𝑝 𝑡 𝑏𝑎𝑡-account for the battery rated power and operating mode with the binary variable 𝑢 𝑡 𝑏𝑎𝑡+ denoting the charging mode (Eq. ( 4) and Eq. ( 5)) in order to avoid simultaneous charging and discharging. Note that a traditional alternative formulation embeds two distinct binary variables for charging and discharging with an additional constraint to ensure that only one of the two is nonnull at every time step. It is not considered here for a reduced complexity of the problem and in order to reduce the solution time. The state of charge (so𝑐 𝑡 ) shall remain in the range 0-100 % (Eq. ( 6)) and is updated at every time step with the charge/discharge power according to the simplified linear model in Eq. [START_REF] Huy | Multi-objective framework for a home energy management system with the integration of solar energy and an electric vehicle using an augmented ε-constraint method and lexicographic optimization[END_REF]. The model accounts for the battery efficiency η and nominal capacity (𝑒 𝑏𝑎𝑡 ̅̅̅̅̅). Additional constraint (Eq. ( 8)) allows to set the initial (so𝑐 0 ) and final SOC values to be similar (typical cyclic constraint for energy conservation purposes). Note that for simplicity purposes, 'storage capacity' here denotes the 'usable capcity', which explains that the soc is allowed to varies in the range 0-100 %. This is the capacity purchased. In practice, the acual capacity is greater, and the battery management system controls the actual voltage and actual state of charge (typically never below 20 % for Li-Ion batteries).

0 bat bat bat t t p u p t T ++      (4)
( )

0 1 bat bat bat t t p u p t T - +   -    (5
  = +  -         (7) 1 || || 1 0 t t T soc soc soc = = + == (8)
The next set of constraints relates to the simplified model to compute the HVAC power based on the temperature setpoints between the bounds in Eq. ( 9). Similar to the battery charge/discharge modes, cooling ( c t p ) and heating ( h t p ) cannot occur at the same time. This is ensured with constraint Eq. ( 10) and the use of the binary variable c t u denoting that the system is operated in cooling mode with an upper limit theoretical (λ = 10 6 ). Cooling occurs whenever the ambient temperature (predicted) is greater than the temperature set points, and heating otherwise as ensured with Eq. [START_REF] Dadashi-Rad | Modeling and planning of smart buildings energy in power system considering demand response[END_REF]. Constraints Eq. ( 12) and Eq. ( 13) computes the cooling/heating power of the HVAC with the fitting coefficients for the proposed linear model. The BigM method here ensures that the appropriate operation and power estimation is valid depending on the operating mode (binary variable value). [START_REF] Gholamzadehmir | Adaptive-predictive control strategy for HVAC systems in smart buildings -A review[END_REF] 24

s t T t T     (9)
( )

0 01 cc tt hc tt pu tT pu            -    (10) ( ) 1 a s c t t t s a h t t t T T u tT T T u    -     - -   (11) ( ) ( )
     +  + +       +  + -   (13)
Finally, the last constraint Eq. ( 14) refers to the overall power balance that ultimately sets the grid power value at every time step and depending on the different settings and operating modes for the flexible/controllable assets (i.e. HVAC and battery here)with the HVAC power being the sum of cooling and heating powers. The optimal decisions are driven by the forecasted input profiles: ambient temperature (𝑇 𝑡 𝑎 ), electrical load (𝑝 𝑡 𝑙 ) and solar generation (𝑝 𝑡 𝑝𝑣 ). It should be noted that the solar generation prediction accounts for the expected ambient temperature and solar radiation. Also, note that the grid power is here an unbounded continuous variable that could be either positive or negative. There is no limitation (e.g. in terms of subscribed power) and no discrimination between import from or export to the grid (e.g. with distinct buying and selling prices of electricity [START_REF] Anvari-Moghaddam | Optimal Smart Home Energy Management Considering Energy Saving and a Comfortable Lifestyle[END_REF]), as the operation is not cost-driven here (Eq. ( 3)). The optimization problem for this MPC over a daily horizon (at 30 min resolution) takes ultimately the form of a Mixed Integer Quadratic Programming problem (MIQP). The output predicted profiles (upperscript " * ") are obtained from the optimization, which are the grid power (𝑝

Near Real-time Correction

In near-real-time operation, the actual values for the load (𝑝 𝑡 𝑙 )., the solar power (𝑝 𝑡 𝑝𝑣 ) and ambient temperatures (𝑇 𝑡 𝑎𝑚𝑏 ) is expected to differ from the predictions. In this paper, the measured values in real-time display the same notations as the prediction in the day-ahead phase (i.e. 𝑇 𝑡 𝑎 , 𝑝 𝑡 𝑙 and 𝑝 𝑡 𝑝𝑣 ) for the sake of clarity. It should be noted that the time resolution is not the same moving from 30 min in day-ahead to 5 min in near realtime control. Due to the unavoidable prediction errors, corrective actions shall then be taken in the operational phase in order to fulfill the commitment as much as possible. In other words, the objective is to remain close to the predicted grid profile 𝑝 𝑡 𝑔𝑑 * with a tolerance bandwidth 𝛥𝑝 𝑔𝑑 while adjusting the controls at the current time step ti.e. battery charge/discharge (𝑝 𝑡 𝑏𝑎𝑡+ , 𝑝 𝑡 𝑏𝑎𝑡-) and temperature setpoints (𝑇 𝑡 𝑠 ). Similar to the previous phase, the near real-time operation relies on an MPC approach over a single time step. The objective is to penalize the deviations above the tolerance (𝑝 𝑡 𝑔𝑑+ ) and below (𝑝 𝑡 𝑔𝑑-) as shown in Eq. [START_REF] Sharma | Time-Coordinated Multienergy Management of Smart Buildings Under Uncertainties[END_REF]. Deviations regarding the battery state of charge and temperature setpoints are also considered with a set of weighting factors α (equal to10 6 for the priority given to the grid power correction), β (equal to10 3 , second priority to temperature setpoints) and γ (equal to 1). The main idea being to take advantage of the degree of freedom provided by the tolerance bandwidth on the grid power to realign the other variablese.g. if the battery has been over-discharged at the previous time steps to mitigate past uncertainties, its SOC can be corrected if the necessity to shave a peak load that was predicted in the following minutes/hours. In addition, state of charge deviations can be constraints within a tolerance around the predicted profiles as in Eq. ( 16)note that the computation of soct accounts for the actual SOC measurement and the update constraints that implicitly represents the storage model in Eq. ( 7), while the charge/discharge limits are still embedded with Eq. ( 4) and Eq. ( 5). Another operational constraint limits the variation of temperature setpoints with ramping bounds ΔT s (Eq. ( 17)) while the overall power balance equation remains the same as Eq. ( 14) over the considered time step (and accounting for the actual measured values for load and solar generation).

( ) ( ) ( ) 2

T T T T T

- - -   +  (17)
In addition to the constraints mentioned previously, the mathematical formulation of the real-time control problem shall handle the nonlinearity incurred by the need to quantify the grid power deviation beyond the tolerance bandwidth. As illustrated in Figure 4, this formulation requires the introduction of additional variables in order to discriminate the different cases. In practice, binary variables allow to identify if the grid power is above (𝑢 𝑡 𝑔𝑑+ ) or below (𝑢 𝑡 𝑔𝑑-) the tolerance bandwidth (∆𝑝 𝑔𝑑 ) with constraint Eq. ( 18). Obviously, those two cases cannot occur simultaneously, which is ensured with Eq. [START_REF] Rigo-Mariani | Off-line and On-line Power Dispatching Strategies for a Grid Connected Commercial Building with Storage Unit[END_REF]. In order to quantify the deviations above the tolerances, two continuous variables are introduced 𝑝 𝑡 𝑔𝑑+ , 𝑝 𝑡 𝑔𝑑-and are non-null whenever the corresponding binary variables 𝑢 𝑡 𝑔𝑑+ , 𝑢 𝑡 𝑔𝑑-are active (i.e. = 1) (Eq. ( 20)). A last variable 𝑝 𝑡 𝑔𝑑0 is needed to capture any grid power values within the tolerance (Eq. ( 21)) while the overall relationship between the introduced quantities is driven by constraint Eq. ( 22) that reconstructs the expected grid power for the considered time step. Similar to the day-ahead phase, the expected grid power values depend on the HVAC power estimated with a simplified least-square fit model of the building and the temperature setpoints values (i.e. degree of freedom). In near real-time operation, the thermal model accounts for the measured zone temperatures and the 5 min resolution fitting mentioned in Section 1.2.2. The formulation relies on the same approach as the one described for the look-ahead MPC with the binary variable 𝑢 𝑡 𝑐 denoting that the system operates in cooling mode, and corresponding constraints on the setpoints and cooling mode detection (Eq. ( 9) -Eq. ( 11)). Constraints that estimate the HVAC power integrate the correct fitting coefficient and model formulation (Eq. ( 23) and Eq. ( 24)).

( ) ( )

5 5 5 5
5 5 5 5 1 1 a s z a s z T a T s T z c c c t c t c t c t t c T a T s T z c t c t c t c t c t a T a T a T b u p tT p a T a T a T b u      +  +  + + -      +  +  + --   (23) 5 5 5 5 5 5 5 5 a s z a s z T a T s T z c h h t h t h t h t t h T a T s T z c t h t h t h t h t a T a T a T b u p tT p a T a T a T b u      +  +  + +       +  +  + -   (24)
Both MPC stages (first MILP stage and second MIQP stage) are written in Matlab using YALMIP Toolkit [START_REF] Lofberg | YALMIP : a toolbox for modeling and optimization in MATLAB[END_REF] and solved with Gurobi.

Online Tuning of the Simplified Thermal Model

Decisions taken in near real-time then rely on an approximation of the thermal behaviordenoted 𝑝 ̃𝑡 ℎ𝑐 in this subsectionwhich is in practice the output from the MPC corresponding to the mathematical equations that represent the HVAC operations (i.e. contribution of cooling/heating powers). Once the controls are actually sent and processed by the system using the reference, the actual HVAC power can be accessed. Preliminary results display a very significant error between the actual HVAC power 𝑝 𝑡 ℎ𝑐 and the predicted 𝑝 ̃𝑡 ℎ𝑐 -57 % Mean Average Error -MAE depicted in Figure 5a over a daily horizon. Thus, despite the very good determination factors (R 2 > 0.95) obtained with the fitting at 5 min resolution (Section 1.2.2), the simplified linear fitting model fails to capture the realistic behavior of the heating/cooling power, with respect to the temperatures (ambient, room and setpoints). This is due to the effect of the PID corrector in the actual building equations that adapts the HVAC power to comply with the temperature setpoints. Its effects are not captured in the model simplification as every sample considered in the fitting is generated with the PID error set to zero. Thus, the use of the 5 min resolution model is enhanced in this section by keeping track of the error between the model estimation and the measured values once the controls are processed and the system is simulated (Eq. ( 25)). Then equations Eq. ( 23) and Eq. ( 24) that estimate the cooling/heating power integrate this error as an additional term in the simplified model (Eq. ( 26) and Eq. ( 27)). Ultimately, this allows to strongly reduce the error between the power estimated in the real-time MPC and the actual value (4 % Mean Average Error -MAE in Figure 5b), which will ultimately lead to a better control of the grid power profiles as discussed further in the results section.

Rule-Based-Controller for Near Real-time Operations

In a second step, a Rule-Based-Controller (RBC) is implemented for near real-time management. The main motivation is to be able to quickly provide a solution for the actual controller implementation and with ensured convergence. For simulation purposes, such RBC can also allow testing a wide range of setups as will be discussed in the following sectione.g. different installed capacities of the assets, impact of the forecast accuracy. The flowchart of the considered RBC is displayed in Figure 6. For the sake of clarity, equations in the test blocks and calculation of the control values are not explicitly described. The underlying idea is to stick to the logic implicitly represented in the optimization problem introduced in the previous subsection. Overall, the priority is to maintain the grid power profile within the tolerance bandwidth (Δp gd ). To do so, the battery is firstly used within its own boundsi.e. maximum charge/discharge and accounting for the SOC tolerance (Δsoc). If the battery action is not enough to compensate for the grid power deviation from the scheduled profile, then the temperature setpoint is tuned within its bounds (min/max values and accounting for the maximum variation ΔT s ). Otherwise, if at a given time step forecast errors are not significant, the estimated grid power value (with no controls) may be within the tolerance bandwidth. That bandwidth is then used as a degree of freedom to correct if needed, the temperature setpoint according to the scheduled values. If the setpoint matches the schedule, the charge/discharge of the battery is adapted to bring the SOC closer to the predicted value. Obviously, those last two actions, shall not lead to a grid power beyond the tolerance. The larger the bandwidth in the near real-time control, the larger the degree of freedom to adjust temperature setpoints and SOC. The settings of the real-time control parameter will be discussed in Section 3.2.

Performance Metrics

Two criteria are defined to assess the performances of the proposed control methodology and represent the two main target objectivesi) power profile smoothing and ii) predictability. The first metric denoted E 2 is somewhat homogeneous to the square of the energy exchanged with the grid (i.e. import/export) in kW 2 . It represents the capacity to smoothen the grid power profile with the objective targeted in the look-ahead phase (Eq. ( 28)). The second criterion E dev in kW estimates the total energy contained in power deviations around the committed grid power profile and tolerance bandwidth (Eq. ( 29)).

( )

2 2 gd t tT E p dt  =   (28) ( ) ( )
   + +- -  = - +   +   =+  = - -  -   (29)

Obtained Results and Sensitivity Analysis

This section presents the obtained results over different test periods and for different parameters tuning of the real-time controller. Load profiles [START_REF] Murray | An electrical load measurements dataset of United Kingdom households from a two-year longitudinal study[END_REF] and weather data [START_REF]Climate Reference Network after One Decade of Operations: Status and Assessment in[END_REF] (temperature and solar radiation) are considered over a full year at a sampling resolution of 5 min for the system simulation in near real-time operations. In the look-ahead MPC, at first, and in order to emulate the forecast 'lack of accuracy', the predictions for a given day (load, temperature, and solar generation) are generated using the profiles of the previous days, resampled at 30 min. The installed solar panel and battery storage have capacities of 3 kWp and 3 kWh, respectively.

Results Over a Single Day

A first daily simulation (summer day) is performed for a summer day. The parameters for the real-time MPC are set to: Δp gd = 300 W, Δsoc = 50 %, and ΔT = 0.5°C. Obtained results are displayed in Figure 7. Especially, Figure 7a displays the grid power profiles with the day-ahead commitment to follow and the tolerance bandwidth (Δp gd = 300 W here). It also highlights the interest of real-time controls that allow to remain within that tolerance most of the time, compared to a case in which the controls scheduled on the look-ahead phase remain unchanged (grey curve). In case of a potential generation deficit compared to the forecasts, the net grid power may exceed the predicted (point A) if the controls scheduled on the look-ahead phase are not corrected. However, it is mitigated thanks to the near real-time MPC with a battery discharge while the state of charge remains within the tolerance bandwidth (Δsoc = 50 % here) around the scheduled patterns (Figure 7b). When there is a generation surplus or an electrical load level lower than predictions (point B), the solution considered in real-time for the simulated day comprises increasing the cooling power by reducing the temperature setpoint (Figure 7c). Table 1 displays the values obtained for the two considered metrics over four different days (seasonal). The case without control does not consider any battery and temperature setpoints adjustment. In that case, the prediction of the grid power is purely based on solar generation and an estimation of the cooling/heating load with a temperature setpoint at 21°C and the forecasted ambient temperature. Results highlight the need for real-time adaptation of the control, especially for uncertainties mitigation and to remain closer to the predicted commitment. Best values for both objectives are obtained with the proposed approach with the online tuning of the thermal model (at 5 min resolution). Note that both MPC and RBC approaches for the near real-time management alternatively returns best values for one of the two metrics.

B. increase cooling

Note that simulations were performed on an Intel Core i5 @ 1.6 GHz, 16GB RAM. The computational burden is very light. The considered Mixed Integer Quadratic Programming (MIQP) problems are solved with Gurobi 10.0.0. The look-ahead stage takes on average 2.21 seconds to run, while the near real-time optimization is performed on average in 0.73 seconds.

Impact of the Near Real-Time Control Parameters

In the second stage, the proposed approach is run over four days (one per season) and with different sets of parameter values for the near real-time MPC. Obtained results are displayed in Figure 8 with the two metrics (energy exchanges E 2 and deviation from commitment E dev ) summed along the four days and plotted in every case. Obviously, deviations around the committed grid profile are maximum when no tolerance bandwidth is considered (Δp gd = 0 W in Figure 8a). At the same time, oscillations around the committed profile are reduced, this also tends to decrease the overall indicator on the energy exchanges E 2 with a smoother grid profile. Also, the bigger the tolerance bandwidth around the scheduled SOC profiles, the bigger the available capacity in real-time to mitigate uncertainties (i.e. more reserve), and the smaller the deviation and smoother the grid profiles (Δsoc = 50 % in Figure 8b). The ramping limit of the temperature setpoints between two successive time steps appears to have no impact on the energy exchanges (E 2 ). However, bigger ramping limits slightly reduce the deviations around the commitment while providing more degrees of freedom in the real-time correction (Δsoc = 50 % in Figure 8b). 2 summarizes four settings extracted from the investigated scenarios that displayed the best performances for both MPC and RBC methods for near real-time management. Overall, performances returned by the MPC approach are slightly better than the ones from the rule-based method. However, in the following section several runs of the control strategy will be performed, and the RBC is applied to reach a shorter computational time.

Trade-Off Between System Performances and Battery Usage

Previous simulations and modeling neglected any impact of battery usage on its degradation and cost. In practice, any over usage (e.g. higher rates of charge/discharge currents, numbers of cycles) along with severe environmental conditions can significantly impact the storage lifespan. In the field of power and energy systems

E dev E 2 E dev E 2 E dev E 2 Δp gd = 300 W Δp gd = 500 W Δsoc = 5 % Δsoc = 10 % Δsoc = 50 % ΔT s = 0.5°C ΔT s = 1°C ΔT s = 6°C a) b) c)
management and planning, conventional problems approximate battery degradation with simplified linear/convex models [START_REF] Li | Sizing of a stand-alone microgrid considering electric power, cooling/heating, hydrogen loads and hydrogen storage degradation[END_REF], [START_REF] Cardoso | Battery aging in multi-energy microgrid design using mixed integer linear programming[END_REF] even though nonlinear representations based on more accurate battery models [START_REF] Li | Ensemble Nonlinear Model Predictive Control for Residential Solar-Battery Energy Management[END_REF] or cycle counting algorithms [START_REF] Hossain | Energy scheduling of community microgrid with battery cost using particle swarm optimisation[END_REF] can be found. Especially, at the first order, aging is characterized by a loss of storage capacity over time that is dependent on the energy exchanged along the simulated horizon (i.e. the integration of charging/discharging power over time) [START_REF] Seger | A storage degradation model of Li-ion batteries to integrate ageing effects in the optimal management and design of an isolated microgrid[END_REF]. Deriving from simple linear models, this subsection then introduces a degradation metric in terms of the 'number of equivalent cycles'i.e. the exchanged energy divided by the nominal capacity of the battery. This metric is integrated as a constraint in the first look-ahead stage of the MPC where a maximum number of cycles per day Ncycle_max is set ((30)). Especially, a factor α in [0,1] is introduced in order to allow more or less battery usage. Similarly, for the near real-time stage, the factor α is used to set the maximum battery power available for uncertainties mitigation ((31)).

( )

( ) _ max 1 2 bat bat t t tT cycle bat p p dt N e  + -  +  -   (30) ( ) 1 bat bat p p   - (31)
There is then a trade-off between the system performances and the battery usageno usage at all for α = 0. A new set of simulations is performed while varying the allowed battery usage along the four tested days (one per season). Note that there is no cost consideration or long-term sizing perspective in the paper that focuses mainly on operation planning. Thus, battery usage is not used here to assess the economic viability of the system or to account for the loss of storage capacity over time. Instead, a degradation indicator in terms of 'the number of equivalent cycles is analyzed with regards to its impact on the technical performance metricsi.e. energy exchanges E 2 and energy deviation with commitment E dev . Obtained results are displayed in Figure 9 where performance metrics display their worst value when the battery is not used at all. In such a case the only degree of control for the building comes from temperature setpoint tuning. Most significant improvements, especially in terms of energy exchanges, occur whit greater batter usages over four equivalent cycles. Thus, a conservative approach to estimate the battery degradation for that kind of application is to assess roughly one daily cycle (simulations performance along four test days).

Cross Sensitivity of the Forecast Accuracy and Storage Size

In this subsection additional simulations are performed while assessing different forecast qualityfor the electrical load (p t l ), solar radiation (𝐺 𝑡 ), and temperature (T t a ). As illustrated in Appendix, forecast profiles for each four seasonal days are taken from historical profiles during the same year. The idea is to assess the impact of the forecast quality and storage capacity (in the range 0 kWh -10 kWh). Note that the solar panel peak power remains fixed here at 3 kWp. Simulations are then performed with different battery capacities and three distinct forecast qualities. Results are displayed in Figure 10, which are computed (mean and confidence interval at 95%) over twenty independent runs in every casewith different forecast profiles at every run. Obviously, the greater the installed capacity, the more reduced the grid exchanges over the tested day, no matter the forecast qualityi.e. decreasing E 2 in Figure 10a. Note that with a value of 456 kWh 2 for the baseline scenarios (i.e. no storage, no thermal control), gains are significant over 25 % in every casealmost half of it allowed by the thermal control (i.e. no storage in Figure 10a). Also, with bad forecast quality, it tends to be more difficult to stick to the committed grid profile as displayed in Figure 10b with near constant E dev with varying installed battery capacity. In addition to the energy deviation with the commitment, it is worth estimating the error between the predicted grid exchanges and the actual ones (E 2 ). Figure 10c displays this error (MAE in %) and confidence interval over twenty independent runs. As for E dev , the accuracy of the forecast significantly affects this error. It is worth noticing that the error also increases with the installed battery capacity. It can be somewhat counterintuitive as more capacity would provide more degree of freedom to absorb deviations between actual and forecasted values. However, in the look-ahead stage, the battery capacity is used in a scheduling phase to smooth the grid power profile (expected for the next day) as much as possible. This leads to an optimal schedule of the battery that oscillates between its minimum/maximum soc values for energy arbitrage purposesat 30 min resolution forecast. Assuming that the battery can follow its schedule in real-time and reach lower state of charge values at a given time step, it would not be able to absorb a sudden deficit of local generation (e.g. important load and/or cooling/heating needs, lower solar generation). Following the previous observations, a last set of simulations/tests is performed while considering the average forecast quality for two different battery capacities 3 kWh and 10 kWhhighlighted points in Figure 10c. Different scenarios are considered while varying the amount of battery capacity that is reserved in day-ahead operations. A capacity ratio is then defined in the range of 0 -50 % to account for more or less capacity available in the look-ahead optimization. Concretely, an allowed state of charge bandwidth around 50 % is implemented while adjusting the SOC constraints in the optimization problem (Eq. ( 6))e.g. ± 10 % around 50 %, ± 20 %, ± 30 %, etc. Results presented over the three charts in Figure 11 highlight the trade-off between actual and deviations from the predictions. As previously observed, increased battery capacity reduces the actual grid exchanges (Figure 11a). However, the improvement rate decreases with greater capacity ratios in look-ahead optimizationi.e. decreasing slope in Figure 11a. At the same time, increased capacity ratios lead to more deviations with the commitmentboth in energy (Figure 11b) and while comparing the actual grid exchanges with the predicted ones (Figure 11c). An interesting trade-off is identified for the investigated capacities around 10 -20 % of the overall storage is usable in the day-ahead phase.

Conclusions

In this manuscript, a two-stage energy management was proposed that mitigates both forecast uncertainties and model equations approximations in model-based controllers. The first MILP stage minimizes the predicted exchanges with the grid and generates a daily energy commitment profile. This committed profile is then used as a reference for the near real-time controller (both optimization and rule-based approaches were tested). The proposed strategy adapts the system model in real-time based on the uncertain solar generation, demand, and ambient temperature. In addition, performances of the real-time control are enhanced while tuning online the model used in the decision-making process with the observed deviations at the previous time steps. This is allowed with the consideration of different model granularities in both the first and second stage controller compared to a reference building representation to which the controls are sent. Simulations performed show that the energy management strategy follows the predicted/committed grid profile with small deviations in real-time operation. The simulations conducted under different weather conditions demonstrated that the proposed strategy reduces energy exchange by at least 25% while meeting the household's energy demand and comfort requirements. Furthermore, sensitivity analysis of the forecast quality and battery capacity was also presented to derive a crucial understanding. Ongoing additional works investigate the possibility to control clusters of building with the implementation of coordination/decentralization schemes. The objective is to uptake higher performance and take advantage of heterogenous energy usages to further enhance the integration of renewable sources with higher systems predictability.

Appendix A

The last sets of simulations performed in this manuscript relies on various forecast for the four seasonal days considered. The forecasts refer to the predicted day-ahead profiles for the solar radiation, ambient temperature, and electrical load. As presented in the manuscript those profiles are input of the look-ahead MPC that allows to define the schedules before real-time control is applied. More specifically, the idea in Section 3.3 is to assess the impact of the forecast quality. Thus, for every investigated day, several forecast profiles shall be generated with different degree of accuracy. In the absence of historical forecasts, a most rigorous approach could consist of implementing different time series predictors [START_REF] Lazzeri | Machine Learning for Time Series Forecasting with Python[END_REF] and train them to reach distinct degree of accuracy e.g. while reducing the training set and/or training iterations. However, the development of such forecasting tools is beyond the scope of the paper. Thus, for the sake of simplicity, forecasts are here taken from historical data along the same year as the four seasonal reference days. For each of those reference days, the other daily profiles are arranged in ascending order with regards to the error compared to the daily reference. The error is the RMSE normalized by the standard deviation of the reference daily poweri.e. a RMSE of 100 % denotes a forecast that displays as much variations around the actual values as the natural variation of the reference profiles around its mean values. Figure 12 displays sets of twenty forecast profiles of different quality (four different quality in columns) for the load (1 st row), temperature (2 nd row) and solar radiation (3 rd row). The most accurate prediction for the solar radiation and temperature reaches RMSE values of 20-40%. However, the load profile at the scale of a single household being much noisier and with less deterministic seasonality/daily variations, the lowest RMSE values observed are above 70 %. [START_REF] Huy | Multi-objective framework for a home energy management system with the integration of solar energy and an electric vehicle using an augmented ε-constraint method and lexicographic optimization[END_REF] Single house, PV, EV, storage, HVAC Cost, PAR MILP ✓ [START_REF] Ghayour | Optimal scheduling of electrical and thermal resources and appliances in a smart home under uncertainty[END_REF] Single house, multi-energy, PV, thermal/electrical storages, controllable loads

Cost MILP [START_REF] Dadashi-Rad | Modeling and planning of smart buildings energy in power system considering demand response[END_REF] Multiple houses in a distribution grid, PV, storage, controllable loads Cost PSO [START_REF] Zupančič | Genetic-programming-based multi-objective optimization of strategies for home energy-management systems[END_REF] Single house, PV, storage Cost, emissions GA [START_REF] Rigo-Mariani | Off-line and On-line Power Dispatching Strategies for a Grid Connected Commercial Building with Storage Unit[END_REF] Single building, PV, storage Cost NLP and heuristic ✓ [START_REF] Kim | Application of market-based control with thermal energy storage system for demand limiting and real-time pricing control[END_REF] Single house, PV, storage, controllable load Cost, energy DP and heuristic ✓ [START_REF] Mansouri | Energy management in microgrids including smart homes: A multi-objective approach[END_REF] Multiple houses in a distribution grid, PV, storage, controllable load Cost, emissions, PAR MIQCP [START_REF] Sharma | Time-Coordinated Multienergy Management of Smart Buildings Under Uncertainties[END_REF] Single house, multi-energy, PV, thermal/electrical storages, controllable loads Cost MINLP ✓ [START_REF] Zamanloo | Optimal two-level active and reactive energy management of residential appliances in smart homes[END_REF] Single household, PV, storage, controllable loads Cost MILP ✓ [START_REF] Anvari-Moghaddam | Optimal Smart Home Energy Management Considering Energy Saving and a Comfortable Lifestyle[END_REF] Single house, multi-energy, PV, fuel cell, storage, CHP unit Cost MINLP ✓ [START_REF] Duman | A home energy management system with an integrated smart thermostat for demand response in smart grids[END_REF] Single house, multi-energy, PV, thermal/electrical storages, controllable loads Cost MILP ✓ [START_REF] Di Piazza | A two-stage Energy Management System for smart buildings reducing the impact of demand uncertainty[END_REF] Single house, PV, Storage Cost MILP / DP ✓ [START_REF] Aznavi | Two-Stage Energy Management of Smart Homes in Presence of Intermittencies[END_REF] Single house, PV, EV, storage, controllable loads Costs Metaheuristic ✓ [START_REF] Sharma | Robustly Coordinated Bi-Level Energy Management of a Multi-Energy Building Under Multiple Uncertainties[END_REF] Single house, multi-energy, PV, fuels cell, storage, CHP unit Costs MINLP ✓ ✓ [START_REF]Two-stage Optimization for Building Energy Management[END_REF] Single house, PV, storage, controllable loads Cost MILP ✓ [START_REF] Ye | Model-Free Real-Time Autonomous Control for a Residential Multi-Energy System Using Deep Reinforcement Learning[END_REF] Single house, multi energy, PV, storage Cost RL [START_REF] Pinto | Data-driven district energy management with surrogate models and deep reinforcement learning[END_REF] Multiple buildings, PV, storage Cost RL ✓ ✓ [START_REF] Wang | Data-driven model predictive control for building climate control: Three case studies on different buildings[END_REF] Single building Cost RL ✓ ✓ [START_REF] Gao | Energy management and demand response with intelligent learning for multi-thermal-zone buildings[END_REF] Single building, controllable load Cost PSO ✓ ✓ [START_REF] Wang | Field test of Model Predictive Control in residential buildings for utility cost savings[END_REF] Single house Cost NLP ✓ ✓ [START_REF] Gomes | MILP-based model predictive control for home energy management systems: A real case study in Algarve, Portugal[END_REF] Single building, storage Cost MILP ✓ ✓ [START_REF] Knudsen | Economic model predictive control of space heating and dynamic solar shading[END_REF] Single

Figure 1 :

 1 Figure 1: Controlled system

Figure 2 :

 2 Figure 2: Reference Model for the building thermal behavior.

Figure 3 :

 3 Figure 3: Flowchart of the proposed methodology.

Figure 5 :

 5 Figure 5: Real-time HVAC power simulated and predicted with 5 min resolution simplified modela) without online correction of the simplified modelb) with online adaption of the simplified model.

Figure 6 :

 6 Figure 6: Flowchart of the implemented RBC

Figure 7 :

 7 Figure 7: Results for a single summer daya) grid power profileb) state of chargec) temperature setpoint.

Figure 8 :

 8 Figure 8: Controller performances over four distinct seasonal days -a) Δp gd -b) Δsoc = 50 % -c) ΔT s Table2summarizes four settings extracted from the investigated scenarios that displayed the best performances for both MPC and RBC methods for near real-time management. Overall, performances returned by the MPC approach are slightly better than the ones from the rule-based method. However, in the following section several runs of the control strategy will be performed, and the RBC is applied to reach a shorter computational time.

Figure 9 :

 9 Figure 9: System performance metrics (E 2 and E dev to minimize) versus battery usage along four test days

Figure 10 :

 10 Figure 10: Mean results and confidence interval at 95 % over 20 independent runs for different forecast quality and battery capacitya) grid exchanges E 2 -b) deviations around the commitment E devc) mean error between predicted and actual grid exchanges E 2 .

Figure 11 :

 11 Figure 11: Mean results and confidence interval at 95 % over 20 independent runs for different battery capacity and usable capacity ratioa) grid exchanges E 2 -b) deviations around the commitment E devc) mean error between predicted and actual grid exchanges E 2 .

Figure 12 :

 12 Figure 12: Sample forecasts for the reference day in autumndifferent forecast quality for the load, ambient temperature and solar radiation profiles.

  set of time steps (time step dt in hour),

				l tt pv pp	load and solar generation at time t (kW)
	Variables :		t T	a	ambient temperature at time t (°C)
	, tt bat bat pp +-	charge/discharge power of battery at time t (kW)	Gt	solar radiation (W/m²)
				Ts c a a b Ta c c	HVAC model coefficient in cooling mode (kW/°C, kW)
	bat t u +	battery in charging mode at time t {0,1}	,, Ta h a a b Ts h h	HVAC model coefficient in heating mode (kW/°C, kW)
	gd t p	grid power at time t (kW)	, pe bat	bat	battery rated power and capacity (kW, kWh)
	, ch tt pp	HVAC cooling/heating power at time t (kW)	0 soc	initial state of charge (%)
	hc t p	HVAC power at time t (kW)			battery efficiency (-)
	c t u	HVAC in cooling mode at time t {1,0}	. *		superscript to denote the committed profiles
	t T	s	Temperature setpoint at time t (°C)	Δp gd	Tolerance bandwidth around committed grid power (kW)
				Δsoc	Tolerance bandwidth around soc profile (%)
				ΔT	Tolerance bandwidth around committed temperature (°C)

t soc battery state of charge at time t (%) ,,

Control Management Temperature setpoints Charge discharge Weather conditions

		gd t p
	, a t G T t	pv t p		bat t p	l t p		hc t p
		bat t p	+	,	bat t p	-	t T	s

model 2 Actual controls -for next 5 mn

	Measures : load
	Linear fitting
	of an accurate
	building
	model at
	different time
	samplings
	Online tuning
	of the model
	with observed
	deviations
	Sytem state profiles :
	• power : grid, HVAC
	• zone temperature
	• battery state of charge

: • battery charge/discharge • temperature setpoints Accurate building model : every 5 mn at 1 mn sampling ▪ PID controller based on the reference HVAC setpoints ▪ Update battery state of charge

, solar and weather Forecasts : load, solar and weather

Additional variables and formulation to identify/quantify grid power deviation around the committed profile.

	* () () * gd gd gd t t gd gd gd t t p p p p p p  -+    - - 	 	gd t gd t u u	+ -	 	 	(18)
	gd tt gd uu +-+		1				(19)
	0 0       	gd tt gd gd gd tt pu pu ++ -- 	 	 	(20)
	gd t p	*	gd -  p	gd t p	0		gd t p	*	p + 	gd	(21)
	gd t p	=	gd t p	0	+	gd t p	gd t p +--	(22)
								gd t p within	gd t p above	gd t p below
								the tolerance	the tolerance	the tolerance
										gd t u + = gd t u -= gd t p + = gd t p -=	0 0 0 0	gd t u + = gd t u -= gd t p -=	1 0 0 p + gd t	gd u + = t gd u -= t gd p + = t	0 1 0
												gd t p	*	p + 	gd
				grid power						gd t p	gd t p 0	*	p -	gd
										gd t p	=	gd t p	0	+	gd t p	+	-	gd t p	-	gd t p -
	Figure 4: time

Table 1 : Power profile smoothing and predictability metrics for four different simulation days

 1

		Winter	Spring	Summer	Autumn
		E 2	E dev	E 2	E dev	E 2	E dev	2	E dev
	No control, no MPC	164.5	9.6	116.1	20.4	46.6	17.6	66.5	11.14
	Look-ahead MPC, no real-time control	104.6	5.8	73.1	14.6	27.4	9.19	33.9	6.9
	Look-ahead and real-time MPC	121.9	3.5	111.4	5.6	25.6	1.3	34.7	2.5
	Look-ahead and real-time MPC, model tuning	100.0	0.7	82.9	2.3	20.3	0.9	26.8	0.8
	Look-ahead MPC and real-time RBC, model tuning	101.6	1.9	88.8	1.7	21.0	0.4	20.6	1.2

Table 2 : Parameters settings returning the best performances over the four seasonal days.

 2

	Look-ahead and real-time	Look-ahead MPC and real-
	MPC, model tuning	time RBC, model tuning

Table 3

 3 summarizes the short literature review performed to highlight the scope of the proposed paper.

Table 3 : Parameters settings returning the best performances over the four seasonal days.

 3

	Ref.	Case Study, DERs and controls	Objectives	Controller Algorithm	HVAC Model	Two-Stage Strategy	Validation Model/System

  PV : photovoltaics, EV : electrical vehicles, MILP : mixed integer linear programming, MIQP : mixed integer quadratic programming, PSO : particle swarm optimization, GA : genetic algorithm, PAR : peak to average ratio, MIQCP : mixed integer quadratically constrained programming, CHP : combined heat and power, NLP : nonlinear programming, MINLP : mixed integer nonlinear programming, DP : dynamic programming, RL : reinforcement learning

		building	Cost	MILP	✓		✓
	This work	Single house, PV, storage	Energy exchanges	MILP/QP and heuristic	✓	✓	✓

6 Acknowledgments This work has been carried out in the framework of the INT2MEC project -INTelligent Multi-Energy Communities for enhanced distributed resources INTegration in Singapore. The research is supported by the National Research Foundation, Prime Minister'sOffice, Singapore under its Campus for Research Excellence and Technological Enterprise (CREATE) program.