N.B. Cette thèse a été rédigée en

The legend goes that the acknowledgements are the hardest part to write in a thesis. I concur. Unlike the scientific content presented in this document, notions of gratitude and friendship are much more slippery. I found that the only way to gauge them is by whether they last past convenient circumstance. So, a month after the madness is over, well-rested and overfed, here it goes: First and foremost, I would like to thank my parents, to whom I dedicate this milestone, for their love and for every opportunity they gave me. I also thank my brothers for their endless support.

Then, I would like to thank the members of the jury for the constructive exchange we had during my defence. In particular, I would like to thank Professor Laurent Lefèvre, Professor Frédéric Kratz, and Professor Jean-Marc Thiriet for their goodwill and keen advice during my thesis.

I would like to thank my supervisor, Professor Stéphane Grieu, for his integrity, rigour, and sense of duty. I am thankful for all the time and energy he invested in helping me to hone my craft. I have learnt a plethora of skills from him, but I am particularly thankful for the perspective he gave me on research, the scientific community, and human behaviour. My Stockholm Syndrome and I are eternally grateful. I would like to thank Dr. Stéphane Thil for his valuable input and well-camouflaged kindness. Special thanks are reserved for Sandrine Puig for helping me navigate some stressful times, and for Laurent Thomas for being both a raging metalhead and a sage professor in one cool package.

I would like to thank all the wonderful friends that populate my life, without whom these past three years would have been much grimmer. I will not even attempt to make an exhaustive list of these friends and their attributes. I never cared much for minefields. Instead, I would like to extend my deepest gratitude to all those with whom I have shared foreboding philosophical discussions at our lows and energetic mirthful moments at our highs, whether we bonded over common experiences or held hands as we dove into new ones, whether we got lost together on a hike or exploring a city, whether we shared a good meal and some carefree laughs, whether we smiled at each other from across the room because we had just thought of the same joke or reference, or whether we headbanged to the same song we both love, or all of the above: I appreciate you. Except when you do not pick up on my sarcasm. Try harder.

Last, but definitely not least, I would like to thank all my favourite metal bands out there, who don't know I exist but consistently make my life better and help make sense of the noise.

"Life is a pendulous fall, but maybe worth the pain" Kamelot -The Pendulous Fall iii vii viii [START_REF] Pepermans | Distributed generation: definition, benefits and issues[END_REF] Example of flexible assets' setpoints using the switch control formulation, where the sampling instants t i and the switching instants ti have been highlighted. . . . 2.5 The unbalance between power supply and demand within the power distribution grid per sliding window size, over four "season-typical" weeks. . . . . . . . . . . . 2.6 A closer look at the unbalance between power supply and demand within the power distribution grid per sliding window size over four "season-typical" weeks. 2.7 Computational complexity, measured as the mean number of function evaluations per sliding window weighted by its size. . . . . . . . . . . . . . . . . . . . . . . . 2.8 Supply/demand gap before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.9 Biogas plant power generation setpoints before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window. . . . . . . . . . . . . . . . 2.10 Water tower power consumption setpoints before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window. . . . . . . . . . . . . . . . 2.11 Biogas plant storage volumes before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window. . . . . . . . . . . . . . . . . . . . . . . . . 2.12 Water tower storage volumes before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a [START_REF] Tawarmalani | Convexification and global optimization in continuous and mixed-integer nonlinear programming: theory, algorithms, software, and applications[END_REF] S OFF Tally of power generation and power consumption in the power distribution grid when the water tower's pump is turned off S ON Tally of power generation and power consumption in the power distribution grid when the water tower's pump is turned on U OFF,q Voltage values when the water tower is turned off U ON,q Voltage values when the water tower is turned on

List of Figures

U j
Voltage at node j of the grid U q Voltage at node q of the grid V end b,down Stored biogas volume in the biogas plant's storage unit at the end of the current time step if the duration of the pulse could not be extended and is shortened to ti = 1 -V middle b,down Stored biogas volume in the biogas plant's storage unit at switching time ti of the current time step if the duration of the pulse could not be extended and is shortened to ti = 1 -V b,down Stored biogas volume in the biogas plant's storage unit at the end of the current time step if the pulse is eliminated V end b,f lip Biogas volume at the end of the time slot if the setpoints are flipped

V middle b,f lip

Biogas volume at the new switch time after the setpoints are flipped V end b,up Stored biogas volume in the biogas plant's storage unit at the end of the current time step if the duration of the pulse is extended to equal the pre-defined threshold

V middle b,up

Stored biogas volume in the biogas plant's storage unit at switching time ti of the current time step if the duration of the pulse is extended to equal the pre-defined threshold xiv V b,up Stored biogas volume in the biogas plant's storage unit at the end of the current time step if the pulse is extended

V s b

Biogas volume corresponding to candidate setpoints of the biogas plant's power generation

V b

Biogas volume in the storage unit V end w,down Stored water volume in the water tower's tank at the end of the current time step if the duration of the pulse could not be extended and is shortened to ti = 1 -V middle w,down Stored water volume in the water tower's tank at switching time ti of the current time step if the duration of the pulse could not be extended and is shortened to ti = 1 -V w,down Stored water volume in the water tower's tank at the end of the current time step if the pulse is eliminated V end w,f lip Water volume at the end of the time slot if the setpoints are flipped V middle w,f lip Water volume at the new switch time after the setpoints are flipped V end w,up Stored water volume in the water tower's tank at the end of the current time step if the duration of the pulse is extended to equal the pre-defined threshold

V middle w,up

Stored water volume in the water tower's tank at switching time ti of the current time step if the duration of the pulse is extended to equal the pre-defined threshold V w,up Stored water volume in the water tower's tank at the end of the current time step if the pulse is extended

Résumé (version française) Introduction

Afin de lutter contre la dégradation de l'environnement, une transition est en cours vers une production d'électricité propre. Cette transition doit faire face à la raréfaction des ressources énergétiques fossiles et répondre à la forte croissance de la demande mondiale en énergie. Un de ses piliers est le développement de réseaux électriques durables et respectueux de l'environnement, en présence d'une production d'électricité ci-après dénommée "production décentralisée". Parce que les réseaux électriques ont à l'origine été pensés et conçus pour une production centralisée et des flux d'énergie unidirectionnels, le déploiement à grande échelle d'une production décentralisée pose de nombreux problèmes, en particulier opérationnels. Le concept de réseau électrique intelligent (ou "smart grid") répond à un besoin : améliorer l'observabilité des réseaux électriques, anticiper plus précisément les problèmes opérationnels qui pourraient être causés par les producteurs décentralisés et contrôler ces réseaux plus efficacement pour en garantir la sécurité et la qualité de service.

Bien que la définition d'un réseau électrique intelligent puisse encore évoluer, un consensus semble émerger quant aux principales caractéristiques d'un tel réseau : une pénétration élevée de la production décentralisée, une observabilité améliorée grâce à des compteurs communicants, des prévisions des grandeurs stochastiques qui affectent le réseau, et des outils de gestion intelligente qui fondent la prise de décision, par l'opérateur, sur des données d'exploitation. Par ailleurs, le nombre de clients connectés au réseau, la zone géographique qu'il couvre ainsi que sa nature, qu'il s'agisse d'un réseau urbain, périurbain ou rural, sont des facteurs déterminants dans la mise en oeuvre d'une stratégie de gestion adaptée.

Face au défi majeur que représente le déploiement d'une production décentralisée, la littérature scientifique regorge de travaux traitant des implications de la pénétration de cette production dans les réseaux électriques, qu'il s'agisse de travaux en lien avec la production d'électricité propre, le développement de solutions électrotechniques pour la connexion des générateurs ou la modélisation, la surveillance et le contrôle/commande des réseaux.

Alors que les technologies vertes pour la production d'électricité, en particulier les panneaux solaires photovoltaïques, sont de plus en plus efficaces pour un coût en baisse, les gestionnaires prévoient une forte augmentation de la pénétration de la production décentralisée dans les réseaux électriques de distribution. Comme on peut le voir sur la Figure 1, la capacité mondiale en solaire photovoltaïque est passée de 8 GW en 2007 à 402 GW en 2017.

En raison de sa nature intermittente, une production solaire photovoltaïque prolifique peut entrainer, au sein d'un réseau électrique de distribution de petite taille, de brusques et importantes fluctuations de l'équilibre entre offre et demande qui, à leur tour, entraînent des fluctuations de tension. Les gestionnaires ayant l'obligation contractuelle de limiter ces fluctuations, les travaux présentés dans ce manuscrit s'inscrivent dans cette démarche.

Le projet "Smart Occitania"

Dans ce contexte, le gestionnaire du réseau électrique de distribution français ENEDIS fonde son activité de R&D sur plusieurs projets de démonstrateurs de réseaux électriques intelligents pour, notamment, la mise en oeuvre de stratégies de gestion prévisionnelle exploitant des flexibilités. En 2020, le site d'ENEDIS répertorie dix projets terminés et dix projets en cours en France métropolitaine [START_REF]Map of demonstrator projects led by ENEDIS for smart grid technologies as of[END_REF]. La Figure 2 précise la localisation de ces démonstrateurs.

Les travaux présentés dans ce manuscrit ont été réalisés dans le cadre du projet "Smart Occitania" (repéré par le chiffre 7 sur la Figure 6), visant à apporter la preuve de concept d'un réseau électrique intelligent en milieu périurbain/rural. Le projet est financé par l'Agence de la Transition Ecologique (ADEME), et soutenu par la région Occitanie. Le projet implique des structures académiques et des industriels, parmi lesquels l'Institut de Recherche en Informatique de Toulouse (IRIT), PROMES-CNRS, ACTIA Télécom et le groupe CAHORS. Le projet a débuté en mars 2017 et se terminera en mars 2021, pour un budget de 8 millions d'euros [START_REF]Smart Occitania page on the ADEME website[END_REF]. Est proposée par PROMES-CNRS une stratégie fondée sur la théorie de la commande prédictive (ou MPC, pour Model-based Predictive Control), exploitant deux flexibilités, un méthaniseur et un château d'eau, destinée aux réseaux électriques de distribution périurbains faisant face à un niveau élevé de pénétration d'une production décentralisée. Le coût calculatoire de la solution est maîtrisé, autorisant son implémentation en temps réel.

Des prévisions de l'éclairement global horizontal (ou GHI, pour Global Horizontal Irradiance), de la charge du réseau et de la demande en eau, à horizon de temps infra-journalier, sont prises en compte afin d'exploiter efficacement les flexibilités susmentionnées et d'équilibrer l'offre et la demande en électricité. La production solaire photovoltaïque est déduite des valeurs de GHI en utilisant un modèle simplifié issu de la littérature. Par souci de simplicité, on parlera plutôt de prévision de la production solaire photovoltaïque pour regrouper le modèle de prévision de GHI et celui de la conversion du GHI en production solaire photovoltaïque.

Les travaux présentés dans ce manuscrit s'appuient sur un cas d'étude : un quartier résidentiel périurbain d'environ 120 habitations (pour onze producteurs solaires photovoltaïques). La stratégie de contrôle développée présente un caractère prédictif et peut être mise en oeuvre en temps réel, avec un pas de temps T = 10 min. Elle opère au niveau du transformateur Haute Tension A/Basse Tension (HTA/BT) et tire profit de deux flexibilités : un méthaniseur qui injecte une production électrique sur le réseau et un château d'eau dont les pompes consomment de l'énergie électrique pour alimenter un réservoir et répondre à la demande locale en eau. La prise de décision est fondée sur la connaissance du comportement du système et sur des prévisions à horizon de temps infra-journalier de la production solaire photovoltaïque, de la charge du réseau et de la demande en eau. xxii Figure 2: Carte des projets de démonstrateurs portés par ENEDIS. Les projets 1 à 10 sont en cours, les projets 11 à 20 sont terminés. Le projet ADEME "Smart Occitania", auquel participe PROMES-CNRS, est le projet 7 [START_REF]Map of demonstrator projects led by ENEDIS for smart grid technologies as of[END_REF].

Les flexibilités considérées pour la mise en oeuvre de la stratégie de commande proposée ne sont pas physiquement connectées au réseau. En effet, aucun réseau électrique de distribution basse tension en région Occitanie ne fait face à un important déploiement d'installations solaires photovoltaïques et ne dispose des flexibilités en question. Ainsi, pour les besoins des travaux présentés dans ce manuscrit, un réseau virtuel (deux configurations distinctes, ci-après présentées) est considéré et des simulations sont réalisées.

Ces travaux de thèse répondent à un important besoin : le développement de solutions logicielles, flexibles et évolutives, pour la gestion prédictive des réseaux électriques de distribution faisant face à une importante production décentralisée. Ces solutions, dont il convient de maîtriser le coût calculatoire, doivent contribuer à limiter les problèmes opérationnels rencontrés par les réseaux électriques de distribution ruraux et périurbains, à favoriser leur intégration de la production décentralisée sans modification importante des infrastructures existantes et à garantir la qualité de service, favorisant ainsi leur transition énergétique. L'apport de ces travaux réside principalement dans le traitement d'un cas d'étude, impliquant des flexibilités jusqu'alors inexploitées à des fins de régulation de la tension, mais également dans la gestion du fonctionnement tout-ou-rien (TOR) du château d'eau sans avoir recours à la programmation non linéaire mixte en nombres entiers (MINLP) ou à des relaxations. La stratégie MPC bénéficie également de prévisions de la charge du réseau, de la production solaire photovoltaïque et de la demande en eau. L'impact de ces prévisions, obtenues par une régression non paramétrique par processus Gaussien (ou GPR, pour Gaussian Process Regression), sur les performances de la structure de contrôle est évalué. Ce type de régression présente l'avantage de fournir des intervalles de confiance associés aux prévisions. Ces intervalles sont utilisés, au cours d'une étape ultérieure, pour modifier la stratégie MPC et, ainsi, la rendre robuste aux erreurs de prévision.

xxiii

Le paradigme du réseau électrique intelligent

Au cours des dernières décennies, le réseau électrique a connu d'importantes évolutions, tant en matière d'infrastructures que de mécanismes de fonctionnement. Ces évolutions sont à l'origine d'un paradigme : le réseau électrique intelligent. Bien qu'aucune définition universelle ne puisse en être donnée, un consensus commence à émerger sur les principales caractéristiques d'un tel réseau. En premier lieu, ce paradigme est fondé sur une abondante production décentralisée. Des unités de production d'électricité exploitant des ressources renouvelables sont directement connectés au réseau électrique de distribution ou côté client du compteur [START_REF] Ackermann | Distributed generation: a definition[END_REF][START_REF] Pepermans | Distributed generation: definition, benefits and issues[END_REF][START_REF] Driesen | Distributed generation: challenges and possible solutions[END_REF]. La pénétration de cette production décentralisée dans les réseaux de distribution affecte les flux d'énergie, la régulation de tension, l'efficacité du système et la détection de défauts. L'interaction entre ces générateurs et leurs réseaux hôtes est régie par un ensemble de règles que le gestionnaire du réseau électrique de distribution doit prendre en compte dans la formalisation de procédures de planification, d'exploitation ou de maintenance [START_REF] Baghzouz | Some general rules for distributed generation-feeder interaction[END_REF].

Le terme "smart grid" fait ainsi référence à un réseau électrique moderne et réactif qui intègre intelligemment la production des générateurs décentralisés et qui est capable de rediriger efficacement les flux d'énergie afin d'équilibrer en temps réel l'offre et la demande tout en respectant des contraintes de stabilité, de qualité et de sécurité. Ce réseau exploite les possibilités offertes par le stockage de l'énergie, adapte les équipements de protection pour la gestion des flux d'énergie bidirectionnels et est capable de desservir des charges non traditionnelles [START_REF] Mišák | A heuristic approach to active demand side management in off-grid systems operated in a smart-grid environment[END_REF].

De plus, l'une des pierres angulaires de ce paradigme est une meilleure observabilité, permettant la surveillance en temps réel de l'état du système. Il est possible d'atteindre cet objectif grâce à une instrumentation de pointe ainsi qu'au déploiement de compteurs de nouvelle génération capables de communiquer de façon bilatérale avec les opérateurs réseau. Les compteurs intelligents enregistrent la consommation des clients et la transmettent à des fins de traitement, de régulation et de facturation. La communication peut s'effectuer sans fil ou via une infrastructure existante comme est le cas du CPL (Courant Porteur de Ligne). Les compteurs intelligents transmettent à intervalles réguliers des paquets de données contenant la puissance active, la puissance réactive, la puissance apparente, la consommation énergétique, la tension, les valeurs de courant et d'autres informations pertinentes. Grâce à ces compteurs, il est possible de suspendre à distance la fourniture d'électricité, notamment pour prévenir certaines pannes, ou de donner la priorité à certaines charges lors d'une remise sous tension progressive. Le compteur intelligent déployé par ENEDIS, l'opérateur du réseau électrique de distribution français, porte le nom de Linky. Son déploiement a débuté en 2015 et devrait se poursuivre jusqu'en 2021. Grâce à Linky, les abonnés ont accès à des informations détaillées sur leur consommation électrique quotidienne, à des courbes de charge depuis l'installation du compteur et à diverses informations statistiques pouvant les aider à mieux gérer leur consommation.

L'intelligence d'un réseau électrique réside principalement dans l'utilisation, par l'opérateur, de techniques avancées de gestion permettant le suivi et l'optimisation en temps réel de son fonctionnement. Ces techniques agrègent des mesures et des prévisions afin de mieux gérer les ressources et de maintenir l'équilibre entre offre et demande tout en assurant la stabilité du réseau et en sécurisant la fourniture d'électricité.

La gestion de la demande (ou DSM, pour Demand Side Management), le pilotage de la consommation électrique par des incitations financières et des évolutions comportementales afin d'influencer sur les profils de consommation des clients [START_REF] Gellings | Demand-side management: concepts and methods[END_REF][START_REF] Strbac | Demand side management: Benefits and challenges[END_REF], est un important marqueur de l'évolution des réseaux électriques. La gestion de la demande regroupe un ensemble de techniques utilisées pour atteindre, directement ou indirectement, un objectif de "forme de charge". La gestion active de la demande peut être définie comme "la combinaison de commandes automatisées et d'une gestion de la demande influant sur la courbe de charge des consommateurs" [START_REF] Gregio | Active demand side management for households in smart grids using optimization and artificial intelligence[END_REF]. La xxiv mise en oeuvre d'une démarche de planification de gestion de la demande peut être décomposée en cinq tâches [START_REF] Kreith | Energy management and conservation handbook[END_REF] : la définition des objectifs, l'identification des alternatives, l'évaluation et la sélection, la mise en oeuvre et le suivi de cette démarche.

Etat de l'art

Un état de l'art est proposé dans le premier chapitre de ce manuscrit, classifiant comme suit les approches de commande avancée des réseaux électriques, dans un contexte de déploiement d'une production décentralisée : les systèmes multi-agents, la commande prédictive, la gestion de la demande et la gestion des flexibilités. Leurs avantages et inconvénients sont discutés en détail. Cet état de l'art a donné lieu à une publication dans une revue internationale à comité de lecture [START_REF] Dkhili | A survey of modelling and smart management tools for power grids with prolific distributed generation[END_REF]. Le choix d'une approche de gestion dépend du type d'application. Les applications diffèrent selon, notamment, les caractéristiques du réseau électrique considéré, les incertitudes pesant sur les variables systèmes et l'objectif poursuivi (par exemple, la planification optimale des opérations, la détection et la correction de défauts, l'optimisation économique ou le contrôle/commande en temps réel). Par conséquent, diagnostiquer précisément l'application est capital lors de la définition d'une stratégie de gestion.

Un aperçu des travaux les plus remarquables traitant de la modélisation et du contrôle des réseaux électriques est donné dans le premier chapitre. En premier lieu, trois approches principales de modélisation des réseaux électriques sont présentées et discutées. Ces approches vont des modèles "boîte noire", qui ne prennent en compte que les interactions entre les composants du réseau et qui visent les applications de gestion de la demande, aux ensembles d'équations dérivées de lois physiques régissant le système pour l'analyse des flux d'énergie au sein du réseau. Ces dernières années, les approches fondées sur les systèmes multi-agents ont gagné en popularité pour la modélisation et le contrôle des réseaux électriques de par leur capacité d'adaptation à la composition évolutive des réseaux et leur aptitude à la mise en oeuvre de stratégies avancées de surveillance et de contrôle en temps réel. Certaines des méthodes présentées empruntent une voie indirecte pour résoudre les problèmes de congestion des réseaux, tentant d'orienter la consommation des clients vers une courbe de charge souhaitée grâce, principalement, à des incitations financières. À l'autre extrémité du spectre, on trouve les techniques dites de résolution directe des phénomènes de congestion, contrôlant directement l'équipement du client, en partie ou en totalité, pour adapter sa courbe de charge. En particulier, il est possible, grâce à ces techniques, de gérer des flexibilités afin de stocker et d'injecter de l'énergie sur le réseau au moment opportun dans le but d'en garantir la stabilité et le bon fonctionnement.

Pour ce qui est de la gestion intelligente du réseau électrique, deux options principales émergent : le dimensionnement et la planification des infrastructures électriques pour répondre aux projections tant en matière de demande énergétique que de pénétration de la production décentralisée et le recours aux techniques avancées de contrôle/commande et de surveillance pour tenter de résoudre les problèmes engendrés par le déploiement d'une telle production. Alors que la première option est valide lorsque la construction de nouvelles lignes électriques est programmée ou pour la planification d'une allocation optimale de la production décentralisée, les gestionnaires de réseaux font généralement le choix de solutions moins coûteuses et mettent en oeuvre des techniques de gestion intelligente pour les infrastructures existantes, sans mise à niveau majeure des équipements.

Cas d'étude

Le cas d'étude est un quartier résidentiel périurbain d'environ 120 habitations. Onze installations solaires photovoltaïques y sont recensées. Ce cas d'étude a fait l'objet de plusieurs hypothèses en xxv lien avec les objectifs du projet. Tout d'abord, des mesures de la charge du réseau sont collectées au niveau du transformateur HTA/BT. Elles montrent que les niveaux de puissance réactive dans le réseau ne dépassent pas 5%. Par conséquent, les effets de la puissance réactive ont été négligés.

La puissance solaire photovoltaïque installée n'étant pas suffisante pour affecter la stabilité du réseau, elle a été augmentée à 200 kW (soit l'équivalent de cinquante installations solaires photovoltaïques domestiques d'une puissance unitaire de 4 kW) afin que puisse être apportée la démonstration, en simulation, que la stratégie de contrôle proposée est capable de combler un écart important entre offre et demande, tout en maintenant les niveaux de tension dans les marges imposées (ici, 10 % de la valeur de tension nominale). Le contrôleur agit au niveau du transformateur ; les résultats obtenus sont de fait indépendants de la distribution de la production solaire photovoltaïque au sein du réseau.

Les flexibilités, qui ne sont pas physiquement connectées au réseau, sont un méthaniseur et un château d'eau. La production solaire photovoltaïque est déduite de mesures de GHI fournies par un capteur placé sur le toit du laboratoire PROMES-CNRS. Le méthaniseur considéré est dimensionné selon une approche générique et sa production de biogaz est supposée constante. Pour ce qui est du château d'eau considéré, le niveau d'eau dans le réservoir de stockage est régulé selon une approche TOR. Des mesures du niveau d'eau et du débit d'eau entrant dans le réservoir ont été collectées, permettant le calcul de la demande en eau.

Stratégie fondée sur la théorie de la commande prédictive

La commande prédictive repose, d'une part, sur l'utilisation d'un modèle dynamique du système à contrôler permettant de simuler son comportement futur et, d'autre part, sur la résolution, sur une fenêtre glissante, d'un problème d'optimisation contraint. Pour chaque intervalle de temps, la première étape des consignes optimales issues du problème d'optimisation est mise en oeuvre puis de nouvelles informations en lien avec le comportement du système et les grandeurs exogènes sont prises en compte ; le problème d'optimisation est à nouveau résolu à l'intervalle de temps suivant. La force d'une telle stratégie réside dans sa capacité à prendre en considération, en temps réel, les prévisions infra-journalières des différentes perturbations affectant la stabilité du réseau électrique de distribution considéré, pour une meilleure anticipation des contraintes émergentes.

Contrairement à une planification d'opération classique où un seul problème d'optimisation est résolu et sa solution mise en oeuvre sur un horizon fixe (par exemple une semaine), l'horizon glissant d'un contrôleur MPC autorise le contrôle en temps réel dans la mesure où l'optimisation effectuée sur une fenêtre glissante prédéfinie de quelques heures est bien moins coûteuse d'un point de vue calculatoire. De plus, sont impliquées dans la gestion des réseaux électriques des grandeurs stochastiques dont les prévisions ont tendance à se dégrader rapidement à mesure que l'horizon de prévision s'éloigne. L'horizon glissant d'un contrôleur MPC permet l'adaptation continue à une possible amélioration des prévisions.

La stratégie basée sur la théorie de la commande prédictive présentée dans ce manuscrit est résumée par la Figure 3. A chaque pas de temps, le modèle du réseau électrique de distribution basse tension est alimenté par des données provenant à la fois du module de prévision et des instruments de mesure. Grâce au modèle du réseau, sont évaluées les contraintes en tension ; ces informations sont transmises à l'algorithme d'optimisation qui tente de trouver une solution : les valeurs de consignes des flexibilités. Une fois le problème d'optimisation résolu, la première valeur de consigne est implémentée au prochain pas de temps. L'ensemble du processus se répète à chaque pas de temps.

Dans un premier temps, les erreurs commises sur les prévisions de la production solaire xxvii photovoltaïque, de la charge du réseau et de la demande en eau sont supposées nulles et les écarts de performance entre l'approche relaxée et l'approche proposée sont dues à la formulation du problème d'optimisation. À ce stade, l'objectif est de démontrer l'efficacité de la formulation proposée et d'évaluer ses performances par rapport à l'approche relaxée. Le réglage MINLP (pour Mixed Integer NonLinear Programming) du problème dû au contrôleur tout ou rien du château d'eau est un véritable défi car il est complexe et coûteux en temps de calcul, ce qui est particulièrement pénalisant pour les applications en temps réel. Dans la littérature, les techniques dites de relaxation [START_REF] Burer | Non-convex mixed-integer nonlinear programming: A survey[END_REF][START_REF] Tawarmalani | Convexification and global optimization in continuous and mixed-integer nonlinear programming: theory, algorithms, software, and applications[END_REF] sont habituellement utilisées pour contourner les problèmes que pose la programmation MINLP. Pour autant, l'approche présentée dans ce manuscrit n'a pas recours à une relaxation du problème : une formulation permettant au problème MINLP d'être résolu comme un problème d'optimisation non-linéaire lisse est proposée. La formulation alternative du problème d'optimisation repose sur l'introduction d'une nouvelle variable d'optimisation t ∈ R Hp , avec H p le nombre entier d'intervalles de temps sur l'horizon de prévision considéré. Cette variable désigne l'instance, entre deux pas de temps, à laquelle la valeur de consigne du château d'eau passe d'une valeur entière à la valeur entière suivante.

P cons (k) GHI(k) Q w,out (k) V w (k) V b (k) GHI P cons , Q w,out
Bien que cette technique soit issue de la théorie du contrôle optimal paramétré, elle n'a à ce jour pas été implémentée pour une application de ce type. Cependant, une approche similaire a été implémentée dans [START_REF] Salas | Economical optimization of thermochemical storage in concentrated solar power plants via pre-scenarios[END_REF] pour déterminer des stratégies de planification optimale destinées aux centrales solaires à concentration via des pré-scénarios. Avec cette formulation, les valeurs de consigne de production électrique du méthaniseur et de consommation électrique du château d'eau ne sont pas constantes au cours d'un intervalle de temps ; elles sont autorisées à changer de valeur une fois entre deux instants d'échantillonnage consécutifs.

Soit P w,min et P w,max les valeurs minimale et maximale de la consommation électrique du château d'eau. Soit P b,min et P b,max les valeurs minimale et maximale de la production électrique du méthaniseur. Soit H p le nombre entier d'intervalles de temps sur l'horizon de prévision considéré, T le pas de temps et N le nombre de noeuds du réseau électrique. Entre deux instants d'échantillonnage t i et t i+1 , le château d'eau peut basculer d'un état de fonctionnement à un autre (P w,min et P b,max ) alors que, pour le méthaniseur, la valeur de la consigne peut être mise à jour dans l'intervalle [P b,min , P b,max ]. Si les flexibilités changent d'état au cours d'un intervalle de temps, elles le font au même instant, noté ti .

Notons X = P b,ON P b,OFF t U ON,q U OFF,q T , avec P b,ON ∈ R Hp et P b,OFF ∈ R Hp les valeurs de consigne du méthaniseur telles que :

P b (τ ) = P b,ON (τ ), τ ∈ [t i , t i + ti ] P b,OFF (τ ), τ ∈ [t i + ti , t i+1 ] (1)
Les valeurs des tensions dans les différents noeuds du réseau électrique U ON,q ∈ R Hp×N et U OFF,q ∈ R Hp×N , avec q ∈ {1, . . . , N }, sont définies comme suit :

U q (τ ) = U ON,q (τ ), τ ∈ [t i , t i + ti ] U OFF,q (τ ), τ ∈ [t i + ti , t i+1 ] (2)
À chaque pas de temps, le problème peut être résolu en supposant que l'état initial du château d'eau est toujours ON. Dans certains cas extrêmes, cette hypothèse peut induire des problèmes de mise en oeuvre du fait de contraintes de volume qui sont solutionnés par le biais d'un posttraitement. Cette simplification réduit la complexité du modèle sans pénaliser significativement les performances.

La Figure 4 transition entre les états ne se produit pas seulement au début de chaque pas de temps. La fonction objectif est formulée comme suit :

f obj (X) = Hp-1 i=0 t i + ti t i S ON (τ )dt + t i+1 t i + ti S OFF (τ )dt (3)
où P PV , P b et P cons sont des mesures de la production solaire photovoltaïque, de la production électrique du méthaniseur et de la charge du réseau, respectivement. Le problème est alors formulé comme suit :

X * = arg min X f obj (X) (6)
sujet à, ∀i ∈ {1, . . . , H p }, avec H p le nombre entier d'intervalles de temps sur l'horizon de prévision considéré :

• bornes de puissance du méthaniseur P b,min P b,ON (τ ) P b,max [START_REF] Mišák | A heuristic approach to active demand side management in off-grid systems operated in a smart-grid environment[END_REF] et

P b,min P b,OFF (τ ) P b,max (8)
• bornes des instants de commutation

0 ti T (9) xxix • contraintes en volume (méthaniseur) V b,min V b (t) V b,max (10)
où V b est le volume de biogaz stocké et V b,min et V b,max sont respectivement les volumes minimal et maximal de stockage du méthaniseur.

• contraintes en volume (château d'eau)

V w,min V w (t) V w,max [START_REF] Kreith | Energy management and conservation handbook[END_REF] où V w est le volume d'eau stockée et V w,min et V w,max sont respectivement les volumes minimal et maximal de stockage du réservoir d'eau.

• contraintes en tension ti

• K t (P b,ON (τ ), P w,max , U ON,q (τ )) = 0 (12)
(Tti ) • K t (P b,OFF (τ ), P w,min , U OFF,q (τ )) = 0 (13)

|U ON,q (τ ) -U n | δU ( 14
)
|U OFF,q (τ ) -U n | δU ( 15
)
où U n est la valeur nominale de tension.

La fonction K t (P b (t), P w (t), υ(t)) décrit les variations de tension à travers le réseau comme une fonction des puissances injectées (resp. absorbées) à (resp. par) chaque noeud. Les contraintes dues aux lois de Kirchhoff sont présentées sous la forme de deux jeux de contraintes (équations ( 12) et ( 13)) qui garantissent que ces lois sont respectées dans les deux sous-intervalles de chaque pas de temps. Les équations décrivant les variations de tension sont multipliées par ti [START_REF] Dkhili | A survey of modelling and smart management tools for power grids with prolific distributed generation[END_REF] et par T -ti [START_REF] Burer | Non-convex mixed-integer nonlinear programming: A survey[END_REF], en utilisant des valeurs de consigne du méthaniseur et du château d'eau appropriées, pour chaque intervalle, afin de garantir qu'une seule contrainte est activée en cas de valeurs extrêmes de ti . En fait, dans le cas ti = 0, l'équation [START_REF] Dkhili | A survey of modelling and smart management tools for power grids with prolific distributed generation[END_REF] est éliminée. Cela traduit le fait qu'au cours du pas de temps i, le château d'eau est inactif dès le début de ce pas de temps. De même, dans le cas ti = T , l'équation [START_REF] Burer | Non-convex mixed-integer nonlinear programming: A survey[END_REF] est éliminée car le château d'eau reste en fonctionnement pendant la totalité du pas de temps. Les contraintes en tension sont également formulées sous la forme de deux ensembles de contraintes d'inégalités (inégalités [START_REF] Tawarmalani | Convexification and global optimization in continuous and mixed-integer nonlinear programming: theory, algorithms, software, and applications[END_REF] et [START_REF] Salas | Economical optimization of thermochemical storage in concentrated solar power plants via pre-scenarios[END_REF]) assurant le respect des bornes de tensions à chaque pas de temps et pour chaque noeud du réseau. Tout en décrivant les mêmes contraintes physiques, cette formulation du problème d'optimisation présente, comparativement à la formulation MINLP, un ensemble plus étendu de solutions possibles. Par conséquent, l'optimum global, pour la formulation proposée, est au moins aussi bon que celui de la formulation MINLP.

Les performances de la stratégie proposée sont analysées puis comparées aux performances d'une stratégie de planification hebdomadaire et à une stratégie MPC basée sur un problème d'optimisation relaxé où la consigne du château d'eau varie dans un intervalle continu entre deux valeurs de consommation électrique minimale et maximale. Dans un premier temps, les résultats obtenus pour la stratégie de planification hebdomadaire utilisant les quatre jeux de données (pour les quatre saisons de l'année) sont présentés. Ensuite, une analyse de sensibilité est menée afin d'évaluer l'impact de la taille de la fenêtre glissante du contrôleur MPC sur ses performances. Enfin, une fenêtre glissante est choisie sur la base de l'analyse de sensibilité précitée et les résultats obtenus sont examinés en détail. Ces derniers montrent que la stratégie MPC proposée réussit à réduire considérablement l'écart entre offre et demande, comparativement à ce que permettent les stratégies classiques, à savoir une planification hebdomadaire et une commande xxx basée sur un problème d'optimisation relaxé, tout en respectant les contraintes opérationnelles et les bornes acceptables de tension. Il s'agit d'un résultat prometteur, de nature à permettre le déploiement de micro-réseaux électriques autonomes, capables de répondre à la demande grâce à une production locale d'électricité tirant profit de ressources énergétiques renouvelables. Les améliorations possibles incluent la reformulation de la fonction objectif pour "lisser" les valeurs de consigne des flexibilités sans avoir recours à un post-traitement.

La suite des travaux traite de la prise en compte, en temps réel, des prévisions infrajournalières des différentes grandeurs stochastiques affectant la stabilité du système, à savoir la production solaire photovoltaïque, la charge du réseau et la demande en eau, pour une meilleure anticipation des contraintes émergentes et pour évaluer la robustesse de la stratégie MPC proposée aux erreurs de prévision.

Prévision infra-journalière de grandeurs stochastiques

Les trois grandeurs stochastiques influant sur la mise en oeuvre de la stratégie proposée sont la charge du réseau électrique de distribution, la production solaire photovoltaïque et la demande en eau. Des algorithmes pour la prévision infra-journalière de ces grandeurs ont donc été développés et sont présentés dans le chapitre 3 de ce manuscrit. La charge du réseau est la demande en énergie électrique agrégée à l'échelle du cas d'étude considéré, à savoir un quartier résidentiel périurbain. La production solaire photovoltaïque, qu'il est possible de déduire du GHI et des principales caractéristiques des installations solaires photovoltaïques équipant la zone étudiée, est une production électrique agrégée. La demande en eau correspond au débit d'eau sortant du réservoir du château d'eau, elle influe sur le niveau d'eau stockée et donc sur l'opération de l'installation.

En premier lieu, une étude comparative des outils de l'apprentissage automatique pour la prévision infra-journalière du GHI réalisée par l'équipe COSMIC du laboratoire PROMES-CNRS a montré qu'aucun outil ne sortait réellement du lot, avec toutefois un léger avantage (le critère d'évaluation est l'erreur quadratique moyenne normalisée) pour les réseaux de neurones artificiels LSTM (pour Long Short Term Memory) et les modèles fondés sur une régression non paramétrique par processus Gaussien (ou GPR, pour Gaussian Process Regression).

Le choix d'un modèle de prévision étant soumis aux exigences de l'application visée, il est important de garder à l'esprit les objectifs du projet "Smart Occitania" dès lors qu'il convient d'évaluer l'adéquation des modèles GPR à la tâche à accomplir. En effet, le projet, un démonstrateur de réseau électrique intelligent en milieu rural/périurbain, traite du développement d'une stratégie de contrôle capable de fonctionner en temps réel, ce qui implique la recherche d'un compromis entre performance et temps de calcul. Les modèles GPR développés, bien que requérant une mise à jour de paramètres à chaque pas de temps, sont adaptés à l'application. Toutefois, la nature prédictive du contrôleur le rend dépendant d'un accès en temps réel aux mesures nécessaires à la mise à jour, à chaque pas de temps, des modèles GPR. De ce fait, le développement d'une instrumentation garantissent un transfert de données rapide et fiable est nécessaire. Pour les raisons énoncées ci-avant, les modèles de prévision choisis -l'horizon de temps est infra-journalier -sont fondés, pour trois grandeurs stochastiques ci-avant mentionnées, sur une régression non paramétrique par processus Gaussien.

Un processus Gaussien (GP) est un ensemble de variables aléatoires dont tout nombre fini a une distribution gaussienne commune [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF]. Un GP définit une distribution Gaussienne a priori sur les fonctions qui peut être convertie en une distribution a posteriori par l'observation de données. Pour indiquer qu'une fonction aléatoire f (x) suit un processus gaussien, elle s'écrit

f (x) ∼ GP(µ(x), k(x, x )), où x et x sont des variables d'entrée arbitraires, µ(x) = E [f (x)] est la fonction moyenne et k(x, x ) = E (f (x) -µ(x))(f (x ) -µ(x ) T )
est la fonction de covariance xxxi ou noyau. Un noyau quantifie la similarité entre deux points et formule des hypothèses sur la fonction à apprendre. Ces hypothèses peuvent être, par exemple, à quel point la fonction est lisse ou si elle est périodique. Toute fonction peut être utilisée comme noyau tant que la matrice de covariance résultante est semi-définie positive. Une liste détaillée de noyaux est présentée dans [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF].

Les intervalles de confiance associés aux prévisions GPR sont obtenus sans qu'il soit nécessaire, contrairement aux régressions par machine à vecteur de support (ou SVR, pour Support Vector Regression) ou par réseau de neurones artificiels, de réaliser des simulations de Monte-Carlo. Ces intervalles de confiance fournissent au contrôleur prédictif une information exploitable pour améliorer la robustesse de la stratégie. En effet, les intervalles de confiance fournis par les modèles GPR sont particulièrement utiles dès lors qu'il s'agit de faire face à l'impact sur les performances du contrôleur de l'incertitude des prévisions.

Les prévisions infra-journalières de la charge du réseau montrent que le modèle GPR fonctionne bien pour des horizons de temps courts (l'erreur quadratique moyenne normalisée est de 9% pour un horizon de prévision de 10 minutes). Cependant, l'erreur de prévision se dégrade rapidement à mesure que l'horizon de temps augmente, ce qui n'est pas surprenant. Il convient de noter que l'approche proposée est capable de fournir des prévisions satisfaisantes avec seulement deux semaines de données d'entraînement. Cela allège non seulement la charge de calcul mais permet une adaptation relativement rapide à une reconfiguration du réseau ou à la disponibilité de nouveaux jeux de données.

En raison de la nature régulière des données de demande en eau, la combinaison simple d'un noyau périodique et d'un noyau quadratique rationnel s'avère suffisante pour capturer plutôt fidèlement la dynamique infra-journalière de la série temporelle. Pour un horizon de prévision de 10 minutes, l'erreur quadratique moyenne normalisée est égale à 9 %. Cette erreur se stabilise rapidement autour de 13 % pour des horizons plus lointains.

Le modèle GPR utilisé pour la prévision infra-journalière de l'éclairement global horizontal (ou GHI) -la production solaire photovoltaïque est obtenue à partir des prévisions du GHIfonctionne bien pour des horizons de temps courts (pour un horizon de 10 minutes, l'erreur quadratique moyenne normalisée est égale à 15 %) mais ses performances se dégradent à mesure que l'horizon s'éloigne, pour se stabiliser à environ 32 % pour des horizons supérieurs à 6 heures. En effet, les fluctuations infra-journalières deviennent de plus en plus difficiles à appréhender.

Ainsi, les prévisions de la charge du réseau électrique de distribution considéré, de la production solaire photovoltaïque et de la consommation d'eau alimentent le contrôleur développé au cours du projet. Ces prévisions permettent l'anticipation des contraintes en tension influençant la prise de décision du contrôleur. L'impact des erreurs de prévision sur les performances de la stratégie est évalué. Enfin, les intervalles de confiance associés aux prévisions fournis par les modèles GPR sont utilisés pour réduire les dépassements de tension.

Robustesse de la stratégie MPC aux erreurs de prévision

Afin d'évaluer précisément la robustesse de la stratégie MPC aux erreurs de prévision, le cas d'étude a été adapté : la charge du réseau et la production solaire photovoltaïque ont été augmentées afin d'engendrer des écarts entre offre et demande plus importants, aggravant ainsi les fluctuations de tension. Cette nouvelle configuration du cas d'étude correspond à environ 600 habitations et 200 installations solaires photovoltaïques de 4 kW chacune, soit au total une puissance installée de 800 kW. Elle anticipe une forte augmentation de la demande et un déploiement à grande échelle de la production solaire photovoltaïque.

Par ailleurs, pour les besoins de l'étude, la marge acceptable pour les fluctuations de tension est abaissée de 10 % à 3 %. Les seuils de tension sont donc définis comme suit :

xxxii

U min = 0.97 • U n et U max = 1.03 • U n , avec U n = 230 V
la valeur de tension nominale pour des charges monophasées. Les autres caractéristiques du cas d'étude (composition, structure, etc.) sont inchangées. Le dimensionnement des flexibilités est lui aussi identique, la puissance maximale du méthaniseur étant de 200 kW et les pompes du château d'eau fonctionnant en mode TOR avec P w ∈ {0, 100 kW}.

L'impact des erreurs de prévision sur les performances du contrôleur prédictif est évalué et analysé, en prenant comme référence les performances observées en présence de prévisions dites parfaites (des mesures sont utilisées, les erreurs de prévision sont par conséquent nulles). Les résultats obtenus montrent que les erreurs de prévision ne provoquent pas de dégradation significative des performances du contrôleur. En effet, pour ce qui est de la valeur finale de la fonction objectif, l'écart le plus important est observé pour une fenêtre de 22 heures et ne représente que 1,98 % de la valeur initiale, avant mise en oeuvre de la stratégie MPC.

Toutefois, afin de prévenir une éventuelle dégradation des performances, le contrôleur prédictif est modifié afin que soit améliorée sa robustesse aux erreurs de prévision par la prise en compte des intervalles de confiance associés aux prévisions GPR. Ce faisant, le contrôleur prédictif évalue de possibles violations de contrainte induites par les prévisions des grandeurs stochastiques susmentionnées, auxquelles sont associés des intervalles de confiance. Le contrôleur détermine ensuite des valeurs de consigne destinées aux flexibilités qui minimisent la violation de contraintes au prochain pas de temps, quelles que soient les valeurs, au sein des intervalles de confiance, des grandeurs stochastiques prédites.

Le travail réalisé est basé sur la commande prédictive min-max pour des systèmes non linéaires incertains sous contraintes [START_REF] Martino Raimondo | Min-max model predictive control of nonlinear systems: A unifying overview on stability[END_REF][START_REF] Daniel Limón | Input to state stability of min-max MPC controllers for nonlinear systems with bounded uncertainties[END_REF]. Les prémisses de cette technique se résument à une aversion au risque par le calcul d'un scénario dit du "pire cas" en amont d'un problème standard d'optimisation. En l'état, la stratégie proposée suppose que les prévisions des grandeurs stochastiques sont parfaites. Par conséquent, la solution du problème d'optimisation respecte les contraintes calculées à partir de ces prévisions mais ne garantit pas le respect de ces contraintes pour des valeurs prédites différentes.

L'approche proposée repose sur une couche appelée "problème min-max", se situant en amont du problème d'optimisation qui détermine les valeurs de consigne des flexibilités. Sont calculées les valeurs de la production solaire photovoltaïque, de la charge du réseau et de la demande en eau pour lesquelles la violation des contraintes serait maximale. Pour ces valeurs, est défini le scénario du pire cas. Par la suite, une solution (les valeurs de consigne des flexibilités) qui respecte les contraintes calculées pour ce scénario est recherchée.

Il est important de noter qu'à chaque pas de temps, ces corrections ne sont apportées qu'à la prise de décision au prochain pas de temps et pas sur la totalité de l'horizon de prévision. Deux raisons motivent ce choix. La première est que déterminer le scénario du pire cas sur la totalité de l'horizon de prévision est un problème d'optimisation coûteux d'un point de vue calculatoire et qui, de fait, est incompatible avec l'application en temps réel considérée. La deuxième est qu'en boucle fermée, calculer des valeurs de consigne robustes sur la totalité de l'horizon de prévision est un gaspillage de ressource car, à chaque pas de temps, seule la première valeur de consigne est appliquée. Par conséquent, la structure de commande cherche uniquement à fournir une valeur de consigne robuste aux erreurs de prévision au prochain pas de temps.

Soit P PV , P cons et Q w,out les mesures de la production solaire photovoltaïque, de la charge du réseau et de la demande en eau, respectivement. P PV , P cons , Q w,out en sont les valeurs prédites sur l'horizon de temps considéré. δ P V , δ c et δ w sont les écarts permettant de définir les intervalles de confiance associés à ces prévisions GPR au prochain pas de temps. Il existe un triplet (P PV (t + 1), P cons (t + 1), Q w,out (t + 1)) qui induit, au prochain pas de temps, le scénario du pire cas vis-à-vis des contraintes du problème d'optimisation. La recherche de ce triplet et sa prise en compte par la stratégie proposée permettent au contrôleur d'ajuster sa prise xxxiii de décision afin de réduire, si possible éliminer, les dépassements de contraintes qui pourraient survenir au prochain pas de temps en raison de mesures des grandeurs stochastiques différentes des prévisions, dans la limite des intervalles de confiance fournis par le module de prévision.

Soit Y le vecteur regroupant les valeurs de la production solaire photovoltaïque, de la charge du réseau et de la demande en eau au prochain pas de temps :

Y = P PV (t +
La valeur finale de la fonction objectif, bien que diminuée par rapport au cas initial (cas 1), change très peu entre le cas du contrôleur MPC utilisant des prévisions GPR (cas2) et le cas du contrôleur MPC utilisant des prévisions GPR, complété par le problème min-max (cas 3). Cela montre que le problème min-max ne provoque aucune dégradation de la capacité de la stratégie MPC à réduire l'écart entre offre et demande.

Les instances de dépassement de tension diminuent régulièrement du cas 1 au cas 3. En effet, le contrôleur MPC complété par le problème min-max (cas 3) réduit leur pourcentage (ν) à 4,96 % pour une fenêtre de 4 h et à 6,35 % pour une fenêtre de 10 h, pour une valeur initiale de 23,71 %. La surface totale des dépassements de tension Φ est également considérablement réduite par rapport à la valeur initiale : cette surface est ramenée à 1464.5 kV pour une fenêtre de 4 h et à 1176.8 kV pour une fenêtre de 10 h, pour une valeur initiale de 4371.4 kV.

La réduction de l'écart entre offre et demande pour la configuration du cas d'étude considérée au chapitre 4 est moins importante qu'elle ne l'est pour la configuration du cas d'étude considérée au chapitre 2. Pour la semaine du mois d'avril considérée, et dans le cas où les erreurs de prévisions sont supposées nulles, la réduction maximale de cet écart est de 24,4 % pour une fenêtre glissante de 23 heures (configuration du cas d'étude considérée au chapitre 2) et de 15 % pour une fenêtre glissante de 18 heures (configuration du cas d'étude considérée au chapitre 4).

Comparativement aux performances observées pour la configuration du cas d'étude considérée au chapitre 2, les performances du contrôleur MPC pour la configuration du cas d'étude considérée au chapitre 4 sont en retrait. Ceci peut être expliqué, au moins en partie, par le dimensionnement des flexibilités et par leur adéquation avec les objectifs poursuivis. Dès lors que la charge du réseau et la production solaire photovoltaïque augmentent rapidement, la marge de manoeuvre permise par les flexibilités considérées diminue. Par conséquent, deux questions se posent. La première est celle du dimensionnement optimal de ces flexibilités. Dans cette étude, la stratégie MPC opère au niveau du transformateur HTA/BT. Cependant, pour une application présentant xxxiv une granularité spatiale plus fine, cette question impliquera également la localisation optimale des flexibilités au sein du réseau. La deuxième question est celle du type de flexibilité et de son adéquation avec les objectifs poursuivis.

Avoir recours à un méthaniseur et à un château d'eau répond à l'un des objectifs du projet "Smart Occitania" : démontrer la faisabilité du concept de réseau électrique intelligent en milieu rural/périurbain, d'où le choix de ces flexibilités, en région Occitanie, dont le fonctionnement est pilotable. Ceci étant, ce couple de flexibilités présente plusieurs handicaps. En premier lieu, le fonctionnement TOR dy château d'eau augmente la complexité calculatoire du problème d'optimisation à résoudre et, de fait, pénalise l'implémentation en temps réel de la solution proposée. En outre, ce couple de flexibilités induit des valeurs de consigne très variables qui, non seulement, aggravent les fluctuations de tension mais qui, de plus, réduisent la durée de vie des équipements. Enfin, les flexibilités dont il est fait usage doivent avoir la capacité d'adapter leurs marges de manoeuvre, avec un coût minimal, à la croissance, plutôt rapide, de la demande en électricité et à la pénétration de la production décentralisée au sein du réseau. Les flexibilités ici considérées sont insuffisamment "malléables", en particulier le méthaniseur qui implique un procédé organique complexe.

Lorsqu'une stratégie destinée à la gestion des réseaux électriques, fondée sur la théorie de la commande prédictive, est développée, le choix du pas de temps est très important. Un compromis est toujours recherché entre coût calculatoire et granularité du modèle afin d'appréhender au mieux les phénomènes observés sur le réseau. La mise en oeuvre d'une telle stratégie est par ailleurs dépendante d'un accès en temps réel à des mesures, cet accès étant contraint par des considérations techniques. Des solutions à ces problèmes existent, en particulier grâce au déploiement, au cours des dernières années, d'une infrastructure avancée de mesure.

Le pas de temps de 10 minutes considéré dans ces travaux résulte d'un compromis. Il permet la réalisation des calculs nécessaires à l'obtention des prévisions GPR et à la résolution du problème d'optimisation. Toutefois, ce pas de temps limite la capacité de la stratégie à appréhender efficacement les dynamiques rapides des réseaux électriques et rend difficile certaines interventions. La stratégie proposée peut être vue comme une stratégie de contrôle de haut niveau, qu'il convient d'associer à des outils de planification à plus long terme et à des méthodes d'exploitation de bas niveau, telles que les méthodes qui relèvent du génie électrotechnique et qui permettent de réagir à des phénomènes électriques rapides.

Conclusion et perspectives

Les travaux présentés dans ce manuscrit mettent en lumière le potentiel d'une stratégie fondée sur la théorie de la commande prédictive pour la gestion des réseaux électriques de distribution basse tension qui pourraient faire face, à l'avenir, à une abondante production décentralisée, en particulier une production solaire photovoltaïque. Le cas d'étude permet par ailleurs d'évaluer, en simulation, la pertinence des deux flexibilités considérées, un méthaniseur et un château d'eau. La stratégie MPC proposée redirige efficacement les flux électriques au sein du réseau pour répondre à la demande en électricité sans enfreindre les normes de stabilité et de qualité de service. La formulation du problème d'optimisation en tant que problème non-linéaire lisse limite son coût calculatoire. Dans le même ordre d'idées, les modèles GPR utilisent un support de prévision glissant d'une dimension réduite (24 heures) pour la mise à jour de leurs paramètres et l'obtention, à chaque pas de temps, d'une nouvelle prévision. Ces efforts visent à rendre la stratégie adaptée aux applications en temps réel. Une discussion abordant les principaux enseignements tirés de ce travail est menée au chapitre 4. Sont mis en évidence les forces et les faiblesses de la stratégie proposée.

Les travaux menés peuvent donner lieu à plusieurs évolutions. Dans un premier temps, le xxxv problème d'optimisation pourrait être reformulé afin que soit prise en compte l'implémentabilité des valeurs de consigne des flexibilités sans avoir recours à un post-traitement. Cela pourrait prendre la forme d'une optimisation multi-objectif qui réalise un compromis entre objectifs parfois contradictoires. En effet, les flexibilités pilotées par le contrôleur MPC sont détenues et exploitées par des tiers. Dans de tels cas, la fonction objectif du contrôleur doit prendre en compte les intérêts de l'ensemble des parties impliquées, avec des priorités prédéfinies. En outre, le problème min-max, introduit dans la stratégie prédictive afin d'améliorer la robustesse du contrôleur aux erreurs de prévision (chapitre 4), pourrait être étendu du prochain pas de temps à la totalité de l'horizon de prévision. Cela augmenterait inévitablement la charge de calcul du contrôleur mais devrait également améliorer ses performances grâce à une meilleure anticipation des problèmes pouvant survenir au fil du temps, en particulier du fait de la dégradation des prévisions pour des horizons de temps de plus en plus lointains.

Par ailleurs, la question du dimensionnement optimal des flexibilités que le contrôleur MPC pilote est centrale. Plusieurs critères sont à prendre en compte lors du processus de dimensionnement : la disponibilité de la ressource énergétique renouvelable (notamment pour ce qui est du méthaniseur), les niveaux attendus de production solaire photovoltaïque et le coût économique de ces installations, pour n'en citer que quelques-uns. Un autre problème qui doit être examiné est la latitude et la rapidité avec lesquelles les flexibilités choisies peuvent réagir aux problèmes survenant au sein du réseau électrique de distribution et qui menacent tant sa stabilité que la qualité de service. En effet, un compromis doit être trouvé entre un pas de temps suffisamment long, permettant aux algorithmes développés de produire des prévisions et la résolution du problème d'optimisation, et un pas de temps court nécessaire à la prise en compte d'évènements, des fluctuations de tension, survenant au sein du réseau.

Structure du manuscrit

Introduction

Worldwide, the energy transition to renewable-energy-based power generation is in full swing. This comes as an effort to curb environmental decay due to large-scale use of fossil fuels and, to a lesser extent, to prepare for the eventual dwindling of accessible fossil fuel reserves in the face of growing global energy demand. A proposed solution to these problems resides in the large-scale deployment of renewable-energy-based power generation sources, hereinafter referred to as distributed generation, which present a promising alternative for sustainable and eco-friendly power grids.

Because power grids were originally designed for centralised generation with unidirectional power flow, large-scale deployment of distributed generation ushers in numerous operational issues. The notion of a "smart grid" was born out of the need to better monitor the behaviour of these evolving power grids, to more accurately anticipate the operational issues that could be caused by the new components, and to more efficiently control them to ensure safety and service quality.

As the technology behind these power generation sources, especially solar photovoltaics (PV), becomes cheaper and more efficient, power distribution grid operators predict a sharp and significant increase of distributed generation present in power distribution grids. As a matter of fact, global solar PV capacity has jumped from 8 GW to 402 GW in the decade between 2007 and 2017 as can be seen in Figure 5. Within this context, the French distribution grid operator ENEDIS puts in place several demonstrators for smart grid technologies across France. As of 2020, the official website of ENEDIS catalogues 10 finished projects and 10 others that are still underway in various locations in metropolitan France [START_REF]Map of demonstrator projects led by ENEDIS for smart grid technologies as of[END_REF]. The map in Figure 6 displays these locations.

This thesis falls within the scope of the project "Smart Occitania" (marked as number 7 in Figure 6), defined as a proof of concept for rural and suburban smart grids. A novel predictive control scheme is proposed in this manuscript for suburban power distribution grids with high levels of PV penetration using flexible assets, namely a biogas plant and a water tower. The scheme incorporates forecasts of PV power generation, grid load, and water demand in order to efficiently operate the aforementioned flexible assets towards balancing supply and demand within the grid.

As to be expected with such a global challenge, the literature is rife with research dealing with the different aspects of the deployment of distributed generation into power grids, be it refinement of the technology behind renewable-energy-based power generators, electrotechnical solutions for successful connections, or modelling, monitoring, and efficient control of power grids. The scope of this work focuses on modelling and control of low-voltage power distribution grids with prolific distributed generation. An extensive survey covering this topic is provided in the first chapter of this thesis, dividing the control approaches into four main ones: multi-agent systems, model-based predictive control, demand-side management, and flexible asset management. The benefits and shortcomings of various techniques are discussed at length with respect to a variety of specific applications under the umbrella of control schemes in the smart grid paradigm. Study of the state of the art on this topic amounted to a peer-review publication [START_REF] Dkhili | A survey of modelling and smart management tools for power grids with prolific distributed generation[END_REF].

In fact, the choice of a control scheme depends heavily of the type of application for which it is conceived. Applications differ on many planes: the characteristics of the power grid in question, the uncertainties of system variables or inputs, and the objective of the scheme: operation planning, fault detection and mitigation, economic optimisation, and real-time control, to name a few. For instance, the components, operation, and issues of a medium-voltage power grid are not the same as those of a low-voltage one, and the techniques used to mitigate their issues are consequently very different. In addition, the scale of a power distribution grid, i.e. the number of connected clients and the geographical area it covers, as well as its nature, be it a rural, suburban or urban grid, are determining factors in the grid operator's control strategy, to say nothing of the fact that data collection is usually less bountiful in suburban and rural areas than they are in urban ones. As a result, the accurate diagnosis of the application is an important requirement to developing a control strategy.

Against the backdrop detailed hereinabove, ENEDIS is leading the project "Smart Occitania". This project in funded by France's Agency for Ecological Transition (ADEME) and supported by the Occitania region. It comprises several academic and industrial partners such as the national centre for scientific research (CNRS), the Toulouse Institute of Computer Science Research (IRIT), ACTIA Télécom, and CAHORS group, to name a few. The project started in March 2017 and is scheduled to last through March 2021, and has an estimated global budget of 8 million euros [START_REF]Smart Occitania page on the ADEME website[END_REF].

The project's goal is to demonstrate the feasibility of the smart grid concept for low-voltage rural and suburban power distribution grids. The definition of a smart grid is still a fluid idea in the literature but there is an emerging consensus as to the fundamental characteristics of such a grid. An in-depth review of these characteristics is performed in the first chapter. On that promise, the three main pillars of a smart grid can be defined as the following: high penetration levels of distributed generation, enhanced observability through smart metering and forecasts of stochastic quantities, and smart management tools which incorporate incoming data in the decision-making process.

For sustainability reasons, control strategies that utilise renewable-energy-based power generators to solve the operational issues of power distribution grids are encouraged. Because power distribution grids vary in scale and composition, scalable and flexible software solutions are preferred to hardware ones. And finally, for real-time control schemes, computational complexity needs to be minimal.

The project relies on a simulated case study, which is based on a residential suburban neighbourhood in the south of France, containing approximately 120 households. A number of hypotheses defined by the circumstances of the project Smart Occitania have been made. In fact, measurements of grid load collected on site at the medium-voltage/low-voltage (MV/LV) transformer level of the studied neighbourhood show that levels of reactive power in the considered low-voltage power distribution grid do not exceed 5%. Therefore, a hypothesis is made throughout this work to neglect the effects of reactive power on the system. PV power generation is inferred from GHI values using a simplified model available in the literature. The number of PV panel installations in the studied power distribution grid is adapted to the purposes of the study, namely to demonstrate voltage overshooting phenomena resulting from high levels of PV power generation. For simplicity, the term "PV power generation forecasting" will be employed to group both GHI forecasting and the conversion of GHI into PV power generation.

The developed control strategy operates in real time, with a 10-minute time step, at the level of the MV/LV transformer, using two flexible assets: a biogas plant which injects power into the grid and a water tower whose pump consumes power to sustain a reservoir that meets the local water demand. The control strategy is predictive, it bases its decisions on knowledge of the system's behaviour but also on forecasts of global horizontal irradiance (GHI), grid load, and water consumption within the considered area. The flexible assets used in the development of the control strategy are not physically connected to the power grid of the case study. During the duration of the project, no small-scale suburban power distribution grid gathering high levels of PV panel deployment, a functioning biogas plant, and a water tower was available. For the purposes of this study, a simulated power distribution grid gathering all aforementioned elements is used.

Due to its intermittent nature, prolific PV power generation in a small power distribution grid can result in sharp and consequential fluctuations in the supply/demand balance, which in turn result in voltage fluctuations. As it stands, power distribution grid operators have a contractually-binding obligation to keep voltage variations bounded. The control strategy developed herein will aim for promoting autarky of power distribution grids, constrained by permissible voltage bounds.

Despite the fact that this research field is a very active one, to the knowledge of the authors at the time of the writing of this thesis, the question of real-time predictive control of rural/suburban power distribution grids with high levels of distributed generation, while still connected to the main power grid, has yet to be answered. In the current ecological and economic context, installed PV power generation capacity is expected to surge in such grids and smart management tools must be ready to meet them.

The contribution of this work resides in its treatment of a particular case study, with flexible assets previously unexploited for voltage regulations purposes, but also in its novel handling of the ON/OFF operation of the water tower without recourse to mixed-integer nonlinear programming or to relaxations. The MPC strategy also benefits from forecasts of grid load, PV power generation, and water consumption over the forecast horizon. An evaluation is carried out of their impact on the control scheme's performance. The forecasts are obtained through a Gaussian process regression, which has the advantage of providing confidence intervals associated with its forecasts without the added computational burden of Monte Carlo simulations. These intervals are used, in an ulterior step, to modify the MPC strategy in order to improve its robustness to forecasting errors.

This work provides an answer to an important and urgent need for better management tools to 'intelligently' operate power distribution grids in the face of increasing deployment of distributed generation, in order to avoid operational issues and maintain quality of service.

The tools developed herein enable rural and suburban power distribution grids to successfully host rising levels of distributed generation without drastic changes to existing infrastructure, in order to promote the energy transition of power grids.

The manuscript is organised as follows: the first chapter provides a comprehensive state of the art of modelling and smart management tools for power grids with prolific distributed generation. In the second chapter, the predictive control strategy is proposed, the method with which the discrete water tower operation if handled is detailed, and performance results are analysed. The forecast models for stochastic quantities impacting the system are given in the third chapter. In the fourth chapter, the impact of forecasting errors on the control scheme's performance is examined and a strategy is presented to use the confidence interval supplied by the forecast model to enhance the strategy's robustness to the uncertainty of the aforesaid stochastic quantities. The fifth and last chapter is the conclusion, looking back at the different steps of the research explained beforehand and suggesting paths for betterment and questions that remain open.

To make the reading of the manuscript more practical, the reader is invited to refer to the nomenclature for brief definitions of the notations used throughout. The work presented in this thesis has led to the following peer-reviewed publications and conference papers.

• Peer-reviewed publications Chapter 1

State of the art of modelling and control of power distribution grids 1.1 Introduction

The electrical power grid was conceived for electrical power to flow in a single direction: from large generation plants towards end-users. For several decades, European power grids have comprised three main parts: transmission, sub-transmission, and distribution grids. Although they can be recognized by the roles they fulfil, these parts are commonly categorized by the voltage levels of their power lines. The transmission grid, directly connected to large centralized power plants, transmits energy over very long distances. At this level, permanent supply of electricity is paramount and is therefore ensured by the complex mesh structure of the grid. This allows for energy exchange with neighbouring countries and reinforces the robustness of the grid [START_REF]European Network of Transmission System Operators for Electricity[END_REF]. Up to thousands of kilometres of lines are needed to reach electrical substations [20,[START_REF]European Network of Transmission System Operators for Electricity[END_REF].

In alignment with this goal, its power lines carry Very High Voltage (VHV) and High Voltage (HV) electric power in order to minimize energy losses. The sub-transmission grid is the next stage of electricity transport. It ensures the supply of electricity to big consumers, such as railway companies and heavy industries. To do so, voltage levels are decreased through step-down transformers. As a result, the sub-transmission grid can be made up of both HV lines and Medium voltage (MV) lines. It has redundant pathways for operational security reasons. It also dispatches electricity to various substations that supply the distribution grid, which connects to end-users (mainly small industries and the household stock). The distribution grid is almost entirely made up of Low Voltage (LV) power lines. The cost of construction and maintenance of meshed structures proves too high and its operation too complex to warrant its implementation for distribution grids. Therefore, rural distribution grids take on a radial structure with relatively small branches. Urban distribution grids are operated radially but still have loop structures for reliability reasons. This undermines their robustness but has a lesser economic cost.

Be that as it may, this structure has been undergoing major changes in recent years. Driven by environmental motivation, desire to decrease fossil fuel dependency, and increase in power demand worldwide, the penetration of distributed generation in power grids has been on the rise. Electrical power is "injected" at both ends of the network, resulting in a bidirectional power flow [START_REF] Enedis | Principes d'étude et de développement du réseau pour le raccordement des clients consommateurs et producteurs BT[END_REF]. Moreover, injections of distributed generators connected to distribution grids are irregular and often uncontrollable. The most notable examples are solar and wind energy resources which fluctuate depending on weather conditions and geographical locations. Therefore, grid operators, that are contractually obligated to maintain steady and reliable service to their customers according to national and international regulations, are faced with a growingly complex system.

The behaviour exhibited by such a system could lead to several issues [START_REF] Driesen | Distributed generation: challenges and possible solutions[END_REF][START_REF] Eltawil | Grid-connected photovoltaic power systems: Technical and potential problems -A review[END_REF]. For the time being, operational problems have been avoided, at least to a great extent, by reinforcing or adapting the existing infrastructure in order to cope with the high penetration levels of distributed generation. These solutions are very costly and difficult to implement. They also lack adaptability and require the new infrastructure to be over-dimensioned to accommodate future deployment. As a result, grid operators must be equipped to handle this increased deployment by developing smart and non-invasive monitoring and operation techniques compatible with the grid's new challenges.

The regulations by which grid operators must abide mainly concern voltage bounds, current levels and voltage drop gradients. However, the decentralization of power generation is expected to make compliance with these constraints increasingly difficult and trigger a large number of stability, quality, and safety issues [START_REF] Barker | Determining the impact of distributed generation on power systems. I. Radial distribution systems[END_REF][START_REF] João | Integrating distributed generation into electric power systems: A review of drivers, challenges and opportunities[END_REF][START_REF] Sri | Distributed generation in power systems: An overview and key issues[END_REF]: short-circuits, equipment damage, and power outages to name a few. The penetration of distributed generation into power grids creates planning issues as well as legal and regulatory ones [START_REF] Coster | Integration issues of distributed generation in distribution grids[END_REF]. The backflow of power in periods of peak photovoltaic (PV) generation, for instance, is a major concern for distribution grid operators in the light of the multiplication of household installations.

As a result, the models used by grid operators must be adapted to account for distributed generation and improve the estimation of physical quantities of interest (voltage levels, injected power, consumed power, etc.), thus enabling a better operation of power grids. This estimation is propelled by the deployment of an advanced metering infrastructure that allows for data collection in real time, providing improved observability of the grids. To uphold the balance between supply and demand without violating stability constraints, grid operators must develop new tools to manage their resources efficiently. A lot of methods have been elaborated for this purpose and will be detailed and contrasted in the present chapter with regards to their theoretical basis and their applications.

It is important to stress that the composition and regulations of the power sector may differ to varying degrees between countries [START_REF] Perez-Arriaga | Regulation of the power sector[END_REF]. This chapter gives the reader an overview of the state of the art of modelling and control of power grids with prolific distributed generation. Section 1.2 is about the rise of renewable energies. Section 1.3 presents technical constraints imposed upon traditional power grids and issues due to the violation of said constraints. In Section 1.4, a definition of the smart grid paradigm within which modern power grids equipped with distributed generation operate is given. The main modelling approaches for power grids are presented and evaluated with regards to various applications in Section 1.5. Section 1.6 gives an overview of operation and control techniques dedicated to power grids. The merits and shortcomings of these techniques and the applications for which each technique is most suited are discussed. The chapter ends with a conclusion summing up the main points made beforehand.

The rise of renewable energies

The rise of renewable energies has been fast and massive in scale. In this section of the chapter, we briefly present common forms of renewable energies, address the reasons behind their surge, and give a glimpse into the laws and regulations that promote the penetration of renewable energy sources into the distribution grid.

Motivation behind the transition to renewable energy

Depletion of fossil fuels

Ever since the industrial revolution, fossil fuels have been the backbone of the world's energy supply. Oil, for instance, provided 32.9% of the world's total primary energy supply in 2016 [29]. In Europe, 41% of overall energy net generation in 2017 was fossil-fuel based [START_REF]European Network of Transmission System Operators for Electricity[END_REF]. The composition of net power generation sources differs from one European country to another (Table 1.1). The share of fossil-fuel based generation, though decreasing in most countries, still represents a significant share in many of them. Table 1.1 also shows an increase in the share of solar and wind energy in net generation across the board. Even with the introduction of alternative energy sources, many sectors remain dependent on liquid fuel, such as the transportation fleet whose energy is over 90% oil-based [START_REF] Fantazzini | Global oil risks in the early 21st century[END_REF]. It follows that the oil price has a drastic impact on global economy and oil lobbyists continue to gain more power and profit. The fossil fuel industry therefore continues to develop more effective drilling techniques. As a result, studies show that giant heavily exploited oil fields are being depleted [START_REF] Bentley | Global oil & gas depletion: an overview[END_REF][START_REF] Sorrell | Global oil depletion: A review of the evidence[END_REF]. The replenishment of these fields is not a viable option at all, as the rate of creation of fossil fuels is far slower than its rate of extraction. The International Energy Agency (IEA) has declared in 2010 that the peak of conventional oil production occurred in 2006 [34]. From here onwards, more energy and money are needed to extract fossil fuel as fields are becoming fewer and less accessible. On this account, renewable energy sources are becoming increasingly attractive, as they offer the prospect of clean and sustainable electricity production.

Global warming

The scientific community has overwhelming evidence that mankind's industrial activity is the principal contributor to the observed global warming. The concentration of main greenhouse gases has increased in the atmosphere due to human activity, namely those of carbon dioxide, methane, nitrous oxide, and fluorinated gases. On its own, carbon dioxide is responsible for 64% of man-made global warming. Its concentration has risen by 40% compared to pre-industrialization era levels [START_REF] Hook | Depletion of fossil fuels and anthropogenic climate change -A review[END_REF]. The disastrous repercussions of anthropogenic climate change are being observed all over the world and on different planes, ranging from extreme weather conditions to the extinction of entire species and rise of sea levels. This has brought about the urgency of taking measures to limit greenhouse gas emissions. The production of electricity has long been largely reliant on the burning of oil, gas and coal. It follows that, in order to limit greenhouse gas emissions, electricity generation must be released from its fossil fuel dependency and switched to environment-friendly energy sources.

Growth of energy demand

The scientific and technological progress over the last few decades has spawned a drastic improvement in the standards of living across the globe and indirectly sparked an increase in the population due to better healthcare and safer lifestyles. In addition, human activity keeps getting more energy-intensive. As a consequence, the energy demand is constantly growing. The U.S. Energy Information Administration (EIA) estimates in its 2017 report that the total world energy consumption will increase by 28% in the time frame between 2015 and 2040, while the world net electricity generation will increase by 45% over the same period [36]. Estimates show that the rate of energy consumption increase will continue to grow rapidly across the board, in every region of the world and from virtually every energy source. In the face of aforementioned environmental concerns and the depletion of fossil fuels, the growing electricity demand must be met with viable alternative sources, hence the recourse to renewable energy sources.

A regulated transition

Driven by the preceding dilemma, the international community has put in place a number of binding regulations and non-binding targets to reduce greenhouse gas emissions and to limit the dependency of the energy sector upon fossil fuels. At the European scale, we mention the 2030 climate and energy framework, a binding legislation set by the government leaders of the European Union (EU) in 2014 and revised in 2018, that has three key objectives by 2030: a 40% cut in greenhouse gas emissions compared to the 1990 levels, a 32.5% improvement of energy efficiency, and reaching a 32% portion of the EU energy supply originating from renewable energy [START_REF]2030 climate and energy framework[END_REF]. EU member countries have also taken on annual national targets within the framework of the Effort Sharing Decision (ESD), where countries define and are responsible for the implementation of their own binding annual greenhouse gas emissions targets for the period of 2013-2020.

On the global scale, examples include the Kyoto Protocol, an international legally binding agreement linked to the United Nations Framework Convention on Climate Change (UNFCCC), first conceived on December 11, 1997 and amended in 2012 to set new greenhouse gas emissions reduction targets, a revisited list of greenhouse gases, and a second commitment period. Another notable example is the Paris agreement, brought about by the UNFCCC, and coming into effect on November 4, 2016 [START_REF]Paris agreement[END_REF]. Its main objective is keeping the global temperature rise below 2°C. The commitment, signed by government leaders, aims to construct a new technological and financial flow framework in order to limit greenhouse gas emissions and enhance countries' resilience to the impacts of climate change. A global stock-taking will be carried out every five years to assess the progress of the efforts. The agreement emphasises the principle of "equity and common but differentiated responsibilities" by promoting the definition of nationally determined contributions.

In 2017, 1260 climate change laws were in effect worldwide, which is a 20-fold increase from 1997 [START_REF] Nachmany | Global trends in climate change legislation and litigation[END_REF]. These initiatives have vitalized the renewable energy business and fuelled its progress along several axes. The International Energy Agency (IEA) predicts that the share of renewable energy sources in electricity production will continue to increase steadily to reach 30% of the total electricity production in 2022 [40].

Faced with the challenge to uphold requirements for environmental protection and balance demand and supply, governments and companies alike are leaning towards the path of reinforcing the use of Distributed Energy Resources (DER), and more particularly, renewable-energy-based power generation. Notable renewables comprise solar energy, wind power, biogas, hydro-power, and geothermal energy. The booming of these alternative energy sources gave birth to the notion of distributed electricity generation (DEG). Although different types of DER are set to play key roles in the power grids' transition into the smart grid setting, such as batteries and electric vehicles, the scope of this chapter will primarily be focused on renewable-energy-based DEG, and on occasion storage systems. DEG is an interesting solution for the problems facing the future of power grids, but also comes with its own set of issues, due to the unreadiness of grid operators to manage the power grid's new configuration.

Constraints and emerging issues

Electricity providers are contractually obligated to maintain steady and reliable service to their customers according to national and international norms. However, the decentralization of power generation has triggered a large number of stability, quality, and safety concerns. In this section of the chapter, we will briefly cite the quality constraints set for distribution grid service and present the phenomena arising from the shift in grid configuration, and some of the issues it generates.

Technical constraints

Distribution grid operators, are contractually obligated to continuously provide electricity to its clients while upholding three types of constraints [START_REF] Enedis | Principes d'étude et de développement du réseau pour le raccordement des clients consommateurs et producteurs BT[END_REF].

• Voltage bounds. Slight variations of voltages from the nominal value are permitted. This is almost always the case due to electromagnetic phenomena along the electrical wires. That being said, the voltage mean of a distribution grid over 10 minutes must at all times remain within prescribed margins. In cases where distributed generation is high and the grid load is low, voltage levels rise and overvoltage is observed. Symmetrically, when the grid load is too high and distributed generation is not enough to balance it out, the voltage levels plummet, leading to undervoltage. Both scenarios are problematic. The aim of algorithms dedicated to the management of LV distribution grids is to anticipate such discrepancies and prevent them, making sure that voltage levels stay within the prescribed range no matter the decentralized production and the grid load.

• Current bounds. In addition to remaining within voltage bounds, the current levels are also regulated. A MV/LV transformer is considered under constraints when its power load mean over two hours exceeds 110% of the nominal load value. Electrical wires have a predefined maximum current intensity value which changes with temperature conditions, their proximity to other wires, and whether the wires are underground or aerial.

• Gradient bounds. The addition of a 1 MW load to a node in the network generates an extra voltage drop dubbed a voltage drop gradient. In order to ensure good service quality, the voltage drop gradient must stay under a prescribed margin.

Emerging issues

The respect of the aforementioned constraints becomes increasingly challenging as the rate of renewable energy penetration in distribution grids, notably household PV panel installations, climbs [START_REF] Barker | Determining the impact of distributed generation on power systems. I. Radial distribution systems[END_REF]. In fact, solar energy is inherently intermittent [START_REF] José | Intermittency and variability of daily solar irradiation[END_REF]. It depends on the time of year, the time of day, and atmospheric conditions which are extremely difficult to predict, resulting in irregular injections of electrical power into the distribution grid. As a result, distributed generation could lead to several issues described below.

• Power outage. Two types of power outages can occur: a voltage drop in the electrical power supply called a "brownout" or a complete loss of power to an area called a "blackout".

The former results from a high current draw at one or more nodes of the network, while the latter can either be the result of a sudden peak in current draw or too much power being injected into the grid over a short amount of time, triggering circuit breakers whose purpose is to keep the electricity levels within prescribed margins (±10% for grids managed by ENEDIS).

• Harmonics distortion. The connection of distributed generators to the power grid requires the use of power electronics converters, which comes with harmonic distortions caused by non-linear electric loads. When they draw current from the grid, the waveform of the aforesaid current can be quite complex depending on the type of load and its interactions with other electrical components. However, it can be decomposed through Fourier series into a sum of simple sinusoids occurring at integer multiples of the fundamental frequency, called harmonics. Current harmonics also cause voltage harmonics. Current increase, equipment heating, and electric motor losses ensue.

• Short-circuit current. The addition of distributed generator modules throughout the distribution grid modifies its global impedance, hence the variation in short-circuit power and short-circuit current values accordingly. That being the case, the dimensioning of the protection gear becomes erroneous. This leads to malfunctions such as the triggering of circuit breakers in the absence of faults or the failure to respond to cases of faulty circuits.

• Islanding. A distributed generator is often directly connected to an end-user (PV panels on the rooftop of a house, a biogas plant to power a farm, a hydraulic engine connected to a workshop, etc.). In the case of a power outage, the distributed generator continues to power the above-mentioned end-user as long as its energy source is available and sufficient for power production. Although islanding may be intentional to render part of the network it powers autonomous, it can also pose a threat to utility workers who may not realize the portion of the network is still under power, or prevent re-connection to the main grid upon restoration of the power.

Towards the deployment of smart grids

Faced with the issues detailed in the previous section of the chapter, the structure and procedures of operation of power grids must evolve. This need has given birth to the idea of a flexible and interactive power grid, baptised a "smart grid", that successfully integrates modular renewable energy plants and efficiently manages its resources for smooth and continuous balancing of both supply and demand.

In the present section, the basic knowledge needed to grasp the concept of a smart grid and the characteristics that such a grid demonstrates are introduced. Then, an investigation of the relationship between the physical topology of the grid and the communication pathways between its elements is carried out.

The smart grid paradigm

During the past few decades, the power grid has been undergoing drastic changes in its infrastructure and operation mechanisms. These evolutions are referred to as the deployment of smart grids by the scientific community. A single, universally agreed upon definition of a smart grid has yet to be reached, but there is consensus about the primary concepts of the smart grid paradigm. First and foremost, power grids in this paradigm are characterised by prolific use of distributed generators. They can be defined as electricity generation units based mainly on renewable energy sources, that are decentralized and directly connected to the distribution grid or on the customer side of the meter [START_REF] Ackermann | Distributed generation: a definition[END_REF][START_REF] Pepermans | Distributed generation: definition, benefits and issues[END_REF][START_REF] Driesen | Distributed generation: challenges and possible solutions[END_REF]. Examples include wind farms, solar plants, household PV panel installations, and biogas plants. The first two are connected to transmission grids whereas the second two are connected to distribution grids. The penetration of distributed generators into LV distribution grids impacts the latter with regard to power flow, voltage regulation, system efficiency, and fault detection. The interaction of these installations with their host networks is governed by a set of rules to be taken into account by distribution grid operators for planning, operation, and maintenance procedures [START_REF] Baghzouz | Some general rules for distributed generation-feeder interaction[END_REF].

The term "smart grid" thus refers to modern reactive power grids that intelligently integrate these distributed generators with end loads and efficiently reroute power flows to balance supply and demand in real time with respect to stability, quality, and safety constraints. They must offer the possibility of energy storage, adapt grid protection equipment to handle bidirectional power flow and be capable of serving non-traditional loads [START_REF] Mišák | A heuristic approach to active demand side management in off-grid systems operated in a smart-grid environment[END_REF]. A cornerstone of power grids in the smart grid paradigm is improved observability, enabling real-time monitoring of the system states. This is achieved through state-of-the-art instrumentation and deployment of the next generation of advanced metering infrastructure capable of bilateral communication with grid operators. Smart meters record data pertaining to customers' consumption and report them for treatment and regulation and billing purposes. Communication may be wireless or via existing infrastructure like power line communication. Smart meters send out data packets at regular intervals containing active power, reactive power, apparent power, energy, voltage, current values, and other relevant information for the corresponding household. In particular cases, it could allow grid operators to turn electricity on and off remotely to prevent blackouts or prioritize some loads when turning the power back on gradually. The smart meter deployed by the French power distribution grid operator ENEDIS is called Linky. Its rollout began in 2015 and is scheduled to continue through 2021. Thanks to Linky, clients can access detailed information regarding their electricity consumption over a day, load curves for the entire period since its installation, and other statistical informations to help manage their consumption.

Last but not least, the intelligence of a modern power grid resides in the advanced management techniques that allow autonomous and real-time monitoring and optimization of its operation. These techniques aggregate measurements and forecasts in order to better manage the grid resources and maintain balance between supply and demand while ensuring grid stability.

A key marker of the power grid's evolution is the possibility of demand-side management (DSM), which is the governance of consumer energy demand through financial incentives and behavioural changes in order to influence customers' electricity consumption profiles [START_REF] Gellings | Demand-side management: concepts and methods[END_REF][START_REF] Strbac | Demand side management: Benefits and challenges[END_REF]. It encompasses a set of techniques utilized to achieve a load shape objective, either directly or indirectly. Active DSM can be defined as "the combination of automated controls with demandside management, which causes changes in the consumer load curve" [START_REF] Gregio | Active demand side management for households in smart grids using optimization and artificial intelligence[END_REF]. The DSM planning framework can be decomposed into five main elements [START_REF] Kreith | Energy management and conservation handbook[END_REF]: objective setting, alternatives identification, evaluation and selection, implementation, and monitoring. The objectives of a DSM planning framework are defined in three stages: broad utility objectives (reducing energy consumption, increasing earnings, etc.), that lead to operational objectives (reducing the need for new infrastructure, improving service quality, etc.), which in turn spawn ideal load shapes that drive the grid towards the fulfilment of upper-level objectives. To meet these objectives, an evaluation of alternative actions is performed, starting with the identification of end-users most susceptible to be targets for DSM programs. Afterwards, the choice of adequate technologies for each program is made. An examination of possible implementation methods is done. The selection of the method follows from an evaluation based on multiple criteria including customer and supplier considerations and cost-benefit analysis. Implementation methods include: customer education, direct customer contact, trade ally cooperation, advertising and promotion, alternative pricing, and direct financial incentives [START_REF] Kreith | Energy management and conservation handbook[END_REF]. Finally, monitoring of customer behaviour and system impacts after the implementation of DSM frameworks allow for the quantification of errors and better planning for future programs.

Smart grid features

In the smart grid paradigm, power grids acquire several interesting features, listed below.

• Observability. Communicating sensors throughout the grid and advanced metering infrastructure report the evolution of its state in real time (or near-real time).

• Flexibility/modularity. Being able to plug in or plug out a distributed generation module at any given time or point in the grid without destabilizing it. The modularity of the system model means that the addition or removal of one or more modules does not require starting over modelling and optimization.

• Scalability. This characteristic derives from the flexibility/modularity of the system. The modelling and optimization algorithms are adaptable to small grids of a few tens of nodes up to large-scale networks made up of thousands of nodes.

• Reliability. The core objective of grid operators is to maintain the balance between supply and demand at all times, and provide a high quality of service to their customers, according to contractually binding standards.

• Self-healing. In theory, a smart grid is a power grid able to autonomously detect and find fast and efficient solutions to its problems.

• Minimization of hardware stress. The predictive nature of the measures taken in the framework of a smart grid leads to the minimization of costs originating from equipment wear, failure or damage.

• Automatic voltage regulation. Voltage regulation procedures have long been administered manually or semi-manually by technicians. The connected network of sensors and actuators through which a smart grid operates renders this operation automatic.

• Security. The preceding features make smart grids a safer choice in terms of technical issue avoidance, financial costs, and service reliability.

Network topology and control architecture

The topology of power grids is constantly evolving with technological advances and the rise of alternative energy sources, spawning a shift from their rigid centralized structure to more flexible configurations: decentralized and distributed grids. In a centralized grid, all units are directly or indirectly connected to a central unit that aggregates the information it receives from the entire network and issues controls. In a decentralized grid, remote generator units are connected directly to end-users, separately from the main power plants elsewhere. These units have little or no connection to the main power grid and operate based on information pertaining to their immediate surroundings. A distributed grid, however, is one where units have a pack mentality; they share information and resources in order to reach a consensus, based on a set of prioritized objectives and constraints. The resulting emerging behaviour pushes the ensemble towards a common goal. This rationale falls within the framework of cooperative game theory [START_REF] Brandenburger | Cooperative game theory[END_REF][START_REF] José | Distributed model predictive control based on a cooperative game[END_REF][START_REF]Distributed Model Predictive Control Made Easy[END_REF].

Regarding the control scheme, it can be either decentralized or distributed. A decentralized control scheme is where the system is decomposed and each of the subsystems has its own set of state variables, inputs, and outputs [START_REF] Scattolini | Architectures for distributed and hierarchical model predictive control -A review[END_REF]. The local regulators solve their own problems and interaction between the subsystems stems solely from the states' effects on one another. No information exchange between the regulators is witnessed in this scheme. On the other hand, a distributed control scheme is where local regulators do communicate. When they solve local MPC (model-based predictive control) problems, for instance, they exchange predicted controls and/or state variables computed locally, allowing them to predict the effects of future controls or coupled variables over a finite forecast horizon. Distributed control algorithms can be partitioned with respect to several criteria; they can either be fully or partially connected algorithms, iterative or non-iterative, independent or cooperative, etc. Centralized systems have long been the status quo for power grids, but they're losing ground to more flexible configurations that are less vulnerable to disturbances and better suited to cope with the evolution of the grid. A case can be made for a future power grid where both centralized and decentralized aspects co-exist, allowing for a multimodal operation [START_REF] Bouffard | Centralised and distributed electricity systems[END_REF].

It is plausible to differentiate the communication topology of the grid's sensors from its physical topology [START_REF] Gunn | Power supplydemand balance in a smart grid: An information sharing model for a market mechanism[END_REF], notably since the latter is planned over several years and lacks flexibility for obvious reasons (high financial cost, geographical constraints, customer connection requests, so on and so forth), while the former can be adapted to the type of communication channels available, the technological advancements of electronic devices and the adopted monitoring and control techniques. Because not every node in the grid can be fully instrumented, sensor placement is of the utmost importance to have a view as comprehensive as possible of the system's state.

Power grid modelling

Building a comprehensive and efficient model for power grids has been the subject of extensive work, spanning a large array of tools and techniques. Herein, the most prominent power grid modelling approaches are displayed in an effort to flesh out their specificities and an emphasis is put on the type of applications for which the models are constructed.

These approaches can be classified into two main categories. The first category is technologyfree models, which enable the simulation of the power grid's behaviour without specific knowledge of its physical and technical inner-workings. The accessibility, scalability, and interoperability of these methods is making them an increasingly appealing choice, especially with the remarkable evolution of dedicated software. The second category, by far the more prolific and well-researched of the two, is the power flow family of methods. A glimpse is provided into well-established numerical methods used in the literature to solve power flow equations. Then, Optimal Power Flow and its applications are introduced. Emphasis is put on modelling applications since power flow analysis is a thoroughly-researched reliable tool for infrastructure planning, electrical system dimensioning, and risk assessment. The lesser prominent control applications are mentioned without warranting their own subsection among the monitoring and control ones.

The notable works highlighted in this section of the chapter are then recapitulated in Table 1.2.

Technology-free models

Technology-free models cover any black box modelling method that doesn't require physical and technical knowledge of the system's components and behaviour. Such models have been proposed for DSM applications [START_REF] Gonzalez De Durana | Technology-free microgrid modeling with application to demand side management[END_REF], putting forward a modelling approach with minimal data requirements as physical characteristics of generators, loads, and power lines aren't explicitly present. Basically, an electrical circuit can be represented simply by both its efficiency and time-dependant power flow. Agents in a smart grid are perpetually exchanging power. As a result, each node can be modelled as a linear combination of incoming and outgoing power flows. Using this paradigm to model various distributed generators (wind turbines, water pumps, etc.), a simple self-contained microgrid model is proposed to test DSM algorithms in [START_REF] Gonzalez De Durana | Technology-free microgrid modeling with application to demand side management[END_REF].

Because of the heterogeneity of power grid components, it is sensible to use energy as the lingua franca of the model. Dispensing with differential equations to depict energy conversion at various nodes, the model describes energy flow or power flow throughout the grid by having recourse to graph theory [START_REF] Brent | Introduction to Graph Theory[END_REF], particularly bond graphs [START_REF] Filippo | A survey of bond graphs: Theory, applications and programs[END_REF].

The main selling point of bond graphs is their ability to integrate several subsystems from different physical domains into one comprehensive homogeneous model seamlessly, by relying entirely on power flow to depict the system's behaviour. However, an important drawback of such an approach that rapidly surfaces upon examination is its susceptibility to various errors and algebraic loops [START_REF] Šarga | Simulation of Electrical System using Bond Graphs and MATLAB/Simulink[END_REF].

Object-oriented programming [START_REF] Graham | Object-oriented methods: principles & practice[END_REF] defines components of power grids as objects sorted by their electrical behaviour (energy producers, consumers or pro-consumers) and the physical laws by which they abide. As a result, this approach facilitates the formalisation of interactions between grid elements. Power grids are essentially a set of nodes and links. Therefore, the model avails itself of the organisational principles upon which object-oriented programming is built [START_REF] Cheung | A unified model of the electrical power network[END_REF].

1. Classification. Classes, which can be either physical items of the grid or data packets in a monitoring system, are defined.

2. Inheritance. Subclasses share common features while having particular attributes that set them apart (equipment type, accuracy, etc.).

3. Association. It represents the links between different classes, an association can be defined between a PV panel and an inverter, for instance.

4. Aggregation. Objects built from different component parts are modelled as aggregations.

Though the escalation of these methods' use to simulate power grid behaviour is relatively recent, it has been gaining popularity. This is a result of the rapid progress in software technology and the growing need for simple yet efficient ways to study the power grid's behaviour within the smart grid context. These tools offer the possibility of constructing flexible and scalable models without requiring a deep understanding of the inner workings of the grid's components, in order to test control algorithms and DSM programs. The rising interest in modelling and smart management of power grids has also fuelled the development of dedicated simulation software [START_REF] Connolly | A review of computer tools for analysing the integration of renewable energy into various energy systems[END_REF][START_REF] Kondoro | Simulation Tools for a Smart Micro-Grid: Comparison and Outlook[END_REF]. These methods, however accessible they may be, are not without shortcomings. Their black box nature relinquishes, partially and sometimes completely, the ability to have access to internal system parameters and adjust them for specific technical applications. Their "user-friendly" attribute could indeed become a limitation once the desired application strays from the tasks the model was specifically designed to fulfil.

Power flow analysis

Applications whose aim is infrastructure planning in the light of the power grid's evolution [START_REF] Rana | Operation and planning of distribution networks with integration of renewable distributed generators considering uncertainties: a review[END_REF][START_REF] Vallem | Optimal placement of DG in radial distribution systems based on new voltage stability index under load growth[END_REF][START_REF] De Oliveira-De | A detailed network model for distribution systems with high penetration of renewable generation sources[END_REF] demand further inquiry into the power flow between grid components and along grid lines. More accurately, numerical methods are elaborated to calculate distribution grid power flow. These methods range from deterministic algorithms [START_REF] Renan | Substitution-Newton-Raphson method for the solution of electric network equations[END_REF][START_REF] Sayfutdinov | Laboratory evaluation of a deterministic optimal power flow algorithm using power hardware in the loop[END_REF] to probabilistic ones [START_REF] Augusto | Probabilistic algorithms for power load flow and short-circuit analysis in distribution networks with dispersed generation[END_REF][START_REF] Wei | A probabilistic power flow algorithm based on semi-variable and series expansion[END_REF], incarnating a state observer for the grid's key parameters.

Power flow estimation is the oldest method for modelling the behaviour of power grids in terms of energy transfer between its elements, and can be viewed as a centralized scheme originating from Kirchhoff's laws that model power flow and inequality constraints for lines' capacity limits. It can be broken down into three main stages: the reduction of the network into an equivalent electrical circuit, the construction of an equation set to describe the evolution of the system's key parameters such as voltage, current, and power at each node, then the resolution of the equation set at each step to update the estimation of the parameters' values. The first step is reducing the intricate electrical schemes of power grids into more basic ones in order to fast-track the computation and eliminate unnecessary details. Complex electrical circuits can be modelled using simpler equivalent ones [START_REF] Johnson | Origins of the equivalent circuit concept: the voltage-source equivalent[END_REF] that exhibit the same behaviour as their more sophisticated counterparts while maintaining visual and computational intelligibility. As a result, voltage drop estimations become simpler and faster. Obviously, equivalent circuits are inherently less detailed but the margin of error is acceptable when they are used for MV grids' planning [START_REF] Ruggeri | Simplified LV feeders model in presence of DG for MV network studies[END_REF].

All types of loads linked to the power grid can be approximated by a simple load model. In a distribution grid, each node has four associated variables of interest: the active power, the reactive power, the voltage amplitude and the phase-shift. Once the equivalent scheme of the LV distribution grid is contrived, the next step is the construction of the equation set that describes it using Kirchhoff's laws, and then its resolution using numerical algorithms to be briefly introduced below. A prominent stimulus for grid operators' probing into LV distribution grid models is the desideratum for MV grid planning. In this context, work has been carried out by EDF to build simplified models for the estimation of voltage variations in LV distribution grids and their accurate presentation in MV planning studies. The main idea is to perform an LV feeder reduction by extracting the electricity path causing maximum voltage drop, that would later on contribute to prediction of worst-case scenarios and MV grid assessment [START_REF] Ruggeri | Simplified LV feeders model in presence of DG for MV network studies[END_REF].

An extensive record of chapters tackling power flow analysis in distribution grids is conducted in [START_REF] Joshi | Advances in distribution system analysis with distributed resources: Survey with a case study[END_REF]. Simulation software such as RAPSim [START_REF] Pochacker | The microgrid simulation tool RAPSim: Description and case study[END_REF], which is an open source tool, have been developed with the purpose of facilitating power grid simulation based on power flow equations. As a matter of fact, power flow contains Direct-Current Power Flow (DC-PF) [START_REF] Van Hertem | Usefulness of DC power flow for active power flow analysis with flow controlling devices[END_REF][START_REF] Beerten | VSC MTDC systems with a distributed DC voltage control-a power flow approach[END_REF][START_REF] Taheri | Power flow solvers for direct current networks[END_REF] and Alternating-Current Power Flow (AC-PF) [START_REF] Gómez | Reliable load flow technique for radial distribution networks[END_REF]. Hereinafter, emphasis is placed on the Newton-Raphson (NR) and backward forward sweep (BFS) algorithms, which are used to solve AC-PF problems, due to their widespread use in distribution power grid modelling. Probabilistic algorithms are also briefly presented.

Newton-Raphson algorithm

NR is one of the most commonly used algorithms to solve equation sets, in the present case nonlinear equations depicting the behaviour of power grid components. It is simple to implement and basically boils down to writing the equations describing the system in the format f (x) = 0 and then iteratively searching for the best approximation of the function's roots within a reasonable margin of error [START_REF] Bonnans | Numerical Optimization: Theoretical and Practical Aspects[END_REF][START_REF] Givens | Computational Statistics, Second Edition[END_REF]. NR is widely used for power flow estimation in transmission grids. Distribution grids, however, prove challenging in this respect due to the high resistance/reactance ratio which leads to difficulties in inverting the Jacobian matrix and therefore creates convergence problems for the algorithm. Lured by the algorithm's straightforward formulation, several attempts have been made to bypass this issue, the simplest being the inversion of the Jacobian matrix using chain rule [START_REF] Baran | Optimal sizing of capacitors placed on a radial distribution system[END_REF].

Backward forward sweep

BFS is more widely used in distribution grids than NR [START_REF] Bompard | Convergence of the backward/forward sweep method for the load-flow analysis of radial distribution systems[END_REF][START_REF] Teng | A direct approach for distribution system load flow solutions[END_REF][START_REF] Eminoglu | Distribution systems forward/backward sweep-based power flow algorithms: A review and comparison study[END_REF][START_REF] Augugliaro | A backward sweep method for power flow solution in distribution networks[END_REF][START_REF] Michline Rupa | Power flow analysis for radial distribution system using backward/forward sweep method[END_REF]. Equally simple and robust, it can handle three-phase unbalanced networks. The backward sweep consists in applying Kirchhoff's laws to find voltage and current values starting from the farthest load up to the MV/LV station to compute the currents flowing in the network, followed by the forward sweep where the same process is conducted in the opposite direction in order to compute the voltage drops in all the branches. The iterative process goes on until the difference between the voltage mismatch is within a reasonable margin of error. Formulation of the matrices BIBC (bus injection branch current) and BCBV (branch current bus voltage) -both matrices deal with the connection between branch and injection currents, and voltage drops and branch currents, respectively -is required.

Probabilistic algorithms

NR and BFS algorithms are deterministic approaches in solving the power flow estimation problem. However, demand and generation in modern distribution grids are both afflicted with high uncertainties due to the stochastic nature of human behaviour and the inherent irregularities of renewable-energy-based power generation. Consequently, probabilistic algorithms emerge as an improved solution to take into account the stochastic nature of certain system variables. They can either be numerical or analytical. On one hand, numerical methods run a large number of simulations with random state variables, then extract the needed information through a statistical analysis of the results. The most prominent numerical method in the literature is the Monte Carlo one [START_REF] Conti | Probabilistic load flow using Monte Carlo techniques for distribution networks with photovoltaic generators[END_REF], which can be applied to assessment of the penetration of distributed generation (DG) [START_REF] Zio | Monte Carlo simulation-based probabilistic assessment of DG penetration in medium voltage distribution networks[END_REF] and harmonic power flow simulations [START_REF] Šošić | Fuzzy-based Monte Carlo simulation for harmonic load flow in distribution networks[END_REF], among others. On the other hand, analytical methods resort to linearisation of power flow equations [START_REF] Allan | Probabilistic load flow using multilinearisations[END_REF][START_REF] Brucoli | Quadratic probabilistic load flow with linearly modelled dispatch[END_REF] to avoid the convolution brought about by their non-linearity when formulating a probabilistic algorithm. Uncertainty is taken into account by considering system variables as random and providing their probability distribution functions.

Discussion

As opposed to more sophisticated algorithms, NR and BFS are abundantly used in existing works concerned with real-time monitoring and control. Several upgrades have been made over the years to boost their performance and adapt them to unbalanced three-phase networks [START_REF] Vander Menengoy Da Costa | Developments in the analysis of unbalanced three-phase power flow solutions[END_REF][START_REF] Ramos De Araujo | Comparisons between the three-phase current injection method and the forward/backward sweep method[END_REF]. There also exists a number of other deterministic algorithms used to solve the problem of state estimation in distribution grids such as fast-decoupled algorithms [START_REF] Augugliaro | A backward sweep method for power flow solution in distribution networks[END_REF] and fixed-point methods [START_REF] Carlos | Phase-decoupled method for three-phase power-flow analysis of unbalanced distribution systems[END_REF] to name a few.

Although probabilistic algorithms offer flexibility in the face of variable sets plagued with uncertainties, they come with a significant computational burden and an added level of mathematical complexity, which explains why their use remains limited despite their aforementioned virtues. While the laborious task of estimating power consumption per household can be made worthwhile by probabilistic algorithms' capacity to cope with unpredictable human behaviour and erratic renewable energy production, power flow estimators whose goal is infrastructure planning and DG allocation can forego meticulous modelling in favour of simplicity. State estimators preceding voltage regulation algorithms juggle accuracy and simplicity with speed. Overvoltages in a distribution grid need to be halted fast, at most in the span of minutes, to avoid equipment damage, blackouts and safety issues. As a consequence, a compromise must be made to ensure swift reaction to voltage variations. In this case, deterministic algorithms, although relatively crude, are a better fit than fine-tuned but slower probabilistic ones.

Optimal Power Flow

Optimal power flow (OPF) encompasses all algorithms that concern themselves with constrained non-linear optimization of electrical power systems deeply rooted in power flow equations derived from the physical laws governing the system. A comprehensive overview of the theory of OPF from an operational research perspective defines it as "any optimization problem that seeks to optimize the operation of an electric power system subject to the physical constraints imposed by electrical laws and engineering limits" [START_REF] Frank | An introduction to optimal power flow: Theory, formulation, and examples[END_REF].

Further exploration of OPF algorithms can be found in [START_REF] Syranidis | Control techniques and the modeling of electrical power flow across transmission networks[END_REF], along with a literature review of associated modelling techniques. OPF algorithms' uses include, but are not limited to, infrastructure planning and distributed generator dimensioning. They enable risk assessment by identifying worst-case scenarios and critical paths in distribution grid lines. They can also be used for operation and control of power grids. An example of OPF being used for operation purposes is illustrated in [START_REF] Riffonneau | Optimal Power Flow Management for Grid Connected PV Systems With Batteries[END_REF] where a "day-ahead" predictive management scheme for distribution power grids with photovoltaic generation and storage systems, taking into consideration the ageing of batteries, is proposed.

Similarly to power flow analysis, OPF also includes several varieties, ranging from Direct Current-Optimal Power Flow (DC-OPF) to Alternate Current-Optimal Power Flow (AC-OPF). On one hand, DC-OPF algorithms are convex linearised problems widely used for transmission grid planning [START_REF] Akbari | Towards integrated planning: Simultaneous transmission and substation expansion planning[END_REF][START_REF] Ugranli | Transmission expansion planning for wind turbine integrated power systems considering contingency[END_REF]. They are an approximation of AC-OPF, whose assumptions make them faster and reasonable for application to very large systems [START_REF] Sun | DC optimal power flow formulation and solution using QuadProgJ[END_REF]. On the other hand, AC-OPF is primarily used for optimization of operation and control strategies. It is a non-linear non-convex problem that uses full AC power flow equations, including reactive power flow, and therefore takes losses into account. AC-OPF methods are better suited for distribution power grid modelling and operation [START_REF] Sortomme | Optimal power flow for a system of microgrids with controllable loads and battery storage[END_REF][START_REF] Ochoa | Minimizing energy losses: Optimal accommodation and smart operation of renewable distributed generation[END_REF][START_REF] Capitanescu | Critical review of recent advances and further developments needed in AC optimal power flow[END_REF][START_REF] Dall'anese | Chance-Constrained AC Optimal Power Flow for Distribution Systems With Renewables[END_REF]. A review of AC-OPF is given in [START_REF] Cain | History of optimal power flow and formulations[END_REF].

The penetration of renewables in distribution grids has not been without its challenges when it comes to OPF algorithms. Distributed generation adds a degree of complexity to an already intricate power grid and boosts the inherently unbalanced nature of loads. In addition to highlighting protection system concerns, the repercussions of large-scale integration of DG into distribution grids on their stability and operation is thoroughly examined in [START_REF] Nazmul Huda | Large-scale integration of distributed generation into distribution networks: Study objectives, review of models and computational tools[END_REF] and an overview of voltage rise mitigation techniques is given. Optimal power flow is one of the most well-researched fields of constrained optimization of power grids. Its efficiency for worst case assessment and contingency planning explains its prolific use for infrastructure planning and system dimensioning. However, it remains ill-suited for real-time monitoring and control because of its computational challenges. Discrete settings of control devices such as on-load tap changers in the grid make the problem a mixed-integer non-linear one, which complexifies its resolution. A comparative study of objective functions, constraints, and OPF algorithms in the service of smart grids is given in [START_REF] Abdi | A review of optimal power flow studies applied to smart grids and microgrids[END_REF] and a comprehensive survey of numerical methods used to solve OPF problems can be found in [START_REF] Khaled Khamees | Optimal power flow methods: a comprehensive survey[END_REF].

In a nutshell

Section 1.5 takes a closer look at two of the main poles of methods concerned with the modelling and simulation of power grids in the literature. Technology-free models, simple and easy-to-use, provide a suitable tool for non-specialists to simulate the grid's behaviour and to test operation and control schemes, namely for DSM applications. This approach has benefited greatly from the progress made in software development. Power flow analysis and OPF, on the other hand, take a much more in-depth approach to modelling the behaviour of power grids by using physical power flow equations. These methods have been thoroughly researched for decades and available literature about them is extensive. They are efficient for infrastructure planning and risk assessment. In recent years, they have been increasingly used for optimal dimensioning and allocation of distributed generation. OPF, which can be viewed as an application of power flow equations for optimisation purposes, has some applications for electrical grid control, which are acknowledged in this section. However, they remain a minority compared to OPF's prolific use for infrastructure planning, optimal system dimensioning, and risk assessment.

Power grid operation and control

In this section of the chapter, the methods undertaken in the literature to monitor and control power grids are examined in order to deduce their merits and shortcomings and make an analysis of their suitability to different applications. First, the multi-agent paradigm is introduced. Although it might be viewed as a modelling framework, it is used primarily for operation and control purposes. Second, model-based predictive control is studied, which is a control scheme able to into account data from an evolving environment and adapt accordingly. Then, a special interest is paid to demand-side management and the different methods it encompasses. Lastly, a discussion is carried out around technical and regulatory aspects of flexible asset management. The notable works highlighted in this section of the chapter are recapitulated in Table 1.4.

Multi-agent systems

Definition

The modern distribution grid is composed of heterogeneous elements (regular households, proconsumers, biogas plants, hydraulic stations, etc.), which explains the popularity of multi-agent systems (MAS) in the field of power grid modelling [START_REF] Waseem | The research on multi-agent system for microgrid control and optimization[END_REF]. Analogously to object-oriented programming, multi-agent systems provide a modular and scalable representation of the grid, where the inner dynamics and physical properties of each element are put into a "packet" labelled an agent. Then, rule-based agent behaviour and inter-agent interactions are defined.

Countless definitions of agents and multi-agent systems are given in the literature. An attempt is made hereinafter to extract the guideline shared by these definitions and provide a concise explanation of the basic knowledge one needs to grasp in order to use MAS for operation and control of power grids. Then, recent works tackling modelling and control of distribution grids using MAS are browsed.

An agent is a free-standing entity situated in a partially or totally observable environment to which it is able to react. An agent is, controversially so, characterised as "intelligent". This refers to its ability to perceive changes in its environment and make decisions autonomously. An agent's cyclic behaviour consists of three stages.

1. Perception. The agent receives data from other agents and sensors depicting the state of the system and changes in exterior parameters. An awareness of its environment is established.

Decision

. Taking into account the information gathered during the perception stage, the agent uses its "knowledge" to assess the possibilities and decides which actions to take.

Action. The agent enacts its decision by transmitting it to other agents and actuators.

The nature of the decision (either request or command) is determined by the hierarchy of the system.

An interactive environment

Multi-agent systems possess invaluable attributes that facilitate modelling and control of power grids [START_REF] Stephen | Multi-Agent Systems for Power Engineering Applications -Part I: Concepts, Approaches, and Technical Challenges[END_REF][START_REF] Hassan Et-Tolba | A multi-agent system architecture modeling for smart grid context[END_REF]. They offer flexibility in the face of dynamic situations. For example, they can detect the connection of a new DG to the distribution grid and make the necessary alterations without operator intervention. The inclusion, replacement, or removal of new agents can be done online without compromising the grid. Furthermore, the extensibility of MAS allows straightforward addition of new functionalities to the system or the upgrade of existing ones.

For instance, state of the art sensors or data analysis algorithms can replace outdated ones seamlessly. As a corollary of these features, the system becomes fault tolerant: the failure of one part of the system shouldn't hinder the proper functioning of the rest. So, if a PV panel on-site voltage control unit fails and the amount of PV power generation injected into the grid is no longer controlled, this does not provoke a system-wide failure. Equally crucial is the autonomy of the agents that make their own decisions in service of their goals, licensing them to deny requests from other agents if they do not respect certain criteria and alter or postpone actions when needed, to prioritize tasks such as time or resource consuming calculations or safety protocols.

The design and implementation of MAS models for distribution grids is discussed thoroughly in [START_REF] Pipattanasomporn | Multi-agent systems in a distributed smart grid: Design and implementation[END_REF].

The examples provided in the present chapter fall within the realm of power engineering to highlight the use of MAS for such applications. Nonetheless, it should not escape the reader that the scope of MAS applications extend to many other fields: social behaviour [START_REF] Sabater | Reputation and social network analysis in multi-agent systems[END_REF], electricity markets [START_REF] Zhou | Agent-based simulation of electricity markets: a survey of tools[END_REF], finance [START_REF] Samanidou | Agent-based models of financial markets[END_REF], urban development [START_REF] Yang | Integration of multi-agent systems with cellular automata for simulating urban land expansion[END_REF], etc.

Researchers are flocking to MAS for the modelling of power grids because of its ability to reproduce complex and sometimes unpredictable interactions between grid components with relative ease. A modern power grid is composed of high numbers of agents with heterogeneous dynamics governed by a set of physical laws and technical constraints, whose objectives are dissimilar and sometimes conflicting. Complexity aside, this results in emergent properties for which the MAS framework is well equipped [START_REF] Johnson | What are emergent properties and how do they affect the engineering of complex systems?[END_REF]. The challenge resides in exhaustively defining the laws that govern the considered system. As a matter of fact, the design and implementation of MAS models is by no means an easy feat [START_REF] Stephen | Multi-Agent Systems for Power Engineering Applications -Part II: Technologies, Standards and Tools for Building Multi-Agent Systems[END_REF] and relies heavily on successful agent communication.

In centralized schemes, agents communicate solely with hierarchically superior entities (be it a grid regulator or agents of upper levels) and have limited to no decision making capabilities. On the other hand, in decentralized or fully distributed schemes, agents on the same hierarchical plane can communicate with one another and are authorized, to varying degrees, to participate in the decision making process.

Several pieces of software have been developed in order to simulate the interactions between power grid agents and test operation and controls schemes using the paradigm of multi-agent systems. They can be either open source -GridLab [START_REF] Chassin | GridLAB-D: An Agent-Based Simulation Framework for Smart Grids[END_REF], and Repast [START_REF] Collier | Repast: An extensible framework for agent simulation[END_REF] -or licensed tools -Anylogic [113] -, allowing the assembly of power grid models from predefined blocks complete with their electrical characteristics and behavioural rules.

A coordination framework

Efficient communication and coordination between agents is the centrepiece of control schemes in the framework of multi-agent systems. The communication topology and the hierarchy of decision-making shape the control strategy. The structure of a LV distribution grid as a hierarchical MAS is on display in [START_REF] Hu | A multi-agent system for distribution grid congestion management with electric vehicles[END_REF]: a market-based control method is applied to a two-level hierarchical architecture in order to promote the successful integration of electric vehicles into the grid. The upper level is the distributed system operator that coordinates the fleet operators' power schedule and the lower level is composed of fleet operators allocating charging power to individual electric vehicles. Fleet operators submit power schedules to the market operator who determines the shadow price which takes into account the interest in solving grid congestion, conforming to distributed systems operator's preference. The optimization problem is solved in a few steps in MATLAB [115] and the coordination between agents is done through JACK [116], a cross-platform environment for integrating multi-agent systems. It is worth noting that by giving electric vehicles the possibility to respond to price changes individually, they tend to choose the time slots with lower prices, contrasting the global aim of mitigating congestion in the power grid. This calls into question the validity of giving agents decision-making capabilities.

Multi-agent systems have proven efficient for the management of LV distribution grids in both urban areas [START_REF] Mocci | Demand side integration in LV smart grids with multi-agent control system[END_REF] with upcoming penetration of distributed generation and rural ones such as isolated West African regions with self-sufficient hybrid electrical systems [START_REF] Abdoul | Decentralized control of the hybrid electrical system consumption: A multi-agent approach[END_REF], offering potential for a load shifting scheme relying on the flexibility of loads with different priority levels. With similar load shifting objectives, a MAS model with demand-side integration (DSI) is developed in [START_REF] Mocci | Demand side integration in LV smart grids with multi-agent control system[END_REF], using the open-source platform JADE [START_REF]JADE: Java Agent DEvelopment Framework. An open source platform for peer-to-peer agent based applications[END_REF]. The simulation is run on a typical LV distribution grid in Italy (an urban area). The scheme is founded on a masterslave communication between autonomous agents: the load aggregator centralizes demand and operates a master agent, which in turn operates independent agents. Ideas of Nash's game theory [START_REF] Facchinei | Generalized Nash Equilibrium Problems[END_REF] are used in terms of agents having access to local information (their own dynamics) as well as global information (energy prices, average state of all other agents, and technical constraints). Agents try to maximize their benefit, but their deviation from the mean behaviour is penalised to favour global optimization.

A slightly more complicated 4-level scheme is adopted in [START_REF] Anwar | Agentbased unified approach for thermal and voltage constraint management in LV distribution network[END_REF], where the structure is comprised of four types of agents: transformers, feeders, houses, and devices. The method is an APC-based (active power curtailment) load control for cases where the PV power generation exceeds a predefined threshold, while taking into account customers' comfort [START_REF] Ghosh | Distribution voltage regulation through active power curtailment with PV inverters and solar generation forecasts[END_REF]. Device agents report consumed and generated power, voltage levels, and temperature to corresponding upper level house agents that coordinate them and act as interfaces between households and external entities. Transformer and feeder agents monitor their respective loading. The synchronous communication between agents lays a solid ground for scalability and interoperability of the model. The scheme combines congestion management with low-voltage control. The former is ensured by controlling households' heat pump loads [START_REF] You | Integration of 100% micro-distributed energy resources in the low voltage distribution network: A Danish case study[END_REF] to reduce congestion at the transformer level, whereas the latter is handled either through sensitivity-based control to trim PV power injections or through droop-based active power curtailment [START_REF] Tonkoski | Droop-based active power curtailment for overvoltage prevention in grid connected PV inverters[END_REF]. APC was first developed to avoid repeated tripping of overvoltage relays and incarnates the customer comfort aspect of the method. In fact, PV producers share the financial fallout endured as a result of APC. On the downside, APC is a suboptimal solution for both grid operators and distributed generators: it inhibits the exploitation of renewable energy resources as it forces production to stay under a predefined threshold. Moreover, this strategy is non-predictive. A resource as erratic as solar irradiance can provoke multiple disconnections of a PV panel from the distribution grid over a day and in the long run, this may damage the circuits and shorten their lifespan.

At the Paul Sabatier University in Toulouse (France), research into MAS dates back to the early 2000s, where a tool was developed [START_REF] Picard | Méthodologie de développement de systèmes multi-agents adaptatifs et conception de logiciels à fonctionnalité émergente[END_REF] and baptised ADELFE (Atelier de Développement de Logiciels à Fonctionnalité Emergente), aiming to elaborate adaptive multi-agent systems and the incorporation of emergent behaviour. This tool was thereafter used for the design of an Adaptive Transmission of Energy and Network Analysis framework [START_REF] Perles | An Adaptive Multi-Agent System for the Distribution of Intelligence in Electrical Distribution Networks: State Estimation[END_REF], dubbed ATENA. It is a completely distributed approach put in service of two main goals: load flow analysis and state estimation of distribution grids. The technique solves the load flow problem through applying the Newton-Raphson algorithm at the micro-level. Network state estimation is carried out through agent cooperation using the same algorithm and the voltage values provided by the measurement nodes. Every agent is assigned three types of data: a state vector containing its key parameters, the voltage and phase shift of its neighbours and the characteristics of the lines connected to it. The emerging global function guides the system to its equilibrium state. The authors claim that the required cycles to reach an acceptable solution evolves logarithmically and that the complexity in time evolves linearly on a succession of 1000 resolutions.

The notion of "criticality", as defined in [START_REF] Perles | An Adaptive Multi-Agent System for the Distribution of Intelligence in Electrical Distribution Networks: State Estimation[END_REF], is the dissatisfaction of an agent regarding its own goals. Therefore, acceptance of the solution's suboptimality is clear. This is reminiscent of Nash equilibrium, an inherently suboptimal approximation of the global objective function that calls for an a posteriori verification of compatibility between the computed solution and the application [START_REF] Başar | Dynamic Noncooperative Game Theory, 2nd Edition[END_REF]. Put simply, at time step t, each agent optimizes a quadratic cost while assuming that the neighbouring agents will use the variables computed at time step t -1 to optimize theirs. A Nash equilibrium is reached when this process converges. One could argue that agents' criticality values can be used to estimate the suboptimality gap of the optimization problem global solution but this does not seem to carry weight in the context of the work presented in [START_REF] Perles | An Adaptive Multi-Agent System for the Distribution of Intelligence in Electrical Distribution Networks: State Estimation[END_REF]. This stems from the fact that the application, i.e. solving problems in distribution grids, does not call for an optimal solution. The main focus is put on avoiding congestion, respecting technical constraints, and keeping service quality above a contractual threshold. Agents are able to identify critical situations in their neighbourhoods and act accordingly using a bargaining-like behaviour and considerate control [START_REF]Distributed Model Predictive Control Made Easy[END_REF], which refers to agents in a neighbourhood always helping the agent with the highest criticality.

In order to solve the multicriteria constraint optimization problem that is "smart grid" management, the decisions made by the agents can be computed using a multitude of algorithms. The following subsections of the chapter focus on consensus-based algorithms, gossip algorithms, and game theory and puts into the foreground their use in service of modelling and control of distribution grids.

Consensus-based algorithms

Distributed computations in multi-agent systems call for consensus between agents: an agreement upon agent roles and objectives, and a willingness to participate in the prescribed control strategies to reach the global objective. A consensus algorithm defines rules for the exchange of information between neighbouring agents. Two types of consensus problems emerge: unconstrained consensus problems (i.e. alignment problems), where a consensus is reached when all agents converge asymptotically to the same state, and constrained consensus problems when that state is a predetermined function. An insight into consensus problems in distributed decision-making systems is given in [START_REF] Olfati-Saber | Consensus and cooperation in networked multi-agent systems[END_REF], with respect to various applications such as sensor fusion and formation control. The use of consensus-based algorithms for smart grid applications is scarce but it manifests itself in some recent works [START_REF] Rahbari-Asr | Incremental welfare consensus algorithm for cooperative distributed generation/demand response in smart grid[END_REF][START_REF] Zhao | Consensus-based energy management in smart grid with transmission losses and directed communication[END_REF].

Congestion problems in distribution grids are taken on by converting the power balancing problem into a leader-follower approach where a direct spanning tree originating from the leader is required to ensure the asymptotic convergence of flexible asset outputs to its issued set points [START_REF] Pedersen | Network condition based adaptive control and its application to power balancing in electrical grids[END_REF]. A state machine enables the transition between controllers in accordance with the congestion level of the network, determined by measurements of round trip time (RTT). The algorithm is, however, only tested on star-like topologies, due to the spanning tree requirement.

Another example of consensus algorithms used for power grid control applications is DC microgrid control: in [START_REF] De Persis | A power consensus algorithm for DC microgrids[END_REF], an undirected weighted graph to model the electrical circuit is combined with an undirected unweighted one to model the communication network. Then, they build a non-linear consensus system of differential algebraic equations. The system is analysed through Lyapunov functions inspired by the physical laws governing the power grid. Controllers exchange information regarding the instantaneous injected power and ensure proportional power sharing.

Gossip algorithms

Gossip algorithms are distributed and asynchronous algorithms. Their name is inspired by the communication protocol they promote: a node communicates with one random immediate neighbour during each time slot and thus, the information spreads across large and arbitrarily connected grids [START_REF] Shah | Gossip algorithms[END_REF]. Changes in the state of a node that can be computed through system dynamics are anticipated in a distributed manner and do not deteriorate the algorithm performance. This type of algorithm is inherently fault-tolerant and suitable for all grid topologies, as well as nodes with limited connectivity and computational and energy resources. The model's asynchronous nature means that nodes do not necessarily communicate at the same time. Intuitive applications of gossip algorithms include the computation of aggregate information [START_REF] Kempe | Gossip-based computation of aggregate information[END_REF] and geometric random graphs such as wireless sensor networks [START_REF] Boyd | Randomized gossip algorithms[END_REF].

The suitability of these algorithms for smart grid applications have not escaped researchers when honing their monitoring and control tools in the face of power grids' transition into fully fledged smart grids. An extension of distributed gossip algorithms with self-stabilizing properties is presented in [START_REF] Warnier | Distributed monitoring for the prevention of cascading failures in operational power grids[END_REF]. The scheme relies on the propagation of a locally computable minimum value which serves to detect and prevent cascading failures in operational power grids. To do so, a robustness metric is constructed for better monitoring of the grid in near real-time, with convergence time scaling logarithmically with the grid size. The flexibility and scalability inherent to such approaches is invaluable to modern power grids because nodes are incessantly being added to the network structure, intentionally removed from it, or disconnected due to equipment failure, communication congestion, or exterior factors.

Optimal power flow has also attracted the use of gossip algorithms in an interesting way. The optimal power flow problem can indeed be formulated as a distributed semi-definite programming one: each agent solves a local optimization problem with its own cost functions, physical constraints, and decision constraints shared with its neighbourhood to ensure the compatibility of the agent's decisions with those of its neighbouring agents [START_REF] Chang | A scheduled-asynchronous distributed algorithm for the optimal power flow problem[END_REF].

Game theory

Game theory is a branch of applied mathematics used to tackle a multitude of problems where the components of the system have evolving interdependent relationships. It models the behaviour of agents of subsystems involved in strategic situations where the outcome of a player's actions is function of its choices, those of other players, and exterior factors. In the light of the transition into a free electricity market with multiple suppliers and the deployment of distributed generation, game theory can be put into use for the modelling and smart management of modern power grids. This is one of a wide variety of research fields in which game theory is thriving: economics [START_REF] Hussein Samadi | Quantum Barro-Gordon game in monetary economics[END_REF], psychology [START_REF] Isoni | Reciprocity and the paradox of trust in psychological game theory[END_REF], social behaviour [START_REF] Huan-Huan Tian | Resolution of conflicts in cellular automaton evacuation model with the game-theory[END_REF], etc.

Depending on the scheme's goal, the game modelling the power grid operation can either be cooperative or non-cooperative. From the point of view of a distribution grid regulator, the game can be modelled as a cooperative one where all agents prioritize balancing supply and demand and ensuring grid stability over maximizing their own profit. From an economics point of view, a free international electricity market is a non-cooperative game where multiple electricity suppliers compete to maximize their profit and the end consumers seek to maximize theirs as well [START_REF] Majid | Demand side management in a smart grid with multiple electricity suppliers[END_REF]. A highly influential approach which consists in a distributed demand-side management strategy formulated as an energy consumption scheduling game has been proposed in [START_REF] Amir-Hamed Mohsenian-Rad | Autonomous demand-side management based on game-theoretic energy consumption scheduling for the future smart grid[END_REF]. More recently, a non-cooperative game approach for dynamic pricing -with dynamic pricing, end-users are usually given an hour-by-hour breakdown of electricity costs for the next day so they can take advantage of low-cost energy during off-peak hours -in order to reduce peak demand with fast convergence to a Nash equilibrium has been introduced in [START_REF] Barbato | A distributed demand-side management framework for the smart grid[END_REF]. A comprehensive overview of the potential of game theory applications to microgrid systems, demand-side management, and communication protocols can be found in [START_REF] Saad | Game-Theoretic Methods for the Smart Grid: An Overview of Microgrid Systems, Demand-Side Management, and Smart Grid Communications[END_REF].

Model-based predictive control

Suitability for LV distribution grid control

The premise of model-based predictive control (MPC) is to use a dynamic model of the system to predict its future behaviour and solve a constrained optimization problem over a finite time horizon. During each timeslot, the first step of the control strategy is implemented, then new information about the system's behaviour and external variables is incorporated into the optimization problem to be solved over the predefined time horizon once more. The particularity of the rolling horizon allows the controller to account for an evolving environment. Its downside, however, is that it makes the MPC scheme computationally expensive because an optimisation problem is solved over a forecast horizon at every time step.

In recent years, interest in MPC applications for power electronics has been mounting [START_REF] Vazquez | Model predictive control: A review of its applications in power electronics[END_REF] due to the advances made in electrical and mechanical system modelling that provide more accurate representation of systems' behaviour and leaps in microprocessor technology that make MPC implementation worthwhile. The suitability of MPC to distribution grid monitoring and control is plain. An electrical distribution grid is in fact a fragile system subject to volatile quantities such as distributed generation and stochastic demand. On top of jeopardizing equipment and service quality, these disturbances can lead to system failure. LV distribution grids are especially prone to cascading failures because of their weakly meshed, often radial structure, favoured for its cheaper cost and easier installation. Economic convenience edged out the extra layer of safety at the planning stage of LV distribution grids, but this choice has not aged well in the era of distributed generation. Consequently, the aptitude to predict future issues facing the system is a valuable tool to prevent them ahead of time.

Relaxation techniques

Large MPC problems are computationally expensive. To reduce the computational load, several solutions are possible for both linear and non-linear systems. In case of a linear problem, one proposal is to implement MPC by solving a multi-parametric quadratic optimization problem [START_REF] Tøndel | Complexity reduction in explicit linear model predictive control[END_REF]. On one hand, this alleviates the on-line computational complexity because the MPC implementation is done through a piecewise linear function evaluation instead of actual real-time optimization. On the other hand, the off-line complexity of the algorithm increases dramatically and so does the number of constraints. It goes without saying that this approach lacks flexibility as the piecewise function cannot be updated online.

Price-driven coordination also allows the simplification of a complex centralized MPC problem, for example by reformulating it as a large-scale quadratic problem with linking equality constraints [START_REF] Cheng | Price-driven coordination method for solving plant-wide MPC problems[END_REF]. Another option is the decomposition of the global MPC problem into local ones for each agent and using the price vector to penalise agents' deviation from the common goal of maintaining grid stability [START_REF] Sandoval-Moreno | Lagrange multipliers based price driven coordination with constraints consideration for multisource power generation systems[END_REF]. To circumvent the complexity of a global optimization problem concerning the entire power grid, distributed MPC comes forth as an appealing proposal, heavily anchored in a multi-agent framework [START_REF]Distributed Model Predictive Control Made Easy[END_REF]. Agents are each given a local optimization problem such that the emerging system behaviour leads to the resolution of the global problem. This alleviates the algorithmic complexity and produces a scalable control strategy fitting for a power grid with an evolving composition and structure.

Distributed scheme vs. hierarchical scheme

A distributed MAS scheme, whose goal is to couple an information sharing model with an MPC method to ensure power supply and demand balance is presented in [START_REF] Gunn | Power supplydemand balance in a smart grid: An information sharing model for a market mechanism[END_REF]. It divides agent energy demand/production into a flexible part and an external part. An agent in such a framework communicates, at first, with immediate neighbours to meet its own energy demand and also accommodate theirs before widening the search in case no acceptable solution is found. The interesting angle introduced in this work is that the information topology is not necessarily identical to the physical topology, which raises the question of determining the optimal information topology for each physical topology. Future work could focus on doing so in order to minimize grid losses, congestion at the transformer level, and convergence time of the algorithm.

Just as the problem can be completely distributed, a more conservative approach is a hierarchical scheme. The system is decomposed into n subsystems. The first layer regards interactions between subsystems and local regulators: each subsystem solves a local optimization problem with respect to information about the states of other subsystems and instructions it receives from the associated regulator. It then communicates its future state to other subsystems and the computed output to the regulator. The second layer concerns the local regulators and the central coordinator: upon receiving the computed outputs from the associated subsystems, local regulators transmit the local solutions to the central coordinator that aggregates them and generates electricity prices for the next timeslot. The regulators then use the prices to compute the local commands to be injected into the subsystems.

A hierarchical approach is arguably a more realistic way to go about implementing MPC to the power grid than fully distributed schemes. The operator retains some control over the grid and can at all times intervene to steer the agents in extraordinary circumstances while giving them leeway to make individual decisions with respect to their local constraints. The fully distributed approach relies heavily on coordination between agents without the help of a regulator. However, this is not always possible in light of a highly centralized communication infrastructure in the power grid.

The development of wireless communication technologies paves the way for inter-agent data exchange but there is still a long way to go before the implementation of a fully distributed MPC scheme in the power grid, especially in distribution grids, becomes a reality.

MPC with stochastic inputs

Predictive control's selling point is its capacity to anticipate problems that may emerge within the next few minutes or hours. To further improve upon the performance of MPC, the demand forecast fed to the controller can be made into a stochastic variable to take into account the unpredictability of human behaviour. Consumption curves are no longer assumed to be exactly known, they can be replaced with scenario trees where each node is assigned a demand and a probability of occurrence. Ergo, MPC becomes SRHC (stochastic receding horizon control). The latter can be found in the literature in an attempt to use grid operator-owned storage devices for peak reduction [START_REF] Rowe | The real-time optimisation of DNO owned storage devices on the LV network for peak reduction[END_REF]. Performance of the resulting algorithm is compared to that of a classic setpoint controller and that of a controller based on perfect demand forecast. It is found that SRHC is indeed more accurate than the setpoint controller. It moves closer to the perfect forecast controller than conventional MPC but does not outperform it. The same approach can be employed to integrate uncertainties regarding renewable energy sources, most notably household PV power generation, into the control scheme. That being said, when it comes to field implementation, control strategies involving several possible scenarios require a degree of flexibility the installations rarely have. The deterministic approach, though rudimentary by comparison, can generate a fixed storage device planning over a predefined time horizon, which is more suitable for third-party storage device operators.

Demand-side management

DSM has been defined in Subsection 1.4.1 as an integral part of the smart grid paradigm. As opposed to strategies that predict demand and tailor fitting energy supply (optimal power flow, flexible asset management), DSM consists in adapting need for electricity on the grid to available supply, which can be done indirectly by dynamically adjusting electricity prices to influence customer energy consumption (time-of-use pricing, real time pricing, etc. [START_REF] Borenstein | The long-run efficiency of real-time electricity pricing[END_REF][START_REF] Faruqui | Household response to dynamic pricing of electricity: a survey of 15 experiments[END_REF][START_REF] Newsham | The effect of utility time-varying pricing and load control strategies on residential summer peak electricity use: a review[END_REF][START_REF] Roscoe | Supporting high penetrations of renewable generation via implementation of real-time electricity pricing and demand response[END_REF][START_REF] Yang | A game-theoretic approach for optimal time-of-use electricity pricing[END_REF][START_REF] Tsui | Demand response optimization for smart home scheduling under real-time pricing[END_REF]) or directly by remotely controlling customer-side equipment to fit an optimal load curve (demand response [START_REF] Siano | Demand response and smart grids-A survey[END_REF][START_REF] Rahimi | Demand response as a market resource under the smart grid paradigm[END_REF][START_REF] Palensky | Demand side management: Demand response, intelligent energy systems, and smart loads[END_REF][START_REF] Sabita Maharjan | Dependable demand response management in the smart grid: A stackelberg game approach[END_REF][START_REF] Zhao | An optimal power scheduling method for demand response in home energy management system[END_REF][START_REF] Aghaei | Demand response in smart electricity grids equipped with renewable energy sources: A review[END_REF]). A recent comprehensive literature review of DSM is given in [START_REF] Fattahi | A review of demand-side management: Reconsidering theoretical framework[END_REF]. Hereinafter, focus is put on demand response as a valuable tool for supply/demand balance in the context of an electrical power grid with prolific distributed generation. It covers a variety of control schemes including, but not limited to, load shifting, valley filling, and peak shaving. These tools are presented in this subsection and references are provided for further details. Demand response tools are uniquely positioned to benefit from the flexibility added to the power grid by the deployment of distributed generation and the accompanying storage systems.

According to [START_REF] Albadi | A summary of demand response in electricity markets[END_REF], demand response "includes all intentional electricity consumption pattern modifications by end-use customers that are intended to alter the level of instantaneous demand, the timing, or total electricity consumption". Research into demand response techniques is plentiful, thanks to their considerable potential for real-time control of electrical power grids with high levels of renewables' penetration to avoid congestion and balance supply and demand.

Load shifting consists in moving the operation of certain loads in a grid to different time slots within a predefined control horizon in order to approximate a desired load curve without affecting the grid's total energy consumption over the specified time interval [START_REF] Amir-Hamed Mohsenian-Rad | Autonomous demand-side management based on game-theoretic energy consumption scheduling for the future smart grid[END_REF][START_REF] Logenthiran | Demand side management in smart grid using heuristic optimization[END_REF][START_REF] Paulus | The potential of demand-side management in energyintensive industries for electricity markets in germany[END_REF]. In a modern power grid setting, tasks that are not time-sensitive can be rescheduled to alleviate the burden of the grid. This is primarily done through financial incentives (i.e. dynamic prices) that penalise consumption in periods of peak demand and rewards it in periods of peak renewable-energy-based production met with a dip in demand. Load shifting is built on voluntary customer participation. Grid operators use financial incentives, but also raise awareness of the environmental stakes of successful integration of distributed generation in the power grid. The limitation to be taken into account here is that electricity providers do not have free reign to alter prices, of which a significant portion is subject to national and international regulations.

The idea behind the valley filling technique is to create loads in time slots where consumption plummets, in order to "fill the valley" in the load curve [START_REF] Zhong | A distributed demand response algorithm and its application to phev charging in smart grids[END_REF][START_REF] Wang | Grid Power Peak Shaving and Valley Filling Using Vehicle-to-Grid Systems[END_REF][START_REF] Tan | An optimal and distributed demand response strategy with electric vehicles in the smart grid[END_REF]. An example of this is electric vehicle charging, which can be strategically scheduled to absorb excess production from distributed generation when household power demand is not sufficiently high. Another option is to shift loads that use fossil fuels to electrical power to absorb the excess power injected into the distribution grid by PV producers, for instance. Several works in the literature explore such an idea:

As opposed to valley filling, peak shaving aims to reduce power demand during peak periods [START_REF] Wang | Grid Power Peak Shaving and Valley Filling Using Vehicle-to-Grid Systems[END_REF][START_REF] Amir | Smart load management of plug-in electric vehicles in distribution and residential networks with charging stations for peak shaving and loss minimisation considering voltage regulation[END_REF][START_REF] Leadbetter | Battery storage system for residential electricity peak demand shaving[END_REF]. This can be done through adjustment of electricity tariffs to discourage power consumption in periods of high demand during the day and reduce stress on the grid, for instance.

Demand-side management techniques, particularly demand response, are fitting for power grids with high penetration of distributed generation for numerous reasons [START_REF] Strbac | Demand side management: Benefits and challenges[END_REF]. They make localised interventions possible by shifting loads in small-scale distribution grids in order to absorb excess renewable-energy-based generation or alleviate stress during peak-demand timeslots without altering the overall power demand of the day. Operating flexible loads during peak PV generation or wind generation periods takes advantage of the momentarily surge of available power on the grid that may otherwise compromise its stability. As a result, grid stability issues are mitigated and demand is met through cleaner, cheaper electricity. In addition to solving operational issues without having recourse to infrastructure reinforcement, demand-side management also has a societal impact. As a matter of fact, making end-users decision-making partners in grid operation raises awareness and changes the social and cultural perception of the stakes and inner-workings of the grid's energy transition.

On the flip side, demand response deployment is not without its challenges [START_REF] Murthy Balijepalli | Review of demand response under smart grid paradigm[END_REF]. Privacy issues and uneasiness surrounding the capabilities of grid operators to shift end-user demand are an important issue, which further highlights the importance of properly educating end-users concerning DSM and its benefits to all parties involved. The regulatory framework is not yet comprehensive on the matter. Furthermore, successful implementation of demand response techniques requires a mature and reliable advanced metering infrastructure. Finally, long-term investment costs and return on investment prospects of these techniques remain unclear.

Flexible asset management

In distribution grids, the intermittent PV power generation causes surges of voltage levels that could engender system instability and equipment damage. To curb this phenomenon, local PV power generation can be stored using on-site batteries in peak production periods to be used later on in the day. Challenges regarding the efficiency of electrical power storage and storage system design restrain the potential of this approach for large-scale deployment, but it is still reasonably efficient for small-scale use. Several works in the literature address the optimal dimensioning and allocation of distributed generation and storage units in distribution power grids [START_REF] Kansal | Optimal placement of different type of DG sources in distribution networks[END_REF][START_REF] Karimyan | Long term scheduling for optimal allocation and sizing of DG unit considering load variations and DG type[END_REF][START_REF] Viral | An analytical approach for sizing and siting of DGs in balanced radial distribution networks for loss minimization[END_REF][START_REF] Kansal | Hybrid approach for optimal placement of multiple DGs of multiple types in distribution networks[END_REF]. An extensive survey on the optimal allocation of distributed generation with regards to constraints, objectives, and algorithms is given in [START_REF] Mahmoud | A review of the optimal allocation of distributed generation: Objectives, constraints, methods, and algorithms[END_REF].

The regulation of voltage levels in the power grid can be carried out by operating strategicallyplaced distributed generators and storage units to fill the supply-demand gap and store the local power excess, respectively. Though this technique has yet to achieve field implementation, it has already been investigated in recent literature: smart inverters are used in [START_REF] Cappelle | Introducing small storage capacity at residential PV installations to prevent overvoltages[END_REF] to pilot small battery buffers at local production sites to prevent overvoltage in a Belgian rural distribution grid, a control technique using customer-owned energy storage systems is introduced in [START_REF] Sugihara | Economic and efficient voltage management using customer-owned energy storage systems in a distribution network with high penetration of photovoltaic systems[END_REF] to solve voltage fluctuation in distribution grids with high PV penetration, an approach for energy resource management in residential microgrids is put in place in [START_REF] Chabaud | A new approach to energy resources management in a grid-connected building equipped with energy production and storage systems: A case study in the south of france[END_REF] using a grid-connected building equipped with production and storage units, etc.

While scientific and technical aspects of flexible asset management are still an active research field, it is equally important to address the hurdles of regulatory frameworks within which such schemes would operate. The most obvious question is who would operate these facilities: the grid operator, the facilities operators/owners, or a third-party coordinator. And more to the point, the identity of the operator will influence both dimensioning and operation of the installations. In France, for instance, the French Energy Code requires water towers connected to French distribution power grids to be managed by concession holders [180]. Legislation also stipulates that grid operators must sign purchase contracts with entities operating renewableenergy-based distributed generators connected to the distribution grid under the "purchase obligation" article [181]. For a broader outlook on this issue, the regulatory and policy challenges of operating power grids with prolific distributed generation are discussed in [START_REF] Bell | Delivering a highly distributed electricity system: Technical, regulatory and policy challenges[END_REF]. A thorough study of electricity markets and technology policies for renewable electricity is given in [START_REF] Perez-Arriaga | Regulation of the power sector[END_REF].

Grid operators and distributed generator owners have different, sometimes clashing, priorities.

This setting refers back to concepts of mechanism design [START_REF] Jackson | Mechanism theory[END_REF][START_REF] Börgers | An introduction to the theory of mechanism design[END_REF], where individual rationality requires that the system be incentive-compatible for the flexible asset owners to enter in an agreement with the grid operators. In plainer terms, on one hand, grid operators need the cooperation of flexible asset owners in order to implement the aforementioned control schemes. On the other hand, asset owners will not participate if they stand to gain less by cooperating than they would by declining the grid operator's offer. As a result, contracts must be established between parties to stipulate the terms of a -presumably-mutually beneficial operation of distributed generation and storage units. To make this happen, proper incentives could be pledged to flexible asset operators. They can be direct methods, in the form of financial incentives [START_REF]The support of electricity from renewable energy sources[END_REF], or indirect ones such as discounts and positive discriminatory rules [START_REF] Auer | Regulatory instruments to deliver the full potential of renewable energy sources efficiently[END_REF]. Upon examination, flexible asset management emerges as a particularly interesting path to explore for the operation and regulation of distribution grids with prolific distributed generation. That being said, two main obstacles stand in the way of the large-scale deployment of such schemes: the scientific and technical barriers slowing down the development of efficient power storage systems and the legal frameworks that need to be established to regulate the ensuing market.

In a nutshell

An overview of control schemes for smart management of power grids is also given. In order to solve congestion problems in power grids, an abundance of methods have been developed, stemming from a variety of theoretical concepts and therefore apt to counter a large spectrum of issues jeopardizing the smooth running of power grids. In this subsection of the chapter, a brief introduction of notable methods focusing on the issue at hand is presented. Then, a summary of notable works in the literature concerning each of these methods is concocted, along with references to give further insight into the rationale behind each one, their specificities, merits, flaws, etc.

Conclusion

In the present chapter, the evolution of power grids into "smart grids" is explored, in the light of an increasing penetration of distributed generation and the features that ensue. Then, an overview of notable works in the literature aimed at the modelling and control of power grids within this framework is given. First, three main approaches to modelling power grids are presented and discussed. These approaches range from technology-free models that only take into consideration the interactions between grid components and that are aimed at demand-side management applications, to equation sets derived from the physical laws governing the system used to analyse power flow within the grid. In recent years, the multi-agent approach has been gaining popularity for power grid modelling and control thanks to its ability to accommodate the evolving composition of grids and its suitability for advanced real-time monitoring and control strategies.

Some of the methods presented in this chapter follow an indirect route to solving congestion problems; they attempt to steer customer consumption towards a desired load curve through, primarily, financial incentives. On the other end of the spectrum are direct congestion solving techniques, which take matters into their own hands, directly controlling customer equipment, partially or completely, to fit a desired load curve. Particularly, they can manage flexible assets to inject and store energy at opportune times with the aim of maintaining grid stability and proper functioning.

With regard to smart grid management goals, two distinct rationales transpire: planning and dimensioning of power grid infrastructure in advance to respond to projections of demand and cope with decentralized power generation, and applying control and monitoring techniques to existing infrastructure to tackle the issues birthed by the transition of the power grid towards a decentralized generation configuration. Whereas the first option is valid for cases where new power lines are scheduled in the area of study or for the planning of optimal distributed generation allocation, grid operators oftentimes prefer less expensive solutions by implementing smart management techniques to existing infrastructure with minor equipment upgrades.

Model-based predictive control strategy 2.1 Introduction

Over the past few years, power distribution grids have been undergoing major changes due to the increasing penetration of renewable-energy-based distributed generation [START_REF] Pepermans | Distributed generation: definition, benefits and issues[END_REF]. Power injection by distributed generators results in bidirectional power flow [START_REF] Enedis | Principes d'étude et de développement du réseau pour le raccordement des clients consommateurs et producteurs BT[END_REF] and is irregular and often uncontrollable. This is mainly due to solar and wind energy sources, which fluctuate depending on weather conditions and geographical locations [START_REF] Sue | A method to assess the wind and solar resource and to quantify interannual variability over the United States under current and projected future climate[END_REF].

Grid operators are contractually obligated to maintain steady and reliable service to their customers according to national and international regulations, mainly concerned with voltage levels, current levels and voltage drop gradients [START_REF] Perez-Arriaga | Regulation of the power sector[END_REF]. However, the decentralization of power generation is expected to make compliance with these constraints increasingly difficult and to trigger a large number of stability, quality, and safety issues [START_REF] Barker | Determining the impact of distributed generation on power systems. I. Radial distribution systems[END_REF][START_REF] João | Integrating distributed generation into electric power systems: A review of drivers, challenges and opportunities[END_REF]: short-circuits, equipment damage, and power outages to name a few. The penetration of distributed generation into power distribution grids creates planning issues as well as legal and regulatory ones [START_REF] Coster | Integration issues of distributed generation in distribution grids[END_REF]. Within this context, the smart grid paradigm has emerged as a solution to monitoring and control problems facing distribution grid operators [START_REF] Enedis | Principes d'étude et de développement du réseau pour le raccordement des clients consommateurs et producteurs BT[END_REF]: the enhancement of grid observability through an advanced metering infrastructure [START_REF] Rashed Mohassel | A survey on advanced metering infrastructure[END_REF] and forecasting of grid load [START_REF] Swan | Modeling of end-use energy consumption in the residential sector: A review of modeling techniques[END_REF] and distributed generation [START_REF] Wan | Photovoltaic and solar power forecasting for smart grid energy management[END_REF] pave the way for smart management techniques that keep the balance between supply and demand. Techniques concerned with smart management of power grids in the literature are abundant: optimal power flow [START_REF] Syranidis | Control techniques and the modeling of electrical power flow across transmission networks[END_REF][START_REF] Abdi | A review of optimal power flow studies applied to smart grids and microgrids[END_REF], demand-side management [START_REF] Strbac | Demand side management: Benefits and challenges[END_REF][START_REF] Palensky | Demand side management: Demand response, intelligent energy systems, and smart loads[END_REF], and multi-agent systems [START_REF] Stephen | Multi-Agent Systems for Power Engineering Applications -Part I: Concepts, Approaches, and Technical Challenges[END_REF][START_REF] Stephen | Multi-Agent Systems for Power Engineering Applications -Part II: Technologies, Standards and Tools for Building Multi-Agent Systems[END_REF] are some of the most heavily researched topics but by no means the only ones. The choice of a technique depends primarily on its objective, be it planning and dimensioning of power grid infrastructure or real-time monitoring and control. It also depends on technical and computational constraints. For instance, the voltage levels of the grid at hand determine which methods are better suited for its modelling and control. An extensive survey of modelling and smart management tools for power grids with prolific distributed generation is provided in [START_REF] Dkhili | A survey of modelling and smart management tools for power grids with prolific distributed generation[END_REF].

In a modern power grid, several distribution generation and storage device technologies co-exist. Thus, it stands to reason to use the leeway given by these devices to balance supply and demand for a better operation of the grid and a guarantee of its stability. The problem can then be formulated as a minimization problem, where the aim is to minimize the cumulated difference between supply and demand over a time horizon. This strategy brings together the flexible asset management approach [START_REF] Mahmoud | A review of the optimal allocation of distributed generation: Objectives, constraints, methods, and algorithms[END_REF][START_REF] Sugihara | Economic and efficient voltage management using customer-owned energy storage systems in a distribution network with high penetration of photovoltaic systems[END_REF] and implicit MPC [START_REF] Bruni | A study on the energy management in domestic micro-grids based on model predictive control strategies[END_REF][START_REF] Prodan | A model predictive control framework for reliable microgrid energy management[END_REF].

In the present chapter, a MPC-based strategy for low-voltage power distribution grids is proposed using third-party-owned distributed generators and storage systems (biogas plant and water tower) in order to balance supply and demand and limit instances of overvoltage and undervoltage across the grid, in accordance with the assets' operational constraints. This work falls under the ADEME (the French Agency for Ecological Transition) project "Smart Occitania" which responds to a concrete need expressed by the French distribution grid operator ENEDIS for smart management tools for rural/suburban low-voltage power distribution grids with prolific distributed generation. The contribution to this project of PROMES-CNRS ("Processes, Materials and Solar Energy") laboratory focuses on the development of a smart management strategy through a case study. More specifically, this work shines a light on an important constraint of the problem. In the considered case study, ENEDIS investigates the use of third-party-owned biogas plants and water towers as flexible assets in the power grid control scheme.

The biogas plant is controlled by a continuous signal. However, the operation of the water tower is subject to an ON/OFF controller. The discrete nature of the water tower's control signal makes the problem a mixed-integer non-linear programming (MINLP) one, which is still a challenging active research field in applied mathematics [START_REF] Lee | Mixed integer nonlinear programming[END_REF]. The main difficulty in modelling the problem as a MINLP one comes from the fact that it is both nonlinear and non-convex. This is due to the nonlinear non-convex hard constraints representing Kirchhoff's laws, which are polynomial equality constraints (see Equation 2.17b). While several techniques could be implemented and tested, a relaxation of the problem, whether at the modelling stage or the resolution stage, is always required (the reader is referred to [START_REF] Lee | Mixed integer nonlinear programming[END_REF] for a modern survey in MINLP).

The main contribution presented in this chapter resides in proposing an alternate formulation of the problem, dubbed switch control, that bypasses the MINLP framework without relaxing the ON/OFF controller constraint of the water tower. As opposed to a MINLP setting, the switch control formulation allows the problem to be treated as a classical smooth non-linear optimisation. The theory and algorithms used to solve such problems are thoroughly developed in the scientific literature [START_REF] Nocedal | Numerical optimization[END_REF]. In fact, by optimising the instants at which the water tower's controller switches from one state to the next, the discrete control signal is modelled as a continuous one.

The chapter is organised as follows: in Section 2.2, models of the power distribution grid and flexible assets used in the case study are formulated. Section 2.3 provides an explanation of the proposed model-based predictive control strategy. Then, it presents the MINLP problem formulation and introduces the novel formulation proposed in this chapter. In Section 2.4, a sensitivity analysis is performed to determine the most adequate sliding window size. Afterwards, results given by the proposed control strategy are compared with those of two reference strategies. The first reference strategy is a weekly operation planning which provides a heuristic lower bound for the final value of the objective function (i.e. cumulated difference between power supply and demand). The second reference strategy is a MPC scheme based on a relaxed problem formulation. Finally, Section 2.5 concludes the chapter and gives a glimpse into future works.

Case study

Introduction

The proposed approach deals with supply/demand balance in a low-voltage power distribution grid equipped with distributed generators and storage systems. Grid load data used in this study are provided by ENEDIS. They are measured at the MV/LV transformer level of a suburban residential neighbourhood of approximately 120 households. Throughout this study, the inductive and capacitive aspects of the grid components are neglected. Indeed, grid load data show that the portion of reactive power at the transformer level of the considered suburban residential neighbourhood remains under 5% of the apparent power, which validates this assumption.

The case study presented herein is carried out on a simulated low-voltage power distribution grid, composed of approximately 120 households, 50 household PV installations of 4 kW each (approximately 20 m 2 ), amounting to a total capacity of 200 kW, a small-scale biogas plant, and a water tower. The PV power generation is inferred from global horizontal irradiance (GHI) data given by a sensor placed on the roof of the laboratory PROMES-CNRS, a few kilometres away from the same suburban neighbourhood (Figure 2.1). The biogas plant used herein matches the characteristics of a plant studied in the scope of the Smart Occitania project. As for the water tower, measurements of water demand and water levels in its storage tank are collected.

In this chapter, the considered PV power generation capacity is in reality a fourfold increase from the current installed capacity in the considered power distribution grid. The current capacity not being high enough to disrupt the smooth functioning of the power distribution grid, this increase in capacity was decided on to demonstrate the predictive control strategy's ability to close a significant gap between supply and demand, while maintaining the voltage levels within prescribed margins (herein, 10%).

In this section, models of the power distribution grid and the flexible assets used in this case study are presented. In accordance with the predictive control scheme proposed in this chapter, the models of the flexible assets will be formulated over a forecast horizon H. Let H p be the integer number of time slots within this forecast horizon. In the following, and for all time-dependant quantities, t ∈ {1, . . . , H p }.

Biogas plant

Biogas plants are renewable-energy-based distributed generators, connected to low-voltage power distribution grids. A biogas plant is composed of a bioreactor producing methane-filled biogas, a storage unit, and a power generator. The biogas volume in the storage unit (in m 3 ) is described as:

V b (t + 1) = V b (t) + T 60 Q b,in (t) -Q b,out (t) (2.1)
where T = 10 min is the time step and Q b,in (in m 3 h -1 ) and Q b,out (in m 3 h -1 ) are the flow rates of biogas production entering the storage unit and of biogas consumption by the power generator, respectively. The flow rate Q b,out is formulated as follows:

Q b,out (t) = P b (t) ηLHV (2.2)
where P b (in W) is the plant's active power output, η is the generator's efficiency, and LHV (in kWh m -3 ) is the lower heating value of the stored biogas. The output P b is subject to the following constraint:

P b,min P b (t) P b,max (2.3)
where P b,min and P b,max are the minimum and maximum power generation of the biogas plant, respectively.

Regarding the biogas volume in the storage unit (V b ), it is subject to the following constraint:

V b,min V b (t) V b,max (2.4)
where V b,min and V b,max are the minimum and maximum biogas storage capacities of the biogas plant, respectively.

Water tower

Water towers provide pressurized potable water supply and emergency water storage for fire protection. They are connected to low-voltage power distribution grids. The volume in the storage tank (in m 3 ) is described as follows:

V w (t + 1) = V w (t) + T 60 Q w,in (t) -Q w,out (t) (2.5)
where T = 10 min is the time step and Q w,in (in m 3 h -1 ) and Q w,out (in m 3 h -1 ) are the flow rates of water entering the storage tank and water consumption, respectively. Q w,in is formulated as follows:

Q w,in (t) = P w (t) 3600η w ρgh (2.6)
where P w (in W) is the water pump's active power consumption, η w is the water pump's efficiency, ρ (in kg m -3 ) is the water density, g (in m s -2 ) is the gravitational acceleration, and h (in m) is the water level in the storage tank. Let P w,min and P w,max be the minimum and maximum power consumption values of the water tower, respectively. The power consumption P w can only be set following ON/OFF commands, i.e. it is subject to the following constraint:

P w (t) ∈ {P w,min ; P w,max } (2.7)
The water volume in the storage tank (V w ) is subject to the following constraint:

V w,min V w (t) V w,max (2.8)
where V w,min and V w,max are the minimum and maximum storage capacities of the water tank, respectively.

Low-voltage power distribution grid scheme

Grid load and PV power generation data used in the case study are presented in Figure 2.1. The equivalent electrical circuit of the case study power distribution grid is shown in Figure 2.2. The control scheme developed in this chapter operates at the MV/LV transformer level of a small-scale power distribution grid in order to minimize the gap between power generation and consumption. Therefore, the control scheme's results are independent of the dispatching of distributed generation throughout the grid.

For a given branch [qj], the voltage drop between nodes q and j is given by Kirchhoff's law:

U q (t) -U j (t) -z qj (t)I qj (t) = 0 (2.9)
where U q ∈ R Hp , ∀q ∈ {1, . . . , N }, and U j ∈ R Hp , ∀j ∈ {1, . . . , N }, are the voltages at nodes q and j, respectively, z qj ∈ R Hp , ∀q, j ∈ {1, . . . , N }, is the line impedance between nodes q and j and I qj ∈ R Hp , ∀q, j ∈ {1, . . . , N }, is the current flowing between nodes q and j. Let N be the number of nodes in the considered power distribution grid. Under the assumption that reactive power is negligible, U q is proportional to the active power consumed/produced at that node: where P q ∈ R Hp , ∀q ∈ {1, . . . , N }, is the active power consumed/produced at node q and I q ∈ R Hp , ∀q ∈ {1, . . . , N }, is the current injected into/absorbed by node q.

P q (t) = U q (t)I q (t) (2.
Herein, we focus on voltage bounds, which stipulate that voltage values must stay within a pre-defined margin of nominal values (230 V for single-phase connections and 400 V for 3-phase connections) [START_REF] Enedis | Principes d'étude et de développement du réseau pour le raccordement des clients consommateurs et producteurs BT[END_REF]. Measurements made at the transformer level of the distribution grid and used throughout this study correspond to means over each time slot (herein, a 10-minute time step is considered). Voltage means must at all times remain within ± δU of the nominal value, i.e., ∀q ∈ {1, . . . , N }:

|U q (t) -U n | δU (2.11)
where U n is the nominal single-phase voltage value for all grid nodes, N is the number of nodes in the power distribution grid, H p is the integer number of time slots within the forecast horizon, and δU is the acceptable margin of voltage variations with respect to the nominal value (in France, 5% for power sub-transmission grids and 10% for power distribution grids). Here, U n = 230 V and δU is set to be 10% of U n , that is δU = 23 V. Hereinafter, let us define the following bounds:

U min = U n -δU (2.
12)

U max = U n + δU (2.13)
For the equivalent scheme of the case study (Figure 2.2), Equation (2.9) and Equation (2.10) lead to the following equation set:

U 3 (t) -U 4 (t) + z(t) P b (t) U 4 (t) = 0 (2.14a) U 1 (t) -U 2 (t) -z(t) P w (t) U 2 (t) = 0 (2.14b) U 3 (t) -U 5 (t) + z(t) P PV (t) U 5 (t) = 0 (2.14c) U 1 (t) + U 4 (t) + U 5 (t) -3U 3 (t) -z(t) P cons (t) U 3 (t) = 0 (2.14d) U 3 (t) -3U 1 (t) + U 2 (t) + U n = 0 (2.14e)
where P PV and P cons are the PV power generation and the grid load, respectively. Let Q w,out , GHI, P cons , V w , and V b be measurements of water demand, global horizontal irradiance, grid load, water volume, and biogas volume, respectively. Let P * w , P * b be optimal setpoints of water tower power consumption and biogas plant power generation, respectively. Let GHI, P cons , and Q w,out be forecasts of global horizontal irradiance, grid load, and power demand, respectively. Let P s b and P s w be candidate setpoints of biogas plant power generation and water tower power consumption, respectively, and V s b and V s w be biogas volume and water volume corresponding to those candidate setpoints, respectively.

Control strategy

Consumers

Overview of the proposed strategy

The optimisation process presented thus far is the foundation for an implicit MPC-based strategy to be implemented for smart management of rural/suburban low-voltage power distribution grids. The premise of MPC is to use a dynamic model of the system to predict its future behaviour and solve a constrained optimisation problem, herein the one described in Subsection 2.3.3, over a sliding window. During each time slot, the first step of the control strategy is implemented, then new information about the system's behaviour and external variables is incorporated into the optimisation problem which is solved over the shifted window again. This strategy's strength resides in its ability to incorporate, in real time, forecasts of various disturbances afflicting the system's stability, namely PV power generation, grid load, and water demand, for a better anticipation of emerging constraints.

As opposed to a classic operation planning where a single optimisation problem is solved and its solution implemented over a fixed horizon (e.g. a week), the rolling horizon of a MPC controller is suitable for real-time control as the optimisation done over a pre-defined sliding window is much less expensive. In addition, power distribution grids contain several stochastic quantities whose forecasts degrade quickly as the forecast horizon expands. The rolling horizon of MPC allows a perpetual adaptation to the enhancement of forecasts. The MPC-based strategy proposed in the present chapter is summarised in Figure 2.3. At each time step, the low-voltage power distribution grid model assimilates data coming from both the forecast module and the metering infrastructure concerning water demand, global horizontal irradiance, and grid load. Then, the model evaluates the voltage levels in the grid and sends this information to the optimisation algorithm which attempts to find the optimal flexible assets' setpoints. Once the optimisation problem is solved, the first setpoint (for the following time step only) is implemented. The entire process reiterates at every time step.

Throughout this chapter, measurements of PV power generation, power demand, and grid load are used (no forecasting errors are made) and the performance variations between the relaxed approach and the novel one proposed herein are due to the optimisation problem formulation. This approach is taken because the focus of this chapter is to demonstrate the efficiency of the new problem formulation and to evaluate its performance with respect to a relaxed one. The biogas plant's power output and the water tower's power consumption are assumed identical to the flexible assets' respective setpoints. This section starts with formulating the problem as a standard MINLP one. Then, it introduces the proposed reformulation allowing to treat the optimisation problem as a nonlinear smooth one without having recourse to relaxation. The section ends with a presentation of the two reference strategies with which the proposed scheme's performance is evaluated.

MINLP formulation

In the scope of this work, the considered water tower installations are operated by third parties using an ON/OFF controller, a hard constraint by which the power distribution grid control scheme must abide. The integer values of the water tower control setpoint makes the problem a MINLP one [START_REF] Lee | Mixed integer nonlinear programming[END_REF]. This setting is an active research field in applied mathematics and existing solvers able to tackle it have significant limitations [START_REF] Belotti | Mixed-integer nonlinear optimization[END_REF], further worsened by the non-convexities of the constraints [START_REF] Burer | Non-convex mixed-integer nonlinear programming: A survey[END_REF].

In this section, the aforementioned MINLP problem formulation is presented. Its goal is smart management of power distribution grids with prolific distributed generation through flexible asset control while taking into account the binary control of the water tower. In the following, and for all time-dependant quantities, t ∈ {1, . . . , H p }.

Let H be the forecast horizon such that H = H p • T where H p is the integer number of time slots within the forecast horizon, P cons ∈ R Hp the grid load (in W), and P PV ∈ R Hp the PV power generation (in W). The decision variables are P b ∈ R Hp and P w ∈ R Hp , which represent setpoints of the biogas plant's power generation and the water tower's power consumption.

The standard way of integrating acceptable voltage fluctuation margins into the problem would be to write the Kirchhoff laws dictating them as nonlinear constraints. However, herein, things are done differently. Voltages are introduced as optimisation variables and nonlinear constraints described by Kirchhoff laws are turned into linear ones. This version of the problem alleviates its complexity by reducing the number of nonlinear constraints it contains.

The voltage variation between nodes q and j of a power distribution grid at time step t is described as follows:

B qj (t) = U q (t) -U j (t) -z qj (t) • P j (t) U j (t) , ∀q, j ∈ {1, . . . , N } (2.15)
Kirchhoff laws ensure that, at every time step, the following condition is verified:

B qj (t) = 0, ∀q, j ∈ {1, . . . , N } (2.16)
Current variables are eliminated using Kirchhoff's laws. As a result, K t is defined to represent voltage variations across the power distribution grid at a given time step t as a function of the powers injected/absorbed at each node in the following manner:

K t : (R, R, R N ) → R M (2.17a) (P b (t), P w (t), υ(t)) → B(t) (2.17b)
such that:

υ(t) = U 1 (t) U 2 (t) • • • U N (t) T (2.18)
where M is the number of vertices in the connected loopless graph equivalent to the electrical circuit in question and B is made up of M non-redundant elements B qj . Now, let X be the following matrix:

X = P b P w υ (2.19)
where X ∈ R Hp× (N +2) . The problem at hand consists in reducing the gap between power generation and consumption in a power distribution grid. To do so, third-party-owned biogas plant and water tower must be managed in such a way that their power generation/consumption balances out the discrepancies in the grid's supply/demand equilibrium. As a result, the objective function is formulated as follows:

f obj (X) = Hp t=1 |P PV (t) + P b (t) -P cons (t) -P w (t)| 2 (2.20)
The optimisation problem that takes into account the ON/OFF controller specificity of the water tower is: • linear inequality constraints, ∀q ∈ {1, . . . , N }

X * = arg min X f obj (X) (2.
V b,min V b (t) V b,max (2.25) V w,min V w (t) V w,max (2.26) |U q (t) -U n | δU (2.27)
• nonlinear equality constraints K t (P b (t), P w (t), υ(t)) = 0 (2.28)

Switch control

Introduction

In this subsection, the novel optimisation problem formulation allowing ON/OFF control of the water tower without using MINLP is introduced. A post-treatment is then presented to make the solution more suitable for real implementation. Lastly, an explanation is provided of the addition of constraints into the problem in favour of the reduction of the number of variables.

The problem as formulated in Subsection 2.3.2 presents a major challenge in the form of the MINLP setting due to the ON/OFF controller of the water tower. This setting is complex and computational expensive, an especially troublesome trait for real-time applications such as the one addressed in this chapter. The usual route taken in the literature to bypass the difficulties of MINLP are relaxation techniques [START_REF] Burer | Non-convex mixed-integer nonlinear programming: A survey[END_REF][START_REF] Tawarmalani | Convexification and global optimization in continuous and mixed-integer nonlinear programming: theory, algorithms, software, and applications[END_REF]. Instead, the approach presented herein does not relax the problem but proposes a different formulation that allows the mixed-integer problem to be solved as a smooth non-linear optimisation by optimising the timing of the integer variable's transition from one integer value to another.

To the authors' knowledge, even though this technique comes from parametrized optimal control theory, it hasn't yet been implemented for this type of applications. However, a similar approach was implemented in [START_REF] Salas | Economical optimization of thermochemical storage in concentrated solar power plants via pre-scenarios[END_REF] to determine optimal planning strategies for concentrated solar power plants via pre-scenarios.

The reader can note that the constraints given by Equation (2.28) are non-convex. Therefore, only local optimality can be expected, even if the integer constraints (Equation (2.24)) are relaxed. As a result, optimality bounds and analysis of the results must be considered under this setting as heuristic results.

Optimisation problem

To outmanoeuvre the handicaps caused by the MINLP setting, an alternate formulation of the optimisation problem is proposed, which rests on the introduction of a new optimisation variable t ∈ R Hp . In this formulation, setpoints of biogas plant's power generation and water tower's power consumption are no longer constant during a given time slot; they are given licence to switch values once between two consecutive sampling times. In fact, between sampling times t i and t i+1 , the water tower can switch between its two states of operation (P w,min and P w,max ) and the biogas plant can switch between two setpoints within the interval [P b,min , P b,max ]. If the assets do make the switch within a given time slot, they do so at the same instant, which is denoted ti .

Let us denote X = [P b,ON P b,OFF t U ON,q U OFF,q ] T , where P b,ON ∈ R Hp and P b,OFF ∈ R Hp form the biogas plant setpoint as follows:

P b (τ ) = P b,ON (τ ), τ ∈ [t i , t i + ti ] P b,OFF (τ ), τ ∈ [t i + ti , t i+1 ] (2.29)
For every node q ∈ {1, . . . , N }, U ON,q ∈ R (Hp•N ) and U OFF,q ∈ R (Hp•N ) form the voltages in the grid:

U q (τ ) = U ON,q (τ ), τ ∈ [t i , t i + ti ] U OFF,q (τ ), τ ∈ [t i + ti , t i+1 ] (2.30)
At each time step, the problem can be solved assuming that the first state of the water tower is always ON. In some extreme cases, this assumption may induce some issues of implementability with volume constraints, which are tackled in a post-treatment phase (see Subsection 2.3.3.3). The objective function is formulated as follows: The problem is then formulated as follows:

f obj (X) = Hp-1 i=0 t i + ti t i S ON (τ )dt + t i+1 t i + ti S OFF (τ )dt (2.
X * = arg min X f obj (X) (2.34)
subject to, ∀i ∈ {1, . . . , H p }:

• Biogas plant power bounds P b,min P b,ON (τ ) P b,max (2.35) and P b,min P b,OFF (τ ) P b,max (2.36)

• Switch time bounds 0 ti T (2.37)

• Biogas volume constraints

V b,min V b (t) V b,max (2.38)
• Water volume constraints

V w,min V w (t) V w,max (2.39) • Voltage constraints ti • K t (P b,ON (τ ), P w,max , U ON,q (τ )) = 0 (2.40) (T -ti ) • K t (P b,OFF (τ ), P w,min , U OFF,q (τ )) = 0 (2.41) |U ON,q (τ ) -U n | δU (2.42) |U OFF,q (τ ) -U n | δU (2.43)
The function K t (P b (t), P w (t), υ(t)) describes voltage variations across the grid as a function of the powers injected/absorbed at each node as defined in Equation (2.17b). Kirchhoff's law constraints are presented as two sets of constraints (Equation (2.40) and Equation (2.41)) which guarantee that Kirchhoff's laws are upheld in both sub-intervals of each time slot. Equation (2.40) sees the equation set depicting voltage variations multiplied by ti whereas Equation (2.41) sees it multiplied by T -ti , using appropriate values of biogas plant and water tower setpoints for each interval, to ensure that only one constraint is activated in case of extreme values of ti . In fact, in case ti = 0, Equation (2.40) is eliminated. This reflects the fact that during time slot i, the water tower is turned off immediately at the beginning of the time slot. Similarly, in case ti = T , Equation (2.41) is eliminated since the water tower remains on for the duration of the time slot. Voltage constraints are also written as two sets of constraints (Equation (2.42)) and Equation (2.43)) that account for voltage variations in both states of the grid within each time slot.

While depicting the same physical constraints, this formulation of the optimisation problem has a bigger feasible set than the MINLP one presented in Subsection 2.3.2. As a result, the global optimum of this formulation is guaranteed to be equal or better than the one of the MINLP formulation.

Post-treatment

The problem treated in this section splinters the regularly-split time horizon into uneven intermediate intervals. As a result, the power setpoints provided by the optimisation algorithm may present very small pulses which perfect the objective function minimization aspect but compromise the implementability of the solution. Furthermore, small pulses may also appear when trying to set the switch time to an extreme value. For all intents and purposes, a water tower setpoint which stipulates than the pump be turned on for 30 s, for instance, makes little to no practical sense. This issue calls for a post-treatment to eliminate small pulses, while still upholding all constraints.

Throughout this section, all quantities written in a bold font are time-dependent but for clarity, notations do away with time indices. Moreover, the procedure presented herein is implemented at each time step. So, time-dependent variables correspond to the current time step, except for V b and V w , which correspond to the biogas volume and the water volume at the end of the previous time slot i.e. at time step t, V b and V w correspond to V b (t -1) and V w (t -1). In other words, V b and V w are treated as the initial conditions for the current time slot.

At each iteration i of the optimisation process, the determined switching time ti is examined: if the pulse during which the pump is turned on is too short with respect to a pre-defined threshold, then the pulse is eliminated, provided that the volume constraints would still hold. Analogously, if said pulse surpasses the post-treatment threshold, the algorithm attempts to extend it to the full 10-minute interval, if volume constraints permit it.

Different quantities are introduced for the biogas plant volume constraints. These quantities are listed hereinafter.

• V b,down is the stored biogas volume in the biogas plant's storage unit at the end of the current time slot if the pulse is eliminated, i.e. iin case the pump is not turned on in the current time slot.

V b,down = V b + Q b,in T 60 -K b P b,OF F (2.44)
with:

K b = T 60LHVη b (2.45) • V middle b,up
is the stored biogas volume in the biogas plant's storage unit at switching time ti of the current time slot if the duration of the pulse is extended to equal the pre-defined threshold, i.e. if ti = .

V middle b,up

= V b + Q b,in T 60 -K b P b,ON (2.46)
• V end b,up is the stored biogas volume in the biogas plant's storage unit at the end of the current time slot if the duration of the pulse is extended to equal the pre-defined threshold, i.e. if ti = .

V end b,up = V b + Q b,in T 60 -K b P b,ON -(1 -)K b P b,OF F (2.47)
V b,up is the stored biogas volume in the biogas plant's storage unit at the end of the current time slot if the pulse is extended, i.e. if the pump is turned on during the entire time slot.

V b,up = V b + Q b,in T 60 -K b P b,ON (2.48)
• V middle b,down is the stored biogas volume in the biogas plant's storage unit at switching time ti of the current time slot if the duration of the pulse could not be extended and is shortened to ti = 1 -.

V middle b,down = V b + (1 -) Q b,in T 60 -P b,ON K b (2.49)
• V end b,down is the stored biogas volume in the biogas plant's storage unit at the end of the current time slot if the duration of the pulse could not be extended and is shortened to ti = 1 -.

V end b,down = V b + Q b,in T 60 -(1 -)K b P b,ON -K b P b,OF F (2.50)
The following quantities are introduced for the water tower volume constraints:

• V w,down is the stored water volume in the water tower's tank at the end of the current time slot if the pulse is eliminated, i.e. iin case the pump is not turned on in the current slot step.

V w,down = V w - Q w,out T 60 (2.51) • V middle w,up
is the stored water volume in the water tower's tank at switching time ti of the current time slot if the duration of the pulse is extended to equal the pre-defined threshold, i.e. if ti = .

V middle w,up

= V w - Q w,out T 60 + 100K w (2.52)
with:

K w = T 60η w (2.53)
• V end w,up is the stored water volume in the water tower's tank at the end of the current time slot if the duration of the pulse is extended to equal the pre-defined threshold, i.e. if ti = .

V end w,up = V w - Q w,out T 60 + 100 K w (2.54)
• V w,up is the stored water volume in the water tower's tank at the end of the current time slot if the pulse is extended, i.e. if the pump is turned on during the entire time slot.

V w,up = V w - Q w,out T 60 + 100K w (2.55)
• V middle w,down is the stored water volume in the water tower's tank at switching time ti of the current time slot if the duration of the pulse could not be extended and is shortened to ti = 1-.

V middle w,down = V w -(1 -) Q w,out T 60 + 100K w (2.56)
• V end w,down is the stored water volume in the water tower's tank at the end of the current time slot if the duration of the pulse could not be extended and is shortened to ti = 1 -.

V end w,down = V w - Q w,out T 60 + 100(1 -)K w (2.57)
At each time step, the first setpoint undergoes a treatment before it is implemented and later fed to the controller for future time steps. The treatment concerns the switching time ti ∈ [0, 1] and infers modifications of the other setpoint variables:

• if the switching time ti is smaller than the pre-defined threshold , it may be set to three possible values: zero, , or ti , in that order of priority. The steps made in this case are given by Algorithm 1.

Algorithm 1: Post-treatment algorithm 1, part 1.

if ti then if V b,min V b,down V b,max and V w,min V w,down V w,max then ti = 0 else if V b,min V middle b,up
V b,max and V b,min V end b,up V b,max and V w,min V middle w,up V w,max and V w,min V end w,up V w,max then ti = end end end

• if the switching time ti is bigger than the pre-defined threshold , it may be set to three possible values: 1, 1 -, or ti , in that order of priority. The steps made in this case are given by Algorithm 2.

This choice depends on whether the volume constraints of both flexible assets hold. These constraints are guaranteed to hold in the last case by the preceding optimisation algorithm. Then, to further increase implementability of the solution, the possibility of re-arranging the positions of pulses within their respective time slots is studied. This stems from the fact that, within a time slot, the optimisation variable is the duration of the pulse and not its position. In other words, within a time slot, as long as the water tower is turned on for the same amount of time as what has been determined thus far, whether it is turned on in the beginning of the time slot or at its end makes no difference to the problem at hand. Analogously, the same goes for the functioning of the biogas plant.

Algorithm 2: Post-treatment algorithm 1, part 2. if ti 1 -then if V b,min V b,up V b,max and V w,min V w,up V w,max then ti = 1 else if V b,min V middle b,down V b,max and V b,min V end b,down V b,max and V w,min V middle w,down V w,max and V w,min V end w,down V w,max then ti = 1 - end end end
The pulses are therefore "flipped" ( ti is replaced by 1 -ti , and ON/OFF states are inverted) alternately to form a smoother control signal, provided that the flexible assets' volume constraints would still hold.

V end b,f lip

= V b + (1 -) Q b,in T 60 -K b P b,OF F (2.58)
These constraints only need to be verified at the new switching time (1 -ti ) for the new ON/OFF operation, since at the initial and final times of the time slot, they hold thanks to the preceding optimisation algorithm. In conclusion, the following potential state values are introduced:

V middle b,f lip = V b + (1 -ti ) Q b,in T 60 -K b P b,OF F (2.59) V middle w,f lip = V w + (1 -ti ) Q out,w T 60 (2.60)
The extreme cases where ti = 0 and ti = 1 are handled differently. The former case means that the water tower's pump is never turned on during the time slot. As a result, the algorithm will not flip the control setpoint of the next time slot, provided the volume constraints hold, in order to glue the "OFF periods" together. In the latter case, the water tower's pump is turned on during the entirety of the time slot. So, the algorithm will flip the control setpoint of the next time slot, if the volume constraints hold in order to glue the "ON periods" together.

The steps undertaken by the post-treatment algorithm to smooth the control signal by flipping switch time value within their corresponding time slots are further illustrated in Algorithm 3.

Algorithm 3: Post-treatment algorithm 2. if f lip = 1 then if V b,min V b,f lip V b,max and V w,min V w,f lip V w,max then f lip next = 0 else f lip = 0 and f lip next = 1 end else f lip next = 1 end if ti = 0 then f lip next = 1 else if ti = 1 then f lip next = 0 end end
When an MPC iteration is started, a state variable f lip is given: if f lip = 1, the posttreatment will try to flip the setpoints of current time step before implementing them, and if f lip = 0, it won't. Then, it will set a new variable f lip next which will be given as input to the next MPC iteration.

Additional constraints

In the remainder of this subsection, all quantities written in a bold font are time-dependent. However, for clarity, notations do away with time indices and time dependency is implicit.

In order to alleviate the computational burden of the problem, it is advantageous to reduce the number of optimisation variables. In this case study, this is rendered possible by the reformulation of Equations (2.14a) to (2.14e), which can then be written as follows:

U n -U 1 = z P w U 2 + P cons U 3 + P b U 4 + P PV U 5 (2.61) U 1 -U 3 = z P cons U 3 + P b U 4 + P PV U 5 (2.62)
such that:

U 2 = U 1 + U 2 1 -4zP w 2 (2.63
)

U 4 = U 3 + U 2 3 + 4zP b 2 (2.64
) At this stage, it becomes clear that there are merely two voltage variables (U 1 and U 3 ) in the optimisation problem. However, in reality, voltages U 2 , U 4 , and U 5 are still expected to be within the bounds described in Equation (2.11). As a result, these bounds infer additional constraints on variables U 1 and U 3 . In the following, these constraints are determined.

U 5 = U 3 + U 2 3 +
• Constraints inferred by bounds of U 2 : from Equation (2.63), it is trivial that U 2 U 1 .

As a result, U 2 U max is redundant. As for the lower bounds, using Equation (2.63):

U min U 2 (2.66) U min U 1 + U 2 1 -4zP w 2 (2.67) 2U min -U 1 U 2 1 -4zP w (2.68) Since 2U min U max , 2U min -U 1 0. Then, (2U min -U 1 ) 2 U 2 1 -
U max U 3 + U 2 3 + 4zP b 2 (2.72) 2U max -U 3 U 2 3 + 4zP b (2.73) (2U max -U 3 ) 2 U 2 3 + 4zP b 2 (2.74) U 2 max -zP b U max U 3 [Additional constraint 2] (2.75)
• Constraints inferred by bounds of U 5 : analogously to the constraints inferred by U 4 , and by using Equation (2.65), it can be easily demonstrated that U 5 U min is redundant and that:

U 2 max -zP PV U max U 5 [Additional constraint 3] (2.76)

Reference strategies

In this section, the initial operation of the flexible assets (before any control scheme is applied) is given. Then, the reference control strategies that will serve as a basis of comparison for the results given by the novel problem formulation detailed in Subsection 2.3.3 are presented. Both these strategies are based on a relaxation of the MINLP problem described in Subsection 2.3.2.

The relaxed problem formulation lifts the ON/OFF controller constraint of the water tower and assumes that its water consumption may have any value within a feasible interval. Therefore, the relaxed problem is formulated in the same way as the MINLP one except for Equation (2.24), representing the ON/OFF characteristic of the water tower's setpoint. This equation is replaced with the following boundaries where P w,max = 200 kW: P w,min P w (t) P w,max

(2.77)

Initial operation

The initial operation of the flexible assets does not take into account power grid regulation purposes. The biogas plant's power generation is a constant nominal value (herein, P b,n = 100 kW). This is in line with the steady biogas flow generated by the bioreactor and coming into the storage unit. As for the water tower, its water pump is subject to an ON/OFF controller which ensures that the water level remains between two threshold values at all times (herein, P w,n = 100 kW).

It is interesting to note that the dimensioning of flexible asset storage units is an influential factor in itself. As it stands, the hard volume constraints of storage units are prioritised by the algorithm over the minimization of the supply/demand gap. As a result, when the upper bound of stored biogas volume is reached, the generator kicks in to burn the extra biogas to avoid discarding it into the atmosphere or increasing the storage unit pressure. When the lower bound is reached, the setpoint of power generation is reduced in order to maintain the minimum required volume in storage.

Similarly, the water tower's pump is automatically triggered when the lower volume bound is reached in order to maintain the minimum required volume in storage and is automatically shut down when the maximum water volume is reached. This can sometimes be in conflict with the grid stability's best interest, as it may be necessary to turn on the distributed generator when the grid is already experiencing overvoltage due to excess energy flowing through its lines. It may also be necessary for the storage system to consume electricity at times when the grid is at risk of experiencing undervoltage phenomena.

Asset dimensioning is not addressed in this chapter, but several works exist in the literature to tackle the question of optimal dimensioning and allocation of distributed generation in power distribution grids [START_REF] Vallem | Optimal placement of DG in radial distribution systems based on new voltage stability index under load growth[END_REF][START_REF] Mahmoud | A review of the optimal allocation of distributed generation: Objectives, constraints, methods, and algorithms[END_REF][START_REF] Yammani | Multiobjective optimization for optimal placement and size of DG using shuffled frog leaping algorithm[END_REF].

Weekly planning

The first reference strategy is an operation planning of the flexible assets over the 1-week periods considered in this study. The relaxed optimisation problem is solved once over an entire week and then implemented. Since the results examined in this chapter use measurements of PV power generation and grid load (no forecasting errors are made), the optimal weekly planning given by this single optimisation is indeed the lower bound of performance with which the MPC scheme can be compared.

Relaxed MPC scheme

The second reference strategy is a MPC scheme based on the relaxed problem formulation. In this case, the proposed MPC scheme, based on the reformulation of the problem proposed herein, is compared to a relaxed MPC scheme that is given ample freedom to change the water tower setpoint between its two extreme values (i.e. P w,min and P w,max ).

Results and analysis

In this section, a performance analysis of the approach presented in Subsection 2.3.3 is carried out then compared to a weekly planning strategy and a MPC scheme based on the relaxed optimisation problem, both explained in Subsection 2.3.4. First, the results yielded by the weekly planning using all four datasets are presented. Then, a sensitivity analysis is conducted in order to assess the impact of the MPC's sliding window size on its performance. Lastly, a sliding window is chosen based on the aforementioned sensitivity analysis and a detailed examination of its results is done. All results presented in this chapter were obtained using MATLAB2018a.

Weekly planning performance

The weekly planning of the flexible assets' operation is conducted in four different scenarios: each corresponding to a typical "seasonal" week (Figure 2.1). Results displayed hereinafter showcase the reduced gap between supply and demand obtained through this planning, as well as flexible asset setpoints and corresponding storage volumes, compared to the initial case.

Table 2.1 recapitulates the final values of root squares of the objective function procured by the weekly planning with all four sets of data, where f obj,initial and f obj,f inal are the initial and final objective function values, respectively. When formulating the optimisation problem, the square of the objective function is used to ensure that the algorithm suppresses sharp fluctuations of its values and gives as smooth a variation as possible. Results show that, in all four cases, there is a significant reduction in the supply/demand gap with respect to the initial case, the biggest of which occurs during winter.

Depending on the season, the initial gap between supply and demand within the power distribution grid (modelled by the objective function value) differs: the gap is higher in warmer seasons (spring and summer) as the solar resource, and therefore PV power generation, is substantial. This is typical for the Mediterranean climate. Indeed, results show that the power distribution grid is unable to absorb the excess of power generation during spring and summer, as the final objective function is reduced by 26.5% and 26.1%, respectively, whereas it is reduced by 46.9% for winter and 41.5% for autumn.

The weekly planning scheme presented in this section, using the relaxed problem formulation and using measurements, will be considered as the "ideal case" throughout the rest of the chapter.

Sensitivity analysis

In order to asses the impact of the sliding window size on the MPC-based strategy's performance, both the relaxed problem and the switch control are implemented with sliding window sizes ranging from 1 to 24 hours over four season-typical weeks. The results of these simulations are discussed herein.

The interesting question being investigated is what would be the most appropriate size of this sliding window that would allow efficient control of the power distribution grid without taking on unnecessary computational burdens. In order to determine an answer, a sensitivity analysis of the impact of the sliding window size on the performance of the MPC algorithm is carried out. The considered metrics are the objective function's final value and the computational complexity, measured by the total number of objective function evaluations needed for the algorithm to reach a solution, weighted by the size of the sliding window.

Figure 2.5 displays the evolution of the cumulative gap between power supply/demand (represented by the square root of the objective function's final value) with respect to sizes of the sliding window ranging from one to 24 hours, for both the relaxed problem and the switch control. The weekly planning obtained through the relaxed problem using measurements serves as a reference point to evaluate the MPC scheme's accuracy.

For all four seasons, it can be seen that the same behaviour is reproduced. As the sliding window size increases, the final objective function value decreases and moves towards the ideal value without reaching it. For small window sizes, the switch control provides identical values to those of the relaxed problem. For larger windows, however, the switch control's values still follow the relaxed problem's quite well but a small gap starts to appear between the two.

Considerable reductions in the supply/demand gap are already obtained with a 1-hour sliding window size for the MPC scheme, followed by gradual improvements as the window size increases. These improvements seem, at first glance, to stabilise relatively fast. A closer look is provided by Figure 2.6, revealing a more pronounced difference between results of MPC schemes with various sliding window sizes, though the incremental change remains small when compared to reductions made to the supply/demand gap using the 1-hour sliding window size with respect to the initial values.

For the application considered in this work, the scheme's goal is real-time implementation of

Figure 2.6:

A closer look at the unbalance between power supply and demand within the power distribution grid per sliding window size over four "season-typical" weeks. monitoring and control for power distribution grids. So, it stands to reason that computational cost would be a cardinal criterion. Therefore, a compromise must be made between the algorithm's qualitative results and its computational cost. To do so, an examination of the evolution of the computational cost required by the optimisation algorithm is carried out with respect to the size of the sliding window of the MPC-based strategy. Figure 2.7 shows the computational cost of the implementation of an iteration of the MPC scheme with varying sizes of the sliding window in order to assess the computational burden for the relaxed problem and the switch control. Herein, as opposed to simply registering the time consumed by the MPC scheme's implementation, the computational complexity is quantified by the overall number of objective function evaluations per window. This metric is provided as an output argument of the optimisation function "fmincon" in MATLAB.

The application aims at real-time control of power distribution grids, with a time step of 10 minutes. As a result, strict limitations are imposed on the sophistication of the numerical solver. After testing several ones, the optimisation function "fmincon" of MATLAB, based on interior point algorithm, was selected because it provided the best compromise between quality of results, computational cost, and simplicity of implementation. Of course, this numerical solver does not guarantee convergence to a global minimum. But, for this type of applications, a local minimum that allows satisfactory enhancement of the objective function's final value is acceptable (herein, this translates into reduction of the unbalance between power supply and demand within the power distribution grid).

For a given computer and given operating conditions, the algorithm's speed mirrors a combination of two criteria: the number of function evaluations it performs and the number of optimisation variables, which is proportional to the size of the sliding window. This allows for a more objective rendering of the algorithm's computational complexity that is not clouded by the characteristics of a specific computer.

Figure 2.7 shows that the switch control's computational complexity remains underneath that of the relaxed problem up to a certain window size, then it surpasses it. Which means that, up to a certain, relatively large, window size, the switch control is not only more realistic but is indeed less computationally expensive than the relaxed problem.

Despite the presence of some outliers, the growing tendency of computational complexity is clear and expected. Its main cause is the number of optimisation variables, which is proportional to the size of the sliding window. The main observation is that, for longer windows, a high percentage of the function evaluations serves to improve upon values given by the previous windows by only a small fraction of the objective function's initial value.

In gradient-based descent methods, particularly interior-point methods, this is very common due to the trade-off between convergence criteria and accuracy. For further detail about convergence rates and computational complexity of interior-point methods, the reader is referred to [START_REF] Wright | The interior-point revolution in optimization: history, recent developments, and lasting consequences[END_REF] and the references within.

As of the 14-hour window, the improvement of the final objective function value with respect to the initial value is practically constant. To avoid undue computational burden caused by enlarging the sliding window size with little performance gain, the 14-hour window is chosen going forward as the best compromise between the aforementioned performance criteria.

Predictive switch control performance

In this subsection, results given by the switch control MPC approach with a 14-hour sliding window are examined. The initial case represents the classical operation modes of both flexible assets: through an ON/OFF controller for the water tower that allows the pump to fill the tank whenever it is at a lower threshold and stops when reaching the upper threshold, and constant power generation for the biogas plant, in line with the facility's steady flow of biogas production. Table 2.2 details the reduction of power supply/demand unbalance given by the proposed MPC scheme using a 14-hour window with respect to the objective function's initial values. 2.8 illustrates the gap between power demand and supply in the distribution grid before and after implementing the switch control MPC scheme with a 14-hour window with respect to the initial case and the planning strategy. Similarly, Figure 2.9 and Figure 2.10 show the power setpoints of the biogas plant's power generation and the water tower's power consumption, respectively, before and after optimisation. Similarly, Figure 2.11 and Figure 2.12 show the storage volumes of biogas and water, respectively, before and after optimisation.

In colder months (autumn and winter), the scheme makes more use of the biogas plant's power generation than in warmer seasons, which can be attributed to decreasing PV power generation levels. As a result, the MPC scheme sees less pronounced variations in the stored biogas volume, whose levels remain quite high, than the planning strategy.

Both power setpoints show an obvious departure from the initial operating schemes used before the implementation of the proposed control strategy. The power generation setpoint of the biogas plant, previously constant, now exhibits a cyclic behaviour over the considered time periods. It peaks during nighttime and dips during the day. This makes sense on account of the PV power generation peaking midday and becoming null during the night. The planning strategy benefits from the degree of freedom offered by the biogas storage tank.

The water tower consumption setpoint benefits from the added flexibility for a better distribution of the consumed power over time. This flexibility is further illustrated by the variations appearing in the stored water volume profile which varies from the original one, but remains cyclic nonetheless.

It should be noted that the influence of the post-treatment algorithm on the performance of the MPC strategy has been evaluated. As a matter of fact, the post-treatment algorithm is called, on average, 96% of the time during a 1-week simulation to eliminate or extend a pulse in the water tower's setpoint at the following time step. Although this procedure results in smoother setpoints for the flexible assets, thus boosting the solution's implementability, it has little impact on the power supply/demand unbalance, which is degraded by about 4%.

The fact that the MPC scheme that uses a post-treatment algorithm provides smoother setpoints than the one that doesn't while the supply/demand curve for both schemes remain virtually identical suggests that the main contribution of this post-treatment is in fact in flipping the order of the states within a time step to have a more implementable overall setpoint. More details about the inner-workings on the post-treatment algorithm are provided in Subsection 2.3.3.3. Another noteworthy observation is that the computational burden is increased by 12%, on average, by the post-treatment algorithm.

Conclusion

The proliferation of distributed generation in low-voltage power distribution grids could spawn difficulties in monitoring and control for grid operators, but it also creates new levers upon which to act to guarantee grid stability and service quality, nurtured by the deployment of an advanced metering infrastructure and the advances made in forecasting methods.

In this chapter, a smart management strategy is proposed for a case study of a suburban low-voltage power distribution grid with high levels of PV power generation. This strategy consists in a model-based predictive control scheme with a new formulation of the optimisation problem that operates third-party-owned flexible assets. Its goal is to ensure balance between supply and demand in the grid while upholding the French grid operator's contractual voltage bounds and respecting the assets' operational constraints. The MPC-based strategy operates the flexible assets at a sampling rate of 10 minutes. It is meant for real-time smart management of suburban low-voltage power distribution grids with significant penetration of photovoltaic power generation.

The main contribution presented in this chapter is the novel approach with which the ON/OFF control of the water tower is tackled outside the mixed-integer non-linear programming setting, without relaxing the problem. Results show that the MPC-based strategy adopted in this chapter succeeds in reducing the gap between supply and demand in the power distribution grid substantially with respect to the flexible assets' default operating strategies, while upholding operational constraints and voltage bounds. This constitutes a promising step towards the development of autonomous power distribution grids, which are able to meet the local power demand using on-site renewable-energy-based power generation.

Improvements upon this research include the modification of the objective function to smooth out the flexible assets' setpoints without having recourse to a post-treatment algorithm. The next step is to incorporate, in real time, forecasts of various disturbances afflicting the system's stability, namely PV power generation, grid load, and water demand, for a better anticipation

.9: Biogas plant power generation setpoints before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window.

.12: Water tower storage volumes before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window.

Chapter 3

Intraday forecasting of stochastic quantities 3.1 Introduction

The decentralisation of power generation has rendered obsolete the once-effective fit-and-forget approach to handling power grids. In the emerging smart grid context, state-of-the-art control techniques are developed for efficient energy management in power distribution grids with numerous sets of data plagued with uncertainty, namely renewable-energy-based power generation and end-user power consumption. The performance of real-time control schemes relies heavily on successful forecasts of these quantities. The case study of the "Smart Occitania" project is no exception to this rule. Indeed, the predictive controller managing the grid bases its decisions on known models of the system's behaviour, but also on forecasts of stochastic disturbances that impact this behaviour. A sensitivity analysis of the required size for the predictive controller's sliding window, explained at length in Chapter 2, supports the choice of an intraday sliding window size. As a result, this chapter focuses on intraday forecasting horizons for the considered stochastic quantities.

In the context of the control strategy proposed in this manuscript, the three stochastic quantities that come into play are the following: power distribution grid load, PV power generation, and water demand. The power distribution grid load represents agglomerated power demand of households in the studied suburban area. It is the grid operator's priority to make sure this demand is met at all times, under adequate quality and security standards. The PV power generation represents the agglomerated power generation of household PV panels in the studied area. The main motivation behind the project is to facilitate the integration of PV household panels into the power distribution grid to the fullest extent whilst maintaining quality of service, which comes down to guaranteeing grid stability and round-the-clock power supply. To do so, the controller proposed in this work relies on flexible asset management. One of these assets is the water tower, responsible for meeting the water demand. Therefore, water demand poses a strict constraint on the operation of the water tower's pump and consequently, on the controller's decisions. In this chapter, the methodology used to forecast each of these quantities is detailed and the results are analysed.

The chapter is organised as follows: Section 3.2 provides an overview of the state of the art concerned with intraday forecasting of grid load, water demand, and global horizontal irradiance (GHI). PV power generation forecasts are inferred from forecasts of GHI. Section 3.3 introduces Gaussian process regression (GPR), the method chosen herein to forecast all three quantities. Then, a section is dedicated to each quantity: grid load forecasting, water demand forecasting, and GHI forecasting. In each section, the following steps are undertaken: a description of available data, presentation of the selected kernel composition, and an analysis of the results. Section 3.7 recapitulates the main findings of this chapter.

State of the art

Grid load forecasting

Accurate intraday load forecasting in power distribution grids is a very active research field [START_REF] Raza Khan | Load forecasting, dynamic pricing and DSM in smart grid: A review[END_REF][START_REF] Hong | Probabilistic electric load forecasting: A tutorial review[END_REF][START_REF] He | Load forecasting via deep neural networks[END_REF][START_REF] Vrablecová | Smart grid load forecasting using online support vector regression[END_REF][START_REF] Yang | Sequential grid approach based support vector regression for short-term electric load forecasting[END_REF][START_REF] Hafeez | Electric load forecasting based on deep learning and optimized by heuristic algorithm in smart grid[END_REF]. Load forecasting models can be classified with many a criterion. The classic manner of doing so is to split them into bottom-up and top-down models [START_REF] Swan | Modeling of end-use energy consumption in the residential sector: A review of modeling techniques[END_REF].

On one hand, bottom-up forecasting tools consist in extrapolating data of a representative set of individual end-users and aggregating this knowledge to build a comprehensive model of the entire stock. They can in turn be divided into engineering tools and statistical ones. The former build models based on power ratings, thermodynamic laws, and use of electric devices. Their inputs include building geometry, heat insulation, appliance ownership and use, occupancy, and climate conditions [START_REF] Fischer | Model for electric load profiles with high time resolution for German households[END_REF][START_REF] Richardson | Domestic electricity use: A high-resolution energy demand model[END_REF]. As for the latter, their backbone is historical data of end-user power consumption, usually provided by government surveys of energy providers [START_REF] Fumo | Regression analysis for prediction of residential energy consumption[END_REF][START_REF] Ghofrani | Smart meter based short-term load forecasting for residential customers[END_REF]. Constrained by confidentiality laws, however, energy providers do not, as of yet, exploit their smart meter data to the fullest extent. To remedy this, non-intrusive disaggregation of smart meter data can be carried out to extract further information from available aggregate data [START_REF] Basu | Nonintrusive load monitoring: A temporal multilabel classification approach[END_REF].

The bottom-up forecasting tools allow the model to keep up with technological advances of household electrical devices, take into account the occupants' behaviour, and be independent from historical data. The resulting downside is their complexity and their susceptibility to errors due to unpredictable elements of human behaviour. Their main flaw, however, remains their reliance on detailed data that aren't easily accessible.

Top-down forecasting tools, on the other hand, use aggregate data that provide a holistic view of the power grid in order to forecast future demand. They can also be split into engineering and statistical tools. The former can establish power consumption prediction as a function of top-level macroeconomic indicators, housing construction rates, energy prices, and climate conditions [START_REF] Labandeira | A residential energy demand system for Spain[END_REF][START_REF] Balaras | European residential buildings and empirical assessment of the Hellenic building stock, energy consumption, emissions and potential energy savings[END_REF]. They are intrinsically coarse and are primarily used for predicting largescale supply requirements. The latter encompass time series analysis and various machine learning approaches based solely on historical data of end-user power consumption such as, but not limited to, fuzzy algorithms, artificial neural networks, and genetic algorithms [START_REF] Pai | Forecasting regional electricity load based on recurrent support vector machines with genetic algorithms[END_REF][START_REF] Ying | Using adaptive network based fuzzy inference system to forecast regional electricity loads[END_REF].

Top-down models have the advantage of making use of widely available information such as macroeconomic data and climate conditions and of being less impacted by small deviations in the target population characteristics than bottom-up models. In particular, statistical top-down methods, though inherently dependent on historical grid load data, don't require any further knowledge of the system's components or inner-workings.

Load forecasting models depend heavily on the type and the quantity of available data, which are usually the deciding criteria when it comes to the choice of forecasting techniques. There exist various types of data suitable, each corresponding to certain techniques. The first type of information that can be used is socio-economic data: income, unemployment rates, education, and social class. Education levels, for instance, can be an indication of the users' awareness of their role in the energy transition. Then, there are the physical characteristics of buildings in terms of thermal insulation and orientation. Information regarding appliances' ownership and use patterns contribute in increasing the model's accuracy. Also important to the model are weather conditions. Last, but perhaps most importantly, historical data of end-user electrical consumption are valuable input data for load forecasting models.

In the case study treated in this manuscript, available data are aggregate power consumption face challenges such as the complexity of knowledge-based models of clients' behaviour and uncertainties on weather variables to improve their accuracy.

GHI forecasting

Within the context of the Smart Occitania project, intraday forecasting of PV power generation is inferred from intraday forecasting of global horizontal irradiance (GHI), which is the total amount of short-wave radiation received from above by a surface horizontal to the ground.

To this effect, a forecasting method is developed by members of the COSMIC team of the PROMES-CNRS laboratory in Perpignan. This method is based on Gaussian process regression (GPR) and is detailed in [START_REF] Tolba | GHI forecasting using gaussian process regression: kernel study[END_REF][START_REF] Gbémou | Global horizontal irradiance forecasting using online sparse Gaussian process regression based on quasiperiodic kernels[END_REF][START_REF] Tolba | Multi-horizon forecasting of global horizontal irradiance using online gaussian process regression: A kernel study[END_REF]. Forecasts of PV power generation obtained through the aforementioned work are then used as inputs for the smart management scheme elaborated in this thesis.

A review of the works in the literature focusing on GHI forecasting methods reveals a wide array of statistical, physical, and hybrid methods [START_REF] Lorenz | Prediction of solar irradiance and photovoltaic power[END_REF][START_REF] Rich | Solar forecasting methods for renewable energy integration[END_REF][START_REF] Antonanzas | Review of photovoltaic power forecasting[END_REF][START_REF] Ahmed | A review on the selected applications of forecasting models in renewable power systems[END_REF][START_REF] Diagne | Review of solar irradiance forecasting methods and a proposition for small-scale insular grids[END_REF]. Based on these works, statistical methods are identified as the most suitable approach for intraday forecasting based on historical data. A comparative study of three prevalent statistical methods was conducted in [START_REF] Lauret | A benchmarking of machine learning techniques for solar radiation forecasting in an insular context[END_REF]. These methods are Gaussian process regression, support vector regression, and artificial neural networks. The study demonstrated that these methods outperform both persistence and autoregressive models but was inconclusive as to the superiority of any method with respect to the others.

Discussion

As part of the research activities of the COSMIC team, a similar comparative study is carried out for intrahour and intraday forecast horizons using a two-year database of GHI measurements sampled at a 10-minute rate. The models are developed for multi-step-ahead GHI forecasting. This study relies on several criteria, including normalised root mean square error and coverage width-based criterion (CWC) [START_REF] Khosravi | Lower upper bound estimation method for construction of neural network-based prediction intervals[END_REF], to analyse the performance of each model. Results demonstrate that, although all three models outperform the persistence model, there is no clear frontrunner in terms of nRMSE values, with a slight advantage for LSTM-network-based ANN and GPR models when taking into account the quality of the associated confidence intervals. Values of CWC, which combines two criteria assessing the surface area of the confidence interval and the probability that the measurements would fall inside it, show that the considered models perform very similarly for infrahour forecast horizons. For longer intraday forecast horizons, differences start to emerge.

Confidence intervals are a noteworthy perk of using GPR models in the forecast module of the smart management strategy since they are built-in in the model and do not require running a Monte Carlo simulation to be statistically inferred as is the case for the SVR or ANN methods. These confidence intervals give the predictive controller supplementary information it may use to achieve a more robust control strategy. In fact, the confidence intervals provided by the GPR model are a valuable tool for dealing with the uncertainty attached to the forecasts.

Since the choice of forecasting models is subject to the application's requirements, it is important to keep in mind the characteristics of the Smart Occitania project when evaluating the suitability of GPR models to the task at hand. In fact, the project, a smart grid demonstrator, requires a control strategy capable of operating in real time, which promotes a compromise between performance and computational burden. GPR models used herein are, in part due to the fact that the database used to update the model's parameters is a sliding one, sufficiently fast to be a valid candidate for this application.

On the downside, the predictive nature of the controller makes it dependant upon real-time access to measurements to be able to sustain the forecasting models' sliding databases and to update their parameters at each time step. This limitation is true for all machine-learning-based methods operating in real time. This is a major motivation for the development of state-of-the-art smart metering technologies that ensure quick and reliable data transfer.

For the reasons listed above, the choice has been made to use GPR models to provide intraday forecasts for the smart management scheme developed in this thesis. The associated confidence intervals are incorporated into the control scheme to improve its robustness to forecasting errors as explained in the next chapter.

Gaussian process regression

Definition

A Gaussian process (GP) is a collection of random variables, any finite number of which have a joint Gaussian distribution [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF]. A Gaussian process defines a prior over functions, which can be converted into a posterior over functions once some data has been observed. To indicate that a random function f (x) follows a Gaussian process, it is written as f (x) ∼ GP(µ(x), k(x, x )), where x and x are arbitrary input variables, µ(x) = E [f (x)] is the mean function (usually assumed null) and k(x, x ) = E (f (x) -µ(x))(f (x ) -µ(x ) T ) is the covariance function or kernel.

A kernel measures the similarity between two points. It encodes the assumptions about the function to be learnt. This initial belief could be how smooth the function is or whether the function is periodic. Any function can be a covariance function as long as the resulting covariance matrix is positive semi-definite. A detailed list of kernels is provided in [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF].

Kernel composition

It is possible to combine several kernel functions to obtain a more complex one. The only requirement is that the resulting covariance matrix must be a positive semi-definite function. Two ways of combining covariance functions while keeping the positive semi-definite property are addition and multiplication. A quasiperiodic Gaussian process can thus be modelled by multiplying a periodic kernel by a non periodic one, providing a way of transforming a global periodic structure into a local one. Herein, a different kernel composition is used to fit each of the three stochastic quantities in question, according to their respective behaviours. For every quantity, appropriate kernels are chosen to model various aspects present in the available data.

Hereinafter, the kernel functions used in this work are defined:

-The periodic kernel (Per) is given by:

k Per (x, x ) = σ 2 1 exp   - 2 sin 2 π(x-x ) P 2 1   (3.1)
A periodic kernel assumes a globally periodic structure of period P in the function to be learnt. In Equation (3.1), σ 1 > 0 is the amplitude and 1 > 0 is the correlation length. Larger P causes a slower oscillation while smaller P causes a faster one. Intuitively, 1 controls how fast the functions sampled from your GP fluctuate. If 1 is large, even points that are far away have meaningful correlation; therefore, GPs sampled functions would vary slowly and vice versa.

-The isotropic squared exponential (SE) kernel is given by:

k SE (x, x ) = σ 2 2 exp - (x -x ) 2 2 2 2 (3.2)
The squared exponential kernel k SE defined by Equation (3.2) contains two hyperparameters: the amplitude σ 2 > 0 and the correlation length 2 > 0, which have the same interpretation as in the periodic kernel.

-The isotropic rational quadratic (RQ) kernel is given by:

k RQ (x, x ) = σ 2 3 1 + (x -x ) 2 2α 2 3 -α (3.3)
with α > 0 and 3 > 0. This kernel is equivalent to a scale mixture of SE kernels with different correlation lengths [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF]. Samples from a GPR model based on this kernel are less smooth than the ones obtained using a SE kernel.

Time series forecasting

Consider the standard regression model with additive noise, formulated as follows:

y = f (x) + ε (3.4)
where x ∈ R D×1 is the input vector with a dimension of 1, f is the regression function, y is the observed value and ε ∼ N (0, σ 2 ε ) is an independent, identically distributed Gaussian noise. Gaussian process regression is a Bayesian non-parametric regression which assumes a GP prior over the regression functions [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF]. It consists in approximating f (x) ∼ GP(µ(x), k(x, x )) using a training set of n observations D = {(x i , y i ), 1 i n}. As shorthand notation, all input vectors x i are merged into a matrix X ∈ R n×D and all corresponding outputs y i into a vector y ∈ R n×1 , so that the training set can be written as (X, y).

From Equation (3.4), it can be seen that y ∼ N µ(X), K + σ 2 ε I , where K = k(X, X) ∈ R n×n . In this setting, the joint distribution of the observed data y and the latent noise-free function on the test points f * = f (X * ) is given by:

y f * ∼ N µ(X) µ(X * ) , K + σ 2 ε I K * K T * K * * (3.5)
where

K * = k(X, X * ) ∈ R n×n * and K * * = k(X * , X * ) ∈ R n * ×n * .
The posterior predictive density is then also Gaussian f * | X, y, X * ∼ N (µ * , σ 2 * ), where:

µ * = µ(X * ) + K T * K + σ 2 ε I -1 (y -µ(X)) (3.6)
and:

σ 2 * = K * * -K T * K + σ 2 ε I -1 K * (3.7)
Let us examine what happens in the case of a single test point x * . Let k * be the vector of covariances between the test point and the n training points:

k * = [k(x * , x 1 ) . . . k(x * , x n )] T (3.8)
Equation (3.6) becomes:

µ * = µ(x * ) + k T * K + σ 2 ε I -1 (y -µ(x * )) (3.9)
Thus µ * , the mean prediction for f (x * ), can be written as a linear combination of kernel functions, each one centred on a training point:

µ * = µ(x * ) + k T * α = µ(x * ) + n i=1 α i k(x i , x * ) (3.10) where α = K + σ 2 ε I -1 (y -µ(x * )).
In the remainder of the chapter, the coefficients α i are referred to as parameters. Whereas kernel parameters, referred to as hyperparameters, are no longer updated after the training phase is done, parameters are updated at every time step. This means that at each time step, a new observation is integrated into the sliding-window database of fixed size (herein, 24 hours), the model parameters are updated, and then new forecasts are made over the forecast horizon.

In this way, the forecast module takes into account new information and provides the predictive controller with updated GPR forecasts of grid load, water demand, and PV power generation over the forecast horizon, at each time step.

Hyperparameters are estimated from data during training. To this end, the probability of the data given the aforementioned hyperparameters is computed. This is done through the computation of the log marginal likelihood given by [START_REF] Edward Rasmussen | Gaussian Processes for Machine Learning[END_REF]:

L(θ) = - 1 2 y T K + σ 2 ε I -1 y + log det K + σ 2 ε I + n log(2π)) (3.11)
The maximization of the log marginal likelihood (given by Equation (3.11)) leads to an estimation of the hyperparameters θ. The GPML toolbox [START_REF] Edward | Gaussian processes for machine learning (GPML) toolbox[END_REF] has been used in the present work.

In addition to forecasts, the regression model provides an associated confidence interval within which measurements have a probability of 95% of staying. This interval is computed as follows:

CI = µ * ± 1, 96 σ 2 * (3.12)
where CI represent the confidence interval bounds, µ * is the predictive mean, and σ * is the predictive variance.

Evaluation metric

The evaluation metric considered in this comparative study is the normalised root mean square error (nRMSE), expressed as follows: nRMSE = 100

1 n * n * i=1 y test (i) -y forecast (i) 2 1 n * n * i=1 y test (i) (3.13)
where y test ∈ R n * ×1 are the test data, y forecast ∈ R n * ×1 are the forecasts given by the considered models, and n * is the number of data points in the forecast horizon.

Grid load forecasting

In order to ensure the efficiency of the predictive control scheme for the power distribution grid, the first stochastic quantity that needs to be forecasted is the grid load. In the past, the problem of the stochasticity of demand was skirted by overfitting the supply capacity. This strategy was suitable for the era of centralised power generation, which is no longer the case. In a power distribution grid rife with distributed generation, stochastic and otherwise, accurate forecasts of power demand become a necessity. In this section, available grid load data are presented. Then, the chosen kernel composition for the GPR model is given. An analysis of intraday grid load forecasts is carried out.

Data description

This study uses data spanning one year, sampled at a 10-minute time step. They represent the grid load of the studied power distribution grid (Section 2.2). The entire dataset is displayed in Figure 3.1 where the seasonal tendencies can be observed, whereas Figure 3.2 zooms in on a few days highlighting the daily patterns. The forecast horizons considered in this work are intraday: they range from 1 to 24 hours. For the training phase, two weeks of data are used. The testing phase is then performed over one week.

Kernel composition

The choice of kernels is informed by an examination of the signal's behaviour. Based on Figure 2.1 and Figure 3.2, the power distribution grid load can be broken down into a mixture of three main components: a periodic daily pattern, a seasonal tendency due to long-term climate conditions, and daily fluctuations due to intraday behavioural patterns of end-users.

As previously mentioned, the composition of kernels can be done through a sum or a multiplication, both of which can be used for the purposes of this study. That being said, in the case of a multiplication, the hyperparameters that fit the amplitudes of various kernels in the combination would merge into one hyperparameter σ that adjusts the amplitude of the forecast. In the case of a sum, however, these hyperparameters remain separate, thus providing further degrees of freedom when fine-tuning the forecast. For this reason, the kernel composition used to forecast power distribution grid load in this study is obtained through a sum, and is formulated as follows:

k gl (x, x ) = k gl Per (x, x ) + k gl SE (x, x ) + k gl RQ (x, x ) (3.14)
Herein, the period of the grid load data is 24 hours, and the structure of the periodic kernel k gl Per translates the periodic shape of the grid load. The kernel k gl SE produces rather smooth signals, which is why it is used here to capture the long-term trend of data, namely the seasonal tendencies present in the grid load. Reasons for seasonal changes' impact on grid load include, but are not limited to, longer nights in winter leading to more frequent use of artificial lighting and colder temperatures leading to more frequent use of heaters. Since the kernel k gl RQ is suitable for capturing erratic fluctuations, it is used to capture the intraday variations observed in grid load data, namely intraday fluctuations due to behavioural patterns of end-users.

Forecasting results

In this subsection, intraday forecasts of power distribution grid load are provided by Gaussian process regression based on the kernel composition presented in Subsection 3.4.2. Figure 3.3 shows the evolution of the nRMSE values for the GPR model, with respect to the length of the forecast horizon. For a 1-hour horizon, the GPR model achieves an error as low as 13%. As for the 6-hour horizon and the 12-hour one, nRMSE values are virtually constant (21% and 23%, respectively). This remains the case for a forecast horizon of 24 hours, where the GPR model has an error of 26%. When considering the general tendency of the forecasting errors, it can be seen that the GPR model's error values increase quickly for short forecast horizons but then stabilise around an acceptable level for all remaining forecast horizons. In fact, GPR is non-parametric regression which allows the optimisation of kernel parameters to best fit the time series in question. This means that the quality of forecasts hinges on the suitable choice of these kernels, which establish inductive biases for the training process. On one hand, in cases where there is too much uncertainty and the model is incapable of providing accurate forecasts, the GPR model used in this study will return to the "default shape" determined by the periodic component of its kernel composition, therefore bestowing a degree of reliability unto the use of GPR. On the other hand, the kernel composition of the GPR model traps the forecasts in a pre-determined shape and limits the model's adaptability to new observations of the signal's behaviour. that the model estimates the measured data will remain within this interval with a pre-defined probability. For the 10-minute horizon, forecasts have a nRMSE value of 9%. On the first day, forecasts fit the median of the data, which fluctuates with high frequency but with small amplitudes. On the second day, as the data fluctuations become more erratic, the differences with the forecasts become clearer, while data points remain within the confidence interval nearly at all times. For longer forecast horizons, the model struggles more to keep up with these fluctuations. This is especially visible on the second day, where the data is often near the borders of, and sometimes outside, the confidence interval of the forecasts. That being said, for all intraday horizons, the model succeeds in capturing the peak that occurs between 8 pm and 10 pm every day.

Water demand forecasting

The original purpose of a water tower is to ensure water supply to the local population, be it for household consumption, or for irrigation purposes in suburban and rural areas. The satisfaction of water demand is the installation's priority. Unfortunately, this water demand is stochastic.

It has varying patterns depending on the population's collective behaviour, as well as seasons and weather conditions. Since the water tower's operation is constrained by both storage tank limitations and the satisfaction of the water demand, forecasting the latter quantity becomes a necessity. This section will cover the intraday forecasting of water demand met by the considered water tower. After a presentation of the available data, the kernel composition of the GPR model is given and the results are examined.

Data description

Data used in this study are measured as part of the experimentation campaign carried out in the context of the Smart Occitania project. Available data span a full year and are sampled at a 10-minute rate. Due to data acquisition issues which compromise the efficient use of these data in the control strategy, a pre-treatment algorithm is implemented in order to fill gaps and apply corrections to erroneous data. Figure 3.5 shows the water flow outgoing from the storage tank, which represents water demand in the corresponding area, over a full year. Some seasonal tendencies can be observed: the mean water demand during the summer period (from June to August) is slightly higher than the rest of the year. Figure 3.6 shows the evolution of water demand over a few days in April, which reveal the daily patterns: data present cyclic behaviour with a period of 24 hours and general peaks and dips occurring at roughly the same time every day.

Kernel composition

The patterns present in the data (Figure 3.5 and Figure 3.6) inform the choices of GPR kernels. Since a daily periodic pattern is observed, it makes sense to use a periodic GPR kernel. One or more other kernel can be added to fit the rest of the fluctuations. A brief kernel study leads to the conclusion that the simple addition of a squared exponential kernel is sufficient to have satisfactory results without adding too much computational burden to the model. Therefore, the chosen kernel composition for the GPR model is the following:

k wt (x, x ) = k wt Per (x, x ) + k wt SE (x, x ) (3.15)
where k wt Per models the daily periodic shape of the data and k wt SE is used to fit the data's intraday fluctuations.

Forecasting results

In this subsection, intraday forecasts of water demand, obtained using a GPR model based on the kernel composition given in Subsection 3.5.2, are presented for various forecast horizons. Figure 3.7 shows the evolution of nRMSE values along the intraday forecast horizons, starting at a mere 9.43% for a 10-minute forecast horizon, then stabilizing around 13% for longer forecast horizons.

Then, Figure 3.8 displays forecasts at multiple intraday forecast horizons (10 minutes, 1 hour, 6 hours, 12 hours, and 24 hours) and their corresponding confidence intervals, with respect to measured data, over a two-day period in April. For a 10-minute forecast horizon, measured data are fitted very closely by the forecasts, and they are within the confidence interval at all times. As the forecast horizon grows, discrepancies between forecasts and measured data increase, although they stay minimal. However, on the first day, it is seen that data moves away from the forecasts and closer to the edges of the confidence intervals. On the second day, data is briefly outside the confidence intervals altogether.

PV power generation forecasting

At the core of the "Smart Occitania" project, there is a need to prepare for large-scale deployment of PV power generation in low-voltage power distribution grids. For all the advantages of this form of power generation, it is also highly stochastic. Widespread use of PV panels in small suburban neighbourhoods may cause significant operational challenges for grid operators in the near future. On that account, intraday forecasts of PV power generation are an important building block for the smart management scheme developed in this work. These forecasts are inferred from intraday GHI forecasts using a simplified model available in the literature, provided by Equation (3.17). In this section, GHI data are displayed and the kernel composition of the GHI forecasting model is given. Then, GHI forecasts over a few days in April are presented for various intraday forecast horizons.

PV power generation behaviour is inferred from GHI values using a simplified model available in the literature. The number of PV panel installations in the studied power distribution grid is adapted to the purposes of the study, namely to demonstrate voltage overshooting phenomena resulting from high levels of PV power generation. For simplicity, the term "PV power generation forecasting" will be employed to group both GHI forecasting and the conversion of GHI into PV power generation.

Data description

Available GHI data span two years and are sampled at a 10-minute rate. They originate from GHI measurements made by a Rotating Shadowband Irradiometer (RSI), with typical uncertainties about 5%, installed at the laboratory PROMES-CNRS. The entire dataset is displayed in Figure 3.9 where seasonal tendencies can be observed, whereas Figure 3.10 zooms in on a few days highlighting the daily patterns. The forecast horizons considered in this work are intraday: they range from 1 to 24 hours. The training phase uses 2 weeks of data whereas the testing phase is performed over one week. During the testing phase, a sliding 24-hour long dataset is used to forecast each point and is updated with the newest measurement at each time step.

Kernel composition

A thorough study is conducted in order to determine the most suitable kernel composition for intraday GHI forecasting [START_REF] Gbémou | Global horizontal irradiance forecasting using online sparse Gaussian process regression based on quasiperiodic kernels[END_REF]. As a result, the chosen kernel composition used for the smart management scheme is the following:

k GHI (x, x ) = k GHI Per (x, x ) • k GHI RQ (x, x ) (3.16)
where the periodic kernel k GHI Per models the daily periodic shape of the data and the kernel k GHI RQ captures the intraday fluctuations present in the data.

Forecasting results

In this subsection, results of GHI forecasting are given over a few days in April, the same period used for the results of intraday grid load forecasting in Section 3.4. In Figure 3.11, nRMSE values of the GHI forecasts are given for various intraday forecast horizons. These values increase sharply over the first hours and later stabilise around the same value (roughly 32%) for longer horizons. Figure 3.12 illustrates GHI forecasts with respect to measured data over two days in April, along with their associated confidence intervals, for multiple forecasts horizons: 10 minutes, 1 hour, 6 hours, 12 hours, and 24 hours. The displayed period is marked by a stark contrast in the GHI distribution between the two days: the first day is cloudy with significant intraday fluctuations whereas the second day is a clear-sky one.

Unsurprisingly so, the GPR model's ability to accurately track the evolution of GHI over the considered period is lessened as the forecast horizon gets longer. The model captures the intraday fluctuations quite well for the 10-minute forecast horizon (nRMSE is 15%), notably the ones seen during the first day in Figure 3.12. For the 1-hour forecast horizon, the nRMSE value doubles with respect to the 10-minute horizon, reaching 29%. This is translated into a noteworthy degradation of the forecasts' quality. The model struggles to fit intraday fluctuations on the first day and overshoots beyond the maximum value of 1000 W m -2 . On the second day, forecasts keep the general pattern of the first day but oscillate around the measured data and progressively correct course towards the end of the day. The confidence interval is quite slim and surrounds the data during most of the displayed period.

For the larger forecast horizons (6 hours, 12 hours, and 24 hours), forecasts have very similar behaviour and identical values of nRMSE (32%). In fact, for these horizons, the model is unable to fit the intraday fluctuations of the first day and ends up reproducing the daily periodic bell curve. On the second day, the forecasts follow a similar pattern to that of the first day. Yet, contrarily to the forecasts of the 1-hour forecast horizon, the amplitude of those obtained at longer horizons fall below that of the data. The interval gets significantly larger as the horizon gets longer. For the 6-hour horizon and beyond, the width of the confidence interval is around 500 W m -2 , which is 50% of the maximum GHI value.

The PV power generation forecast at a given time step k is inferred from the GHI forecast using the following equation [START_REF] Skoplaki | On the temperature dependence of photovoltaic module electrical performance: A review of efficiency/power correlations[END_REF]:

P PV (t) = η T ref S • GHI(t) • (τ α) [1 -β ref (T p -T ref )] (3.17)
where η T ref is the PV panel's efficiency (herein, η T ref = 0.21), S is the total surface area of PV panels in the power distribution grid, GHI are global horizontal irradiance forecasts, τ α is the effective transmittance of the PV panels (herein, τ α = 0.95), β ref is the coefficient of power degradation due to high temperatures (β ref = 0.004), T ref is the reference temperature (herein, T ref = 25 °C), and T p is the PV panels' temperature, computed as follows [START_REF] Jakhrani | Comparison of solar photovoltaic module temperature models[END_REF]:

T p = T a + k • GHI(t) (3.18)
with T a is the ambient temperature and k = 0.025.

Conclusion

This chapter focuses on intraday forecasting of three stochastic quantities affecting the system: PV power generation, grid load, and water demand. After a brief review of noticeable works in the literature concerned with forecasting these quantities, the reasoning behind the choice of Gaussian process regression to forecast all three quantities is clarified. A definition of GPR for time series forecasting follows. Afterwards, for each quantity, available data and the chosen kernel composition of the GPR model are given, then results are displayed and analysed. Intraday forecasts of grid load show that the GPR model performs well for short time horizons. However, the forecasting error rapidly increases as the forecast horizon does, which is an expected result. A noticeable perk of the proposed approach is its ability to provide satisfactory results with only two weeks of training data. This not only alleviates the computational burden of the approach, but also adds a degree of flexibility to it since it allows for a relatively quick adaptation to new grid configuration and new datasets.

Due to the regular nature of water demand data, a simple combination of a periodic kernel and a rational quadratic kernel for intraday fluctuations proves enough to capture the data's behaviour quite faithfully. The values of nRMSE start at 9% for a 10-minute forecast and quickly stabilises around 13% for longer forecast horizons.

The GPR model used for intraday forecasting of GHI (from which PV power generation is inferred) performs well for short forecast horizons (15.74% for a 10-minute horizon) but its performance degrades as the forecast horizon grows and it stabilises around 32% for horizons beyond 6 hours. This is reflected in the temporal evolution of the forecasts where it can be seen that intraday fluctuations become increasingly difficult to fit. Further work is currently underway to enhance the model's performance for long intraday horizons.

Forecasts presented in this chapter are, in due course, fed into the predictive controller developed in the context of the Smart Occitania project. They contribute to a better anticipation of voltage overshooting phenomena within the power distribution grid, which impact the controller's decision-making. In the subsequent chapter, an examination of the impact that forecasting errors have on the performance of the MPC strategy is performed. Then, the confidence intervals provided by the GPR models are used to reduce the resulting voltage overshooting.

Chapter 4

Resilience of the control strategy to forecasting errors

Introduction

In Chapter 2, results of the control strategy were obtained under the assumption that no forecasting errors of PV power generation, grid load, and water demand are made. Needless to say that when the control strategy is implemented in-situ, its performance will be impacted by forecasting errors of these stochastic quantities. In this chapter, the aforementioned impact is quantified and scrutinised in comparison with the previous results (where no forecasting errors are made).

Next, in order to enhance the predictive controller's performance, the MPC scheme is modified to be robust to forecasting errors, by incorporating confidence intervals associated with the GPR forecasts. In doing so, the control scheme evaluates possible constraint violations induced by values of these stochastic quantities contained within their respective confidence intervals. Then, it determines flexible asset setpoints that ensure no constraint violation occurs at the next time step regardless of input values within the aforementioned confidence intervals. Hereinafter, the steps undertaken by the modified MPC scheme are detailed and the results it produces are analysed.

To serve the purposes of this chapter, a modified configuration of the case study is used (Section 4.3). Simulations focus on a week in April where there is significant PV power generation and therefore more noteworthy voltage overshooting phenomena.

This chapter is organised as follows: first, the evaluation metrics used throughout this chapter are defined and the case study is presented. Second, an evaluation is carried out of the impact of forecasting errors on the MPC strategy's performance. Then, a brief overlook is given of works in the literature dealing with stochastic MPC applications. Finally, the amendments carried out on the control strategy in order to boost its resilience to forecasting errors is introduced and its results are discussed. The chapter ends with an in-depth discussion of the main conclusions derived from the culmination of results.

Evaluation metrics

Various evaluation metrics used throughout this chapter are defined hereinafter. Let H t be the number of time slots in the simulation period.

1. Final value of the objective function: its square root ( f obj,f inal ) represents the cumulative gap between power supply and demand within the power distribution grid during the simulated week.

2. Computational complexity κ: it is quantified by the mean number of objective function evaluations per window, weighted by its size. The number of objective function evaluations is provided as an output argument of the optimisation function "fmincon" in MATLAB.

3. Mean deviation from the forecasted values: let PPV , Pcons , and Qw,out be vectors grouping one-step-ahead forecasts (herein, 10-minute forecasts) of PV power generation, grid load, and water demand, respectively, during the simulation period. This evaluation metric represents the mean deviation of stochastic input values from the ones forecasted at a one-step-ahead forecast horizon:

Ω P PV = Ht-1 k=0 ( PPV (t + 1) -P PV (t + 1)) H t (4.1)
where Ω P PV is the mean deviation of PV power generation values (P PV ) from the ones forecasted at a one-step-ahead forecast horizon, in W.

Ω Pcons = Ht-1 k=0 ( Pcons (t + 1) -P cons (t + 1)) H t (4.2)
where Ω Pcons is the mean deviation of grid load values (P cons ) from the ones forecasted at a one-step-ahead forecast horizon, in W.

Ω Qw,out = Ht-1 k=0 ( Qw,out (t + 1) -Q w,out (t + 1)) H t (4.3)
where Ω Qw,out is the mean deviation of water demand values (Q w,out ) from the ones forecasted at a one-step-ahead forecast horizon, in m 3 h -1 .

4. Instances of voltage overshooting ν: in cases where the main optimisation problem has no feasible solution, overvoltage or undervoltage may occur in the power distribution grid. These are the instances that the present chapter studies and attempts to reduce. This metric records the percentage of these instances during the simulation period.

5. Surface area of voltage overshooting Φ: this metric is complementary to the number of instances of voltage constraint violation. It represents the total surface area of voltage overshooting past the prescribed lower and upper voltage levels in the power distribution grid, during the simulated period. It is measured in Volts and is calculated as follows:

Φ(Ψ) = N q=1 Ht t=1 max (U q (t) -U min , U max -U q (t), 0) (4.4)
where N is the number of nodes in the power distribution grid, U min is the lower voltage threshold, U max is the upper voltage threshold, and U q , where q ∈ {1, . . . , N }, are voltage values in various nodes of the power distribution grid. Let Ψ ∈ R Hp×3 be the matrix containing the measured stochastic inputs of the control strategy, over the simulation period, defined as follows:

Ψ = P PV P cons Q w,out (4.5)
Note that voltage values across the power distribution grid are linked to the values of Ψ through Kirchhoff laws, given in Equation (2.14).

Case study

In this subsection, the limitations of the previous case study presented in Chapter 2 are brought to light and the new case study to be used throughout this chapter is introduced. As a matter of fact, the power distribution grid is dimensioned in such a way that the acceptable voltage margins are significantly larger than the voltage fluctuations induced by the current levels of distributed generation being deployed. Consequently, although the case study used thus far was suitable to demonstrate the proposed MPC strategy's ability to close the gap between power supply and demand in the presence of significant PV power generation, it remains unsuitable for fleshing out voltage overshooting that can result from high levels of distributed generation and the possible voltage constraints that may arise as a result of forecasting errors.

For this reason, a modified case study will be used in this chapter. In this new case study, both the grid load and the PV power generation capacity are inflated in order to create more consequential peaks and dips in the power supply/demand gap curve, thus augmenting voltage fluctuations. Specifically, the virtual neighbourhood considered in this case study comprises approximately 600 households (as opposed to 120 household in Chapter 2) and 200 PV panel installations of 4 kW each (as opposed to 50 PV installations in Chapter 2), amounting to a total capacity of 800 kW. This configuration foresees evolutions in the near future, in light of the fast-growing power demand and the proliferation of PV power generation witnessed by power distribution grids. All other characteristics of the case study (composition, structure, etc.) remain the same. The dimensioning of the flexible assets also remains unchanged, with the biogas plant having a maximal power generation output of 200 kW and the water tower's pump operating in ON/OFF mode where P w ∈ {0, 100 kW}.

For the considered case study introduced hereinabove, the initial power supply/demand gap is 10 035 MW for the considered week in April. The initial case where no optimisation is carried out presents voltage overshooting phenomena resulting from the power supply/demand disparities. The percentage of instances of voltage overshooting ν is 23,71%, while the total surface area of voltage overshooting Φ reaches 4371 kV.

Evaluation of the impact of forecasting errors on MPC performance

In this section, the impact of forecasting errors on the MPC strategy's performance is studied. The control scheme is tested over the week in April presented in the previous section and for sliding window sizes ranging from 1 to 24 hours. Intraday GPR forecasts of grid load, water demand, and PV power generation (inferred from GHI forecasts), acquired as explained in Chapter 3, are used to run these simulations.

The performance of the predictive controller fed with GPR forecasts is evaluated in comparison with a controller fed with measurements, i.e. a case where no forecasting errors are made. This comparison will focus on three main aspects of the scheme's performance: the power supply/demand gap f obj,,f inal (Figure 4.2), computational cost κ (Figure 4.3), and surface area of voltage overshooting Φ (Figure 4.4). In Figure 4.2, the cumulative power supply/demand gap given by the MPC scheme over the considered week is displayed per sliding window size. Though these values degrade as the sliding window size increases in both cases, the ones given by the MPC scheme when it uses GPR forecasts are not significantly degraded with respect to those given by the MPC scheme that uses measurements. In fact, the maximum difference between the two curves is 198.39 kW, obtained for the 22-hour sliding window, which constitutes only 1.98% of the initial value (10 035 MW). The computational cost, presented in Figure 4.3, steadily grows in both cases as the sliding window size does. It is different for the scheme that uses GPR forecasts, which is to be expected since the updated forecasts displace the optimisation problem's starting point with respect to the previous time step. That being said, the increase in computational cost due to the use of forecasts remains subdued. For window sizes between 1 and 10 hours, its average value is a 12.3% increase from the scheme using measurements. For all window sizes up to 24 hours, this average is evaluated at 16.4%. For sliding window sizes up to 3 hours, the MPC scheme is unable to reduce voltage overshooting and actually makes matters considerably worse. Starting from a 4-hour sliding window, voltage overshooting given by the MPC scheme decreases significantly from the initial value, in both the case where the scheme uses measurements and the one where it uses GPR forecasts. Then, for larger window sizes, it quickly stabilizes around the same level. As of the 4-hour window size, the MPC strategy effectively eliminates more than 50% of voltage overshooting. When taking into account the fact that the forecasting errors are at their lowest for short forecast horizons (inferior to 3 hours) and rapidly grow for longer horizons, it becomes apparent that the accuracy of forecasts for these short horizons is not enough to guarantee better management of voltage fluctuations on its own. In reality, the availability of forecasts over a longer forecast horizon is pivotal to better equip the MPC scheme to anticipate emerging voltage overshooting and work to prevent it. In light of this observation, it is recommended, for the purposes of this study, to prioritise reducing forecasts' error rates for forecast horizons up to several hours, rather than only focusing on short horizons.

Figure 4.5 displays the percentages of time steps during the simulated week where overshooting is observed, with respect to the size of the sliding window. As of the 2-hour window, this percentage is significantly lower than the initial one (23.71%) for both MPC schemes, the one using measurements and the one using GPR forecasts. It quickly stabilizes at roughly 7% for both cases and reaches a minimum of 3.67% for the former and of 5.16% for the latter, both corresponding to the 24-hour window. These values are lower than the initial value (18.29%) for both schemes, with the values corresponding to the MPC scheme using GPR forecasts being slightly lower than the ones corresponding to the MPC scheme using measurements. It is interesting to note that despite the percentage of overshooting occurrences (ν) being significantly higher for small windows than for larger ones, values of φ remain at roughly the same level regardless of sliding window size. Their average is 11.6 V per time step for the scheme using measurements and 10.7 V per time step for the one using GPR forecasts. This means that, for large window sizes, overshooting incidents are less frequent but have a higher amplitude than for small ones. On another note, voltage overshooting is not remarkably impacted by the use of GPR forecasts as opposed to the case where measurements are used. The two sets of values, whether in terms of cumulative voltage overshooting (Figure 4.4) or percentage-wise (Figure 4.5), behave similarly and remain roughly at the same level. These results point to the MPC strategy proposed herein being inherently resilient to forecasting errors of PV power generation, grid load, and water demand. This is thanks to the closed-loop structure of model-based predictive control, which allows course-correction as new information comes in at every time step.

Although the MPC strategy succeeds in reducing voltage overshooting with respect to the initial case, it does not completely eliminate it. In order to further enhance the strategy's performance, a complementary module can be added upstream of the main optimisation problem upon which the predictive controller is based. This module attempts to limit overshooting due to erroneous GPR forecasts of grid load, water demand, and PV power generation.

State of the art of stochastic MPC

The issue of stochastic data in MPC schemes is present in a wide array of problems, which makes it an active research field. There exists a significant body of literature handling stochastic MPC for linear problems [START_REF] Bemporad | Robust model predictive control: A survey[END_REF][START_REF] Mayne | Robust model predictive control of constrained linear systems with bounded disturbances[END_REF][START_REF] Di Cairano | Stochastic MPC with learning for driver-predictive vehicle control and its application to hev energy management[END_REF].

As for nonlinear problems, which is the case addressed in this work, more recent works have tackled them in different ways. A common rationale in the literature are "multi-stage" control schemes. Recent examples include offline computation of an incremental Lyapunov function which is then used for an online construction of a "tube" to tighten the constraints [START_REF] Köhler | A computationally efficient robust model predictive control framework for uncertain nonlinear systems[END_REF], a decomposition into several deterministic sub-problems whose solutions are then aggregated using an operation-cost-based rule [START_REF] Fioriti | A novel stochastic method to dispatch microgrids using monte carlo scenarios[END_REF], and the modelling of the uncertainty through a tree of discrete scenarios, coupled with a tube-based MPC to balance the system's variability and its economic profitability [START_REF] Lucia | A new robust NMPC scheme and its application to a semi-batch reactor example[END_REF][START_REF] Lucia | Handling uncertainty in economic nonlinear model predictive control: A comparative case study[END_REF].

The use of a multi-stage approach adds a layer of complexity into the control scheme. The advantages of such methods are their ability to combine several different techniques into a hierarchical scheme to tackle numerous difficulties in the problem. This often presents itself as an offline stage that feeds into an online one. Their obvious drawbacks is the added complexity and, in the case of scenario-based methods, significant computational burden which make them ill-suited for real-time applications.

The method proposed hereinafter is based on min-max MPC for uncertain nonlinear systems under constraints [START_REF] Martino Raimondo | Min-max model predictive control of nonlinear systems: A unifying overview on stability[END_REF][START_REF] Daniel Limón | Input to state stability of min-max MPC controllers for nonlinear systems with bounded uncertainties[END_REF]. This technique's premise boils down to risk aversion by computation of a worst-case scenario upstream of a standard optimisation problem. As it stands, the MPC strategy we use assumes that the forecasts of stochastic quantities in the system are perfect. Therefore, the solution of the optimisation problem upholds the constraints computed using those forecasted values, and does not guarantee satisfaction of constraints for values that are different from the forecasted ones.

The solution proposed here adds a layer, to be called "the min-max problem", upstream of the main optimisation problem which determines the flexible assets' setpoints. Note that the main problem referred to throughout is the switch control optimisation problem upon which the MPC strategy has been based so far. The min-max problem will determine the values of possible PV power generation, grid load, and water demand for which constraint violation will be at a maximum, within the forecasts' respective confidence intervals. The scenario with these values is dubbed the worst-case scenario. Then, the predictive controller searches for optimal flexible assets' setpoints that uphold constraints computed with values of PV power generation, grid load, and water demand corresponding to the worst-case scenario.

The worst-case scenario approach

In this section, amendments are made to the predictive control strategy in order to enhance the controller's performance by making it more robust to forecasting errors of the system's various stochastic quantities. The premise of the method is to use min-max optimisation in order to find and solve a "worst-case scenario" at each time step based on confidence intervals given by the inputs' respective GPR models. Eliminating, or at least minimising, the constraint violations corresponding to the worst-case scenario guarantee that these violations are also minimised for all other possible scenarios.

It should be noted that, at each time step, these amendments are only made to the decisionmaking of the subsequent time step, and not over the entire forecast horizon. This choice is motivated by two reasons. The first is that determining a worst-case scenario over the entire forecast horizon is a conservative and computationally expensive optimisation problem, which is incompatible with the real-time application at hand. As a matter of fact, a min-max problem over the entire forecast horizon has a feasible space of dimension (3 × H p ), as opposed to the problem concerned only with the following time step only having a 3-dimensional feasible space. The second is that, due to the closed-loop nature of MPC, computing robust setpoints for the entire forecast horizon is in high likelihood a waste of resources because, at each time step, only the first setpoint is applied and the whole procedure is reiterated at the next one. Ergo, the scheme only seeks to provide a setpoint robust to forecasting errors for the next time step.

First, let P PV , P cons , and Q w,out be forecasted values of PV power generation, grid load, and water demand, respectively, over the forecast horizon. Then, let P PV , P cons , and Q w,out be measured values of PV power generation, grid load, and water demand, respectively, over the forecast horizon. Finally, δ PV , δ c , and δ w define confidence intervals, for the next time step, of GPR forecasts of PV power generation, grid load, and water demand, respectively, as follows:

P PV (t + 1) ∈ [ P PV (t + 1) -δ PV , P PV (t + 1) + δ PV ] (4.8) P cons (t + 1) ∈ [ P cons (t + 1) -δ c , P cons (t + 1) + δ c ] (4.9) Q w,out (t + 1) ∈ [ Q w,out (t + 1) -δ w , Q w,out (t + 1) + δ w ] (4.10)
Herein, the confidence intervals are computed such that there is a 95% probability of measurements remaining inside them (Equation (3.12)). There exists a triplet (P risk PV (t+1), P risk cons (t+1), Q risk w,out (t+1)), contained in the feasible space illustrated in Figure 4.7, that induces a worst-case scenario vis-a-vis the optimisation problem constraints in the next time step. Finding this triplet and incorporating it into the predictive control strategy described in chapter 2 allows the controller to adjust its decision-making in order to reduce, if possible eliminate, any constraint violation that could occur in the next time step as a result of the stochastic quantities' measured values being different from the forecasted ones, within the limits of the associated confidence intervals. Let Y be the vector containing measurements of PV power generation, grid load, and water demand, for the next time step: Y = P PV (t + 1) P cons (t + 1) Q w,out ( 2. Forecast module: measured values of the controller's stochastic inputs (GHI, grid load, and water demand) are added to the sliding databases of respective GPR models, which are then used to update the models' parameters. Afterwards, the module produces updated forecasts of all three stochastic quantities over the forecast horizon, along with their respective confidence intervals. Lastly, GHI values and their corresponding confidence intervals are converted into PV power generation ones.

3. Worst-case scenario: phase 1 of the controller's decision-making process consists in determining the stochastic input values corresponding to the worst-case scenario of the following time slot, in terms of constraint violation. This bloc receives measurements of biogas volume and water volume, GPR forecasts of PV power generation, grid load, and water demand for the following time slot, and confidence intervals of GPR forecasts for the following time slot. An optimisation algorithm searches the feasible space defined in 4. Reduction of power supply/demand unbalance: phase 2 of the controller's decision-making process consists in determining the flexible assets' optimal setpoints. This bloc receives GPR forecasts of PV power generation, grid load, and water demand over the entire forecast horizon, as well as worst-case scenario input values of the following time slot, produced by phase 1. An optimisation algorithm searches for optimal setpoints of biogas plant power generation and water tower power consumption. It does so based on the optimisation problem defined in Subsection 2.3.3.2 and using the low-voltage grid model described in Equation (2.14) to evaluate various constraints.

5. Implementation of flexible assets' setpoints: optimal setpoints of flexible assets are produced, the first step of which are implemented by the biogas plant and the water tower.

For clarity, in what follows, the "term min-max problem" refers to phase 1 of Figure 4.8, which provides inputs corresponding to the worst-case scenario of the next time slot. The term "main optimisation problem" refers to phase 2, which provides setpoints of the flexible assets over the forecast horizon, in order to balance power supply and demand in the power distribution grid.

Results and analysis

It should be noted here that the main optimisation problem responsible for balancing power supply and demand in the power distribution grid, as constructed in Chapter 2, prioritises constraints so that the volume ones are always upheld. In other words, in cases where no feasible solution is found, voltage constraints are relaxed in order to guarantee that biogas volume constraints and water volume constraints are always upheld. For this reason, hereinafter, only voltage constraint violation is examined to evaluate the efficiency of the proposed min-max problem in enhancing the control strategy's robustness to forecasting errors. have no direct impact on voltage fluctuations in the power distribution grid. Their influence resides solely in determining the water tower's capacity in absorbing excess power off the grid at a given time.

The instances of voltage overshooting decrease steadily from case 1 through case 3. In fact, the amended MPC scheme with the min-max problem (case 3) brings down their percentage (ν) to 4.96% and 6.35% for the 4-hour window and the 10-hour window, respectively, from an initial value of 23.71%. The total surface area of voltage overshooting Φ is also considerably reduced from the initial value. It brought down to 1464.5 kV and 1176.8 kV for the 4-hour window and the 10-hour window, respectively, from an initial value of 4371.4 kV.

The gain procured through the addition of the min-max problem to the MPC scheme is deduced by comparing the metrics of cases 2 and 3. As it happens, for the 4-hour sliding window, voltage overshooting is further decreased from case 2 to case 3 by 168.2 kV, which amounts to 3.8% of the total surface area of voltage overshooting in the initial case. Percentage-wise, this decrease corresponds to 0.4% of the initial instances of overshooting.

For the 10-hour sliding window, voltage overshooting is decreased from case 2 to case 3 by 287.8 kV, which amounts to 6.6% of the total surface area of voltage overshooting in the initial case. Percentage-wise, this decrease corresponds to 0.5% of the initial instances of overshooting. The small fraction of the eliminated instances of overshooting with respect to the corresponding percentage of reduced surface area suggests that the min-max problem is particularly apt in eliminating major overshooting incidents. Table 4.1 reveals that the drop in the total surface area of voltage overshooting observed between the scheme using a 4-hour window and the one using a 10-hour window is accompanied by an increase in the percentage of instances of overvoltage.

Figure 4.9 illustrates the extrema of voltage fluctuations within the power distribution grid for the standard MPC strategy and the one using a min-max problem, for both sliding window sizes (4 hours and 10 hours). For both windows, voltage overshooting is considerably reduced in both cases with respect to the initial case. Voltage values mostly remain within the acceptable voltage bounds and veer closer to the nominal value (230 V). Unfortunately, this is achieved at the expense of the smoothness of the voltage curves. A possible solution to this issue could be the addition of a regularisation term to the objective function in order to penalise high-frequency voltage fluctuations. That being said, several voltage fluctuations are eliminated thanks to the addition of the min-max problem to the control strategy. This is especially noticeable for the MPC scheme using a 10-hour window where notable overshooting incidents are removed during midday of April 16 th and April 18 th .

The addition of the min-max problem does not introduce additional computational burden to the control strategy. In fact, the computational complexity (measured by κ) decreases from case 2 to case 3, by 2.9% for the scheme using a 4-hour window and by 6.8% for the scheme using a 10-hour window.

Figure 4.10 displays the evolution of the gap between power supply and demand for MPC schemes with and without the min-max problem. It is clear that neither scheme succeeds in reducing this gap significantly. However, they trim the peak occurring everyday around noon, due to the peak in PV power generation. This trimming effect is more visible for the scheme using a 10-hour window than the one using a 4-hour window. This is reflected in the the final values of the objective function. Though reduced from the initial case, they changes very little between case 2 (MPC using GPR forecasts) and case 3 (MPC using GPR forecasts and the min-max problem). This suggests that the min-max problem does not provoke any degradation to the MPC strategy's ability to reduce the gap between supply and demand in the power distribution grid.

In the case study considered here, it can be seen that the MPC strategy fares considerably worse in reducing the gap between supply and demand than it did in Chapter 2. This may be traced back to the dimensioning of the flexible assets, especially the dimensioning of these assets' storage units. In fact, while the grid load and PV power generation capacity were both inflated to demonstrate the possibility of emerging voltage constraints as a result of forecasting errors and to analyse the added value of the min-max problem, the dimensioning of the flexible assets was left untouched. One could argue that the power generation capacity of the biogas plant and the power demand capacity of the water tower become too small to have any meaningful impact on the reduction of the supply/demand gap within the power distribution grid. This observation further illustrates the importance of optimal dimensioning of flexible assets in order for the smart management scheme to yield efficient results.

Discussion

This work studies the relevance of the smart grid concept in rural and suburban power distribution grids through a case study, examines the potential of model-based predictive control for a smart management scheme dedicated to these grids, and evaluates the pertinence of two flexible assets compatible with the rural setting of the project Smart Occitania. The results obtained throughout demonstrate the proposed MPC scheme's ability to efficiently manage power flows within the grid in order to reduce the gap between power supply and demand and minimise voltage overshooting. The control scheme proves itself inherently resilient to forecasting errors. In fact, its performance is only slightly degraded and its computational cost only slightly increased as a result of these errors. Results also show that power distribution grids such as the one described in this case study are currently very far from having their stability and quality of service threatened by the deployment of distributed generation. As previously discussed in this manuscript, at the planning stage of power grids, they were traditionally oversized in order to leave room for future expansion and new connections with minimal need for new infrastructure. The unintended outcome of this decision is the grids' aptness to absorb significant levels of distributed generation without compromising its stability, namely in terms of acceptable voltage fluctuations.

Be that as it may, smart management scheme such as the one elaborated herein are still relevant to power distribution grid operators thanks to their potential in efficiently managing power flows within the grid using local assets. This permits the prevention of power backflow unto the medium-voltage power grids and represents a step towards the possibility of operating these grids in islanded mode, on condition that suitable and sufficient energy storage is made available.

The modifications to the MPC strategy carried out in Section 4.6 are inspired by previous works on min-max optimisation for uncertain nonlinear systems under constraints, which is by definition a conservative risk aversion technique. It is chosen for its relative ease of implementation and is used in this chapter to complement the previously developed predictive control strategy in order to anticipate the worst-case scenario, in terms of stochastic input values, and minimise resulting voltage overshooting. The conservativeness of the technique is lessened by its containment to the following time step instead of the entire forecast horizon. This is done primarily to reduce the computational burden added by the min-max problem, in light of the real-time aspect of the application at hand. Nevertheless, the merit of extending the min-max problem to the entire forecast horizon and a quantification of its added cost are valid questions worth investigating in a follow-up to this work. It is worth mentioning that, on top of reducing voltage overshooting, the min-max problem has virtually no effect on the reduction of the gap between power supply and demand.

It is clear that both the growing power demand and the deployment of distributed generation within power distribution grids are not slowing down in the near future. Therefore, configurations like the one studied in Section 4.6 will likely materialise in the upcoming years, accompanied by emerging constraints such as the ones observed in this study. This goes to show the pertinence of studies such as this one in order to prepare for this inevitability.

The reduction of the gap between power supply and demand in the case of the configuration considered in Section 4.6 is less remarkable than the one in case of the configuration considered in Chapter 2. For the considered week in April and assuming no forecast errors are made, the maximum reduction accomplished for the configuration of Chapter 2 is by 24.4%, attained for a 23-hour sliding window, while the maximum reduction accomplished for the configuration of this chapter is by 15%, attained for a 18-hour sliding window. This damper on the control scheme's performance in the configuration of Section 4.6 with respect to the one of Subsection 2.3.3 can be traced back, at least partially, to the flexible assets' dimensioning and their suitability to the task. As grid load and PV power generation levels rapidly rise, the flexible assets' room for manoeuvre diminishes. Consequently, two critical questions transpire. The first question is that of optimal dimensioning of these flexible assets. In this study, the control strategy operates at the level of the MV/LV transformer. However, in an application with finer spatial granularity, this question also encompasses optimal placement of the assets within the grid. The second question is that of the assets nature and their suitability to the application.

The combination of a biogas plant and a water tower in this case study was selected in an attempt to utilise small-scale assets compatible with the rural setting of the project Smart Occitania and offer the possibility of deferment of the assets' operation. Having said that, the examination of this duo's potential reveals several flaws. To begin, the water tower's ON/OFF operation adds computational complexity to the optimisation problem and is therefore a handicap to the real-time aspect of the applications. Besides, it infers choppier setpoints which not only worsen voltage fluctuations but also shorten the equipment's life expectancy. This is especially problematic when the installation's latitude in terms of storage levels is limited. Furthermore, flexible assets need to be extensible in order to adapt their room for manoeuvre to the rapidly growing power demand and distributed generation levels within the grid with minimal cost. The assets considered herein are not easily extensible, particularly the biogas plant whose energy source is based on a fairly delicate organic process.

In the case of model-based predictive control applications for power grids, choosing the time step is a pivotal task with no definitive answer. A compromise is always made between the high computational cost of this type of control schemes and the granularity of the model which allows to capture a maximum of phenomena occurring in the system. This type of control strategy is also dependent upon access to data, in real time, which comes with its own set of technical issues. Solutions to these issues are starting to come together through the maturing of advanced metering infrastructures in recent years.

The 10-minute time step considered in this work is very much an instance of the aforementioned compromise. It allows the necessary computations of both the forecast module and the optimisation problem to run their course. But, it limits the strategy's visibility into the high dynamics of power grids and thus makes it impossible to intervene between two sampling times. This type of strategy can therefore be seen as an-upper level control scheme, to be coupled with longer-term planning strategies and lower-level operation methods that have the capacity to react to rapid electrical phenomena, namely methods that fall under the umbrella of electrotechnical engineering.

Conclusion

In this chapter, the question of the proposed predictive control strategy's robustness to errors of grid load, water demand, and PV power generation GPR forecasts is addressed. An evaluation of the impact of the aforementioned errors of the MPC scheme's performance is thoroughly examined. Results show that the predictive control strategy is inherently resilient to forecasting errors as the final objective function value varies little between the case where measurements are used and the one where GPR forecasts are used. In addition, the MPC's ability to reduce voltage overshooting phenomena also remains the same despite the forecasts' errors. Interestingly, this ability is improved as the forecast horizon gets longer, in spite of growing forecasting errors.

After a brief overview of the literature concerned with stochastic MPC, a choice is made to use a min-max optimisation problem to complement the previously developed MPC strategy in order to enhance its ability to limit voltage overshooting phenomena occurring within the power distribution grid. The confidence intervals associated with the GPR forecasts are therefore used to determine a worst-case scenario for the next time step, that is subsequently integrated into the main optimisation problem.

In this manner, the predictive controller anticipates the possible overshooting incidents due to forecasting errors, for the next time step, and incorporates this new information into its decision-making process. This method is tested in the case of a week in April, presenting significant voltage overshooting due to high levels of PV power generation, and for two different sizes of sliding window. Results demonstrate that the min-max problem succeeds in reducing voltage overshooting, with respect to the case where it isn't used, in terms of both percentage of incidents and surface area of overshooting.

The chapter ends with an in-depth discussion of the main takeaways of this work. The strengths and weakness of the proposed control strategy are highlighted with respect to the application. Future developments of this research could include the investigation of the a min-max problem that spans the entire forecast horizon, instead of just the following time step, and an examination of how that would affect the controller's performance, but also the scheme's computational cost. In an ulterior step, a closer look needs to be taken at the optimal choice of flexible assets and their optimal dimensioning to best fit the needs of the control strategy.

Conclusion and outlook

The detrimental repercussions on the environment of industrialised human activity, namely large-scale use of fossil fuels, are becoming undeniable. Ergo, a global consensus is forming around the urgency of finding alternate energy sources to meet the growing power demand, hence the fervour of developing renewable-energy-based power generation. It is safe to say that one of the central issues of the energy transition is the successful large-scale deployment of renewable-energy-based power generation, referred to as distributed generation, in power grids.

In fact, the conception of power distribution grids was based on centralised power generation and unidirectional power flow. Therefore, the integration of distributed generation is accompanied by a wide array of technical challenges in fields ranging from material science and engineering, electrical engineering, information technology, control theory, etc. From a systems' control point of view, these challenges are mainly concerned with guaranteeing the stability, security, and quality of service of low-voltage power distribution grids. Questions of subduing voltage fluctuations and minimising the risk of power backflow are especially relevant.

The smart grid paradigm is emerging as a viable answer to these questions. Its main objective is the seamless integration of high levels of distributed generation into power grids. It rests on three main pillars: improved observability through advanced metering techniques, forecasting tools for stochastic quantities and the use of "smart" control techniques for better management of power flows within the grid, and the possibility of energy storage and demand-side management.

The work presented in this manuscript falls within the scope of the project "Smart Occitania", whose goal is to demonstrate the feasibility of the smart grid concept for rural and suburban low-voltage power distribution grids. To this end, a simulated case study is constructed, based on data collected during the project's run and made available by ENEDIS, in order to elaborate a predictive control strategy for more efficient management of power flows within a power distribution grid with prolific levels of distributed generation, namely PV power generation. The case study in question is a suburban residential neighbourhood, of approximately a 120 households, equipped with 50 PV panel installations of 4 kW each. The simulated case study is equipped with two flexible assets, a biogas plant and a water tower.

The premise of the proposed strategy is to use a model-based predictive controller to optimise setpoints of flexible assets present in the power distribution grid, in order to reduce the gap between supply and demand. This optimisation is constrained by pre-defined acceptable voltage margins, in addition to the assets' operational restrictions. The flexible assets in question offer the possibility of deferment of the biogas plant's power generation and the water tower's power consumption. The strategy relies on forecasts of grid load, water demand, and PV power generation, that are updated at each time step, to anticipate the constraints emerging within the power grid. In addition, it utilises confidence intervals associated with these forecasts to foresee possible voltage overshooting phenomena over the next time step and works to minimise them.

There are three main steps in this work. First, a model-based predictive control strategy is developed for the smart management of power flows within the power distribution grid. The particularity of this strategy is its handling of the ON/OFF operation of the water tower as a smooth nonlinear optimisation problem without recourse to mixed-integer nonlinear programming or to relaxation. This is done by shifting the decision-making process from the integer state of the water tower's operation to the real-valued switching time between those states. A sensitivity analysis is carried out in order to point toward a suitable compromise between the improvement of the final value of the objective function and the computation cost of the control scheme. It resulted in choosing a 14-hour window, with which the MPC scheme succeeds in reducing the power supply/demand gap by an average of 29% with respect to the initial operation scheme (i.e. before optimisation), over the 4 weeks considered in this study.

Second, a forecast module is constructed using Gaussian process regression. It provides intraday forecasts of grid load, water demand, and GHI from which PV power generation is inferred. A suitable kernel composition is selected to forecast each quantity based on an analysis of the patterns present in the available data. At each time step, the forecast module receives new measurements and uses them to update its forecasts along the forecast horizon of the MPC scheme. The quality of the forecasts decreases as the forecast horizon grows longer, but quickly stabilizes around a constant error value. In fact, intrahour forecasts are quite apt at capturing even small data fluctuations. However, as the forecast horizon grows, the model struggles to do so and tends towards reproducing broad patterns with decreasing precision. For the 14-hour window selected in the previous step, the forecasting error of the grid load, water demand, and PV power generation are 24%, 13%, and 48%, respectively. The GPR models also provide confidence intervals associated with the forecasts. Herein, the computed confidence intervals correspond to a probability of 95% of containing the measurements.

Third, an evaluation is carried out of the MPC strategy's resilience to forecasting errors and the induced errors are quantified. Results show that the predictive control strategy is inherently resilient to forecasting errors as the final objective function value varies little between the case where measurements are used and the one where GPR forecasts are used. In fact, the maximum divergence between the two curves is 161.74 kW, seen at the 3 rd hour, which constitutes only 0,74% of the initial value 10 035 MW. In addition, the MPC's ability to reduce voltage overshooting phenomena also remains the same despite the forecasts' errors. Interestingly, this ability is improved as the forecast horizon gets longer, in spite of growing forecasting errors. As of the 4-hour window, the MPC strategy effectively eliminates more than 50% of voltage overshooting. In reality, the availability of forecasts over a longer forecast horizon is pivotal to better equip the MPC scheme to anticipate emerging voltage overshooting phenomena and work to prevent them. In light of this observation, it is recommended, for the purposes of this study, to prioritise reducing forecasts' error rates for forecast horizons up to several hours, rather than only focusing on short horizons.

Finally, a min-max problem is added upstream of the main optimisation problem. Its purpose is to anticipate and minimise the voltage overshooting resulting from forecasting errors. In this min-max problem, the feasible space defined by the confidence intervals of the forecasts is searched, in order to determine the worst-case scenario in terms of constraint violation, over the next time step. Then, the main optimisation problem incorporates this information into its decision-making process. The improved control strategy is tested over a week in April, presenting significant voltage overshooting phenomena. Results show that these incidents are indeed reduced thanks to the min-max problem, both in terms of frequency of their occurrence and the total surface area of overshooting.

The present work shines a light on the potential of such case studies i.e. power distribution grids that host prolific distributed generation, namely PV power generation but also small-scale renewable-energy-based flexible assets. The predictive control strategy effectively reroutes power flows within the grid to meet power demand without infringing on standards of stability and quality of service. The formulation of the optimisation problem as a smooth continuous one alleviates its computational burden. In a similar vein, the GPR models in the forecast module use a sliding database of limited size (24 hours) to update their parameters and produce new forecasts at each time step. These efforts are made in order to make the strategy more appropriate for the real-time application. A discussion of the main takeaways from this work is provided in Section 4.7. It highlights the proposed strategy's strengths and discusses its limitations.

There are several axes along which the present work can make headway. To begin, the optimisation problem could be modified to take into account the implementability of the flexible assets' setpoints, without having recourse to a post-treatment. This could take the form of a multi-objective optimisation that balances out sometimes-conflicting goals. This is particularly reflective of settings where the flexible assets that the predictive controller uses are in fact owned and operated by third parties. In such cases, the controller's objective function needs to take into account the interest of all parties involved, with pre-defined priorities.

In addition, the min-max problem integrated into the predictive control strategy in Chapter 4, in order to improve the scheme's resilience to forecasting errors, can be extended from focusing on the next time step to span the entire forecast horizon. This will inevitably increase the computational burden of the control scheme, but should also enhance its performance through a better anticipation of issues that may arise along the forecast horizon, especially in light of the degradation of the forecasts' quality as the algorithm advances into the forecast horizon.

Moreover, the issue of optimal dimensioning of the flexible assets that the MPC scheme uses remains a pivotal one. There are several criteria to be taken into account in the dimensioning process: the availability of needed renewable energy (namely in the case of biogas plants), the expected levels of PV power generation, and the economic cost of these installations, to name a few. Another issue that needs to be scrutinized is the latitude and speed with which the chosen flexible assets can react to problems occurring within the power distribution grid and threatening its stability and quality of service. In point of fact, a compromise needs to be made between a time step large enough to allow for computations of both forecasts and optimisation, and one small enough so that a maximum of events occurring within the power grid, namely in terms of voltage fluctuations, can be captured. [START_REF] Sabater | Reputation and social network analysis in multi-agent systems[END_REF]

xof Tables 1 . 1 bbww

 11 per sliding window weighted by its size. . . . . . . . . . . . . . . . . . . . . . . . 4.4 The total surface area of voltage overshooting per sliding window size. . . . . . . 4.5 Percentage of time steps where an overshooting is observed, with respect to the sliding window size used by the MPC scheme. . . . . . . . . . . . . . . . . . . . . 4.6 Average voltage overshooting per time step, with respect to the sliding window size used by the MPC scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.7 Feasible space of the min-max problem, defined by the confidence intervals of one-step-ahead forecasts of grid load, water demand, and PV power generation. The time indices are removed to avoid cluttering the illustration. All quantities in this figure correspond to values in the next time slot. . . . . . . . . . . . . . . 4.8 Synoptic scheme of the amended MPC-based strategy for smart management of a low-voltage power distribution grid using flexible assets. . . . . . . . . . . . . . . 4.9 Extrema of voltage fluctuations within the power distribution grid for the standard MPC strategy compared to the one using a min-max problem and to the initial case, displayed for a 4-hour sliding window (above) and a 10-hour sliding window (below). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.10 Gap between power supply and demand within the power distribution grid for the standard MPC strategy compared to the one using a min-max problem and to the initial case, displayed for a 4-hour sliding window (above) and a 10-hour sliding window (below). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .List Energy net generation in European countries in 2017 and the evolution of energy net generation between 2014 and 2017. . . . . . . . . . . . . . . . . . . . . . . . . 1.2 Applications of modelling techniques in the literature. . . . . . . . . . . . . . . . 1.3 Applications of control approaches in the literature, part I. . . . . . . . . . . . . 1.4 Applications of control approaches in the literature, part II. . . . . . . . . . . . . 2.1 Assessment of the reduction of power supply/demand unbalance by the weekly planning, with respect to the initial case. . . . . . . . . . . . . . . . . . . . . . . 2.2 Assessment of the reduction of power supply/demand unbalance by switch control using a 14-hour sliding window, with respect to the initial case. . . . . . . . . . . 4.1 Assessment of the min-max problem's contribution to the control strategy's robustness to forecasting errors, for a week in April. . . . . . . . . . . . . . . . . xi xii Nomenclature ti Time instant between sampling times t i and t i+1 at which flexible assets' setpoints change β ref Coefficient of power degradation due to high temperatures PPV Vector grouping one-step-ahead forecasts of PV power generation during the simulation period Pcons Vector grouping one-step-ahead forecasts of grid load during the simulation period Qw,out Vector grouping one-step-ahead forecasts of water demand during the simulation period t Time instants at which flexible assets' setpoints change between two sampling times GHI Measurements of global horizontal irradiance Ψ Matrix containing measurements of the stochastic inputs over the simulation period GHI Forecasts of global horizontal irradiance over the forecast horizon P PV Forecasts of PV power generation over the forecast horizon P cons Forecasts of grid load over the forecast horizon Q w,out Forecasts of water demand over the forecast horizon Y Vector containing forecasts of PV power generation, grid load, and water demand, for the next time step I qj Current flowing between nodes q and j I q Current injected into/absorbed by node q P risk PV PV power generation corresponding to the worst-case-scenario P PV Measurements of PV power generation P b,OFF Setpoints of the biogas plant when the water tower is turned off P b,ON Setpoints of the biogas plant when the water tower is turned on P s Candidate setpoints of the biogas plant's power generation P b Setpoints of the biogas plant's power generation P * Optimal setpoints of the biogas plant's power generation P risk cons Grid load corresponding to the worst-case-scenario xiii P cons Measurements of grid load over the forecast horizon P cons Measurements of grid load P s Candidate setpoints of the water tower's power consumption P w Setpoints of the water tower's power consumption P * Optimal setpoints of the water tower's power consumption P q Active power consumed/produced at node q Q b,in Flow rate of biogas entering the storage unit Q b,out Flow rate of biogas consumption by the power generator Q w,in Flow rate of water entering the storage tank Q risk w,out Water demand corresponding to the worst-case-scenario Q w,out Flow rate of water demand Q w,out Measurements of water demand over the forecast horizon

ws

  Water volume corresponding to candidate setpoints of the water tower's power consumptionV wWater volume in the storage tank X Matrix containing optimisation variables within the forecast horizon X * Solution of the optimisation problem Y risk Vector containing critical values of PV power generation, grid load, and water demand, defining the worst-case scenario of the next time step Y risk Vector containing candidate values of PV power generation, grid load, and water demand, for worst-case scenario of the next time step Y Vector containing measurements of PV power generation, grid load, and water demand, for the next time step z Line impedance z qj Impedance between nodes q and j δU Allowed margin of voltage variation δ PV Margin defining a confidence interval of PV power generation forecast for the next time stepδ c Margin defining a confidence interval of grid load forecast for the next time step xv δ w Margin defining a confidence interval of water demand forecast for the next η b Generator efficiency η T ref PV panel's efficiency η w Water pump's efficiency κ Computational complexity k GHI Per Periodic kernel modelling daily patterns of GHI data k Per Periodic kernel k gl Per Periodic kernell modelling the periodic shape of grid load k wt Per Periodic kernell modelling the periodic shape of water demand k RQ Rational quadratic kernel k GHI RQ Rational quadratic kernel modelling short-term data fluctuations of GHI data k gl RQ Rational quadratic kernell modelling short-term fluctuations of grid load k SE Isotropic squared exponential kernel k gl SE Isotropic squared exponential kernel modelling long-term fluctuations of grid load k wt SE Isotropic squared exponential kernel modelling long-term fluctuations of water demand CI Confidence interval bounds of GPR forecasts LHV Lower Heating Value of the stored biogas µ * Predictive mean given by the GPR model nRMSE Normalised root mean square error ν Percentage of instances of voltage overshooting during the simulation period Ω P PV Mean deviation of PV power generation values from the ones forecasted at a one-stepahead forecast horizon Ω Pcons Mean deviation of grid load values from the ones forecasted at a one-step-ahead forecast horizon Ω Qw,out Mean deviation of water demand values from the ones forecasted at a one-step-ahead forecast horizon Φ Surface area of voltage overshooting φ Average voltage overshooting per time step Φ max Maximum voltage overshooting ρ Water density σ * Predictive variance given by the GPR model xvi τ α Effective transmittance of the PV panels f obj,f inal Final value of the objective function f obj,initial Initial value of the objective function f lip Flag designating whether setpoints are flipped during the current time slot f lip next Flag designating whether setpoints will be flipped during the next time slot Integer number of time slots within the forecast horizon H t Integer number of time slots in the simulation period k GHI Kernel composition used for intraday GHI forecasting k gl Kernel composition used for intraday grid load forecasting k wt Kernel composition used for intraday water demand forecasting N Number of nodes in the distribution grid n * Number of data points in the forecast horizon P b,max Maximum power generation of the biogas plant P b,min Minimum power generation of the biogas plant P b,nom Nominal power generation of the biogas plant P w,max Maximum power consumption of the water tower P w,min Minimum power consumption of the water tower P w,nom Nominal power consumption of the water tower S Total surface area of PV panels in the installation Nominal single-phase voltage value for all grid nodes V b,max Maximum storage capacity of the biogas plant V b,min Minimum storage capacity of the biogas plant V w,max Maximum storage capacity of the water tank xvii V w,min Minimum storage capacity of the water tank y forecast Intraday forecasts y test Test data xviii

  xxi

Figure 1 :

 1 Figure 1: Evolution de la capacité mondiale en solaire photovoltaïque entre 2007 et 2017.

Figure 3 :

 3 Figure 3: Schéma synoptique de la stratégie MPC proposée pour la gestion intelligente d'un réseau électrique de distribution basse tension au moyen de flexibilités (un château d'eau et un méthaniseur). Q w,out , GHI, P cons , V w et V b sont, respectivement, des mesures du débit d'eau consommée (la demande en eau), de l'éclairement global horizontal, de la charge du réseau, du volume d'eau et du volume de biogaz. P s w et P s b sont, respectivement, les valeurs de consigne possibles pour la consommation électrique du château d'eau et la production électrique du méthaniseur. V s w et V s b sont, respectivement, les valeurs de volume d'eau stockée correspondantes à P s w et de volume de biogas stocké correspondantes à P s b . P * w et P * b sont les valeurs optimales des consignes des flexibilités. GHI, P cons et Q w,out sont, respectivement, des prévisions de l'éclairement global horizontal, de la charge du réseau et du débit d'eau consommée.

Figure 4 :

 4 Figure 4: Exemple de valeurs de consigne des flexibilités pour la formulation du problème de commande à commutation, avec mise en évidence des instants d'échantillonnage t i et des instants de commutation ti .

avecS

  ON (τ ) = |P PV (τ ) + P b (τ ) -P cons (τ ) -P w,max | 2 (4) et S OFF (τ ) = |P PV (τ ) + P b (τ ) -P cons (τ ) -P w,min | 2

Figure 5 :

 5 Figure 5: Solar PV global capacity between 2007 and 2017.

Figure 6 :

 6 Figure 6: Map of demonstrator projects led by ENEDIS for the development of smart grid technologies in France. Projects 1 through 10 are ongoing whereas projects 11 through 20 are finished [1].

Figure 2 . 3 :

 23 Figure 2.3: Synoptic scheme of the proposed MPC-based strategy for smart management of a low-voltage power distribution grid using flexible assets. Let Q w,out , GHI, P cons , V w , and V b be measurements of water demand, global horizontal irradiance, grid load, water volume, and biogas volume, respectively. Let P *w , P * b be optimal setpoints of water tower power consumption and biogas plant power generation, respectively. Let GHI, P cons , and Q w,out be forecasts of global horizontal irradiance, grid load, and power demand, respectively. Let P s b and P s w be candidate setpoints of biogas plant power generation and water tower power consumption, respectively, and V s b and V s w be biogas volume and water volume corresponding to those candidate setpoints, respectively.

Figure 2 . 4 :

 24 Figure 2.4: Example of flexible assets' setpoints using the switch control formulation, where the sampling instants t i and the switching instants ti have been highlighted.

  31) with S ON (τ ) = |P PV (τ ) + P b (τ ) -P cons (τ ) -P w,max | 2 (2.32) and S OFF (τ ) = |P PV (τ ) + P b (τ ) -P cons (τ ) -P w,min | 2 (2.33)

Figure 2 . 5 :

 25 Figure 2.5: The unbalance between power supply and demand within the power distribution grid per sliding window size, over four "season-typical" weeks.

2

 2

Figure 2 . 7 :

 27 Figure 2.7: Computational complexity, measured as the mean number of function evaluations per sliding window weighted by its size.

Figure 3 . 1 :

 31 Figure 3.1: Grid load data of the considered power distribution grid over a year.

Figure 3 . 2 :

 32 Figure 3.2: Grid load data of the considered power distribution grid: zoom on a week of April.

Figure 3 . 3 :

 33 Figure 3.3: nRMSE for grid load forecasts with respect to intraday forecast horizons.

Figure 3 .

 3 4 displays forecasting results over two days for four forecast horizons: 10 minutes, 1 hour, 6 hours, 12 hours. GPR forecasts are accompanied by a confidence interval, meaning

Figure 3 . 4 :

 34 Figure 3.4: Forecasts of power grid load and their corresponding confidence intervals at forecast horizons 10 minutes (9%), 1 hour (13%), 6 hours (21%), 12 hours (23%), and 24 hours (26%).

1 )Figure 3 . 5 :

 135 Figure 3.5: Water demand measured at the water tower of the case study over a year.

Figure 3 . 7 :

 37 Figure 3.7: nRMSE for water demand forecasts using GPR with respect to intraday forecast horizons.

- 2 )Figure 3 . 9 :

 239 Figure 3.9: Global horizontal irradiance data for the considered power distribution grid over two years.

Figure 4 . 1 :

 41 Figure 4.1: The grid load and the PV power generation over a week in April.

Figure 4 .

 4 Figure 4.1 shows the new curves of the grid load and PV power generation for the same week in April as the one used in Chapter 2. The same patterns are preserved but the amplitudes of both quantities in the curve are increased (compared to Figure 2.1). In addition, for the purposes of this study, the acceptable margin for voltage fluctuations is lowered from 10% to

Figure 4 . 2 :

 42 Figure 4.2: The cumulative power supply/demand gap within the power distribution grid, per sliding window size. The gap before optimisation is 10 035 MW.

Figure 4 . 3 :

 43 Figure 4.3: Computational complexity, measured as the mean number of function evaluations per sliding window weighted by its size.

Figure 4 . 4 :

 44 Figure 4.4: The total surface area of voltage overshooting per sliding window size.

Figure 4 .

 4 Figure 4.4 displays the surface area of voltage overshooting, the initial value of which is 4371.4 kV. For sliding window sizes up to 3 hours, the MPC scheme is unable to reduce voltage overshooting and actually makes matters considerably worse. Starting from a 4-hour sliding window, voltage overshooting given by the MPC scheme decreases significantly from the initial value, in both the case where the scheme uses measurements and the one where it uses GPR forecasts. Then, for larger window sizes, it quickly stabilizes around the same level. As of the 4-hour window size, the MPC strategy effectively eliminates more than 50% of voltage overshooting.

Figure 4 . 5 :

 45 Figure 4.5: Percentage of time steps where an overshooting is observed, with respect to the sliding window size used by the MPC scheme.

Figure 4 . 6 :

 46 Figure 4.6: Average voltage overshooting per time step, with respect to the sliding window size used by the MPC scheme.

Figure 4 .

 4 Figure 4.6 displays the average voltage overshooting per time step (φ), with respect to the

P

  PV -δ PV P PV + δ PV Q w,out Q w,out -δ w Q w,out + δ w P cons P cons -δ c P cons + δ c

Figure 4 . 7 :

 47 Figure 4.7: Feasible space of the min-max problem, defined by the confidence intervals of one-step-ahead forecasts of grid load, water demand, and PV power generation. The time indices are removed to avoid cluttering the illustration. All quantities in this figure correspond to values in the next time slot.

Figure 4 .

 4 Figure 4.8 shows the synoptic scheme of the amended MPC strategy. The following is a detailed explanation of the steps taken by the strategy at each time step. 1. Data acquisition: measurements are taken of stored biogas volume and stored water volume and are injected into the predictive controller. Measurements are taken of GHI and grid load and water demand is inferred from measurements of water volume and incoming flow rate Q w,in . These values are injected into the forecast module.

Figure 4 .

 4 7 for worst-case scenario input values. It does so based on the optimisation problem formulated by Equations (4.14) and (4.15c) and using the low-voltage grid model described in Equation (2.14) to evaluate volume bounds and potential voltage overshooting.

Figure 4 . 10 :

 410 Figure 4.10: Gap between power supply and demand within the power distribution grid for the standard MPC strategy compared to the one using a min-max problem and to the initial case, displayed for a 4-hour sliding window (above) and a 10-hour sliding window (below).

5

  Solar PV global capacity between 2007 and 2017. . . . . . . . . . . . . . . . . . . 6 Map of demonstrator projects led by ENEDIS for the development of smart grid technologies in France. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 The grid load and the PV power generation over four "season-typical" weeks. . . 2.2 The equivalent electrical circuit of the low-voltage power distribution grid of the case study. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3 Synoptic scheme of the proposed MPC-based strategy for smart management of a low-voltage power distribution grid using flexible assets. . . . . . . . . . . . . . . 2.

  -hour sliding window. . . . . . . . . . . . . . . . . . . . . . . . . 3.1 Grid load data of the considered power distribution grid over a year. . . . . . . . 3.2 Grid load data of the considered power distribution grid: zoom on a week of April.3.3 nRMSE for grid load forecasts with respect to intraday forecast horizons. . . . . Water demand measured at the water tower of the case study over a year. . . . . ix 3.6 Water demand measured at the water tower of the case study over a week in April. 3.7 nRMSE for water demand forecasts using GPR with respect to intraday forecast horizons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Forecasts of water demand and their corresponding values of nRMSE at forecast horizons 10 minutes (9.43%), 1 hour (14.20%), 6 hours (15.48%), 12 hours (13.43%), and 24 hours (13.59%). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.9 Global horizontal irradiance data for the considered power distribution grid over two years. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.10 Global horizontal irradiance data for the considered power distribution grid: zoom on a week of April. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.11 nRMSE for global horizontal irradiance forecasts with respect to intraday forecast horizons. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.12 Forecasts of global horizontal irradiance and their corresponding values of nRMSE at forecast horizons 10 minutes (15.74%), 1 hour (29.74%), 6 hours (33.44%), 12 hours (33.60%), and 24 hours (32.71%). . . . . . . . . . . . . . . . . . . . . . . . 4.1 The grid load and the PV power generation over a week in April. . . . . . . . . . 4.2 The cumulative power supply/demand gap within the power distribution grid, per sliding window size. The gap before optimisation is 10 035 MW. . . . . . . . 4.3 Computational complexity, measured as the mean number of function evaluations

3.4 Forecasts of power grid load and their corresponding confidence intervals at forecast horizons 10 minutes (9%), 1 hour (13%), 6 hours (21%), 12 hours (23%), and 24 hours (26%). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.5

1 .

 1 Nouha Dkhili, Julien Eynard, Stéphane Thil, Stéphane Grieu. A survey of modelling and smart management tools for power grids with prolific distributed generation. David Salas, Julien Eynard, Stéphane Thil, Stéphane Grieu. An Application of Model-based Predictive Control for Renewables-intensive Power Distribution Grids. 21 st IFAC-V World Congress, Berlin, Germany, July 12-17, 2020. IFAC PapersOnline. 2. Nouha Dkhili, Julien Eynard, Stéphane Thil, Stéphane Grieu. A model-based predictive control for power distribution grids with prolific distributed generation: a case study. 20 th International Conference on Environment and Electrical Engineering EEEIC. Madrid, Spain, June 9-12, 2020. 3. Nouha Dkhili, Julien Eynard, Stéphane Thil, Stéphane Grieu. Comparative study between Gaussian process regression and long short-term memory neural networks for intraday grid load forecasting. 20 th International Conference on Environment and Electrical Engineering EEEIC. Madrid, Spain, June 9-12, 2020. 4. Nouha Dkhili, Hanany Tolba, Julien Eynard, Stéphane Thil, Stéphane Grieu. Intraday load forecasting using Gaussian process regression for power distribution grid management. 33 rd International Conference on Efficiency, Cost, Optimization, Simulation and Environmental Impact of Energy Systems. Osaka, Japan, June 29-July 3, 2020. In: Proceedings of the 33 rd International Conference on Efficiency Cost, Optimization, Simulation, and Environmental Impact of Energy Systems. Pages 1593-1602.

Sustainable Energy, Grids and Networks (2020). Vol. 21. Page 100284. Elsevier. 2. Hanany Tolba, Nouha Dkhili, Julien Nou, Julien Eynard, Stéphane Thil, Stéphane Grieu. Multi-horizon forecasting of global horizontal irradiance using online Gaussian process regression. Energies (2020). Vol. 13. Page 4184. MDPI. 3. Nouha Dkhili, David Salas, Julien Eynard, Stéphane Thil, Stéphane Grieu. Innovative application of model-based predictive control for low-voltage power distribution grids with significant distributed generation. Energies. Accepted for publication. • International conferences 1. Nouha Dkhili, 5. Nouha Dkhili, Julien Eynard, Stéphane Thil, Stéphane Grieu. A flexible asset operation strategy for demand/supply balance in electrical distribution grids. 19 th International Conference on Environment and Electrical Engineering EEEIC, Genova, Italy, June 11-14, 2019. In 2019 IEEE International Conference on Environment and Electrical Engineering and 2019 IEEE Industrial and Commercial Power Systems Europe (EEEIC/I&CPS Europe) (pp. 1-6). IEEE. 6. Hanany Tolba, Nouha Dkhili, Julien Nou, Julien Eynard, Stéphane Thil, Stéphane Grieu. GHI forecasting using Gaussian process regression: kernel study. IFAC Workshop on Control of Smart Grid and Renewable Energy Systems, Jeju, Korea, June 10-12, 2019. IFAC PapersOnline. In: IFAC PapersOnline 52 (4) (2019) 455-460. • Seminars 1. Nouha Dkhili, Julien Eynard, Stéphane Thil, Stéphane Grieu. A predictive switch control technique for electrical distribution grids with prolific distributed generation. Poster at CNRS Microgrids summer school at Belfort, France, July 1-5, 2019.

Table 1 .

 1 1: Energy net generation in European countries in 2017 and the evolution of energy net generation between 2014 and 2017 in percentage point[START_REF]European Network of Transmission System Operators for Electricity[END_REF].

	Energy source	Nuclear energy Fossil fuel	Hydraulic energy Solar energy	Wind energy
	France Spain Portugal Germany Italy Belgium Sweden Finland Switzerland United Kingdom 21%(+5.5%) 71.9%(-4.9%) 21.4%(+0.8%) -12.1%(-4.6%) -50.6%(-3.2%) 39.8%(-1.3%) 33.6%(-1%) 32.5%(-5.2%)	10.3%(+5.2%) 45.2%(+8%) 57.9%(+21.7%) 13.5%(-19.5%) 10.2%(-2.4%) 7.9%(-8%) 52.4%(-3.4%) 4.3%(-0.1%) 61.6%(+1.7%) 13.7%(-8%) 29.8%(-3.3%) 1.7%(-0.4%) 1.7%(-0.4%) 40.4%(-2.5%) 19%(-6.3%) 22.8%(+2.6%) 1.4%(-1.6%) 61%(+4.6%) 53.6%(+4.8%) 2.4%(-0.3%)	1.7%(+0.6%) 4.6%(+1.5%) 5.3%(+0.4%) 18.4%(-0.7%) 1.6%(+0.4%) 22%(-2.2%) 5.9%(+0.4%) 17.3%(+7.2%) 9.1%(+0.4%) 6.4%(+1.2%) 3.7% 7.8%(+1.2%) -10.9%(+3.3%) -7.5%(+5.8%) 1.7%(+1.7%) 0.2% (-) 3.3%(+3.3%) 14.1%(+4.4%)

Table 1 .

 1

	2: Applications of modelling techniques in the literature.

Table 1 .

 1 4: Applications of control approaches in the literature, part II.

	Congestion	Real-time	Optimal	Risk aversion	Optimal DER	Economic	Notable works
	management	monitoring and	scheduling		allocation	optimisation
		control
				Demand-side management
			-	-	-		[150-155]
				-	-		[157, 167-169]
	33		-	-	-	-	[159, 188-191]
	-	-		-	-		[160, 164, 170]
	-			-	-	-	[165,166,192-194]
				Flexible asset management
	-	-		-			[172-176]
	-		-		-	-	[177]
	-		-	-	-		[178]
	-			-	-	-	[179]

  10) Figure 2.1: The grid load and the PV power generation over four "season-typical" weeks.Figure 2.2: The equivalent electrical circuit of the low-voltage power distribution grid of the case study. Let z, z 20 , z 30 , z 34 , z 35 , z 40 , and z 50 be the line impedance (assumed identical for all grid lines), the impedances of the water tower's pump (node 2), the consumers (node 3), the biogas plant's generator (node 4), and the PV installation (node 5), respectively. U 0 is the voltage at the transformer level. U 1 , U 2 , U 3 , U 4 and U 5 are voltages and I 01 , I 12 , I 13 , I 30 , I 34 , I 35 , I 40 and I 50 are currents flowing between various grid nodes.

		z	I 01	1	I 13	z	3
	Active power (kW)	U 0	U 1	I 12 2 z 20 z U 2	U 3	z 30 I 30 U 4	I 34 4 z 34 I 40 z 40 U 5	I 35 5 z 35 I 50 z 50	Grid load PV power generation
	04/15	04/16			04/17	04/18	04/19	04/20	04/21
	Active power (kW)									Grid load PV power generation
	07/18	07/19			07/20	07/21	07/22	07/23	07/24
	Active power (kW)									Grid load PV power generation
	11/19	11/20			11/21	11/22	11/23	11/24	11/25
	Active power (kW)									Grid load PV power generation
	02/01	02/02			02/03	02/04	02/05	02/06	02/07
						Time (month/day)

  U 4 U min is redundant. As for the upper bound, using Equation (2.64):

		U max U 4	(2.71)
		2
		4zP w	(2.69)
	U 2 min + zP w U min	U 1 [Additional constraint 1]	(2.70)

• Constraints inferred by bounds of U 4 : from Equation (2.64) it is trivial that U 4 U 3 . As a result,

Table 2 . 1 :

 21 Assessment of the reduction of power supply/demand unbalance by the weekly planning, with respect to the initial case.

	Season	f obj,initial	f obj,f inal Gain
	Winter	2.186 MW 1.149 MW 46.9%
	Spring	4.251 MW 3.126 MW 26.5%
	Summer 3.875 MW 2.862 MW 26.1%
	Autumn 2.280 MW 1.360 MW 41.5%

Table 2 .

 2 2: Assessment of the reduction of power supply/demand unbalance by switch control using a 14-hour sliding window, with respect to the initial case.

	Season	f obj,initial	f obj,f inal	Gain
	Winter	2.186 MW 1.346 MW 38.4%
	Spring	4.251 MW 3.345 MW 21.31%
	Summer 3.875 MW 2.976 MW 23.2%
	Autumn 2.280 MW 1.517 MW 33.5%
	Figure

  Figure2.8: Supply/demand gap before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window.

			Initial supply/demand gap Initial power gen. setpoint	Supply/demand gap (weekly planning) Power gen. setpoint (weekly planning)	Supply/demand gap (MPC) Power gen. setpoint (MPC)
	Active power (kW) Supply/demand gap (kW) Active power (kW) Supply/demand gap (kW) Active power (kW) Supply/demand gap (kW) Supply/demand gap (kW) Active power (kW)	0 100 200 300 -100 0 100 200 300 -100 0 100 200 300 -100 -100 0 100 200 300	04/15 12:00 04/15 12:00 07/18 12:00 07/18 12:00 11/19 12:00 02/01 12:00 02/01 12:00 11/19 12:00	04/16 12:00 04/16 12:00 07/19 12:00 07/19 12:00 11/20 12:00 02/02 12:00 02/02 12:00 11/20 12:00	04/17 12:00 04/17 12:00 07/20 12:00 07/20 12:00 11/21 12:00 02/03 12:00 02/03 12:00 11/21 12:00	04/18 12:00 04/18 12:00 07/21 12:00 07/21 12:00 11/22 12:00 02/04 12:00 Time (month/day) Time (month/day) 02/04 12:00 11/22 12:00	04/19 12:00 04/19 12:00 07/22 12:00 07/22 12:00 11/23 12:00 02/05 12:00 02/05 12:00 11/23 12:00	04/20 12:00 04/20 12:00 07/23 12:00 07/23 12:00 11/24 12:00 02/06 12:00 02/06 12:00 11/24 12:00	04/21 04/21 12:00 12:00 07/24 07/24 12:00 12:00 11/25 12:00 02/07 12:00 12:00 02/07 11/25 12:00

  Figure2.10: Water tower power consumption setpoints before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window. Figure2.11: Biogas plant storage volumes before and after the implementation of the MPC strategy, with respect to the weekly planning strategy, over four "season-typical" weeks using a 14-hour sliding window.

	Initial power cons. setpoint Initial stored biogas volume Initial stored water volume	Power cons. setpoint (weekly planning) Stored biogas vol. (weekly planning) Stored water vol. (weekly planning)	Power cons. setpoint (MPC) Stored biogas vol. (MPC) Stored water vol. (MPC)
	) )
	Active power (kW) Storage volume (m 3 Storage volume (m 3
	04/15 12:00 04/15 12:00 04/15 12:00	04/16 12:00 04/16 12:00 04/16 12:00	04/17 12:00 04/17 12:00 04/17 12:00	04/18 12:00 04/18 12:00 04/18 12:00	04/19 12:00 04/19 12:00 04/19 12:00	04/20 12:00 04/20 12:00 04/20 12:00	04/21 12:00 04/21 12:00 04/21 12:00
	) )
	Active power (kW) Storage volume (m 3 Storage volume (m 3
	07/18 12:00 07/18 12:00 07/18 12:00	07/19 12:00 07/19 12:00 07/19 12:00	07/20 12:00 07/20 12:00 07/20 12:00	07/21 12:00 07/21 12:00 07/21 12:00	07/22 12:00 07/22 12:00 07/22 12:00	07/23 12:00 07/23 12:00 07/23 12:00	07/24 12:00 07/24 12:00 07/24 12:00
	) )
	Active power (kW) Storage volume (m 3 Storage volume (m 3
	11/19 12:00 11/19 12:00 11/19 12:00	11/20 12:00 11/20 12:00 11/20 12:00	11/21 12:00 11/21 12:00 11/21 12:00	11/22 12:00 11/22 12:00 11/22 12:00	11/23 12:00 11/23 12:00 11/23 12:00	11/24 12:00 11/24 12:00 11/24 12:00	11/25 12:00 11/25 12:00 11/25 12:00
	)
	Active power (kW) Storage volume (m 3 Storage volume (m 3
	02/01 12:00 02/01 12:00 02/01 12:00	02/02 12:00 02/02 12:00 02/02 12:00	02/03 12:00 02/03 12:00 02/03 12:00	02/04 12:00 02/04 12:00 02/04 12:00	02/05 12:00 02/05 12:00 02/05 12:00	02/06 12:00 02/06 12:00 02/06 12:00	02/07 12:00 02/07 12:00 02/07 12:00
			Time (month/day) Time (month/day) Time (month/day)

)

  Figure 3.6: Water demand measured at the water tower of the case study over a week in April.

	h -1	100
	Qout (m 3	50
		0	04/15 12:00	04/16 00:00	04/16 12:00	04/17 00:00	04/17 12:00	04/18 00:00	04/18 12:00	04/19 00:00	04/19 12:00	04/20 00:00	04/20 12:00	04/21 00:00	12:00 04/21
								Time (month/day)

)

  6. Average voltage overshooting per time step φ: it corresponds to the mean of maximum voltage overshooting over the number of instances at which overshooting is observed during the simulation period. It is defined as follows:

	φ(Y ) = 100	Φ max (Y ) νH t	(4.6)
	with	Ht
	Φ max (Y ) =	t=1	max q∈{1,...,N } (U q (t))	(4.7)

P PV , P cons , Q w,out

  Synoptic scheme of the amended MPC-based strategy for smart management of a low-voltage power distribution grid using flexible assets. Let GHI, P cons , Q w,out , V w , V b be measurements of global horizontal irradiance, grid load, water demand, water volume, and biogas volume, respectively. Let Y be forecasts of stochastic inputs for the following time steps. Let δ PV , δ c , δ w be margins that define confidence intervals for the next time step of GPR forecasts of PV power generation, grid load, and water demand, respectively. Let P PV , P cons , Q

	Low-voltage (LV) grid					P * w (t+1)
											P * b (t+1)
	Solar PV systems	Consumers		Water tower		Biogas plant
								V w (t)			V b (t)
	GHI(t)	P cons (t)	Q w,out (t)			LV grid model	Y risk		LV grid model
		Forecast module	Y δ PV , δ c , δ w	V s b , V s w	Voltage	overshooting	Y risk s	V s b , V s w	Voltage	constraints	P s b , P s w
									t + 1)	T	(4.11)
	Min-max Let Y be the vector containing forecasts of PV power generation, grid load, and water demand, Main optimisation optimisation for the next time step: problem problem
				Y = P PV (t + 1) P cons (t + 1) Q w,out (t + 1)	T	(4.12)
	Phase 1 Let Y risk be the vector comprised of critical values defining the worst-case scenario of the next Phase 2 Model-based time step: Y risk = [P risk PV (t + 1) P risk cons (t + 1) Q risk w,out (t + 1)] T (4.13) predictive controller
	where P risk PV , P risk cons , and Q risk w,out are critical values of PV power generation, grid load, and water demand, respectively, corresponding to the worst-case-scenario. Based on Equations (4.8) to (4.10), the triplet (P risk PV (t + 1), P risk cons (t + 1), Q risk w,out (t + 1)) exists in the feasible space illustrated by Figure 4.7. At every time step, the following min-max problem is solved: Y risk = arg min (-Φ(Y )) (4.14) Figure 4.8: w,out Y be forecasts of PV power generation, grid load, and water demand over the forecast horizon, where Φ(Y ) is the voltage undershooting/overshooting corresponding to input values of Y , as defined in Section 4.2, subject to: Y (1) -δ PV Y (1) Y (1) + δ PV (4.15a) respectively. Let Y risk and Y risk be candidate values and optimal values of worst-case scenario s stochastic inputs. Let P s b and P s w be candidate values of biogas plant setpoints and water tower setpoints, respectively. Let V s b and V s w be the biogas volume and the water volume, respectively,
	corresponding to the candidate optimisation variables of a given iteration.

Y (2) -δ c Y (2) Y (2) + δ c (4.15b) Y (3) -δ w Y (3) Y (3) + δ w (4.15c)

Le manuscrit est organisé comme suit : le premier chapitre présente un état de l'art complet des techniques et des outils de modélisation et de gestion intelligente des réseaux électriques faisant face à une importante production décentralisée. Dans le deuxième chapitre sont présentées la stratégie de gestion prédictive développée, la méthode grâce à laquelle le mode de fonctionnement discret du château d'eau est appréhendé et les résultats obtenus. Les modèles de prévision des grandeurs stochastiques impactant le système sont présentés dans le troisième chapitre. Dans le quatrième chapitre, l'impact des erreurs de prévision sur les performances du contrôleur est évalué et une technique exploitant les intervalles de confiance fournis par les modèles de prévision est présentée afin d'améliorer la robustesse de ce contrôleur. Le manuscrit se termine par une conclusion, revenant sur les différentes étapes des travaux présentés, suggérant des pistes d'amélioration et abordant des questions qui, à ce jour, restent ouvertes.Pour faciliter la lecture du manuscrit, le lecteur est invité à se référer à la nomenclature pour de brèves définitions des notations utilisées. xxxvi

Acknowledgements

of emerging constraints and to study the robustness of the proposed MPC-based strategy to forecasting errors.

65

data of end-users in the considered power distribution grid, at the MV/LV transformer level. This calls for a top-down statistical method, the most popular of which are artificial neural networks (ANN) [START_REF] Hippert | Neural networks for short-term load forecasting: A review and evaluation[END_REF]. There exists a very broad spectrum of ANN modelling techniques that have been getting increasing attention in recent years [START_REF] Qamar | A review on artificial intelligence based load demand forecasting techniques for smart grid and buildings[END_REF]. But for the purpose of this work, another statistical approach, Gaussian process regression, is chosen to perform intraday grid load forecasting. The reasoning behind this choice is explained in Subsection 3.2.4.

Water demand forecasting

There are numerous approaches in the literature concerning water demand forecasting, some of which are published during the 1990s and can be considered as leading works [START_REF] Shvartser | Forecasting hourly water demands by pattern recognition approach[END_REF][START_REF] Buchberger | Model for instantaneous residential water demands[END_REF][START_REF] Buchberger | Intensity, duration, and frequency of residential water demands[END_REF].

Among the newest related works, several water demand forecasting techniques can be found. The authors of [START_REF] Caiado | Performance of combined double seasonal univariate time series models for forecasting water demand[END_REF] implement a Holt-Winter Auto-Regressive Integrated Moving Average (ARIMA) model, as well as a Generalized Auto-Regressive Conditional Heteroskedasticity (GARCH) model and test the seasonal impact on data variability. They conclude the usefulness of combining optimal forecast approaches, mainly for intraday predictions. In [START_REF] Hutton | A probabilistic methodology for quantifying, diagnosing and reducing model structural and predictive errors in short term water demand forecasting[END_REF], the authors described a methodology to quantify, diagnose, and reduce the structural modelling and the errors in predictions for water demand forecasting models. They claim that simplistic Gaussian residual assumptions were not appropriate for water demand forecasting. The authors of [START_REF] Bakker | A fully adaptive forecasting model for short-term drinking water demand[END_REF] present forecasts for the following 48-hour water demand with a 15minute time step using only previous water demand and static calendar data. They observed that the 15-minute time step is helpful in some cases where the longer steps are too coarse and detailed optimisations are needed. A combination of unsupervised (time series clustering) and supervised support vector regression (SVR) machine learning techniques are used in [START_REF] Candelieri | Identifying typical urban water demand patterns for a reliable short-term forecasting-the icewater project approach[END_REF] in order to detect patterns related to urban water demand. The results obtained provided reliable intraday (hourly) forecasts.

Water demand forecasting is done in an urban area in a south-eastern Spanish city in [START_REF] Herrera | Predictive models for forecasting hourly urban water demand[END_REF]. Using the obtained results, the authors conclude that SVR techniques are the most accurate. In order to predict water demand over a week, the work presented in [START_REF] Adamowski | Comparison of multivariate regression and artificial neural networks for peak urban water-demand forecasting: evaluation of different ANN learning algorithms[END_REF] uses several forecasting methods: three different multilayer perceptron neural networks which use different learning algorithms: Levenberg-Marquardt (LM), Resilient back-Propagation (RP), and Conjugate Gradient Powell-Beale (CGPB). By comparing obtained results, the authors observed that LM-ANNs provided better results than CGPB-and RP-ANNs.

Research presented in [START_REF] Bai | Dynamic forecast of daily urban water consumption using a variable-structure support vector regression model[END_REF] uses a Model Predictive Control (MPC) to build a Variable Structure SVR (VS-SVR) that allows the prediction of daily urban water demand. Its promising results are based on the combination of the SVR's nonlinearity and the MPC's robustness. Real data acquired from the city of Milan were used in [START_REF] Candelieri | Short-term forecasting of hourly water consumption by using automatic metering readers data[END_REF] to get intraday forecasts of water demand based on a two-stage learning scheme. While the first stage is based on time-series data clustering, the second stage is based on SVR for regression. Both homogeneous and non-homogeneous Markov chains were used in [START_REF] Gagliardi | A probabilistic short-term water demand forecasting model based on the markov chain[END_REF] to build two different models for water demand forecasting. The results show better performance for intraday predictions by the homogeneous chain, whilst the non-homogeneous one was in line with the artificial neural networks.

The reader is referred to [START_REF] Emmanuel A Donkor | Urban water demand forecasting: review of methods and models[END_REF] for a survey of urban water demand forecasting in order to identify the techniques, methods and models that can be useful for related problems. The survey concludes that machine learning techniques, namely artificial neural networks, are more appropriate for short-term water demand forecasting. In the literature, short-term forecasting is mainly directed at ensuring reliable supply of potable water to end-clients. However, scenario-based approaches are more suitable for long-term forecasting, which is more concerned with strategic planning problems and capacity planning. The drawback of machine-learning-based forecasting tools is their dependency on access to sufficient data, whereas scenario-based approaches In this section, the amended predictive control strategy as explained hereinabove is implemented and its results are presented and discussed in comparison with three other cases:

• case 1: the initial case where no optimisation is carried out. The biogas plant has a constant power generation output. The water tower is subject to an ON/OFF controller which activates its pump when a low-level sensor is triggered and deactivates it when a high-level sensor is triggered;

• case 2: the predictive control strategy proposed in Chapter 2, using GPR forecasts of the PV power generation, grid load, and water demand;

• case 3: the amended control strategy proposed in this chapter, based on the addition of the min-max problem to anticipate the worst-case scenario within the forecasts' confidence intervals in terms of constraint violation.

For each case, a simulation is run over a week in April. This period is selected because it presents high PV power generation and therefore demonstrates significant voltage overshooting. Two sizes of sliding windows are used for the MPC schemes in the results that are presented hereinafter: a 4-hour window and a 10-hour window. These two sliding window sizes are chosen to examine the difference in effects of the min-max problem on the MPC strategy's performance for both short sliding windows and long ones. The evaluation metrics of the MPC scheme with both sliding window sizes (4 hours and 10 hours) are assembled in Table 4 When examining the inner-workings of the min-max problem, it can be deduced that there are noteworthy deviations between forecasted values of PV power generation and grid load and the ones corresponding to worst-case scenarios.

For the considered week, for the tested MPC windows of 4 hours and 10 hours, the deviation of worst-case-scenario PV power generation values from the forecasted values (Ω P PV ) represents, on average, 7% and 9% of the data's mean, respectively. When it comes to the grid load, the deviation of worst-case-scenario values from forecasted ones Ω Pcons is less notable. For the tested MPC windows of 4 hours and 10 hours, it represents 3% an 2% of the data's mean, respectively.

Having said that, forecasted values of water demand and the ones corresponding to worstcase scenarios are virtually identical (Ω Qw,out is virtually null). This observation reaffirms the presumption that water demand, and by extension water levels in the water tower's storage tank,

Abstract

The term "smart grid" refers to a modern power grid that successfully integrates prolific distributed generation with end loads and efficiently reroutes power flows to balance supply and demand in real time with respect to stability, quality, and safety constraints. It relies on improved observability and advanced control techniques, and offers the possibility of advanced demand side management.

In the context of the Smart Occitania project, which aims to study the feasibility of the smart grid concept for rural and suburban power distribution grids, this work proposes a model-based predictive control strategy based on flexible asset management (herein a biogas plant and a water tower) that aims to balance power supply and demand within the power grid while maintaining voltage levels within prescribed margins. The control scheme incorporates intraday forecasts of various stochastic quantities that impact the system, procured through Gaussian process regression.

The main contribution of this thesis is twofold: the predictive controller's optimisation problem is formulated in such a way that the ON/OFF of the water tower is handled without recourse to mixed-integer nonlinear programming or relaxation, and the confidence intervals provided by the forecast module are utilised to minimize voltage overshooting due to forecasting errors.

The results illustrate the promise of a predictive controller relying on renewable-energy-based flexible assets to reduce the gap between power supply and demand, while upholding the power grid's voltage constraints.

Résumé

Le terme « réseau électrique intelligent » fait référence à un réseau électrique en présence d'une abondante production décentralisée et redirigeant les flux de puissance afin que soit maintenu l'équilibre entre production et consommation électrique en temps réel. Son fonctionnement est conditionné par le respect de contraintes de stabilité, sécurité et qualité de service. Il tire profit d'une observabilité améliorée, utilise les outils de contrôle/commande avancé et offre la possibilité d'une gestion avancée de la demande.

Dans le contexte du projet Smart Occitania, dont l'objectif est d'évaluer la faisabilité du concept de réseau électrique intelligent en zones rurales et péri-urbaines, ces travaux de thèse proposent une stratégie fondée sur la théorie de la commande prédictive et la gestion de charges pilotables (ici, un méthaniseur et un château d'eau) afin de maintenir l'équilibre entre production et consommation électrique dans le réseau, tout en respectant des contraintes en tension prédéfinies. La stratégie de contrôle inclue des prévisions infra-journalières de plusieurs grandeurs stochastiques qui interviennent dans le système, obtenues par le biais d'une régression non paramétrique par processus Gaussien.

La contribution principale de cette thèse est double : la formulation d'un problème d'optimisation pour gérer la commande tout ou rien du château d'eau sans avoir recours à la programmation non linéaire mixte en nombres entiers ou à une relaxation et l'utilisation d'intervalles de confiance fournis par le module de prévision pour réduire les dépassements de tension dus aux erreurs de prévision.

Les résultats obtenus témoignent du potentiel de la commande prédictive pour la gestion de charges pilotables dans une optique de réduction de l'écart entre production et consommation, tout en respectant des contraintes en tension.