Laurent Battini

Patrick Béguery

Peter Pflaum

Olivier Cottet et Nelly Rousset. Je garderai des très bons souvenirs des nombreuses discussions que nous avons eu, à la fois sur le plan technique et au-delà. De même, je remercie tous les membres de l'équipe Analytics Applications and Programs et en particulier Didier Pellegrin, chef d'équipe, de m'avoir offert l'opportunité d'effectuer ma thèse dans un environnement convivial et plein de curiosité scientifique.

Finalement, une pensée toute particulière pour ma famille et Elizabeth pour leur appui tout au long de ce travail.

Résumé

Le monde de l'énergie est en pleine mutation. La production centralisée d'énergie électrique laisse place à une gestion décentralisée, faisant ainsi apparaître de nouveaux acteurs et défis technologiques dans le monde de l'énergie. La principale cause de cette évolution est le taux croissant des sources d'énergies renouvelables porté par la volonté de décarbonisation du système de production pour contribuer à des enjeux environnementaux majeurs. Le développement rapide des systèmes d'information est perçu comme un accélérateur qui rend possible le déploiement à grande échelle de stratégies de contrôle avancées.

Cette thèse est dédiée au développement et à la validation de stratégies de contrôle avancées pour la gestion de systèmes énergétiques présents dans un réseau de distribution. Dans l'objectif d'une coordination optimale d'un grand nombre d'acteurs, associé au partage des ressources de chacun, émerge un des principaux défis qui est la gestion à grande échelle de ces systèmes. Pour répondre à ce défi, deux méthodes To the present day, fossil fuels have the biggest share (≈ 80%) in the continuously increasing world energy consumption (figure 1.1). The improved standard of life however does not come for free. Since the beginning of the 20th century, several scientists, amongst whom the physicist Svante Arrhenius [START_REF] Arrhenius | Xxxi. on the influence of carbonic acid in the air upon the temperature of the ground[END_REF]], suggest that human made CO 2 emissions may lead to a global warming effect. It took about half a century until this theory became widely accepted and it was only at the beginning of the 1970s that the topic appeared on political agendas. Since then, several global initiatives aiming to reduce the global greenhouse gas emissions were launched, culminating in the declaration to limit global warming to no more than 1.5°C at the UN Climate Change Conference (COP21) in Paris.

Considering the fact that the tendency of an increasing energy consumption persists (figure 1.2), considerable efforts will be necessary to be able to achieve this ambitious objective.

Electricity grid transformation

One key measure to respond to the challenge of reducing CO 2 emissions significantly, is to introduce more renewable energy sources into the existing electricity grid. Especially wind-and solar power have become competitive energy sources thanks to important technological advances during the last decades [START_REF] Hoffmann | The economic competitiveness of renewable energy: pathways to 100% global coverage[END_REF] 1.2. Aims of the thesis today, several countries have a significant share of renewable energy sources in their energy mix. For instance in Germany in 2015, photovoltaics contributed with 6.4% and wind power with 14.7% to the annual electricity consumption (source [BMWi (Bundes Ministerium für Wirtschaft und Energie) 2015]).

This evolution from traditional large and centralized production means towards a high number of spatially distributed smaller renewable production means comes along with great challenges for the electricity grid, putting into question the way it is currently operated. One major change is that the renewable production facilities are often connected directly to the distribution grid. Due to their intermittent nature, local power quality perturbations such as over-voltages or harmonic distortion are becoming more and more frequent.

The emerging number of electric vehicles (EVs) and the resulting charging processes are additional challenges for the electricity grid. In many regions, the distribution grid is not designed to deliver the relatively high amounts of energy which is required by the EVs. For instance, capacity limits of transformers connecting the distribution grid with the medium voltage grid may not be sufficiently high. This is particularly a problem encountered in the United States.

An additional challenge resulting from the introduction of renewable energy sources and EVs is the fact that the level of uncertainties increases. While traditional production facilities based on fossil energy carriers or on nuclear energy can be controlled in a very predictable manner, renewable energy sources are highly fluctuating. Similarly, the behavior of EVs can be very uncertain and hard to predict, which may result in high fluctuations in the load profiles at distribution grid level.

In order to successfully reduce the fossil fuel contribution in the electric power mix and to deal with the arising new challenges, new ways of controlling the electric grid are required. One major trend is to move away from a central control mechanism at the transmission grid level towards a more decentralized control at distribution grid level. Moreover, political incentives are required to guide the grid transformation in a smooth way. Incentives for investing into renewable energies on the one hand, and an adequate compensation for grid-stabilizing measures should be two continuously adapted pillars on this long journey.

Aims of the thesis

In this thesis, Distributed Model Predictive Control (DMPC) strategies are developed and assessed for smart grid energy management systems. Furthermore, Stochastic Optimization strategies are proposed to deal with the uncertainty encountered at Chapter 1. General Introduction Electric Vehicle Charging stations (EVCS) and Photovoltaic (PV) power plants.

Currently, energy management strategies in smart grids are mostly limited to the sub-system level. Typically each actor is managed autonomously without considering the fact that it is embedded in a surrounding electricity grid. For instance, a building energy management system aims at providing the desired level of service to the occupants and does not care about its impact on the grid. Due to the increasing amount of renewable energy sources at distribution level, this situation is becoming a serious threat for the existing electricity grid. For instance in Germany with its relatively high share of renewables, the PV production regularly has to be curtailed in order to guarantee the balance of produced and consumed power.

To respond to these challenges, the concept of smart grids has emerged during the last decade. It relies on the capabilities of modern communication systems which enable the continuous data flow between the actors in a smart grid and on the evolving computational capacities allowing to implement advanced energy management strategies at large scales.

MPC stands out amongst advanced smart grid control strategies for several reasons. Firstly, it allows to easily deal with multi-variable systems which are subject to multiple constraints. And secondly, it is capable to anticipate future events by taking into account forecasts (e.g. weather forecasts, forecasts of building occupancy, electric vehicle charging needs,...). In order to deal with the large-scale nature of smart grids, distributed control approaches are considered to be most suited.

For these reasons, the first part of this thesis is dedicated to DMPC algorithms that aim to optimally coordinate large numbers of actors in a smart grid (e.g. buildings, batteries, PV installations,...). The idea is to have a local MPC controller for each subsystem and one coordinator system which influences the local controllers in such a way that global optimality is recovered. Coordination between the different actors is necessary, because an upper bound on the globally consumed power in the smart grid has to be respected. This may for instance be due to a limited transformer capacity or because of contractual agreements with the grid utility. Moreover the coupling objective of maximizing the local consumption of locally produced energy is considered. This objective is a step towards energy independence of local sub-grids from the external grid and clearly requires coordination mechanisms. In this context, two DMPC frameworks are proposed. The first one is based on a primal decomposition of the initial centralized MPC problem and the second one on a dual decomposition. The pros and cons of both methods are discussed and demonstrated through simulations. Moreover the methods were implemented on test sites in the scope of the European project AMBASSADOR.

Although MPC has a natural ability to compensate prediction errors by continu-1.3. Outline of the thesis ously updating its control strategy, the performance may degrade quite importantly if the forecast uncertainties are too high. For this reason, the second part of this thesis is concerned with the development of stochastic optimization algorithms, allowing to deal explicitly with uncertainties. More precisely, a scenario-based optimization method called randomized algorithms is applied in two different contexts. In the first one, it is applied to design a robust energy management system for EVCSs. In the second one, a randomized algorithm is used to design a MPC controller for PV power plants which are subject to regulative constraints. Furthermore, this MPC controller has also been implemented on two recently commissioned PV farms, operated by Schneider-Electric.

www.ambassador-fp7.eu This Ph.D. thesis was prepared within the Gipsa-lab and Schneider-Electric in the scope of the European project AMBASSADOR (www.ambassador-fp7.eu). This collaborative project, led by Schneider-Electric, targets the development of energy management systems for the different actors in a smart grid as well as coordination mechanisms amongst them.

Outline of the thesis

The manuscript is organized as follows:

Part I Distributed MPC for resource sharing problems

In this part, two distributed MPC frameworks for smart grid energy management systems are proposed and compared with each other. The first one relies on a dual-, and the second one on a primal decomposition of the initial centralized optimization problem.

Chapter 1. General Introduction Chapter 2 Primal & dual decomposition

In this chapter, primal and dual decomposition are applied to divide a centralized resource sharing problem into several sub-problems and one coordinator problem. Besides the characteristic coupling constraint on the shared resource, the considered problem is particular due to an additional coupling in its objective term. Moreover the bundle method which is used to solve the coordinator problem is introduced in this chapter.

Chapter 3 Resource sharing problem in the smart grid context

The previously developed frameworks for solving resource sharing problems in a distributed manner are applied in the context of smart grids. More precisely, a system composed of buildings, batteries, renewable energy sources and electric vehicle charging stations is considered.

Chapter 4 Numerical & real-life validation

In this chapter the primal-and dual decomposition frameworks are validated through simulations. The equivalence of the solutions of the primal and dual decomposition frameworks is assessed and the most efficient configuration of the bundle method is determined for both frameworks. Furthermore, the experimental implementation of the algorithms on two test sites is presented.

Part II Explicit handling of uncertainties in energy management systems

In this part, methods to explicitly deal with the uncertainty induced by electric vehicle charging stations and photo-voltaic power plants are proposed. The main objective for both cases is to provide better predictions of their power consumption/production, enabling a better integration into the power grid.

Chapter 5 Randomized algorithm approach

The stochastic optimization method, namely randomized algorithms, which is going to be applied in the following two chapters is introduced. Moreover, the problems 1.4. List of publications which will be addressed in the following are briefly introduced.

Chapter 6 Energy management under uncertainty for EV charging stations

In this chapter an energy management system for electric vehicle charging stations based on randomized algorithms is proposed. The method allows to determine a day-ahead upper bound profile on the power consumption of an EVCS while guaranteeing the customer satisfaction at a desired probability.

Chapter 7 PV power plants under regulatory constraints and uncertainties

This chapter proposes an energy management system for photo-voltaic power plants with an associated battery storage system and which are subject to regulatory constraints. The method allows to determine the optimal battery size that maximizes the to-be-expected revenue of the installation while taking into account the weather forecast uncertainty.

General conclusion

The general conclusion gathers the most pertinent results and the main contribution of the thesis. x l,k state of the l-th sub-system at time instant k u l,k input of the l-th sub-system at time instant k r l,k consumed resource of the l-th sub-system at time instant k L l objective function of the l-th sub-system R lim,k global resource limit profile Γ k price profile Γ + k , Γ - k buying-and selling price profiles R global resource profile R cons profile of globally consumed resource R prod profile of globally produced resource J l,k optimal cost value of the l-th sub-system at time instant k g l,k

List of publications

(sub-)gradient of J l,k with respect to r l,k L (•) Lagrangian

Motivation for distributed MPC

The principle of distributed model predictive control (DMPC) [START_REF] Camponogara | Distributed model predictive control[END_REF][START_REF] Diehl | Report of literature survey, analysis, and comparison of on-line optimization methods for hierarchical and distributed MPC[END_REF][START_REF] Scheu | Report on assessment of existing coordination mechanisms for simple case studies, and on possible options for improving and extending these coordination mechanisms[END_REF]] is to divide an initial centralized controller into several sub-controllers which solve their local optimization problems separately. Through an iterative communication scheme the local controllers are able to recover the optimal solution of the initial centralized problem or at least to find a relevant sub-optimal solution.

The reason why an iterative communication scheme is required stems from the fact that the sub-problems are usually coupled with each other. This coupling can for instance be a common goal and/or shared resources and/or coupled dynamics. Depending on the nature of the coupling, different kinds of decomposition schemes can be applied as described by [START_REF] Christofides | Distributed model predictive control: A tutorial review and future research directions[END_REF].

Choosing a distributed MPC approach instead of a centralized one can have different motivations. The most important one is that large-scale problems, that would otherwise become computationally intractable, can be solved in reasonable time. Another important motivation is the enhanced robustness of a distributed approach, since a fault on one of the sub-controllers does not affect the entire system. Furthermore a distributed system is more modular, meaning that it can be extended or modified more easily. Finally an issue which is specifically important in the context of smart grids is privacy. In fact a distributed MPC approach allows every actor in a smart grid to keep the control of his local equipments while exchanging only limited information with his environment.

In this work the focus is on large-scale systems which are composed of several dynamically uncoupled sub-systems that share a common resource. The work is very much inspired by the DMPC framework for resource sharing problems proposed by [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]]. The main difference is that not only consumers of the shared resource are considered as sub-systems, but also producers and storage devices.

In the literature several distributed optimization methods have been proposed. Most of them are based on a primal or a dual decomposition of the initial centralized optimization problem. [START_REF] Boyd | Notes on decomposition methods[END_REF]] provides a very good introduction to these 2.2. Resource sharing problems two concepts while [START_REF] Bertsekas | Nonlinear programming[END_REF][START_REF] Boyd | Convex optimization[END_REF] provide exhaustive explanations of the underlying theory.

In this work we propose two DMPC frameworks and compare them with each other from a theoretic and a practical point of view. The first one is based on a primaland the second one on a dual decomposition of the initial centralized problem.

The limiting characteristic of distributed optimization schemes is their relative high number of required iterations to converge to a globally optimal and feasible solution as pointed out by [START_REF] Diehl | Report of literature survey, analysis, and comparison of on-line optimization methods for hierarchical and distributed MPC[END_REF]]. This can be problematic in real-time implementations where only a limited computation-and communication capacity is available at each decision instant. In order to deal with this topic, an efficient implementation of the bundle method is presented where the precision of the cutting plane approximations is chosen in an optimal way. The chapter is organized as follows: Section 2.2 introduces the class of resource sharing problems addressed in this work. In section 2.3, primal and dual decomposition are applied to distribute the previously introduced centralized problem into one master problem and several sub-problems. The mechanism allowing to efficiently solve the distributed problems -namely the bundle method -is described in section 2.4, before concluding the chapter with a discussion of the advantages and drawbacks of the primal and dual decomposition methods in section 2.5.

Resource sharing problems

In this section the class of problems targeted by the proposed primal-and dual DMPC frameworks is described.

The sub-systems

Consider a set of N S dynamically uncoupled sub-systems where each sub-system l ∈ S := {1, ..., N S } obeys the general dynamic equation:

x l,k+1 = f (x l,k , u l,k ) (2.2.1)
where x l,k and u l,k are the state and input vector of the sub-system l at instant k.

In the sequel, given a vector quantity v l ∈ R nv related to sub-system l, the boldfaced vector v l,k represents the future profile of v l over the prediction horizon of length

H beginning at instant k, namely v l,k := v T l,k , ..., v T l,k+H-1
T . Note that when no ambiguity occurs the time index k is dropped.

Chapter 2. Primal & dual decomposition

For each sub-system l ∈ S the vector r l,k ∈ R nr represents the vector of consumed resources where n r stands for the number of different resources. Each sub-system l ∈ S is controlled by a local model predictive controller which is denoted hereafter by MPC l :

MPC l : Minimize x l,k ∈X l,k ,u l,k ∈U l,k ,r l,k L l (x l,k , u l,k , r l,k ) (2.2.2a) Subject to: r l,k = h l (x l,k , u l,k ) (2.2.2b)
where L l (x l,k , u l,k , r l,k ) is the objective function of sub-system l and X l,k , U l,k denote respectively the domains of the state and input constraints which are possibly time-varying. The equality constraint (2.2.2b) expresses the relation between the dynamics of system l and its consumed resources r l over the prediction horizon. Typically the objective of the predictive controller is to provide some service (comfort in a building, charging of electric vehicles,...) at a minimal cost for the consumed resources. However, the objective function can also comprise other terms such as the optimization of the CO 2 footprint or of the system aging.

Remark: Note that the sub-systems' objective functions L l are assumed to be convex. This is in fact the technical key condition which allows to reliably and efficiently solve the optimization problems addressed throughout this whole work.

Centralized optimization problem

Consider now a system composed of several predictive controllers as described by problem (2.2.2). Moreover, consider a global limitation on the shared resource that is expressed through the following inequality:

H(r 1,k , ..., r N S ,k ) ≤ R lim,k (2.2.3)
where R lim,k ∈ R nr•H is the vector of the global resource limit over the prediction horizon and H(r 1,k , ..., r N S ,k ) being linear in order to be decomposable as shown in the next sections. In the sequel, we will assume

H(r 1,k , ..., r N S ,k ) := N S l=1 r l,k (2.2.4)
The centralized MPC problem becomes then:

Resource sharing problems

Minimize

{x l,k ∈X l,k ,u l,k ∈U l,k ,r l,k } l∈S l∈S α l • L l (x l,k , u l,k , r l,k ) (2.2.5a) Subject to: r l,k = h l (x l,k , u l,k ) ∀l ∈ S (2.2.5b) l∈S r l,k ≤ R lim,k (2.2.5c)
with α l being a weighting coefficient between the different sub-systems' objective terms. Note that this problem is precisely the one which was addressed by [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] and solved using an efficient DMPC framework which was based on a primal decomposition. Moreover the assumption was made that the resource vectors r l,k of the sub-systems are strictly positive, meaning that the sub-systems are pure consumers of the shared resource.

In the present work the centralized problem (2.2.5) is extended such that some of the sub-systems can also be producers of the shared resource. Furthermore the assumption is made that the globally consumed resource by the sub-systems needs to be purchased from an external source at a common tariff. For this reason, the term representing the cost of the consumed resource of the l-th sub-system is now written outside the local objective terms L l . Moreover the fact that the consumed resource needs to be purchased at a certain price Γ + and that it can be sold at another price Γ - is taken into account. With these modifications problem (2.2.5) becomes Minimize

{x l,k ∈X l,k ,u l,k ∈U l,k ,r l,k } l∈S l∈S L l (x l,k , u l,k ) +   l∈S r l,k   T • Γ k (2.2.6a) Subject to: r l,k = h l (x l,k , u l,k ) ∀l ∈ S (2.2.6b) l∈S r l,k ≤ R lim,k (2.2.6c) Γ k =        Γ + k if l∈S r l,k ≥ 0 Γ - k otherwise (2.2.6d)
This extension is introduced, because the proposed framework was developed in the context of a smart grid system where an economic objective has to be optimized that takes into account different prices for buying and selling energy from the grid. In chapter 3 this smart grid application is described in greater detail.

In the sequel, problem (2.2.6) is referred to as the centralized problem. In the following section a primal-and a dual decomposition are applied to the centralized problem.

Remark:

In this work the assumption is made that the selling tariff Γ - k may not be Chapter 2. Primal & dual decomposition greater than the buying tariff

Γ + k , namely Γ - k ≤ Γ + k (2.2.7)
This makes sense from an economic point of view, because otherwise it would be beneficial to buy energy from the grid and to instantaneously sell it back at the higher selling price. Provided that this assumption is fulfilled, the centralized problem can be formulated as a linear or quadratic programming problem which can be solved efficiently (cf. chapter 4 where simulation results are presented).

Decomposing the centralized problem

When the number of sub-systems in problem (2.2.6) becomes large, the computation time to solve the problem can become very important. For this reason, but also for the others mentioned in section 2.1, we aim to solve the problem in a distributed manner. However, since the sub-problems are coupled through the shared resources, this is not a trivial task. We apply two different decomposition methods to deal with this difficulty, namely a primal and a dual decomposition of the centralized problem. Both methods are hierarchical decomposition methods where a problem is decomposed into several sub-problems and one master/coordinator problem. In the following the primal and the dual decomposition of the initial centralized problem (2.2.6) are formulated.

Primal decomposition

In order to apply primal decomposition, the sub-problem (2.2.2) is modified by adding an additional constraint which imposes a resource profile r l,k to the subsystem. The sub-problem becomes then MPC l (r l,k ) : Minimize

x l,k ∈X l,k ,u l,k ∈U l,k L l (x l,k , u l,k ) (2.3.1a) Subject to: r l,k = h l (x l,k , u l,k ) (2.3.1b)
Let J l,k (r l,k ) denote the optimal value achieved by sub-problem l for a given resource allocation r l,k :

J l,k (r l,k ) := L l (x l,k , u l,k ) (2.3.2)
A (sub)gradient g l,k (r l,k ) of J l,k is assumed to be available:

g l,k (r l,k ) ∈ ∂J l,k (r l,k ) (2.3.3)

Decomposing the centralized problem

where ∂J l,k (r l,k ) is the sub-differential set of J l,k at r l,k .

Reminder:

The sub-gradient is a generalization of the derivative to functions which are not differentiable. As an example, consider the convex function f = |x|. Its sub-differential ∂f (x 0 ) at x 0 = 0 is the interval [-1, 1]. Each value within this interval represents a valid sub-gradient of f at x 0 . For further information on subgradients and non-smooth optimization in general, the interested reader is referred to [START_REF] Clarke | Optimization and nonsmooth analysis[END_REF]].

Based on these definitions the centralized problem (2.2.6) can be rewritten as Minimize

{r l,k } l∈S l∈S J l,k (r l,k ) +   l∈S r l,k   T • Γ k (2.3.4a) Subject to: l∈S r l,k ≤ R lim,k (2.3.4b) Γ k =        Γ + k if l∈S r l,k ≥ 0 Γ - k otherwise (2.3.4c)
Note that in problem (2.3.4) the local control variables x l,k and u l,k do not appear anymore. Only the resource profiles r l,k to be allocated to the sub-problems remain as decision variables. Finally, in order to get rid of the conditional definition (2.3.4c), the problem can be re-written as follows:

Minimize

{r l,k } l∈S l∈S J l,k (r l,k ) + R T cons,k • Γ + k -R T prod,k • Γ - k (2.3.5a) Subject to: R k ≤ R lim,k (2.3.5b) R k = l∈S r l,k (2.3.5c) R k = R cons,k -R prod,k (2.3.5d) R cons,k , R prod,k ≥ 0 (2.3.5e) R cons,k • R prod,k = 0 (2.3.5f)
where R k is the globally consumed resource. Since the sub-systems are allowed to be producers, R k can also take negative values in the case where more resources are produced than consumed. The variables R cons,k and R prod,k contain respectively the consumed and produced part of the global resource profile R k . This way different tariffs for purchasing and selling the resource can be applied.

Remark:

The non-linear constraint (2.3.5f) is only required in the case where the previously stated assumption (2.2.7) is not respected. In this case the constraint avoids Chapter 2. Primal & dual decomposition that the problem becomes unbounded. Throughout this whole work we assume that (2.2.7) holds and constraint (2.3.5f) can be dropped. Problem (2.3.5) becomes then Minimize

{r l,k } l∈S l∈S J l,k (r l,k ) + R T cons,k • Γ + k -R T prod,k • Γ - k (2.3.6a) Subject to: R k ≤ R lim,k (2.3.6b) R k = l∈S r l,k (2.3.6c) R k = R cons,k -R prod,k (2.3.6d) R cons,k , R prod,k ≥ 0 (2.3.6e)
In the sequel the optimization problem (2.3.6) is referred to as the primal master problem. Note that solving the primal master problem is not a trivial task, since the functions J l,k (•) are not known at the master level. In fact they can only be evaluated point-wise for a given resource allocation profile r l,k and at the cost of solving all subproblems and communicating their results to the master. In section 2.4 the method used to solve this problem in a distributed way will be described, namely the bundle method.

Dual decomposition

The idea of dual decomposition is to introduce dual variables which allow to move the coupling constraints of the centralized problem into the objective term, such that the problem becomes separable.

In a first step, the Lagrangian is developed by transferring the coupling constraint (2.2.6c) into the objective term and by introducing the dual variables λ k .

L (x l,k , u l,k , λ k ) = l∈S L l (x l,k , u l,k ) + λ T k   l∈S r l,k -R lim,k   +   l∈S r l,k   T Γ k (2.3.7)
Looking at the resulting dual problem (2.3.8) however reveals that it is not separable yet, due to constraint (2.3.8c) which represents the fact that the buying-and selling

Decomposing the centralized problem

price for the globally consumed resource in the system are not the same.

Maximize

λ k   inf {x l,k ∈X l,k ,u l,k ∈U l,k } l∈S l∈S L l (x l,k , u l,k )+ +λ T k   l∈S r l,k -R lim,k   +   l∈S r l,k   T Γ k    (2.3.8a) Subject to: r l,k = h l (x l,k , u l,k ) ∀l ∈ S (2.3.8b) Γ k =        Γ + k if l∈S r l,k ≥ 0 Γ - k otherwise (2.3.8c) λ k ≥ 0 (2.3.8d)
In fact, this coupling constraint (2.3.8c) is special, because it is a conditional constraint that depends on whether the system as a whole is consuming more resources than what it is producing or whether it is the other way round. In order to make the problem decomposable, it is not possible to build the Lagrangian of this special constraint in the classic way.

However, by introducing an upper-bounded variable µ k in problem (2.3.8), the decomposable problem (2.3.9) which we are actually interested in, is obtained.

Maximize

λ k ,µ k   inf {x l,k ∈X l,k ,u l,k ∈U l,k } l∈S l∈S L l (x l,k , u l,k ) + λ T k   l∈S r l,k -R lim,k   +   l∈S r l,k   T Γ + k -µ k    (2.3.9a) Subject to: r l,k = h l (x l,k , u l,k ) ∀l ∈ S (2.3.9b) λ k ≥ 0 (2.3.9c) 0 ≤ µ k ≤ Γ + k -Γ - k (2.3.9d)
Clearly, the step from problem (2.3.8) to (2.3.9) is not intuitive. In order to prove that the two problems are indeed equivalent, one can proceed as follows:

• In the objective function of problem (2.3.8), the term

l∈S r l,k T • Γ k is rewritten
as follows, such that the conditional constraint (2.3.8c) becomes obsolete:

  l∈S r l,k   T • Γ k = max   0, l∈S r l,k   T • Γ + k -max   0, - l∈S r l,k   T • Γ - k (2.3.10)

Chapter 2. Primal & dual decomposition

The operator max(a, b) replaces each element in vector b which is smaller than the scalar a, by a.

• The aim is now to show that this term is equivalent to the term

l∈S r l,k T Γ + k -µ k in (2.3.9a),
k :   l∈S r l,k   T Γ + k -µ k = max   0, l∈S r l,k   T • Γ + k -max   0, - l∈S r l,k   T • Γ - k µ k =        [1 1 • • • 1] - max (0, l∈S r l,k ) T l∈S r l,k T        • Γ + k +        max (0, -l∈S r l,k ) T l∈S r l,k T        • Γ - k
Note that the division operator in the above equation represents an elementwise division of the vectors.

• Then, the obtained term for µ k is inserted into the constraint (2.3.9d).

0 ≤ µ k =        1 T - max (0, l∈S r l,k ) T l∈S r l,k T        •Γ + k +        max (0, -l∈S r l,k ) T l∈S r l,k T        •Γ - k ≤ Γ + k -Γ - k
• Finally, one can easily verify that for the two cases l∈S r l,k > 0 and l∈S r l,k < 0, the term in the middle of the inequality either takes the value of the lower bound (µ k = 0) or the value of the upper bound (

µ k = Γ + k -Γ - k )
. This confirms that the problems (2.3.8) and (2.3.9) are equivalent and consequently that problem (2.3.9) is equivalent to the initial centralized problem (2.2.6).

Recall that the crucial point is that in contrast to problem (2.3.8), the dual problem (2.3.9) can now be decomposed into N S sub-problems and one master problem. The sub-problems become 2.4. Bundle method to solve the master problem

MPC l (λ k , µ k ) : Minimize x l,k ∈X l,k ,u l,k ∈U l,k L l (x l,k , u l,k ) + (λ k -µ k ) T • r l,k (2.3.11a) Subject to: r l,k = h l (x l,k , u l,k ) (2.3.11b)
Let J l,k (λ k , µ k ) denote the optimal value achieved by sub-problem l for given dual variables λ k , µ k :

J l,k (λ k , µ k ) := L l (x l,k , u l,k ) + (λ k -µ k ) T • r l,k
(2.3.12)

Based on this definition the dual master problem becomes Maximize

λ k ,µ k l∈S J l,k (λ k , µ k ) -λ T k • R lim,k (2.3.13a) Subject to: λ k ≥ 0 (2.3.13b) 0 ≤ µ k ≤ Γ + k -Γ - k (2.3.13c)

Bundle method to solve the master problem

In this section the bundle method which is used to solve the primal (2.3.6) and the dual (2.3.13) master problems is presented. Bundle methods are well-known for efficiently solving non-smooth optimization problems.

For decomposable problems like the ones studied in this work, bundle methods have shown to require particularly few iterations to find the optimum. In [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] for instance it is shown that a bundle method performs very well in a DMPC application for smart buildings. [START_REF] Briant | Comparison of bundle and classical column generation[END_REF]] mentions that while bundle methods require very few iterations, this comes at the cost of a non-negligible master solving time. Moreover [START_REF] Briant | Comparison of bundle and classical column generation[END_REF]] states that different implementations and versions of bundle methods exist, namely aggregated and disaggregated versions, which allow to potentially reduce the overall computational burden of the method when applied appropriately. These promising characteristics motivated our choice to use bundle methods to solve the resource sharing problems stated in the previous section. Special attention is drawn to the computational efficiency of the bundle implementation and to whether the approach is suitable for large-scale problems.

In the following a detailed explanation of the disaggregated version of the bundle method is provided, before briefly stating the difference from an aggregated and a semi-aggregated one. Note that although the bundle method is explained in the context of a primal decomposition problem, it applies in exactly the same way to the dual problem. For more detailed technical information about bundle methods, the reader is referred to [START_REF] Frangioni | Generalized bundle methods[END_REF]. Jl (r l ) after 4 iterations.

Chapter 2. Primal & dual decomposition r ℓ J ℓ Jℓ J ℓ , Jℓ r (1) ℓ r (2) ℓ r (3) ℓ r (0) ℓ epi(J ℓ )

Disaggregated bundle method

To solve problem (2.3.6), at each decision instant the master needs to approximate the function J = l∈S J l,k as a function of the allocated resource profiles r l,k .

The master is able to affect any resource profile r l,k to the sub-problems l ∈ S and to obtain in return their objective values J l,k (r l,k ) and their corresponding subgradients g l,k (r l,k ) (see 2.3.3). Recall that the sub-problems can be solved in parallel. Bundle methods rely on iteratively approximating the objective function (here J = l∈S J l,k ) by a so-called cutting plane model. In the special case where the objective function is separable, a disaggregated approximation can be built, where each sub-problem's objective function J l,k is approximated by an individual cutting plane model Jl (see figure 2.1).

In the sequel the time index k is dropped, since k does not change during the described procedure (e.g. J l ≡ J l,k ).

The bundles

Since the sub-problems' cost functions J l (r l ) are all convex, every sub-gradient g l (r l ) allows to define a half space which is a supporting hyperplane of the epigraph epi(J l ) of the function J l as illustrated by figure 2.1.

The cutting plane approximation J(s) l (•) of the sub-problems J l at the s-th iterate is 2.4. Bundle method to solve the master problem then defined as follows:

J(s) l (r l ) = Max i=1,...,n B s (i) l , r l + (i) l (2.4.1)
where n B is the number of linear supporting hyperplanes s

(i) l , • + (i)
l which were obtained during the previous iterations and kept in the memory. At each iterate s, the cutting plane model is updated by adding a new hyper plane as follows:

s (1) l ← g (s) l (2.4.2a) (1) l ← J l (r (s) l ) -g (s) l , r (s) l (2.4.2b)
where s

(1) l is the new stored sub-gradient and

(1) l is its corresponding linear offset. In order to keep a constant number n B of supporting hyperplanes in the memory, the oldest one, i.e. the n B -th one, is dropped. This way, for each sub-system a cutting plane approximation of its objective function {J l } l∈S is stored in a FIFO-register-like memory B (s)

l : B (s) l := {s (i) l , (i) l } i=1,...,n B (2.4.3)
Replacing the objective function terms of the sub-systems J l (r l ) by their approximations J(s) l (r l ) and adding a regularization term to problem (2.3.6), the master problem that has to be solved at each iteration s finally becomes:

r (s+1) • := Minimize {r l } l∈S l∈S J(s) l (r l ) + R T cons • Γ + -R T prod • Γ -+ D γ (s) (r • -r • (s) ) (2.4.4a) Subject to: R ≤ R lim (2.4.4b) R = l∈S r l (2.4.4c) R = R cons -R prod (2.4.4d) R cons , R prod ≥ 0 (2.4.4e)
where

r • = r T 1 , ..., r T N S
T is the concatenation of the N S sub-systems' resource profiles.

The stabilizing term

D γ (s) (r • -r • (s)
) is introduced in order to avoid drastic changes in the solution from one iteration to another. r (s) is the current best candidate point, also called the stability center or the central point. If the stabilizing term was dropped, the method would actually be the Kelley cutting plane algorithm [J. E. [START_REF] Kelley | The cutting-plane method for solving convex programs[END_REF] which is known to have some stability problems [START_REF] Bacaud | Bundle methods in stochastic optimal power management: A disaggregated approach using preconditioners[END_REF][START_REF] Briant | Comparison of bundle and classical column generation[END_REF]] when only few cuts are available.

As shown in [START_REF] Frangioni | Generalized bundle methods[END_REF]], quite weak assumptions on the properties of D γ (s) are necessary to ensure the convergence of the algorithm. The most common choice is a quadratic measure:

D γ (s) (r • -r • (s) ) := γ (s) r • -r • (s) 2 2
(2.4.5)

Chapter 2. Primal & dual decomposition

However also other measures and trust regions around the central point are possible. The interested reader is referred to [START_REF] Frangioni | Generalized bundle methods[END_REF][START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] for more information about the different stabilizing terms and the updating rules of γ (s) .

While disaggregated bundle methods require a relative small number of iterations to converge, the time to solve the master problem can become a limiting factor for the scheme's efficiency when the number of sub-systems is large. In fact, in order to solve the master problem (2.3.6) with the piece-wise linear approximations J(s) l (r l ) of the N S sub-problems' objective functions, a linear programming implementation is generally used. To illustrate this, we consider a system composed of N S = 2 sub-systems. For the disaggregated bundle method, the corresponding master problem would be Minimize

r 1 ,r 2 J(s) 1 (r 1 ) + J(s) 2 (r 2
), which can be implemented as a linear program as follows:

Minimize

r 1 ,r 2 η 1 + η 2
Subject to:

                                     s (1) 1 • r 1 + (1) 1 ≤η 1 . . . . . . s (n B ) 1 • r 1 + (n B ) 1 ≤η 1 s (1) 2 • r 2 + (1) 2 ≤η 2 . . . . . . s (n B ) 2 • r 2 + (n B ) 2 ≤η 2 (2.4.6)
It becomes obvious, that the number of decision variables r 1 , ..., r N S and the number of inequality constraints increase linearly with the number of sub-systems. When the number of sub-systems N S becomes high, this may result in important computation times to solve the master problem.

In the following section aggregated and semi-aggregated bundle methods are introduced. They usually result in lower computation times for the master, but come at the cost of an increased number of required iterations.

Aggregated & semi-aggregated bundle methods

Aggregated and semi-aggregated bundle methods allow to reduce the computation time by reducing the number of constraints in the master problem. While in disaggregated bundle methods every sub-problem J l (r l ) is approximated by an individual cutting plane model, an aggregated bundle method builds a single cutting plane model for the sum of all sub-problems' objective functions J = l∈S J l (r l ). Semiaggregated bundle methods can be seen as a trade-off between disaggregated and 2.4. Bundle method to solve the master problem aggregated ones. The idea is to build groups of several sub-systems whose objective functions are then approximated by a common cutting plane model.

The fully aggregated cutting plane model is defined as

B (s) :=                  s (i) 1 . . . s (i) N S       , ∈S (i)            i=1,...,n B (2.4.7)
The number of constraints is reduced by factor N S compared to a disaggregated bundle method. Note however that the number of variables for this aggregated cutting plane model has increased by factor N S .

For defining the cutting plane model of the semi-aggregated bundle method, let N B denote the number of sub-problems cost functions J l (r l ) which are approximated by a common cutting plane model. The number N C of cutting plane models becomes then N C = N S /N B . Note that in case the division N S /N B does not result in an integer value, the last cutting plane model will consist of less than N B sub-problems grouped together. Each of the N C cutting plane models is then defined as

B (s) k :=                               s (i) 1+(k-1)•N B . . . s (i) N B +(k-1)•N B       , N B +(k-1)•N B l=1+(k-1)•N B (i)            i=1,...,n B              k=1,...,N C (2.4.8)

Computational efficiency

DMPC approaches require an important number of iterations compared to a centralized solution as discussed in [START_REF] Diehl | Report of literature survey, analysis, and comparison of on-line optimization methods for hierarchical and distributed MPC[END_REF]]. Obviously the necessary number of iterations is one important factor to evaluate the efficiency of an algorithm. However when aiming to assess the real-time implementability of a DMPC framework the focus should not only be on the necessary number of iterations but also on computation time savings and on the impact of the communication infrastructure. Indeed in some situations it may be more advantageous to accept a higher number of iterations if the computational time per iteration can be reduced in return. The following equation provides a way to estimate the total time a DMPC framework requires to converge:

t total = n iter • (t Master + t Comm + t Subsys ) (2.4.9)
where n iter is the necessary number of iterations to converge to the global optimum, t Master is the time to solve the master problem at each iteration, t Subsys is the time to Chapter 2. Primal & dual decomposition solve the sub-problems (note that they can be solved in parallel and that t Subsys is assumed to be equal for all sub-systems) and t Comm is the delay occurring at each iteration due to the communication time between the master-and the sub-problems.

As a first order approximation it can be assumed that in equation (2.4.9) t Comm and t Subsys are constant parameters. n iter and t Master however depend both on the two parameters n B and N C of the bundle method, which makes it not obvious to determine the optimal trade-off for the bundle parametrization such that the total convergence time t total of the scheme is minimal. However the qualitative impact of n B and N C on the number of iterations n iter and on the time to solve the master problem t Master can be summarized as follows:

• n iter decreases when the approximation of the sub-systems' objective functions in the master problem are sufficiently detailed. More precisely, a sufficient number of cuts n B memorized in each bundle and a high number N C of cutting plane models (i.e. only few sub-problems approximated by a common bundle) result in a small n iter .

• High values of n B and N C however result in an important number of constraints according to N ctr = n B • N C in the master problem and consequently in a high t Master (cf. figure 2.2 which shows measures of t Master for the dual decomposition case). This means, there is a trade-off to be made between reducing n iter and increasing t Master .

Figure 2.3 qualitatively illustrates how the approximations' precision, i.e. the number of constraints N ctr , affects the whole scheme's computational efficiency. However, finding the optimal trade-off between n B and N C is problem-dependent and needs to be done through offline-evaluations.

Discussion: primal vs. dual decomposition

Both, primal and dual decomposition provide a way to solve a larges-scale optimization problem in a distributed manner. The common basic idea is to divide the centralized optimization problem into one master-and several sub-problems and then to recover the optimal solution of the centralized problem through an iterative negotiation process. The crucial advantage is that at each iterations the sub-problems can be solved in parallel, which makes distributed optimization schemes very competitive from a computational point of view.

However the two proposed decomposition schemes for resource sharing problem described in the previous sections have different advantages and drawbacks which

Convex vs. strictly convex:

In order to guarantee that the solutions which are found by primal-and dual decomposition schemes are equivalent to the one of the initial centralized problem, the two approaches require different convexity properties for the centralized problem.

When applying the primal decomposition scheme, it is sufficient that the initial problem is convex [START_REF] Bertsekas | Parallel and distributed computation: numerical methods[END_REF]]. With dual decomposition, it is required that the problem is strictly convex [START_REF] Boyd | Notes on decomposition methods[END_REF]], since otherwise there is no guarantee that a feasible primal solution can be determined. For more information on finding the primal solution from the dual, the interested reader is referred to [START_REF] Boyd | Convex optimization[END_REF].

The strict convexity requirement can be quite a strong limitation in many applications. In chapter 3 those limitations are discussed in greater detail in the context of our proposed smart grid energy management algorithms.

Number of decision variables at the master level:

Comparing the primal master problem (2.3.6) and its dual equivalent (2.3.13), one can see that the number of dual decision variables is independent of the number of sub-problems, while in the primal master problem the number of variables increases linearly with the number of sub-problems. This increasing number of decision variables results in higher computation times for the primal master problem compared to its dual. Especially with very high numbers of sub-systems (several thousands or more), the primal decomposition approach can become computationally very inefficient.

Information exchange between the master and the sub-problems

The information which is exchanged at each iteration between the master problem and the sub-problems is different in the primal and the dual decomposition approach.

In dual decomposition, each sub-problem receives a price profile γ := (λ k -µ k ) for the consumed resource. Based on this price profile, the sub-problems are solved and their resulting optimal resource consumption profile r l,k (γ ) and the corresponding optimal cost value J l,k (γ ) are sent to the master.

With the primal decomposition approach, the sub-problems receive a resource profile r l,k which is allocated by the master. For this imposed resource consumption profile the sub-problems solve their local problem and return their optimal cost value J l,k (r l,k ) and their sub-gradient w.r.t. the allocated resource vector g l,k (r l,k ) to the master.

Discussion: primal vs. dual decomposition

From the sub-problem's point of view, the dual decomposition case is more simple to be implemented, since the only modification is to take into account a modified price profile for the consumed resource, which is likely to be part of an economic optimization anyway. Moreover the consumed optimal resource which is returned to the master problem is simply the optimal resource consumption which is a primal variable of the sub-problem. In the primal case, the sub-gradient information which is required by the master is not as obvious to obtain, unless the sub-problems are linear or quadratic programming problems where the solver provides this information directly through the dual information.

Economic interpretation of the dual variables

From a technical point of view primal decomposition may seem to be more adapted for resource allocation problems, especially due to the weaker convexity requirements [START_REF] Palomar | A tutorial on decomposition methods for network utility maximization[END_REF]. However, we want to emphasize that in the smart grid context, the dual decomposition approach has the very nice feature that the Lagrangian multipliers can be interpreted not only as virtual prices, but as real monetary prices. As such they could be used by a local energy retailer to dynamically determine the price at which the affected sub-systems have to pay their resource consumption.

Context and motivations

Traditionally the electricity grid was managed in a top-down manner where large production facilities were managed in a centralized way in order to meet an inflexible demand which could be predicted with a satisfying precision.

With the increasing amount of renewable energy sources and the foreseeable EV penetration in the electricity grid, the situation has become more complex. Firstly the new generation facilities are of smaller scale, much more numerous and spatially distributed. Very often they are directly connected to the distribution grid which gives rise to numerous new challenges for the reliable and safe operation of the grid. Typical problems are locally occurring voltage fluctuations and transformer-and cable capacity violations. Secondly, most of the renewable energy sources such as windand solar power are highly uncertain energy sources. Similarly, EVs represent highly uncertain electrical loads.

Context and motivations

For the aforementioned reasons, the traditional way of managing the electricity grid is not feasible anymore and the concept of smart grids has emerged over the past 10 years. The idea in smart grids is to consider not only the production means as flexible and controllable systems, but also the consumers. Moreover not only large systems connected at high-and medium voltage level are part of the control mechanisms as it was the case in the past. In fact, any actor down to the end-user can become a flexible and controllable system which contributes to the reliable and safe grid operation. This way renewable energies can be exploited in a more efficient way by optimally matching supply and demand at all times. Moreover, since the systems are controlled at all levels, power quality issues can be mitigated by acting on the systems which are physically close to the point where the problem is encountered.

In this context, model predictive control (MPC) is considered as a powerful tool for energy management applications [START_REF] Vardakas | A survey on demand response programs in smart grids: Pricing methods and optimization algorithms[END_REF]]. This stems from its ability to handle constrained MIMO (Multiple-input-multiple-output) systems and to anticipate future events by taking into account weather forecasts, occupancy schedules of buildings, varying energy tariffs etc.

In this chapter the distributed MPC frameworks for resource sharing problems introduced in the previous chapter will be applied to the smart grid context. The objective of the approach is to coordinate a large number of smart grid actors (producer-, consumer-and storage systems) in a globally optimal way withoug having the vision of the whole system in a single controller. This is not a trivial task, since the following two coupling mechanisms link the behavior of the different actors with each other.

• An upper bound on the globally consumed power from the external grid may not be exceeded. This is a typical situation for a low-voltage smart grid which is connected with the medium-voltage grid through a transformer that has a limited capacity.

• In order to minimize the energy bill of the smart grid, it is desirable to consume the locally produced renewable energy locally within the smart grid, rather than selling it to the external grid. Different reasons may motivate this objective. In the case where the remuneration for selling energy to the grid is lower than the price for buying the same amount of energy, it is economically more beneficial to consume it locally. Other non-monetary reasons are an increased independence from the external grid, an improved resilience and reliability of the power supply and the mitigation of power outages.

The chapter is organized as follows: In section 3.2 the model of the addressed smart grid will be presented. Section 3.3 provides the centralized MPC controller problem which is based on the previously described model. In the following two sections 3.4 and 3.5, the primal and dual decomposition frameworks which were devel- oped in chapter 2 will be applied to the centralized smart grid MPC problem. Finally, section 3.6 concludes the chapter.

Model description

In this section the smart grid system considered in this work is described in detail.

The system is composed of several buildings, batteries, renewable energy sources and electric vehicle charging stations. Moreover a single connection with the external electricity grid is assumed as illustrated in figure 3.1.

While in the traditional grid, all these sub-systems would have been operated independently from each other, the objective in this work is to control them in a coordinated manner such that a globally better behavior is achieved. More precisely, the following objectives will be addressed by the MPC scheme described in section 3.3:

• Respect an upper bound on the globally consumed energy/power from the external grid.

• Reduce the overall electricity bill by increasing the consumption of locally produced renewable energy within the scope of the smart grid and by optimally exploiting variable energy tariffs.

In the following the models of the different sub-systems are introduced.

Building model

Buildings represent an important part of the electric energy consumption. According to [IEA 2011b], households and tertiary buildings together account for 40% of the world-wide primary energy consumption.

Model description

During the last decade many innovative MPC-based control strategies have been proposed for buildings. In [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] a DMPC controller is proposed where each zone of a building is controlled by an individual zone controller, exchanging some information with a coordinator layer which is in charge of the overall optimization at building level. Through simulations the authors show that the energy consumption can be reduced by 15% compared to a standard controller. [START_REF] Oldewurtel | Use of model predictive control and weather forecasts for energy efficient building climate control[END_REF] investigates how MPC and weather forecasts can increase the energy efficiency for several representative European buildings, while respecting the occupant comfort. Moreover they propose a Stochastic MPC formulation allowing to further reduce the risk of comfort related constraints violations. For further references regarding MPC for buildings, the reader is referred to the review paper [START_REF] Afram | Theory and applications of HVAC control systems-a review of model predictive control (MPC)[END_REF] which classifies the most common building control strategies in a comprehensive manner.

While building modeling is a crucial aspect for the good performance of building MPC schemes, the focus in this work is more on how the building MPC controller integrates into the smart grid. For this reason the following simple discrete linear model is assumed to represent the thermal dynamics of a building:

ϑ + = ϑ + σ c (ϑ ext -ϑ) + η c P (3.2.1)
where ϑ is the indoor temperature, ϑ + is the indoor temperature at the next time sample, ϑ ext is the outdoor temperature and P is the controllable thermal heating/cooling power. The coefficients σ, η, c are the ambient conductivity coefficient, the heating/cooling efficiency and the heat capacity respectively.

Please note that this simple building model can be replaced by a more realistic one without putting the performance of the two distributed MPC frameworks which were proposed in the previous chapter into question. Indeed, the simulation results provided in our paper [START_REF] Pflaum | Comparison of a primal and a dual decomposition for distributed MPC in smart districts[END_REF], are based on the more complex building models and their corresponding MPC controllers developed in [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]].

Battery model

Battery storage systems can be represented by the following discrete switched system equation:

E + = E + τ • η(P Bat ) • P Bat with η(P Bat ) =        η + if P Bat ≥ 0 1/η -otherwise (3.2.2)
where E is the stored energy in the battery, P Bat is the battery charging power and τ is the sampling period. η(P Bat ) represents the efficiency of the charging-and discharging process with constants η + , η -∈ ]0, 1]. Note that although no other effects such as self-discharging or battery aging are included in the model, this kind of extension could be added if desired. The only restriction however is that the additional terms must be linear or at least such that the model can be implemented in a convex optimization problem formulation. [START_REF] Desdouits | Multisource elevator energy optimization and control[END_REF] for instance models the battery aging through a linear term which is proportional to the absolute value of the charging/discharging power. A good review of the most common battery technologies and their applications in the context of power systems is provided by [START_REF] Divya | Battery energy storage technology for power systems -an overview[END_REF]. For more detailed information on battery modeling, the reader is referred to [START_REF] Castano | Dynamical modeling procedure of a li-ion battery pack suitable for real-time applications[END_REF] where a model of a Li-Ion battery pack is presented and experimentally validated.

EV charging station model

Electric vehicle charging stations (EVCS) are considered to have an important impact on the electric grid of the future. They require a high amount of energy to recharge their batteries, but the moment when they actually connect to the grid for being recharged is highly uncertain. For this reason, integrating EVs into the electric grid is a challenging task. In chapter 6 we propose a stochastic energy management strategy which is specifically dedicated to dealing with the uncertainty in the EV behavior, even if only little online information is available. In contrast, in this part an EVCS will be considered as a sub-system of a smart grid where at each decision instant a forecast of the occupancy schedules of all charging points of the station is available. This energy management system has recently been deployed on the "Euref Campus" [Euref Campus 2016] in Berlin as part of a centralized MPC controller. Apart from an EVCS of 10 charging points, this MPC controller is also in charge of managing a battery and a PV installation.

For the EVCS, the forecasted occupancy schedules can be described as follows:

S := {t arr,v , t dep,v , E req,v } v∈V (3.2.3)
where V := {1, ..., N EV } is the set of N EV vehicles connecting to the charging station during the considered prediction horizon. t arr,v , t dep,v are the arrival-and departure times of the v-th vehicle and E req,v is the required energy which should be supplied to the v-th vehicle's battery during its connection period [t arr,v , t dep,v ].

For each vehicle v ∈ {1, ..., N EV } connecting to the charging station, one battery model is associated as follows:

3.3. Centralized MPC controller E + v = E v + η • τ • P Bat,v with P Bat,v ≥ 0 (3.2.4)
and the global power consumption of the charging station is

P EVCS = N EV v=1 P Bat,v (3.2.5)
Note that the model of the EVs' batteries is similar to the one for the battery described in the previous section (see eq. (3.2.2)). However the EV batteries cannot be discharged, meaning that we do not consider V2G (vehicle-to-grid) technology in this work.

Renewable energy sources

Renewable energy sources such as photovoltaic panels and wind turbines are assumed to be non-controllable, meaning that they are taken into account in the control scheme through their power production forecasts P only.

The quality of prediction models for renewables plays a crucial role for the good performance of MPC control solutions in the context of smart grids. However, this forecast modeling aspect is not further investigated in this work, since previous studies amongst which [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] demonstrated the robustness of similar MPC solutions w.r.t. forecast uncertainties. In the sequel, the assumption is made that forecasting modules providing satisfying results are available.

The interested reader is referred to [START_REF] Foley | Current methods and advances in forecasting of wind power generation[END_REF][START_REF] Inman | Solar forecasting methods for renewable energy integration[END_REF] where stateof-the-art techniques in solar and wind power forecasting are reviewed and classified.

Centralized MPC controller

In this section the optimization problem of the centralized MPC controller for the smart grid is presented. As already mentioned, the objective of the controller is to supply the required energy to the sub-systems at a minimal cost, while delivering the required service (thermal comfort in buildings, charging of electric vehicles,...). Moreover we aim to guarantee that a limit on the globally consumed electric power from the grid is not exceeded. The optimization problem (3.3.1) of the centralized MPC controller implements these objectives. Recall that in this section, boldfaced symbols represent profiles of the corresponding variable over the prediction horizon sampled at τ (typically τ = 15 minutes and a horizon length of 24 hours, resulting in H = 96 discrete time samples).

Chapter 3. Resource sharing problem in the smart grid context

Minimize Γ T • P G (3.3.1a) Γ =        Γ + if P G ≥ 0 Γ -otherwise (3.3.1b) P G = l∈S P l (3.3.1c) P G ≤ P G (3.3.1d) h l (x l , u l , P l ) ≤ 0 ∀l = {1, ..., N S } (3.3.1e)
where P G is the power profile from/to the external grid and P l is the consumed/produced power profile of the l-th sub-system. P G is the upper limit on the globally consumed power from the grid P G . The generic constraint (3.3.1e) represents the local constraints of each of the N S sub-systems. These local constraints will be detailed in the following sections for the different types of sub-systems.

Remark: While the generic centralized problem (2.2.5) provided in section 2.2.2 contained cost function terms of the different sub-systems, these terms don't appear in the centralized MPC problem 3.3.1 of the smart grid system which we address in this section. This is due to the fact that the considered objective is the cost of the globally consumed energy from the grid which is expressed in the global objective term (3.3.1a). Note however that any additional local objective term could be added without a problem.

In the following sections 3.3.1 -3.3.4, the local constraints h l (x l , u l , P l ) ≤ 0 of the different types of sub-systems will be described in detail.

Building constraints

Each building is represented by a set of constraints (3.3.2) which have to be added to the centralized MPC controller (3.3.1) if the l-th sub-system is a building:

ϑ = Z(ϑ 0 , P, ϑ ext ) (3.3.2a) ϑ ≤ ϑ ≤ ϑ (3.3.2b) P ≤ P ≤ P (3.3.2c)
where Z is the building simulator that implements equation (3.2.1) over the prediction horizon. Note that it can easily be implemented through linear equality constraints.

ϑ 0 is the currently measured indoor temperature or in other words the initial state of the system). The constraints (3.3.2b) represent the thermal comfort constraints in the building. More precisely, thermal comfort is achieved if the indoor temperature profile ϑ lies within the predefined lower-and a upper bound temperature profiles ϑ and ϑ. This is further illustrated in figure 3.2. Finally the constraints (3.3.2c) represent the lower-and upper bounds on the control variable which is the thermal power profile P.

In building MPC controllers it is common practice to implement the comfort bounds (3.3.2b) as soft constraints as it is discussed in [START_REF] Radecki | Self-excitation: An enabler for online thermal estimation and model predictive control of buildings[END_REF][START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]]. In this case, additional terms which represent the penalty for violating the corresponding constraints have to be added to the cost function (3.3.1a). In the case of the distributed MPC frameworks, these terms appear in the sub-systems' cost functions. The reason for this kind of implementation is to guarantee feasibility for any initial system state. This practice is also followed in our implementation. Figure 3.3 illustrates how this is realized (note that the figures 3.2 and 3.3 are extracted from [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] which strongly influenced the building MPC implementation in this work).

Battery constraints

Each battery sub-system is represented by the following set of constraints:

ρ 1 y ρ 0 y δ y δ y ρ 0 < ρ 1 J C (y)
E = E 0 + τ • η + • Φ • P + -τ • (1/η -) • Φ • P - (3.3.3a) E ≤ E ≤ E (3.3.3b)
P ≤ P ≤ P (3.3.3c)

P = P + -P - (3.3.3d) P + , P -≥ 0 (3.3.3e)
where E is the charged energy profile, E 0 is the current measured charged energy, i.e. the initial system state. P + and P -are profiles which contain respectively the positive and the negative elements of P. Thanks to these additional variables, the switching characteristic of the battery model can be expressed through linear constraints. Φ ∈ R H×H is a lower triangular matrix which represents the discrete time integration of the charged/discharged power over the prediction horizon, resulting in the charged energy profile E. It is defined as follows:

Φ :=          1 0 0 . . . 0 1 1 0 . . . 0 . . . . . . . . . . . . . . . 1 1 1 . . . 1          (3.3.4) 3.3.
B v [kWh] B v [kWh] E v [kWh]
Figure 3.4 Illustration of feasible charging profiles for an EV which is connected to the charging station from 9am to 17pm. Any profile E v of supplied energy to the battery (red) that lies in between the profiles B v , B v satisfies the vehicle's charging needs.

EVCS constraints

Based on the EVCS model described in section 3.2.3, the following profiles over the prediction horizon can be defined for each vehicle v ∈ {1, ..., N EV }:

P max,v :=    P max, Ev if t arr,v ≤ t < t dep,v 0 otherwise (3.3.5) B v :=    0 if 0 ≤ t ≤ t arr,v E req,v if t > t arr,v (3.3.6) B v :=    0 if 0 ≤ t < t dep,v E req,v if t ≥ t dep,v (3.3.7)
where P max, Ev is the maximal battery charging power. Forecasts of E req,v , t arr,v and t dep,v are supposed to be available. Figure 3.4 illustrates the profiles B v and B v . It also shows several feasible profiles of the supplied energy to the EV's battery (in red), which illustrate the EVs' high potential as flexible loads.

Given these definitions, the local constraints of the EVCS become

P EVCS = N EV v=1 P Bat,v (3.3.8a) E v = η • τ • Φ • P Bat,v ∀v = {1, ..., N EV } (3.3.8b) 0 ≤ P Bat,v ≤ P max,v ∀v = {1, ..., N EV } (3.3.8c) B v ≤ E v ≤ B v ∀v = {1, ..., N EV } (3.3.8d)
where E v is the profile of energy charged into the battery of the v-th vehicle and P Bat,v is the charging power profile of the v-th vehicle. P EVCS is the total power consumption profile of the charging station. Constraint (3.3.8b) implements the battery model with the constant charging efficiency η, the sampling time step τ and Φ being a lower triangular matrix with all elements equal to 1 as defined by (3.3.4) in the previous section. The constraints (3.3.8c) and (3.3.8d) represent respectively the lower-and upper limits on the charging power profiles and on the profiles of the charged energy into the EVs' batteries.

Renewable energy source constraints

Renewable energy sources such as wind turbines or photovoltaic panels are considered to be non-controllable, meaning that they are only taken into account through their power production forecast. Nevertheless the corresponding trivial constraint for such renewable energy source sub-systems are provided by (3.3.9). The reason for explicitly stating this constraint is that in the sections 3.4, 3.5, modifications of this constraint in order to be compliant with the dual-and primal decomposition frameworks will be presented.

P = P (3.3.9)
where P is the power production profile and P is the forecasted power production profile. Note that for some renewable energy plants it is required to reduce the actually injected power P from time to time in order to avoid grid instabilities. This kind of control could easily be taken into account in the above formulation by replacing the equality constraint (3.3.9) by an inequality.

Primal decomposition

In this section the primal decomposition approach introduced in chapter 2 is applied to the centralized MPC controller (3.3.1). Recall that the principal motivation for decomposing the problem is the large size of the centralized problem in the case where many sub-systems are present.

The centralized controller (3.3.1) is divided into one master problem and several sub-problems (one for each sub-system). In the following, the master-and the subproblems are provided with a special emphasis on how the sub-problems must be formulated to guarantee feasibility for whatever power profile P l is allocated to them by the master.

Recall that in the primal decomposition framework the master problem consists in determining the optimal feasible resource allocation for each of the sub-systems without any knowledge of the nature of the different sub-systems. Based on the master 3.4. Primal decomposition problem (2.3.6) from the generic primal decomposition framework, the master problem corresponding to the smart grid MPC controller (3.3.1) is as follows:

Minimize {P l } l∈S l∈S J l (P l ) + (Γ + ) T • P G,cons -(Γ -) T • P G,prod (3.4.1a)
Subject to: P G ≤ P G (3.4.1b)

P G = l∈S P l (3.4.1c) P G = P G,cons -P G,prod (3.4.1d) P G,cons , P G,prod ≥ 0 (3.4.1e)
At each iteration of the solution method, namely the bundle method described in section 2.4, the sub-system controllers receive a power profile P l from the master, solve their local sub-problem MPC l (P l ) and return their resulting objective value J l (P l ) and a sub-gradient g l (P l ) ∈ ∂J l (P l ) to the master.

Since the principle of the DMPC scheme is that the master is not aware of the physical constraints of the sub-systems, the sub-problems must be formulated in such a way that they are feasible for any power profile P l which is allocated to them by the master. In the following sections, the sub-problem formulations of the local MPC controllers fulfilling this requirement are provided.

Building sub-problem (primal)

In order to guarantee the feasibility of the building sub-problem for whatever P l is imposed by the master, the upper-and lower bounds on the building's consumed power profile (3.3.2c) and on its indoor temperature profile (3.3.2b) must be implemented as soft constraints. This is achieved by introducing additional slack variables. The resulting sub-problem becomes then:

MPC(P) := Minimize ϑ,z 1 ,z 2 ,z 3 ,z 4 m T (z 1 + z 2 + z 3 + z 4 ) (3.4.2a) Subject to: ϑ = Z(ϑ 0 , P, ϑ ext ) (3.4.2b) ϑ + z 1 ≥ ϑ , ϑ -z 2 ≤ ϑ (3.4.2c) P + z 3 ≥ P , P -z 4 ≤ P (3.4.2d) z 1 , z 2 , z 3 , z 4 ≥ 0 (3.4.2e)
where z 1 , z 2 , z 3 , z 4 are the slack variables and m ∈ R H is a vector of high linear weights, leading to a high cost value if one of the constraints is not respected for Chapter 3. Resource sharing problem in the smart grid context an imposed power profile P.

Remark:

In a concrete implementation it may be desirable to apply different weights m 1 , m 2 , m 3 , m 4 to the violation of comfort constraints (z 1 , z 2 ) and power limit violations (z 3 , z 4 ). This is due to the fact that it may be acceptable to have an indoor temperature which is slightly outside the comfort bounds, while the limit on the HVAC power consumption is a physical constraint without any margin.

Battery sub-problem (primal)

In the same way as for the building sub-problem, the battery sub-problem is realized by introducing slack variables in order to guarantee its feasibility for any allocated power profile P:

MPC(P) := Minimize P + ,P -,E,z 1 ,z 2 ,z 3 ,z 4 m T (z 1 + z 2 + z 3 + z 4 ) (3.4.3a) Subject to: E = E 0 + τ • η + • Φ • P + -τ • (1/η -) • Φ • P -(3.4.3b) E + z 1 ≥ E , E -z 2 ≤ E (3.4.3c) P + z 3 ≥ P , P -z 4 ≤ P (3.4.3d) P = P + -P - (3.4.3e) P + , P -≥ 0 (3.4.3f) z 1 , z 2 , z 3 , z 4 ≥ 0 (3.4.3g)

EVCS sub-problem (primal)

For the EV charging station, instead of introducing slack variables to soften all hard constraints, a slightly different approach is chosen to guarantee feasibility for any 3.4. Primal decomposition allocated power profile P. The resulting sub-problem is as follows:

MPC(P) := Minimize

P EV CS ,z 1 ,z 2 ,{P Bat,v ,Ev} v∈V m T (z 1 + z 2 ) (3.4.4a)
Subject to:

P EVCS = N EV v=1 P Bat,v (3.4.4b) E v = η • τ • Φ • P Bat,v ∀v ∈ V (3.4.4c) 0 ≤ P Bat,v ≤ P max,v ∀v ∈ V (3.4.4d) B v ≤ E v ≤ B v ∀v ∈ V (3.4.4e) P EV CS + z 1 ≥ P , P EV CS -z 2 ≤ P (3.4.4f) z 1 , z 2 ≥ 0 (3.4.4g)
where the slack variables z 1 , z 2 are the distance of the feasible power consumption profile P EV CS from the power profile P that was allocated by the master. In the case where the allocated power profile P does not allow to satisfy all EVs' energy demands, then z 1 takes positive values and results in a high local cost value due to the strong linear weight m. On the other hand, if the master allocates too much power P to the EVCS which cannot be charged into the EVs' batteries at certain time samples, then z 2 takes positive values which results in an increased local cost function.

Renewable energy source sub-problem (primal)

The sub-problems of the renewable energy resource sub-systems are obtained by introducing slack variables which represent the distance of the allocated power profile P from the forecasted power production profile P. The resulting local optimization problem for renewable energy source sub-system becomes then:

MPC(P) := Minimize z 1 ,z 2 m T (z 1 + z 2 ) (3.4.5a) Subject to: P + z 1 ≥ P , P -z 2 ≤ P (3.4.5b) z 1 , z 2 ≥ 0 (3.4.5c)
As mentioned before, the controller of the renewable energy source does not have any degree of freedom and can be considered to be trivial. Alternatively, one could have gathered the predictions of all renewable energy source sub-systems at the master level and integrated them directly into the master problem constraints. Nevertheless, we implement each renewable energy source sub-system as an individual MPC controller to demonstrate that any sub-system (controllable or not) can be integrated into the distributed framework without any knowledge of the sub-system's nature at coordinator level. Moreover we mentioned in section 3.3.4 that the produced power of the renewable energy source could be curtailed at certain time instants by its local MPC controller. In this case, the renewable source sub-system become controllable just like the others.

Dual decomposition

In this section the dual decomposition framework described in section 2.3.2 is applied to the centralized controller problem (3.3.1). As mentioned before, applying dual decomposition to solve a centralized optimization problem requires that the problem is strictly convex. This is quite a strong assumption which is not fulfilled by the centralized controller problem (3.3.1) which we aim to solve. In fact, if the dual decomposition was applied directly to the centralized problem which is only convex but not strictly convex, then there would be no guarantee that the duality gap becomes zero after convergence. Therefore it would not be guaranteed that the coupling constraints (3.3.1d), i.e. the upper bound profile on the global power consumption, was respected. This has been demonstrated in [START_REF] Pflaum | Comparison of a primal and a dual decomposition for distributed MPC in smart districts[END_REF] where we applied the dual decomposition approach to the convex building MPC problem proposed by [Lamoudi, Alamir & Béguery 2012, Lamoudi, Alamir, Béguery et al. 2012]. We showed that the duality gap between the primal and the dual solution does not reduce to zero and that the global power limitation is not strictly respected after convergence.

In further investigations it turned out that it is possible to overcome this problem by slightly modifying the sub-problems to enhance strict convexity of the subproblems. It is important to note however that this comes at the price of slightly modifying and degrading the solution of the optimization problem. In the following, the master-and the sub-problems with their modifications to become strictly convex are described. The crucial point with the introduced modifications is that they have to be chosen and tuned in such a way that they degrade the resulting controller's performance as little as possible compared to the solution of the initial centralized controller (3.3.1). In chapter 4 we show that this is actually the case for the smart grid problem addressed in this work.

The dual master problem corresponding to the centralized MPC controller (3.3.1) is provided in the following. It is the direct transcription from the general case (2.3.13)

Dual decomposition

which was developed in the previous chapter.

Maximize

λ,µ l∈S J l (λ, µ) -λ T • P G (3.5.1a) Subject to: λ ≥ 0 (3.5.1b) 0 ≤ µ ≤ Γ + -Γ - (3.5.1c)
While in the centralized optimization problem and in the primal master problem the energy purchasing tariff Γ + appeared at the master level, it is transferred into the sub-problems' cost function terms J l (λ, µ) in the dual decomposition framework. This will become clear in the following, where the local MPC controllers for the different sub-systems are described. To clearly understand why Γ + ends up in the subproblems, the reader is also invited to re-read section 2.3.2 where the dual decomposition framework is developed and to specifically focus on this point.

Building sub-problem (dual)

The building MPC controller in the dual decomposition framework is as follows:

MPC(λ, µ) := Minimize P,ϑ,dP,z 1 ,z 2 (Γ + + λ -µ) T • P + ρ 1 z T 1 z 1 + ρ 1 z T 2 z 2 + ρ 2 dP T dP (3.5.2a) Subject to: ϑ = Z(ϑ 0 , P, ϑ ext ) (3.5.2b) ϑ + z 2 ≥ ϑ ϑ -z 1 ≤ ϑ (3.5.2c) P ≤ P ≤ P (3.5.2d) dP = P i -P i-1 ∀ i = {2, ..., H} (3.5.2e) z 1 , z 2 ≥ 0 (3.5.2f)
where z 1 and z 2 are slack variables which become positive in case the indoor temperature profile ϑ takes values beyond its lower-and upper bounds ϑ and ϑ. If this is the case, a quadratic penalty which is weighted with the scalar parameter ρ 1 applies. Moreover a quadratic penalty on the rate of variations dP of the consumed power profile P is added.

The quadratic terms in the objective function (3.5.2a) were introduced with the purpose of making the problem strictly convex. While the quadratic penalty on the comfort violations do not have a negative effect on the performance of the controller in comparison with the initial centralized controller (3.3.1), the penalty term ρ 2 dP T dP on the rate variations does, if the parameter ρ 2 is not tuned properly. In fact, the objective of this term is to make the solution of the problem unique by privileging profiles with less strong variations from one time step to another. If ρ 2 was chosen too high however, this quadratic term would predominate the linear energy cost term and the resulting solution would be degraded compared to the initial centralized controller. On the other hand, if it was chosen too small, the desired effect of enhancing the convergence of the dual decomposition framework to a feasible globally optimal solution might not be achieved.

Battery sub-problem (dual)

Similarly as for the building, the battery MPC controller for the dual decomposition framework contains a quadratic penalty on rate variations dP of its power profile P in order to enhance strict convexity of the sub-problem. Moreover, the energy tariff profile Γ + and the dual variables λ and µ appear in the objective function as a linear weight on the consumed power of the charging station in a similar way as for the building sub-problem. MPC(λ, µ) := Minimize P,P + ,P -,E,dP

(Γ + + λ -µ) T • P + ρ dP T dP (3.5.3a) Subject to: E = E 0 + τ • η + • Φ • P + -τ • (1/η -) • Φ • P -(3.5.3b) E ≤ E ≤ E (3.5.3c)
P ≤ P ≤ P (3.5.3d)

P = P + -P - (3.5.3e) dP = P i -P i-1 ∀ i = {2, ..., H} (3.5.3f) P + , P -≥ 0 (3.5.3g)

EVCS sub-problem (dual)

The EVCS sub-problem's strict convexity is enhanced by adding a quadratic penalty on rate variations of each EV's charging profile P Bat,v .

Conclusion

MPC(λ, µ) := Minimize

P EVCS ,P Bat,• ,dP Bat,• ,E• (Γ + + λ -µ) T • P EVCS + N EV v=1 ρ dP T Bat,v dP Bat,v (3.5.4a) Subject to: P EVCS = N EV v=1 P Bat,v (3.5.4b) E v = η • τ • Φ • P Bat,v ∀v = {1, ..., N EV } (3.5.4c) 0 ≤ P Bat,v ≤ P max,v ∀v = {1, ..., N EV } (3.5.4d) B v ≤ E v ≤ B v ∀v = {1, ..., N EV } (3.5.4e) dP Bat,v = P i Bat,v -P i-1 Bat,v ∀ i = {2, ..., H}, ∀ v = {1, ..., N EV } (3.5.4f)

Renewable energy source sub-problem (dual)

Remind that the idea of the distributed framework is to avoid any visibility of a subsystem's nature at the master level. For this reason, even though the renewable energy source sub-system does not have any degree of freedom, a local MPC controller is created which interacts in exactly the same way with the coordinator as the ones from the building, the battery and the EVCS:

MPC(λ, µ) := Minimize P (Γ + + λ -µ) T • P (3.5.5a)
Subject to: P = P (3.5.5b)

Note that at each negotiation iteration between the master and the sub-problem, the local MPC controller (3.5.5) returns the same power consumption profile P = P to the master, but the returned objective value changes with the dual variables λ and µ obtained from the master.

Conclusion

In this chapter we described the smart grid problem which is addressed in this work in detail. It is to control a number of sub-systems in a smart grid with decoupled dynamics, but with a coupling constraint and with a coupling objective. More precisely, the coupling constraint is a limitation on the global electric power consumption in the smart grid and the coupling objective is to reduce the cost of the pursued energy from the external grid.

The proposed centralized MPC controller requires solving a large-scale optimization problem which can be difficult to be achieved in reasonable time, especially when the number of sub-systems is high. Moreover other reasons such as privacy considerations, robustness and modularity of the controller motivate the development of distributed methods to solve the initial centralized optimization problem.

Having defined the centralized MPC controller, the two distributed MPC frameworks which have been proposed in chapter 2 are applied. The first one is based on a primal decomposition, and the second one on a dual decomposition of the initial centralized optimization problem. Both frameworks have in common that the problem is divided into one master problem and many sub-problems which correspond to the local controllers of the sub-systems. For both distributed frameworks, the subsystem controllers had to be built in such a way that they guarantee the convergence and the feasibility of the overall framework. For the dual decomposition framework, this needs some additional terms to be introduced at the sub-system level in order to enhance strict convexity which is required to guarantee the convergence of the framework. It is important to note that if these additional terms are not tuned properly, then a non-negligible degradation of the controller performance can be encountered. In the primal framework, it is important that in the local MPC controllers some initially hard constraints are transformed into soft ones in order to guarantee feasibility during the iterative solution process. This however does not have a degrading effect on the controller's performance.

Finally, before moving on to the next chapter, where the performance of the proposed distributed MPC frameworks is assessed through simulations, some comments regarding the chosen decomposition methods are made:

• In both, the primal-and the dual decomposition framework, no knowledge of the underlying sub-systems' nature is included at the master level. In other words, the master is not aware whether a certain sub-system is a building or a wind turbine. This was one of the initial requirements for the developed decomposition frameworks and it could be entirely achieved.

• Both the primal and the dual decomposition frameworks rely on a hierarchical decomposition of the centralized problem. This is a suitable approach for the addressed smart grid problem, where the only coupling between the subsystems is through the sum of their power consumption/production profiles. If one aimed at including network capacity constraints of the distribution grid or any other coupling between certain groups of sub-systems, the scalability of the provided frameworks would be more limited. This is due to the fact that additional coupling between sub-systems results in additional variables and constraints in the master problem, whose complexity would eventually become unmanageable. To overcome these limitations, one way is to group several coupled sub-system in a common MPC controller, such that the coupling would not be

Conclusion

visible at the master level. If this is not possible, for instance because of data privacy issues, other distributed optimization methods may be suitable. For instance ADMM (Alternating Direction Method of Multipliers) has been successfully applied to smart grid energy management problems such as in [START_REF] Kraning | Dynamic network energy management via proximal message passing[END_REF][START_REF] Ma | On distributed charging control of electric vehicles with power network capacity constraints[END_REF]]. Compared to dual decomposition, ADMM has the advantage that it only requires the centralized problem to be convex. A potential drawback of the method is its convergence speed which can be slow if one is looking for a precise solution [START_REF] Boyd | Distributed optimization and statistical learning via the alternating direction method of multipliers[END_REF]]. Moreover our applied bundle method with its possibility to memorize the cutting plane models of the subproblems from one time step to another is not possible with the ADMM method.

For this reason, our proposed primal and dual decomposition frameworks are likely to require significantly less iterations in closed-loop than it would be the case with ADMM.

• As already mentioned in the previous chapter, the appealing feature of the dual decomposition framework lies in the exchanged price information between the master and the sub-systems, which naturally provides an interesting economic interpretation. This very nice feature however comes at the cost of the technical requirement that all sub-problems must be strictly convex which cannot be achieved without a certain controller performance degradation. The provided primal decomposition framework allows to overcome this technical limitation, but in this case the information exchange between the master-and the local controllers is of a more technical nature and is difficult to be interpreted from an economical perspective. Finally, another advantage of the dual decomposition framework over the primal one is that the dimension of the variables in the master problem is independent of the number of sub-systems. In primal decomposition the dimension increases linearly with the number of sub-systems which can result in quite costly computations for the master problem when the number of sub-systems becomes high.

Chapter 4

Numerical & real-life validation

In this chapter the proposed primal and dual DMPC strategies described in the previous 2 chapters are validated through simulations. More precisely, the implementation in the smart grid energy management context which was described in detail in chapter 3 is assessed through simulations.

While the main focus in this chapter is on validating the proposed algorithms through simulations, several real-life implementations have been realized in the scope of the European project "Ambassador" lead by Schneider Electric. The reason for focusing more on the validation through simulations is due to the fact that the key characteristic of the proposed approach which is its scalability, cannot be assessed on the available test sites which are of rather small dimension. Nevertheless a discussion of the real-life implementations is provided at the end of this chapter.

The chapter is organized as follows: In section 4.1 the performance of the proposed DMPC controllers in closed loop is demonstrated. Moreover, the fact that the primal and the dual decomposition approaches lead to equivalently good results as the centralized controller is shown. In section 4.2 the scalability of the proposed DMPC approach is demonstrated. Section 4.3 provides a convergence analysis with a focus on the impact of the aggregation level in the bundle method. In section 4.4 two real-life implementations of the proposed algorithms are provided. Finally section 4.5 concludes the chapter.

Validation of the distributed MPC approaches

Validation through closed-loop simulations

In this section the performance of the proposed distributed control schemes is demonstrated through closed-loop simulations. For this purpose a smart district composed of 10 buildings, 3 batteries, 1 EVCS with 20 charging points and 2 PV installations is considered. Table 4.1 provides the detailed district configuration. It is assumed that selling energy to the grid is not possible, meaning that Γ -= [0, 0, ..., 0] T . The energy tariff profile Γ + for purchasing energy from the grid is depicted in figure 4.1. It is a typical peak-/off-peak tariff policy which can be found in France for instance. Moreover an upper bound on the global power consumption due to a limited transformer capacity is assumed to be P G = 75 kW.

Since the primal and dual decomposition approaches lead to equivalently good performances (which will be confirmed experimentally in section 4.1.2), detailed closed-loop simulation results are presented only for the dual decomposition scheme. This choice has been made, because it allows to illustrate very nicely how the dual variables λ and µ acting as a "virtual price", intervene in order to modify the sub-4.1. Validation of the distributed MPC approaches systems' behavior, such that global optimality is recovered.

Throughout the whole chapter, the MPC controllers use a prediction horizon of 24 hours, sampled at a 15 minutes time-step. This leads to a relatively high number of variables and constraints in the MPC controllers, since all profiles consist of 96 discrete time samples. For instance, the local sub-problem (3.5.3) of the battery MPC controller has 480 variables and 287 linear constraints. The centralized MPC controller of the considered smart grid has around 20000 variables and 12000 constraints. Note however, that despite this high number of variables and constraints, a modern solver like gurobi [START_REF] Gurobi Optimization | Gurobi optimizer reference manual[END_REF] is able to solve this kind of problem in about 1.5 seconds on an up-to-date laptop.

Figure 4.2 shows the closed-loop simulation results of the dual decomposition scheme which was proposed in section 3.5. The simulated time interval is of two and a half days, i.e. 60 hours. The first plot shows the overall power consumption P G (red) in the smart district and the power consumption/production of all sub-systems. One can see that the transformer capacity limit P G (green) is respected almost all the time. The reason why one can observe slight violations of this upper bound in the period from 30h to 40h, is that the iterative process had not fully converged yet. This illustrates one major drawback of the dual decomposition approach which guarantees constraint satisfaction only after full convergence. In the second plot, the temperature evolution of 2 exemplary buildings and their comfort bounds are depicted. Note that for instance between 26h and 30h, building 1 uses its relatively high thermal inertia (compared to the inertia of building 2) to shift its energy consumption to an earlier instant. This way it contributes to respecting the power limit P G on the globally consumed power from the external electricity grid. The third plot shows the state-of-charge (SoC) evolution of the 3 batteries. A first observation is that the behavior of battery 1 differs from the other two batteries. The reason lies in its relatively bad efficiency (see table 4.1) which means that the battery is only activated if the economic benefit is significant enough. A second observation is that the batteries are typically charged during the off-peak hours from 23h -6h or when the PV panels produce more energy than what is consumed by the buildings and the EVCS (e.g. from 11h-14h). However, if it is necessary to anticipate a severe power shortage, the batteries are sometimes also charged during the on-peak period. This behavior can for instance be observed in the period from 32h-37h where the batteries are charged in order to be able to provide energy to the EVCS and the buildings from 38h-42h. This situation illustrates in a very obvious way why MPC controllers with their ability to anticipate future events are very well suited for energy management applications. The behavior of the EVCS is illustrated in the fourth and fifth plots where respectively the power P CP,• and the charged energy E CP,• of three randomly chosen charging points are shown. Typically the EVs are charged during the off-peak hours and -if possible -while the PV panels are producing energy. Moreover one

Scalability

for buying and selling energy from/to the grid may result in completely different quantities. Moreover, the configuration of the smart grid (types and sizes of the subsystems) has an important impact on whether considerable financial savings can be achieved or not.

One extensive case study which nevertheless provides a partial answer to this question is [START_REF] Bourry | Simulation for the evaluation of energy management algorithms at the district levelexample of use case from the AMBASSADOR project[END_REF] where the proposed dual decomposition framework was connected to a district simulation platform in order to evaluate the potentials of the proposed approach for an existing smart grid (located in Lavrion, Greece). An annual simulation of this system revealed an energy cost reduction of 17% when applying the proposed DMPC framework compared to a state-of-the-art controller based on expert rules. A similar energy cost reduction was also obtained in [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] for a building equipped with a battery and PV panels on its roof. Recall that in addition to energy cost reductions, the proposed DMPC frameworks also allow to respect global constraints on the power consumed from the external grid. Integrating this type of constraints in a rule-based controller would be very complicated.

Scalability

One important motivation for deploying distributed MPC approaches lies in their scalability. In smart grid energy management applications this is an important feature, since the more actors are being coordinated by a common master, the better becomes the to-be-expected performance of the system.

In order to demonstrate the scalability of our proposed approach, a smart grid composed of 1000 buildings is considered. Note that the corresponding centralized MPC controller comprises about 800 000 variables and it took 10 minutes to solve the centralized MPC problem. Figure 4.4 shows the open-loop result which was obtained with the dual decomposition approach. One can see that the upper bound on the global power consumption is perfectly respected. Moreover the optimal cost value is the same as the one obtained with the corresponding centralized MPC controller. Note also that solving the centralized optimization problem took around 10 minutes, while solving the distributed MPC problem can be achieved in about 5 seconds (in both cases Gurobi was used as solver). This very low computation time can be achieved, because it is possible to solve the 1000 building MPC problems in parallel. Recall equation (2.4.9) which serves to estimate the total time to solve the distributed optimization problem. Solving the master problem takes around t Master = 30ms and solving the building MPC problems in parallel takes around t Subsys = 80ms. If one assumes that the communication time between the master and the sub-systems can be neglected and that in average it takes around 50 iterations to converge to the optimal solution, then the following estimated time to solve the problem with the dual decomposition approach is obtained:

t total = n iter • (t Master + t Comm + t Subsys ) = 50 • (30ms + 0 + 80ms) = 5.5s

Convergence analysis

In this section the two DMPC schemes are analyzed more in detail with a focus on the convergence speed and the computational effort. Moreover, the impact of the aggregation level in the bundle method (see section 2.4) is assessed. Remind that the bundle method is used to efficiently solve the master problem in both schemes.

Impact of the bundle aggregation level

In section 2.4 we stated that with the disaggregated bundle method the computation time to solve the master problem can become very high. This results from the fact that each sub-system's objective function is approximated by an individual cutting plane approximation. We also mentioned that aggregated and semi-aggregated bundle methods are a way to overcome this issue. Recall section 2.4.2 for the detailed description. However, in general, these aggregated bundle methods require a higher number of iterations to converge to the optimal solution. In the following the impact of the aggregation level in the bundle method on the necessary number of iterations will be assessed for the primal and for the dual decomposition frameworks.

Dual decomposition framework

In the dual decomposition framework it turned out that the disaggregated and the aggregated bundle methods require the same number of iterations to converge to the optimal solution. Convergence was considered to be achieved when the difference of the cost value from the optimal value obtained with the centralized controller was less than 1% of the optimal value. For this reason, the best choice is to use the aggregated bundle method, because of its lower computation time to solve the master problem, as shown in table 4.2. The provided computation time measures are from the 1000 building example which was introduced in the previous section. The number of cuts n B per cutting plane model are fixed to n B = 6. The table shows how the computation time t Master increases quite importantly with the number N C of cutting plane approximations. Recall that N C = 1 means that all sub-problem cost functions are approximated by a single cutting plane model in the master problem.

Primal decomposition framework

In contrast to the dual decomposition framework, the required number of iterations to converge does increase in the primal decomposition framework when moving from a disaggregated towards a semi-aggregated or even fully-aggregated bundle method. Consequently, a more detailed analysis is necessary in this case, in order to determine the optimal aggregation level that results in the lowest total computation time of the scheme (recall section 2.4.3 where this principle is discussed in detail).

In the following a smart grid consisting of N S = 500 sub-systems (350 buildings, 70 batteries, 50 PV installations and 30 EVCS) is considered. Figure 4.5 shows the iterative convergence process in the primal decomposition framework for different aggregation levels of the cutting plane model. Recall that N C represents the number of cutting plane models in the master problem. If for instance N C = 10, then each cutting plane model represents an approximation of the sum of N B = N S /N C = 500/10 = 50 sub-system cost functions.

The figure shows that the disaggregated bundle method, where each sub-system's cost function is approximated by an individual cutting plane model in the master problem, converges fastest. The more sub-system cost functions are aggregated in one cutting plane model, the more iterations are required as one would expect. Moreover one can see that with the fully aggregated and with semi-aggregated methods with a high aggregation level, the algorithm does not converge to the global optimum at all. Recall section 2.4.3 where we discussed the fact that a trade-off between the precision of the cutting plane approximations and the computation time of the master problem has to be made. Figure 2.3 illustrated that there is an optimal bundle aggregation level that minimizes the total computation time of the scheme. work for a smart grid composed of 500 sub-systems. It shows that the more sub-system cost functions are aggregated in a common cutting plane model, the higher is the necessary number of iterations to converge to the global optimum.

While for the dual decomposition framework it turned out that the optimal bundle aggregation level is to simply use the fully aggregated bundle method, this is not the case for the primal decomposition framework where the number of iterations does increase for higher aggregation levels. Table 4.3 provides the estimated total computation time as a function of the number N C of cutting plane models in the master problem. It was again estimated using eq. (2.4.9). The necessary numbers of iterations n iter to converge to the optimum was obtained by fixing a threshold in figure 4.5 which is slightly above the global optimum and then to count the number of iterations it took until the objective value got below this threshold. The table shows that the aggregation level that results in the lowest total computation time t total is the one where N C = 25 cutting plane models are used in the master problem, each representing the linear approximation of the sum of N B = 20 sub-system cost functions.

Remark 1: Note that the reason why the number of iterations is quite high in this convergence study (n iter ≥ 150) is that the process was cold-started, meaning that the initial central point was very far from the final optimal point. This number reduces considerably when applying the scheme in closed-loop, since the optimal solution typically does not change a lot from one control instant to another and a warm-start can be performed by simply shifting the previous optimal profiles by one time-step. dual decomposition framework than in the primal decomposition framework. This is due to the fact that the number of variables in the master problem is independent of the number of sub-systems. For this reason, when the number of sub-systems becomes very high, the dual decomposition framework has a better computational efficiency.

Test-site implementation

In the scope of the European FP7 project "Ambassador" which is lead by Schneider Electric, the proposed dual and primal decomposition approaches for energy management in smart grids were implemented on two test-sites.

Figure 4.6 shows the two test sites which are situated at the INES 1 institute in Chambéry, France and in Lavrion, Greece. The INES test site consists of 4 buildings, 2 batteries, 1 EVCS and a PV system. On the Lavrion test site 2 office buildings, 1 battery, 1 PV system, 1 hydrogen storage system, 1 data center, 1 cafeteria and 1 small factory can be found.

On the Lavrion test site which is situated in Greece, the dual decomposition ap-1 Institut National de l'Energie Solaire proach has been implemented, while on the INES test site in Chambéry, France, the primal decomposition approach was chosen. For time reasons and due to other complexity factors of the real-life implementation we have not been able to test both decomposition frameworks on both sites. The architecture to deploy the algorithms is depicted in figure 4.7. The architecture scheme shows that the local MPC controllers and the coordinator are running on a same server in a same MATLAB instance. This architecture has been developed and implemented by Laurent Battini within the Ambassador project and I would like to stress the fact that this step from simulation to real-life has been a great technical challenge. While the distributed nature of the proposed DMPC frameworks would also allow to physically distribute the local MPC controllers, the choice to implement the entire DMPC algorithm framework on a single server situated in the Schneider Electric Cloud was made to avoid additional technological complexity. The scheme shows that the MATLAB instance running the algorithms is hosted by a platform called Rapid Analytics which is able to communicate with the exterior world through web-services. For each sub-system (building, battery, EVCS,...) one Automation server is installed physically on the test sites. It serves as a gateway to gather local information from the sub-system and to transfer it to the server in a regular manner. In the same way, control set-points computed by the algorithms in the cloud are returned to the automation server and transformed into the sub-system specific format. Moreover, additional web services such as local weather forecast services are accessed by the cloud-based algorithm execution platform.

Figure 4.8 shows a screenshot from the SCADA (Supervisory control and data acquisition) system of the INES test site. It shows the predicted optimal power profiles of the different sub-systems, as well as the global predicted power consumption profile "power" in blue. Moreover the state-of-charge evolution of the battery is plotted in red. One can see that from the current time 13:00 until 18:00 the battery is being charged, absorbing the PVs produced power which is not required by the consumers (4 buildings, a load bank and an EVCS) during this period. After that, during the evening hours the battery supplies this energy to the consumers such that less energy needs to be pursued from the external grid.

During the implementation phase of the DMPC framework on the test sites, several challenges were encountered and partially mastered. In the following the main challenges which may be a threat for the successful deployment of MPC-based energy management systems in the future are discussed.

• A reliable data acquisition process is an essential prerequisite for deploying efficient energy management systems. Missing or faulty data are a common and inevitable issue in SCADA implementations and can result in very inefficient control decisions. For this reason, a lot of effort is necessary to pre-process the acquired data before transmitting it to the MPC algorithms, such that an overall satisfying performance may be expected.

• Several sub-systems are more complicated to manage in reality than others. Especially MPC controllers for buildings require a deep understanding of the particularities of the to-be-controlled building. In many cases it may be a more robust alternative to assume a building to be non-controllable and to consider it only through a forecasting model which provides the building's forecasted power consumption to the DMPC scheme. • The obtained performance of MPC-based energy management systems depends a lot on the quality of forecasts. Forecasts intervene in nearly all sub-system controllers (buildings, renewable energy sources, EVCS,...). Although MPC controllers are able to recover prediction errors from one time-step to another, if a sub-systems forecast is constantly biased with some error, the overall behavior may become quite unsatisfactory. This effect has clearly been put into evidence on the INES test site. For instance, for the EVCS sub-system, the EV users were required to declare their EV to the station after their arrival and to indicate the current state-of-charge and the planned departure time. Often, the users forgot to do so and -considering the fact that the EVCS represents an important share of the load on the test site -the overall system behavior was very unsatisfactory.

Conclusion

In this chapter the DMPC frameworks described in the previous two chapters were validated through simulations. Furthermore experimental results from a test-site situated in Chambéry, France and practical issues encountered during the implementation phase were discussed.

The provided simulation results showed that the primal-and dual decomposi-tion frameworks lead to equally good results as the corresponding centralized MPC controller. Moreover the scalability of the proposed frameworks which cannot be achieved with the centralized controller, was demonstrated. In the dual decomposition framework, the scale of the system does not affect the time to solve the master problem at all. For this reason there is essentially no limit on the number of subsystems in the smart grid. In the primal decomposition framework however, the number of variables in the master problem increases linearly with the number of subsystems, which induces a limit to the scalability of the approach.

Concerning the bundle method which is used to efficiently solve the master problem, the effect of the aggregation level of the cutting plane models was explored. It turned out that in the dual decomposition framework it does not have any effect on the number of iterations and that consequently the aggregated bundle method which requires the smallest computation time, is the most efficient and should be chosen. For the primal decomposition framework however, an increasing number of iterations was observed when the number of sub-system cost functions which are aggregated in a common cutting plane model increases. For an exemplary smart grid composed of 500 sub-systems, the optimal aggregation level that minimizes the total computation time of the primal decomposition scheme was determined.

From a computational point of view, the dual decomposition framework should be chosen preferably, provided that it is acceptable to convexify the local MPC problems by adding a view quadratic terms in their objective functions. This is particularly the case when the number of sub-systems is very large, because the time to solve the primal master problem increases strongly with the number of sub-systems.

In future investigations we aim to assess the impact of the memory size of the bundles, that is, the number of hyperplanes per cutting plane model, on the total computation time.

Part

Problem statement

Uncertainties have an important impact on the performance of energy management systems in the context of smart grids. Nevertheless, also in the traditional grid, uncertainties and the necessity to deal with them were a major topic. But they were much less complex and pronounced in traditional grids and thus easier to deal with.

In fact, before the emergence of large amounts of renewable energy resources (especially wind power and photovoltaics) and the foreseeable deployment of electric vehicles at a large scale, uncertainties were mainly present in the load forecasts of consumers. The difficulty faced by the grid operators was to anticipate the uncertain consumption forecasts by optimally managing the production assets with the principal objective to assure the balance between power production and consumption.

The strong uncertainties which are inherent to intermittent renewable energy resources as well as to the behavior of electric vehicles represent a serious threat for the grid stability. In the following two chapters, two energy management systems are proposed which deal with this issue. The first one addresses uncertainties inherent to electric vehicle charging stations and the second one deals with uncertainties at photovoltaic power plants. Both methods rely on a stochastic optimization method called randomized algorithms. In this chapter the principle of this method is explained, before applying it in the following two chapters.

Robust design problem

Randomized algorithms provide a way to solve the following robust design problem:

min θ∈Θ J(θ) subject to g(θ, w) = 0 for all w ∈ W (5.1.1)
where θ ∈ Θ is a design parameter vector of dimension θ ∈ R n θ , J(θ) represents a cost to be minimized, W represents the uncertainty set, w is a realization of the uncertainty and the binary constraint satisfaction function g(θ, w) is defined by:

g(θ, w) :=    0 if θ meets control specifications for w 1 otherwise (5.1.2)
The objective of problem (5.1.1) is thus to determine a θ ∈ Θ which minimizes a certain performance measure J(θ) and which is feasible for all possible realizations of the uncertainty set w ∈ W. g(θ, w) is simply a measure whether for a chosen design 5.1. Problem statement parameter vector θ and a given realization of the uncertainty w, the desired control specifications are met.

Note that problem (5.1.1) is NP-hard, because there exists a potentially infinite number of uncertainty realizations w, and thus an infinite number of constraints. However, in order to deal with this issue, the problem can be recast as a probabilistic problem which can finally be solved by randomized algorithms in reasonable time. The principle of randomized algorithms is explained in detail in section 5.2.

The following two sub-sections describe how the EVCS-and the PV power plant problem which are addressed in the following chapters can be formulated as robust design problems.

Electric vehicle charging station problem

From the grid point of view, an EVCS can be considered like an electric load. In order to integrate such an EVCS into the grid, the DSO or any other entity which is in charge of managing the distribution grid requires a prediction of the EVCS's power consumption profile. Furthermore, if the EVCS was able to declare a day-ahead upper limit profile on its power consumption, this may be very valuable since it potentially enables the DSO to avoid power congestion problems in the distribution grid.

In chapter 6 an energy management system for an EVCS is proposed which has the following features:

• Provide a day-ahead upper limit profile on the EVCS's power consumption to the DSO.

• Strictly respect the declared upper limit profile on the EVCS's power consumption in real time.

• Despite the uncertain EV behavior, guarantee the EV customer satisfaction, i.e. charge the EVs' batteries with their required energy.

Clearly, if one declares a very conservative day-ahead upper limit profile on the EVCS's power consumption to the DSO, meaning that much more energy than actually required by the EV customers is reserved for the charging station, the customer satisfaction is always guaranteed. However, the realized power consumption profile of the EVCS will be very far from the one that was declared and the DSO may have trouble to maintain the balance between production and consumption.

This is where the robust design problem (5.1.1) comes into play. In fact, the problem of determining a day-ahead upper limit profile on the power consumption of the charging station that minimizes the reserved energy for the day while guaranteeing the customer satisfaction can be expressed under this form. More precisely,

• J(θ) represents the total reserved energy for the day. It is a function of the design parameter vector θ which allows to vary the shape of the day-ahead upper limit profile on the EVCS power consumption P lim (θ). • w ∈ W represents a realization of the uncertain 24h EVCS occupancy, denoted as a scenario in the sequel.

J(θ) =

• g(θ, w) represents the indicator function that evaluates whether for a given design parameter vector θ and scenario w, the customer satisfaction is guaranteed. As it will become clear in chapter 6, in order to evaluate g(θ, w), a real-time controller affecting P lim (θ) to the connected EVs is simulated and based on some metric, the resulting EV customer satisfaction is evaluated.

Photovoltaic power plant problem

The power production profiles of photovoltaic power plants are very difficult to forecast, since they strongly depend on the uncertain weather conditions. This makes it very difficult for grid operators to assure the equilibrium between production and consumption at all times. As a measure to overcome these issues, Energy Regulatory Boards of different countries have imposed regulations which force the plant operators to declare their day-ahead power production profiles to the DSO. If these previously declared power profiles cannot be realized, financial penalties are applied.

In this context we propose an energy management system for PV power plants with an associated battery storage, described in detail in chapter 7. The main idea is to determine the optimal parametrization of the PV plant's control strategy, taking into account the uncertainty due to the weather forecast as well as the regulations. The objective is to maximize a guaranteed lower limit on the to-be-expected revenue of the power plant.

Again, this problem can be expressed as a robust design problem (see pb. (5.1.1)):

• J(θ) represents the guaranteed lower limit on the to-be-expected revenue which we aim to maximize.

• w ∈ W represents one realization of the uncertain power production profile of the PV power plant.

• g(θ, w) represents the indicator function that evaluates whether for a given realization w of the uncertain PV power production profile and for a given control strategy parametrization θ, the realized revenue is above a certain threshold.

Randomized algorithms

In the previous section we mentioned that the robust design problem 5.1.1 is difficult to solve, since it is NP-hard. As stated in [START_REF] Alamo | Randomized methods for design of uncertain systems: Sample complexity and sequential algorithms[END_REF], there exist two approaches to overcome this difficulty. The first approach is to use deterministic relaxations of the original problem, which are usually polynomial time solvable, but which may lead to overly conservative solutions [START_REF] Scherer | LMI relaxations in robust control[END_REF]]. The second one is to assume that a probabilistic description of the uncertainty is available. In that case stochastic programming techniques [START_REF] Prékopa | Stochastic programming[END_REF]] and randomized algorithms [START_REF] Tempo | Randomized algorithms for analysis and control of uncertain systems: with applications[END_REF]] can be used to solve the problem in polynomial time. The idea underlying stochastic optimization is to compute a solution which is feasible for almost all possible realizations of the uncertainty and which maximizes the expectation of some function of the decision variables. The main idea of randomized algorithms is to determine a solution with probabilistic guarantees on their feasibility.

In the following two chapters, a version of randomized algorithms is applied which allows to solve problem 5.1.1 in the special case where the set of design parameter vectors Θ is of finite cardinality n C . In the following, the principle of randomized algorithms is explained for this special case.

Randomized algorithm for design sets of finite cardinality

Recall the robust design problem 5.1.1 which we aim to solve:

min θ∈Θ J(θ) subject to g(θ, w) = 0 for all w ∈ W with g(θ, w) :=    0 if θ meets control specifications for w 1 otherwise
Assume that the set of design parameter vectors Θ = {θ (1) , ..., θ (n C ) } is finite. The notion probability of violation formalizes the concept that, given a θ ∈ Θ, the constraint g(θ, w) = 0 is satisfied for a subset of W. The probability of violation is defined as

E(θ) := Pr W { g(θ, w) = 1 } (5.2.1)

Randomized algorithms

The power of randomized algorithms stems from the fact that the lower bound on the sample size (5.2.5) is relatively low and makes the solution of problem (5.2.4) computationally tractable. The mathematical derivation of this inequality is based on the binomial distribution. Further details are avoided in this thesis, but the interested reader can find it in [START_REF] Alamo | Randomized methods for design of uncertain systems: Sample complexity and sequential algorithms[END_REF] P max, CP maximal charging power which can be supplied by a charging point P max,v upper limit profile on the power supplied to the v-th vehicle B v , B v lower/upper limit profile on the energy supplied to the v-th vehicle b v profile of supplied energy to the v-th vehicle Γ energy tariff profile P (S) max maximal power consumption profile of the EVCS in scenario S B (S) , B (S) lower/upper limit profiles on the consumed energy in scenario S P opt, (S) optimal power consumption profile of the EVCS in scenario S P max (θ) parametrized maximal power profile of the EVCS B(θ), B(θ) parametrized lower/upper limit profiles on the consumed energy of the EVCS

Introduction

The foreseeable deployment of electric vehicles will have an important impact on the existing power grid. The high amounts of energy required to charge the EVs' batteries coupled with the uncertainty in their driving patterns may result in severe grid instabilities. Mainly voltage fluctuations due to temporal imbalances between production and consumption as well as cable-and transformer overloading in the low-voltage grid have been addressed in many recent studies concerning the integration of EVs into the existing power grid. The survey provided in [START_REF] Green | The impact of plug-in hybrid electric vehicles on distribution networks: A review and outlook[END_REF] suggests that the impacts of EVs can be determined by the following aspects: driving patterns, charging characteristics, charge timing and vehicle penetration. [START_REF] Galus | On integration of plug-in hybrid electric vehicles into existing power system structures[END_REF] discusses chances and challenges arising with the integration of EVs into the power grid with an emphasis on potential impacts on the activities of current actors in the electricity systems. In [START_REF] Clement-Nyns | The impact of charging plug-in hybrid electric vehicles on a residential distribution grid[END_REF]] the impact of EVs on the Belgium distribution grid is assessed using a dynamic programming model.

While to this day few real-life experiences regarding the EV integration at considerable scales have been conducted, many numerical studies have addressed this issue and the general conclusion seems to be that the existing electricity grid is able to accommodate high amounts of EVs without having to reinforce its physical infrastructure, provided that intelligent charging strategies are applied. [START_REF] Richardson | Optimal charging of electric vehicles in low-voltage distribution systems[END_REF] for instance shows that managing the charging process in a residential low-voltage network consisting of 134 residential customers in a central manner allows to replace 50% of the existing vehicles by electrical ones without violating network constraints.

Similar findings are reported by [START_REF] Lopes | Integration of electric vehicles in the electric power system[END_REF] where a centralized controller using simple rules allows an EV share of 52% while with a dumb charging strategy (each EV is charged at nominal power as soon as it is connected) no more than 10% can be achieved. [START_REF] Quiros-Tortos | Control of EV charging points for thermal and voltage management of LV networks[END_REF] even achieves an EV share of 100% for two simulated low-voltage networks in U.K. using a centralized controller based on simple proportional control.

Unlike the above mentioned papers, this work does not focus on network-related aspects, but on the predictability of charging stations' power consumption profiles and the impact of the uncertain EV behavior. In this context, several authors pro-

Introduction

pose control strategies where optimization problems over a certain prediction horizon are formulated, allowing to anticipate future events and to provide load predictions which are very valuable for DSOs. [START_REF] De Hoog | Optimal charging of electric vehicles taking distribution network constraints into account[END_REF] proposes a linear optimization problem formulation where an unbalanced distribution system is taken into account through a DC-equivalent model. [START_REF] Li | A new real-time smart-charging method considering expected electric vehicle fleet connections[END_REF] demonstrates the good performance of a receding-horizon controller aiming to optimally fill the over-night demand valley which does not only take into account currently connected EVs but also forecasts of EVs which are expected to arrive in the coming hours. In [START_REF] Jin | Optimizing electric vehicle charging: A customer's perspective[END_REF]] a centralized controller for an EV aggregator is proposed which computes charging schedules for the EVs such that the EV owners' charging costs are minimized while at the same time the aggregator maximizes its revenue by selling regulation capacities to the DSO. Other related works where forecasts of the uncertain EV behavior are taken into account are for instance [Bessa & Matos 2013c, Bessa & Matos 2013a, Bessa & Matos 2013b], where optimization problems for an aggregator agent acting as a commercial middle-man between the electricity market and the EV owners are proposed and validated through extensive simulations.

While in most works -amongst which the above cited ones -the robustness of the control strategies against uncertainties is validated through simulations, quite few works can be found where the uncertainty is explicitly considered in the computation of the control strategy. In [START_REF] Vayá | Smart charging of plug-in vehicles under driving behaviour uncertainty[END_REF] for instance a chance-constrained optimization problem is formulated which minimizes the charging costs while providing probabilistic guarantees of network loading limits and constraints related to the batteries. The work differs from the ones cited before in that it addresses the problem on the national scale of Switzerland and does not consider individual EVs, but an aggregated battery model. An interesting control approach is proposed in [START_REF] Iversen | Optimal charging of an electric vehicle using a markov decision process[END_REF] where a stochastic dynamic programming model is used to optimally charge an electric vehicle and where the user's individual risk-aversion is taken into account. In [START_REF] Pantos | Exploitation of electric-drive vehicles in electricity markets[END_REF]] a stochastic linear optimization algorithm considering several uncertainties related to the participation in the day-ahead energy and regulation reserve market is described.

Although a vast literature concerning electric vehicle charging exists, quite few contributions address the special case of EVCS situated on parking-lots close to commercial centers or company sites where one has to deal with a specifically significant stochastic behavior in the EV arrival and departure times. In fact, the majority of recent works are focused on over-night charging in residential areas. This may be explained by the fact that the majority of the time EVs are connected to the grid is during the night in residential areas as reported in [START_REF] Vayá | Smart charging of plug-in vehicles under driving behaviour uncertainty[END_REF]. Nevertheless two examples of contributions addressing EV charging at parking lots are the following: [START_REF] Zhang | Optimal management for parking-lot electric vehicle charging by two-stage approximate dynamic programming[END_REF] for instance proposes a two-stage approximate dynamic programming framework to deal with the high uncertainty while aiming to reduce the energy cost of the charging station. In [START_REF] Kuran | A smart parking lot management system for scheduling the recharging of electric vehicles[END_REF]] a centralized recharge scheduling system for parking-lots is proposed. The authors distinguish between regular EVs whose behavior is repetitive and can be predicted and irregular ones whose individual behavior is unpredictable.

We present a centralized charging strategy for an EVCS located at places such as commercial centers or company sites with relatively high uncertainties in the EVs' behavior. The motivation for the proposed strategy comes from the fact that reliable load forecasts of large consumers such as EVCSs are of great value for DSOs and other entities who are in charge of managing the grid in a reliable and economically profitable way. For instance in distributed optimization frameworks such as the ones presented in the chapters 2 and 3, a reliable load forecast of an EVCS is crucial to be able to coordinate the different grid actors (produces, consumers, storage systems) in a globally optimal way. Moreover, from an economical point of view, a more efficient grid operation may result in financial benefits for all actors who are involved, the DSO, the EVCS operator and the EV customers.

The main characteristics of our proposed EVCS management strategy are the following:

• A day-ahead profile of the upper limit on the EVCS's power consumption is provided to the DSO which is then strictly respected in real-time.

• At the same time the EV customer satisfaction is guaranteed at a configurable probability despite the potentially high uncertainties in the EV behavior. Note that a high probability for the guaranteed customer satisfaction leads to a higher over-estimation of the required energy which is reserved through the upper limit power profile.

• In real-time the control strategy does not require any forecasted information from the EV customers such as arrival-and departure times.

The underlying technique used in the proposed EVCS management strategy are randomized algorithms whose theoretic foundations are discussed in the previous chapter.

Outline of the proposed approach

Before providing the details of our proposed approach in the following sections, a brief overview is provided with the objective to facilitate the readability of the following. The aim of our proposed control strategy is to determine an allowed day-ahead 6.3. Components of the approach power consumption profile for an EVCS such that -despite the uncertain EV behavior -the customer satisfaction is guaranteed with a pre-configured probability. Moreover, an allowed upper limit power profile is considered optimal in the sense of the underlying randomized algorithm problem, if it minimizes the total predicted energy for the day. The key steps of the proposed control strategy are as follows:

• Define a design parameter vector θ ∈ R n θ allowing to modulate the shape of the allowed day-ahead power profile P lim (θ) for the EVCS. This design parameter vector θ is the variable which is manipulated by the randomized algorithm and will be explained in detail in section 6.4.

• Define a real-time controller which distributes an allowed power profile P lim (θ) to the connected EVs.

• Define a discrete set of design parameter vectors Θ = {θ (1) , ..., θ (n C ) }.

• Generate a number N of occupancy scenarios S (1) , ..., S (N ) for the EVCS based on the probabilistic laws described in section 6.3.1.

• For all elements θ (i) ∈ Θ compute the candidate P lim (θ (i) ) and simulate the realtime controller for the N scenarios, distributing P lim (θ (i) ) to the EVs. In total the real-time controller is simulated n C × N times.

• For each θ (i) , determine the number of successful and unsuccessful scenarios (out of N ) according to the definition provided in section 6.3.2.

• Based on the randomized algorithm principle, determine which of the P lim (θ (i) ) are feasible, meaning that no more than m scenarios are unsuccessful.

• Amongst the feasible θ (i) , determine the θ opt which is the one that results in the smallest over-estimation of the required energy for the whole day.

Having provided an overview of the approach, the different components which are assembled to our proposed energy management strategy are explained in detail in the following section.

Components of the approach

The different components which are part of the proposed control strategy and which are described in detail in the following sub-sections are the following:

• A stochastic occupancy model of the charging station, allowing to generate 24h scenarios of EV arrival-departure times and their initial state-of-charge.

• A customer satisfaction metric allowing to distinguish whether an EV customer is satisfied with the amount of energy supplied to his vehicle.

• A predictive scheduler consisting of a method to generate candidate profiles P lim (θ) of the allowed day-ahead upper limit on the EVCS power consumption based on an aggregated model of the EVCS.

• A real-time controller heuristic which distributes the available power P lim (θ) to the connected EVs.

Stochastic occupancy model

In our proposed control strategy the uncertain EV behavior is explicitly taken into account through a certain number N of EVCS occupancy scenarios. In the sequel the term scenario describes a realization of 24h-occupancy schedules for all n CP charging points of the EVCS. A scenario realization is obtained from a scenario-generatorfunction which implements the stochastic laws describing the uncertain EV arrivaland departure times as well as the EVs' state-of-charge (SoC) at arrival.

Remark:

It is not in the scope of this contribution to provide advanced and validated stochastic models of the EVCS occupancy. In fact, the very nice feature of the randomized algorithm approach applied in this control strategy, is its independence from the type of underlying statistic occupancy model. The only requirement is that the stochastic model allows to generate i.i.d. (independent and identically distributed) scenario realizations.

In the literature numerous suitable statistic models of the uncertain EV behavior can be found. In [START_REF] Vayá | Smart charging of plug-in vehicles under driving behaviour uncertainty[END_REF] for instance a traffic model is proposed where different states (driving, parked at work, at home, for leisure or at a shopping location) are defined and driving patterns are modeled using a continuous time non-Markov chain. In [Bessa & Matos 2013a] a linear model with lagged variables and covariates is chosen and fitted from historical data, aiming to forecast the arrival-and departure times of EVs at residential charging points. When historic data is available or when our proposed control strategy is applied on a real system, this kind of graybox model could be a well-adapted choice.

The uncertainty model which is used to generate scenario realizations of the EVCS occupancy in our proposed control strategy is described in the following. A scenario S is represented as follows:

S := {t arr,v , t dep,v , E req,v } with v = 1, ..., n EV
where t arr,v and t dep,v are the arrival-and departure time of the v-th EV and E req,v is its required energy to become fully charged. n EV is the number of vehicles which 6.3. Components of the approach are charged in scenario S. In order to generate a scenario realization as described in algorithm 1, the following stochastic parameters have to be determined (e.g. by identification from historic data): P (n arr |i) probability that n arr EVs arrive during the i-th time interval with i = 1, ..., H. Note that the 24h-horizon is discretized into H time intervals of equal length τ (e.g. τ = 15 minutes).

E(t dep |i) expected value of an EV's departure time which arrived during the i-th time interval.

σ(t dep |i) standard deviation of the EV's departure time.

E(E req |i) expected value of an EV's required energy to become fully charged.

σ(E req |i) standard deviation of the EV's required energy to become fully charged.

Algorithm 1: Scenario generator function. Update n occ (subtract the no. of vehicles that leave the station in interval i );

16 Outputs: S ; Figure 6.1 shows the occupancy profiles of three different charging points (CP) chosen randomly from one scenario of the case study provided in section 6.5. In this case study, an EVCS located at a company site is considered. Note however that due to the lack of real data, the stochastic parameters used to generate the scenarios for this case study are purely made up based on common sense. Figure 6.1 Three random schedules for an EV charging point created from the scenario generator function described by algorithm 1. The black curve represents the availability of an EV at the charging point and the magenta one shows its initial state of charge at arrival.

Customer satisfaction metric

Since the proposed control strategy aims at providing probabilistic guarantees for the customer satisfaction, it is crucial to define what the term customer satisfaction actually means for an EV owner. In [START_REF] Quiros-Tortos | Control of EV charging points for thermal and voltage management of LV networks[END_REF]] a metric to quantify customer satisfaction is proposed which is based on the ratio between the time it took to fully charge the battery and the time it would have taken if the battery had been charged constantly at nominal power. However, for the purpose of our proposed approach, this kind of measure is not appropriate for the following reasons: Firstly, not every EV remains connected long enough to become fully charged, but the customer may still be satisfied with a partial charge. Secondly, a binary satisfaction indicator is required for our proposed strategy. For these reasons we propose a new metric to evaluate customer satisfaction. However, any other metric providing a binary indicator whether a customer is satisfied or not with the obtained amount of charged energy could be applied.

The basic idea of the proposed metric is that a customer is considered to be satisfied if he has obtained more than a certain percentage of the energy he would have required to become fully charged. Moreover, this percentage depends on the connection time of the EV, since a customer who remains connected for a short time interval 6.3. Components of the approach only will not expect his battery to be fully charged at his departure. The metric is implemented by inequality (6.3.1). If it is true, then the customer is considered to be satisfied.

E charged E req ≥ c satis × min 1, t connected τ const (6.3.1)
where E charged is the charged amount of energy, E req is the amount of energy which would have been required to become fully charged, t connected is the time the EV was connected and τ const is a time constant (e.g. τ const = 3h). The right-hand side of equation (6.3.1) represents the satisfaction threshold (in %) which decreases linearly if an EV is connected less than τ const . c satis is the percentage from which on a battery is considered to be "fully charged" (e.g. c satis := 90%).

Définition 6.3.1. A proposed 24h-charging strategy for an EVCS scenario is considered to be successful if 95% of all EVs that connected to the charging station are satisfied in the sense of equation ( 6.3.1).

Predictive scheduler

In this section the predictive scheduler used to compute the allowed upper limit power profile P lim (θ) for the EVCS is presented. The predictive scheduler consists of an optimization problem which is based on an aggregated model of the EVCS. The optimization problem solves for the upper limit power profile P lim (θ) over a certain prediction horizon (typically 24 hours). Note that the predictive scheduler is not the crucial part of the proposed energy management strategy and other potentially simpler methods to determine P lim (θ) might lead to results of similar quality.

The main motivation for using such an aggregated EVCS model -as for instance done in [START_REF] Bessa | Optimized bidding of a EV aggregation agent in the electricity market[END_REF]] -is that for large charging stations, a detailed model taking into account each charging point is very likely to become intractable for optimization purposes. Another motivation is that the objective function based on which the allowed power profile is determined allows to take into account varying energy tariffs.

As already mentioned in section 6.3.1, each scenario can be described by the following set where v ∈ V is the index of the EVs in the scenario:

S := {t arr,v , t dep,v , E req,v } v∈V (6.3.2)
The maximal charging power P max, CP is assumed to be the same for all EVs (typically 3.3kW or 7.4kW with single phase charging points). From this information the profiles P max,v , B v and B v are defined as follows:

P max,v :=    P max, CP if t arr,v ≤ t < t dep,v 0 otherwise (6.3.3)

Components of the approach

objective function (6.3.9a) represents the energy cost to be minimized over the 24hprediction horizon. Constraint (6.3.9b) states that the power limits of the EVs' batteries are respected and constraint (6.3.9c) is the aggregated dynamic model of the EVs' batteries. Finally constraint (6.3.9d) assures that the batteries' capacities are respected and that the required energy is delivered at the EVs' departure.

In our proposed approach the EVs' schedules as defined in (6.3.2) are supposed to be known only through their statistic model which is detailed in section 6.3.1. In real-time, the only information provided by the EVs is their required energy to become fully charged once they are connected. For this reason the "exact", but unknown profiles P (S) max , B (S) and B (S) are replaced in problem (6.3.9) by approximations P max (θ), B(θ) and B(θ) with θ being the so-called design parameter vector. θ provides some flexibility to vary the shape of the aforementioned approximated profiles. The parametrized aggregated EVCS problem becomes then:

P lim (θ) := Minimize p Γ T • p (6.3.10a) Subject to: 0 ≤ p ≤ P max (θ) (6.3.10b) b = τ • η • Φ • p (6.3.10c) B(θ) ≤ b ≤ B(θ) (6.3.10d)
Instead of allocating the optimal power consumption profile p opt,(S) for a known scenario as it is the case in problem (6.3.9), the resulting profile P lim (θ) serves as an upper limit profile on the EVCS's power consumption. For this reason, the parametrization must be chosen conservatively in the sense that for almost all potential scenarios, the power limit profiles P lim (θ) are sufficient to satisfy the customers' energy requirement.

The precise purpose of θ as well as the definition of the approximated profiles P max (θ), B(θ) and B(θ) (see figure 6.3) will become clear in the following section.

Real-time controller

Once a scenario-independent upper limit profile on the EVCS's power consumption P lim (θ) has been obtained from solving problem (6.3.10), the real-time controller is simulated for the N scenarios. Its objective is to charge the connected EVs as fast as possible, while respecting the upper limit profile on the EVCS's power consumption P lim (θ). Moreover it is desirable that the real-time controller be computationally light for the following two reasons. Firstly, excessive simulation times are avoided and secondly, it is easier to be implemented on a real-time machine.

The simple heuristic implemented in the real-time controller is as follows: [kWh] B (S) [kWh] • At each sampling instant of the 24h-horizon (e.g. every minute), check the number of connected EVs and try to equally distribute the available total power P lim (θ) to the EVs.

• If there is still some power left, because one or more vehicles were already fully charged in the previous step, revisit each car starting from the one with the lowest SOC and affect the remaining power to them.

Note that the main objective of the real-time controller is to charge the connected EVs as fast as possible, while respecting the upper limit profile on the EVCS's power consumption P lim (θ).

Randomized algorithm implementation

In this section we explain the implementation of the randomized algorithm method in the context of the EVCS energy management strategy.

Let us recall the main objective of the approach. It is to determine a day-ahead upper limit profile on the EVCS's power consumption, which reserves a sufficient amount of energy such that -despite the uncertainty in the EV behavior -almost all customers can be satisfied. Moreover, we would like the total reserved energy for the day to be as close as possible to the actually required one. In other words, we are looking for an optimal trade-off between reserving no more energy than required and guaranteeing the customer satisfaction despite the uncertainty.

As already defined in section 5.1.2, the total amount of energy reserved for the charging station can be expressed as the integration of the upper limit profile P lim (θ).

J(θ) = 24 t=0 P lim (θ) dt
A crucial point in our proposed approach lies in the choice of the design parameter vector θ which allows us to modify the upper limit power profile P lim (θ) through the predictive scheduler problem 6.3.10. It is important that θ contains as few components as possible while allowing to parametrize the profiles P max (θ), B(θ) and B(θ) with sufficient degrees of freedom. The reason why a small dimension of the design parameter vector θ is desirable is that the cardinality n C of the set Θ and with it the computational burden, would become very high otherwise. It is important to note that this choice depends a lot on the context of the considered charging station, more precisely on its stochastic occupancy model.

Our provided definition of θ is dedicated to charging stations which are located at company-or commercial sites, where EV customers usually arrive in the morning Chapter 6. Energy management under uncertainty for EV charging stations and where several leave for lunch and return in the afternoon. For this case we chose θ = [θ 1 , ..., θ 4 ] T of dimension 4 (see illustration in figure 6.3). The parameters θ 1 , ..., θ 4 are explained in the following:

• The base profile for P max (θ) consists of two superposed normal distributions which approximate the averaged profile P max resulting from 100 scenarios (the black one in figure 6.3) as closely as possible. The parameters for the base profile could be obtained by some curve fitting technique. Given this approximation, θ 1 allows to vary the amplitude of P max (θ):

P max (θ) = θ 1 • P max (6.4.1)
• The base profiles for B(θ) and B(θ) are directly the averaged profiles B and B over 100 scenarios (the black ones in figure 6.3). θ 2 allows to shift the two profiles horizontally towards each other, θ 3 allows to scale their amplitude and θ 4 allows to vary the saturation on their amplitude:

B(θ) = Sat [(B t-θ 2 • θ 3 ), ( B ∞ • θ 4 )] (6.4.2) B(θ) = Sat (B t+θ 2 • θ 3 ), ( B ∞ • θ 4 ) (6.4.3)
where the operator Sat [s, a] saturates each element of the vector s by the scalar a.

Simulation results

In this section simulation results are which demonstrate the feasibility and the relevance of the proposed approach. Moreover a comparison with a simple non-robust charging strategy where each EV is directly charged at its nominal power once it is connected to the EVCS is performed and finally the impact of certain key parameters of the approach is analyzed.

As mentioned before, the EVCS considered in this case study is assumed to be located at a company site. The reader is reminded again that the underlying statistic laws in this case study are made up based on the authors common sense and do not rely on real data. This is mainly due to the lack of sufficient data.

Demonstration of the feasibility of the approach

An EVCS consisting of n CP = 20 charging points is considered. The sampling period τ is 15 minutes. The uncertain occupancy at each day follows the statistic laws de- scribed in section 6.3.1. The set Θ of design parameters θ (1) , ..., θ (n C ) is chosen in a conservative way such that the existence of feasible solutions is enhanced:

θ 1 ∈ {0.7, 0.9, 1.1} θ 2 ∈ {1.25, 1.5, 1.75} θ 3 ∈ {1.15, 1.25, 1.35} θ 4 ∈ {1.05, 1.15, 1.25}
The number of possible combinations of θ 1 , ..., θ 4 is actually the cardinality n C of the set Θ. It is at the same time the number of iterations of the randomized algorithm:

n C = n iter = 3 4 = 81.
The parameters to configure the randomized algorithm are chosen as η = 0.05, δ = 0.05 and m = 7. The necessary number of scenarios computed according to equation (5.2.5) is then N = 456.

Solving the problem for a flat energy tariff profile Γ results in an optimal feasible solution θ opt = {0.7, 1.75, 1.35, 1.05}. The result is illustrated in figure 6.4 where the black curves are the predicted upper limit profiles of the power-and energy consumption, resulting from the aggregated EVCS problem (pb. (6.3.10)) configured with P max (θ opt ), B(θ opt ) and B(θ opt ). The colored lines represent three 24h-scenarios to whom this predicted power consumption has been affected following the real-time controller heuristic described in section 6.3.4. Note that in the three scenarios -though sumption (black) and the actual power consumption after affecting the upper limit profile to 3 different 24h-scenarios. Note that all 3 scenarios are feasible in the sense of the customer satisfaction definition from section 6.3.2.

quite different from each other -all customers are satisfied according to the satisfaction metric defined by inequality (6.3.1). Moreover the upper limit power profile is respected in all three scenarios and the actually realized power consumption profiles are very close to this upper limit profile. This is the reason making our robust strategy very valuable from a DSO's point of view. In order to emphasize this point a comparison with a non-robust charging heuristic is performed in the following sub-section, where high fluctuations between the realized power consumption profiles of the same three scenarios can be observed.

Customer satisfaction:

In order to provide a more precise idea of the client satisfaction at EV level, the scatter plot in figure 6.5 relates the charging time of all EVs from 100 different scenarios with their charged energy, represented as the percentage of their initially demanded energy at arrival. It shows that most EVs actually leave the station being fully charged. Among those which stay connected for less than 5 hours some leave the station partially charged, but still almost all of them are above the customer satisfaction threshold which is visualized by the blue dashed line.

Validation of the robustness on a large set of scenarios:

In order to verify whether the desired robustness configured by the probabilities η and δ is actually achieved, the result is applied to a large number of 24h-scenarios ( N ). Having done so for 5000 scenarios, the percentage of unsuccessful scenarios was found to be 1.1%. This result clearly satisfies the desired limit on the probability of violation η = 5% and confirms that the desired robustness is achieved. For the 5000 scenarios, the mean overestimation of the total energy consumption of one day was in average 13% with a standard deviation of 6%.

Computational considerations:

The computations were performed on an Intel(R) Core(TM) i7-3540M @ 3.00GHz machine. For a given θ, i.e. for one iteration, the required computation time is composed of two principal operations:

t comp,iter = t optim + t dist = 80ms + 540ms = 620ms (6.5.1)
where t optim is the time to solve the aggregated EVCS optimization problem (6.3.10) and t dist is the required time to distribute the obtained power limit profile to the N = 456 scenarios. Multiplied with all possible combinations of θ 1 , ..., θ 4 , the total time to solve the robust optimization problem is t comp,total = n iter × t comp,iter = 81 × 0.62sec = 50.2sec. From this consideration it becomes obvious why it is desirable to restrict the design parameter θ to a small dimension, and with it the cardinality n C of the set Θ. Note however that these computations are performed off-line. Therefor more complex parameterizations θ or a set Θ of higher cardinality could be handled if necessary.

Comparison with a direct charging strategy

From the results presented in figure 6.4, one might conclude that the three scenarios are so similar to each other that the EVCS's power consumption profiles for different scenarios would be very similar anyway, even with a less sophisticated and nonrobust charging strategy. In order to disprove this claim, our robust charging strategy is compared to a simple direct charging strategy in the following.

The principle of this direct charging strategy is to charge each car at its maximal power as soon as it is connected to the EVCS. This is the strategy which guarantees the best possible customer satisfaction. However it does not provide any prediction of the charging station's day-ahead power consumption profile and it is not possible to impose an upper limit on the EVCS's power consumption. Figure 6.6 shows the power consumption of the EVCS with the direct charging strategy for the same 3 scenarios considered in the previous subsection. One can easily see that the power consumption differs importantly from one scenario to another making it basically impossible to provide a meaningful day-ahead prediction.

It is important to note that while in the robust charging strategy (see figure 6.4) the realized power consumption profiles of the EVCS are forced to stay below the predicted power limit, the customer satisfaction is guaranteed nearly as well as with the direct charging strategy. With a non-robust charging strategy however, there is no means to respect such an upper limit on the charging station's power consumption profile while guaranteeing the customer satisfaction. The fact that the actually realized power profiles of the EVCS are very close to the robust upper limit profile makes the strategy very valuable for a reliable integration of electric vehicles into the power grid.

Sensitivity analysis to key parameters

In order to provide a quantitative idea of how certain parameters of the approach influence its performance, the sensitivity to these parameters is analyzed in this section. The studied parameters are the number of charging points n CP , the probabilistic accuracy η and finally the client satisfaction threshold c satis .

Impact of n CP and η: Figure 6.7 shows how the objective value J(θ opt ), i.e. the mean over-estimation of the total energy consumption of N scenarios, depends on the robust charging strategy shown in figure 6.4. It becomes obvious that with the direct charging strategy the power consumption can differ importantly from one day to another due to the uncertainty. Moreover it is impossible to respect a pre-defined upper limit profile on the power consumption with such a non-robust strategy.

the number of charging points n CP , i.e. on the size of the charging station. Additionally the graph shows the dependency on the accuracy η which is the probability that a scenario is not successful, meaning that the customers are not satisfied according to our definition in section 6.3.2. The first conclusion that can be drawn from the figure is that the larger the charging station is, the smaller is the mean over-prediction. This result confirms that the approach is specifically well-suited for charging stations of large size. The second conclusion is that for better robustness guarantees, i.e. for smaller values of η, the predicted mean over-consumption increases as it would be expected. However this effect is less pronounced than the impact of n CP in the performed case study.

Impact of c satis : In figure 6.8 the influence of the parameter c satis on the objective value J(θ opt ), i.e. on the predicted mean over-consumption, is visualized. c satis is the threshold defining the individual client satisfaction (see eq. (6.3.1)). The remaining parameters are fixed to n CP = 20, η = 0.05, δ = 0.05 and m = 20. The figure shows that the tighter this limit is chosen, the higher becomes the predicted mean overconsumption. ter c satis which is the threshold defining the customer satisfaction (see eq. 6.3.1)).

6.6. Conclusion

Conclusion

In this work a robust energy management strategy for electrical vehicle charging stations is proposed. The strategy is based on randomized algorithms and determines a day-ahead upper limit profile on the EVCS's power consumption which is then strictly respected in real-time. This upper limit profile on the EVCS's power consumption is of great value for DSOs and other entities who are in charge of managing the distribution grid. The method stands out because it guarantees the customer satisfaction with a pre-configured probability. Moreover, it can be easily implemented in a real system, since the real-time controller is based on a computationally light heuristic which does not require any online forecasts of the EV customer behavior.

Simulations suggest that the pre-determined upper limit profile for the EVCS's power consumption is close to the actually realized power consumption in the different scenarios, despite the highly uncertain EV behavior. This makes the approach very valuable from a DSO's perspective, since it permits to better anticipate the EVCS's power consumption and thus guarantee the grid stability in a more efficient and less costly manner. This fact is underlined by the comparison with a basic charging strategy where each EV is charged at its nominal power once it is connected and where highly fluctuating power consumption profiles are obtained for different occupancy scenarios.

In future investigations the proposed method can be extended with the following features:

• The possibility to re-compute an updated power allocation profile during the day itself, taking into consideration the previously realized charging tasks. This way an even more precise upper limit profile on the power consumption could be achieved.

• Application of the strategy in a real-life scenario with a focus on how the statistic model of the EV behavior is fitted to the historic measured EV data.

• Embedding the strategy into a dynamic demand-response framework where the day-ahead power allocation for the EVCS would be determined dynamically through interactions with an aggregator agent.

Chapter

Introduction

Photo-voltaic (PV) power plants are considered to become one of the main components in the energy mix of tomorrow. However, already today where the percentage of PVs is still relatively low (e.g. 6.9 % in Germany, 1.1 % in France according to [START_REF] Wirth | Recent facts about photovoltaics in Germany[END_REF], [RTE 2014]), instabilities in the power grid resulting from the intermittent nature of PV energy have become a serious challenge. In order to counteract these instabilities the Energy Regulatory Boards of different countries impose regulations on the operation of PV power plants. More precisely, day-ahead predictions of the injected power are requested and penalties are introduced in case the previously declared power cannot be delivered. In [CRE 2015] an example of such regulations which were announced by the French Energy Regulatory Board is depicted.

In order to respond to these regulations the plant operators are obliged to invest into expensive storage equipment and to deploy advanced energy management systems (EMS) to avoid high penalties which would reduce the to-be-expected revenue otherwise. The major challenge in this context lies in dealing with the uncertainty of the PV power production in the operational control method as well as in the system design phase where the optimal battery size needs to be chosen.

In the literature several studies can be found which discuss the impact of regulatory rules on PV power plants from an economic and technical point of view. For instance in [START_REF] Cervone | Impact of regulatory rules on economic performance of PV power plants[END_REF], costs of penalty and value of energy are compared to evaluate the economic efficiency of such a plant. Additionally it investigates on the in-7.1. Introduction stallation of auxiliary storage devices. [START_REF] Hoppmann | The economic viability of battery storage for residential solar photovoltaic systems -A review and a simulation model[END_REF] discusses the economic viability of battery storage for residential solar photovoltaic systems without any policy support. Moreover it provides a techno-economic simulation model allowing to evaluate the profitability of battery storage for different future market scenarios. The high costs of battery storage systems motivated several contributions addressing the battery sizing problem for PV power plants such as [START_REF] Semaoui | Optimal sizing of a stand-alone photovoltaic system with energy management in isolated areas[END_REF]], [START_REF] Castañeda | Sizing optimization, dynamic modeling and energy management strategies of a standalone pv/hydrogen/battery-based hybrid system[END_REF], [START_REF] Cabral | A stochastic method for stand-alone photovoltaic system sizing[END_REF], [START_REF] Arun | Optimum sizing of photovoltaic battery systems incorporating uncertainty through design space approach[END_REF]] and [START_REF] Cervone | Optimization of the battery size for PV systems under regulatory rules using a markov-chains approach[END_REF] where for instance a Markov chain approach is used to optimize the battery size.

The above cited methods for the optimal battery sizing have in common that the economic performance indicator based on which the battery size is determined, is the mean revenue which can be expected with respect to the uncertain PV power predictions. Contrary to this, our contribution stands out by providing probabilistic guarantees on the to-be-expected revenue. More precisely our proposed method includes the following components:

• A randomized algorithm formulation allowing to maximize the guaranteed lower bound on the to-be-expected revenue for different battery sizes and at configurable probabilities, taking the uncertain PV power production explicitly into account. Moreover the formulation achieves an optimal tuning of the underlying control strategy.

• An advanced control strategy composed of a high-level predictive controller and a low-level real-time controller which are working at different time scales.

• An uncertainty model allowing to generate i.i.d. (independent and identically distributed) realizations of the uncertain PV power production.

The provided framework directly addresses the regulations stated in the call for proposals [CRE 2015]. They are described in detail in the following section. However, due to the similarity of different regulatory frameworks for PV plants, it is easily adaptable to meet other regulations. In fact, the trigger for the present work is an MPC-based energy management system which has been developed within this work for a similar case and which manages two 1MW PV power plants situated in Corsica. The system has been put into place and is operated by the Solar business unit of Schneider Electric and for the energy management system I developed the MPC controller. Figure 7.1 shows a screen-shot from the supervision system of one of the two PV power plants. It shows the result from the control strategy which will become more clear in section 7.4.

Figure 7.1 Screenshot from the supervision system of a 1MW PV power plant with an associated 1MWh battery, located in Corsica. It shows the operation of the energy management system for a complete day. The black curve is the power profile which was actually injected into the grid and which respects the regulatory constraints imposed on its shape. In orange, the power production of the PV panels is plotted and in green, one can see the previously available forecast of the latter. Finally, in blue, the state-ofcharge of the 1MWh battery is shown. Note that it is thanks to the battery that the regulatory constraints can be respected. where a higher power than previously declared is injected into the grid, can always be avoided. For further information on MPPTs the interested reader is referred to [START_REF] Faranda | Energy comparison of MPPT techniques for PV systems[END_REF] where a comparative study of MPPT algorithms is conducted.

Peak power option:

In the sequel, the regulations described so far will be called the basic option. Additionally the regulatory framework provides the possibility to choose an option called peak power option. The peak power option aims at encouraging PV plant operators to invest into larger battery capacities in order to be able to store energy during the day and to deliver it to the grid during the evening peak between 19:00 -21:00. When choosing this option, the PV plant operator is obliged to declare a power P G,19→21 ≥ 20% • P nom between 19:00 -21:00. In return the tariff Γ during this peak period is significantly higher than during the rest of the day.

Note that in all explanations and formulations provided throughout this paper the basic option is addressed. Only in section 7.6.3 where a comparison of the op-7.3. Randomized algorithm implementation timal battery size for both, the basic and the peak power option, is conducted, the peak power option will be re-considered. To do so, the only modification which is required lies in the predictive controller described in section 7.4.1. More details on the regulatory framework being addressed in this work can be found in [CRE 2015].

Randomized algorithm implementation

In this section the main idea of our proposed framework is described. The objective is to provide guaranteed lower bounds on the to-be-expected annual revenue of a PV plant under the regulations described in section 7.2, taking explicitly into account the uncertainties of the weather forecast. Moreover, we aim to optimally tune the underlying control strategy for this context and to choose the optimal battery size that results in the best ROI (return on investment). While focusing only on the main idea in this section, the details of the different components of the framework will be explained in the following sections.

Problem statement

As already shown in section A.3.2, the addressed problem can be formulated as a robust design problem of the form max θ∈Θ J(θ) subject to g(θ, w) = 0 for all w ∈ W (7.3.1)

The only difference from problem (5.1.1) is that problem (7.3.1) is a maximization problem.

The objective term J(θ) is the guaranteed lower bound on the to-be-expected revenue of the PV plant which we aim to maximize. The design parameter vector θ = (θ 1 , θ 2 ) T consists of the following two elements (note that the battery size is fixed at this stage):

• θ 1 : the lower bound on the to-be-expected revenue. In fact, a specificity of this implementation is that J(θ) = θ 1 .

• θ 2 : a scaling factor allowing to vary the amplitude of the forecasted PV power production profile P in the predictive controller described in section 7.4.1.

W is the set of unknown profiles (forecasted and realized PV power production during the life-time of the process). It is described in greater detail in section 7.5. Finally,

Control scheme

Admissible set of design parameters

Having computed g (k,i) , the constraints in the m-level randomized problem (5.2.4) can be evaluated for each candidate parameter θ (k) by summing the columns of the k-th row of the matrix g (k,i) , namely:

N i=1 g(θ (k) , w (i) ) = N i=1 g (k,i) (7.3.4)
If the result is lower than m, then the candidate design parameter θ (k) is considered to be admissible. Therefore the admissible set of design parameters is defined as:

A := k ∈ {1, ..., n C } | N i=1
g (k,i) ≤ m (7.3.5) 5. Compute the optimal guaranteed lower bound on the to-be-expected revenue

The optimal lower bound on the to-be-expected revenue is defined by

θ (k opt )
where k opt is the index of the admissible lower bound that maximizes the cost function, namely:

k opt = argmax k∈A J (k) (7.3.6)
Note that the computationally heavy part in the algorithm lies in computing the failure indicator g(θ (k) , w (i) ), since it implies simulating the control scheme in closedloop over several days in order to obtain representative annual figures. The way this is done is described in detail in the following sections. More precisely, the following section describes the control scheme consisting of a high-level predictive controller and a low-level real-time controller, before providing the stochastic model of the PV forecast uncertainty in section 7.5.

Control scheme

In the following the control scheme consisting of a high-level predictive controller and a low-level real-time controller is introduced. The proposed control scheme implements the following features:

• Compute the to-be-declared grid power injection profiles P G,•→24 which have to be declared to the grid operator and which additionally respect the constraints imposed by the regulatory framework (see equations (7.2.1), (7.2.2)).

• Maximize the revenue by solving an open-loop optimization problem taking into account the forecasted PV power production P.

• Counteract as far as possible potential penalties due to the uncertain PV power production by adjusting the battery's control in closed-loop. This is the task of the real-time controller which is working at a lower sampling period than the predictive controller.

Predictive controller P C

The objective of the predictive controller is to compute the optimal grid power injection profiles P G,•→24 to be declared to the grid operator that maximizes the revenue over the prediction horizon. Moreover, as a consequence from the regulatory framework described in section 7.2, the predictive controller has 4 instances, namely P C 1 , ..., P C 4 which correspond to the time instants where the predicted profiles P G,•→24 have to be declared (before the times { J-1 at 16:00, 04:00, 10:00, 14:00 }). The 4 instances of the predictive controller mainly differ in the shrinking horizon due to the increasing start times t 0 = { 00:00, 06:00, 12:00, 16:00 }. The sampling period of the predictive controller is τ p = 15min.

P C k : Maximize P Bat ,P G 24 t=t 0 Γ • P G -ρ • SoC -
SoC (t) = SoC 0 + E t τ =t 0 P (τ ) Bat (7.4.1f) dP G ≤ P t+1 G -P t G ≤ dP G (7.4.1g) SoC (t=24) = SoC d (7.4.1h)
Constraint (7.4.1b) accounts for the fact that no more than a possibly over-optimisitic correction of the forecasted PV power minus the power consumed by the battery can be supplied to the grid. θ 2 is a scaling factor allowing to vary the amplitude of the forecasted PV power profile P t 0 →24 . It serves as a tuning parameter for the predictive controller and is adjusted by the randomized algorithm implementation described in the previous section. Constraint (7.4.1c) implements equation (7.2.2) which is imposed by the regulatory framework and constraint (7.4.1d) being the lower-and upper bound on the state-of-charge of the battery. The remaining constraints in problem (7.4.1) are straight forward and are not described in further detail. In the sequel the resulting 7.4. Control scheme optimal battery power-and state-of-charge profiles are denoted P opt Bat and SoC opt and the optimal grid power injection profile P opt G . Note that the grid power injection profile which is declared to the grid operator is obtained by simply interpolating the P opt G at sampling period τ r .

Remark 1: The bound constraints on the state-of-charge (7.4.1d) and on the battery power (7.4.1e) are implemented as soft constraints in order to guarantee feasibility of the problem. This is required because of the problems P C k∈{2,3,4} where the constraint (7.4.1c) being a hard constraint by specification can -in some rare cases -be in conflict with the battery's technical constraints.

Remark 2: The constraint (7.4.1h) on the final state-of-charge is realized as a soft constraint in exactly the same way as the penalization on the distance from the SoC d , but with a penalizing parameter ρ (t=24) which is much more important (several orders of magnitude).

Real-time controller

The real-time controller operates in closed-loop and at a smaller sampling period of τ r = 1min. Its objective is to maintain the realized injected power into the grid P G,r in the tolerance margin of ±5% • P nom around the previously declared profile P opt G in order to avoid the penalties described in table 7.1. Additionally the real-time controller aims at driving the battery's state-of-charge SoC towards the optimal profile SoC opt which was previously computed by the predictive controller. This is achieved by exploiting the fact that the tolerance bound of ±5% of the nominal PV plant power P nom is pretty large, providing some flexibility to the controller. The real-time controller is based on a few simple if /else-rules which are applied at each sampling instant in order to determine the battery power P Bat . The precise controller logic is described by algorithm 2.

Figure 7.3 shows the result obtained when applying the control scheme consisting of the predictive controllers P C 1 , ..., P C 4 and the real-time controller RT C for one realization of the uncertain PV power production.

The first plot shows the tolerance envelop P opt G ± 5% • P nom (red) around the declared power injection profile P opt G , the realized grid injection power profile P G,r (blue) and the previously declared grid injection profiles P G,old (grey) before re-declaration through the predictive controllers P C 2 , P C 3 and P C 4 . The second plot shows the realized grid injection power P G,r (blue), the power produced by the PV panels P (magenta) and the battery power P Bat (black). Finally the third plot shows the stateof-charge of the battery. One can see that around 12:00 the real-time controller is not able to maintain the injected power in the declared bounds, because the SoC of the of the predictive controller and the real-time controller in closed-loop. One can see that around 12:00 the injected power into the grid (blue) cannot be maintained in the tolerance bounds (red) around the previously declared power profile, because the battery's state-of-charge is at its lower limit at this moment.

over, since for each day the control strategy is applied to many realizations of the uncertainty, a way to generate not only the four PV power forecasts P .→24 but also the N corresponding i.i.d. realizations of the actually produced PV power profile P is required.

The probability measure which is implemented by the uncertainty generator is defined as follows:

w = P r W (P hist ) (7.5.1)
with the resulting uncertainty realization w consisting of the following elements w := { P 0→24 , P 6→24 , P 12→24 , P 16→24 , P}

where the four profiles P .→24 are the forecasted PV power profiles and P is the actually realized PV power production.

In order to be able to take into account realistic seasonal variations of the forecasted and realized PV power, profiles are created based on historic measured data. with the max()-and min() operators selecting respectively the maximum and the minimum value of a profile. The way the constraints (7.5.5) are implemented is by constructing the profile P sample by sample. More precisely, for each sample t a candidate point P t candidate is created using a uniformly distributed random variable in a first step. Then, the mean derivatives D t n S ( P) (for n S = {1, 2, 4, 10}) are computed taking into account the candidate point and the previously generated samples P 1 , ..., P t-1 of the profile P and -in case the constraints (7.5.5) are not respected -P t is obtained by projecting P t candidate on the feasible set accordingly. As described in section 7.4, the predictive controller is executed 4 times for one day in order to (re-)declare the predicted grid power injection profile P opt G to the grid operator. Each time the predictive controller is executed (more precisely at times t 0 = { J-1 at 16:00, 04:00, 10:00, 14:00 }), it requires the PV power forecast P .→24 created at the corresponding time t 0 as an input. In figure 7.6 the generated PV power forecasts P .→24 related to the 4 prediction instants t 0 are illustrated. One can see very nicely how the updated predictions differ from the previous ones. This underlines the importance of being able to re-adjust the initially declared power injection profile P opt G,0→24 by the predictive controllers P C 2 , P C 3 and P C 4 .

Remark:

The sampling period for the generated forecasts P is τ p = 15min while the one for the generated realized power profile P is τ r = 1min.

Figure 7.7 shows one realization of the uncertainty w consisting of the 4 forecasts P 0→24 , P 6→24 , P 12→24 and P 16→24 and of one associated realized power profile P.

Simulation results

In this section a case study is provided based on historic measured data of an existing PV power plant. The nominal power of the plant, i.e. the maximal power which can be produced by the PV panels is P nom = 5M W . Under the regulatory framework described in section 7.2, a newly installed PV farm of this size requires the installation of a battery. The results obtained by applying the method described in the previous sections provides valuable information for choosing the appropriate battery size and for estimating the profitability of the investment.

Algorithm set-up:

In order to keep the computation time of algorithm (3), i.e. the computation of the realized revenue for all scenarios, in a reasonable range (around 6 -10 hours), the algorithm is only applied to every 15-th day of the year (1 Jan, 15 Jan, 1 Feb, ...,15 Dec), meaning that N days = 24 in algorithm 3. This way the results cover the seasonal variations of the year and can be considered to provide representative annual figures. Note that in order to obtain annual figures on the to-be-expected revenue, the direct results of the algorithm are scaled by the factor 365/24 = 15.2. Based on some preliminary tests the finite set of the design parameter vector θ is chosen as follows:

θ 1 = {4 • 10 5 , 4.005 • 10 5 , ..., 4.6 • 10 5 } (revenue limit) θ 2 = {0.90, 0.95, ..., 1.20} (PV power scaling factor)

Moreover the algorithm is applied for the following battery sizes: 500, 1000500, , 1500500, , 2000, 5000, 10000} [kWh] , 5000, 10000} [kWh] The choice for the randomized algorithm parameters is: accuracy η = 10%, confidence δ = 5% and the allowed number of failures m = 5. The resulting sample complexity N becomes then

C bat = {1,
N ≥ 1 η ( e e -1 )(ln n C δ + m) ≥ 234 (7.6.1)
with cardinality n C = n θ 1 •n θ 2 = 840. Note also that in this case study a constant energy tariff of 0.10 e/kWh is applied. Nevertheless variable energy tariffs are possible as well.

Computation time considerations:

The computations were performed on an Intel(R) Core(TM) i7-3540M @ 3.00GHz machine. It takes around t day = 90 ms to execute the control scheme consisting of the 4 predictive controllers P C 1 , ..., P C 4 and the real-time controller RT C in closed-loop for one day. Due to the specificity that the paramter θ 1 does not appear in the time-consuming computations of the realized revenue, the computation time can be estimated by the following formula:

t C = n C bat • n θ 2 • n days • N • t day = 7 • 7 • 24 • 234 • 90 ms = 7 hours (7.6.2)

Obtained results for a 5M W PV plant

In figure 7.8 the obtained guaranteed lower bounds J opt (θ) on the to-be-expected revenue for different battery sizes are depicted. The results state that with probability greater than 1η = 90% and confidence 1δ = 95% the annual revenue of the installation is greater than the obtained values of J opt (θ). One can see very nicely how for increasing battery sizes the obtained guarantees on the to-be-expected revenue increase as well. Moreover the corresponding mean revenues 1 N N i=1 J r (θ, w (i) ) over the N realizations of the uncertainty are plotted. They are around 1 -2 % higher than the guaranteed ones for the different battery sizes.

In figure 7.9 the mean annual revenue over the N = 234 realizations of the uncertain PV power production is provided as a function of the design parameter θ 2 and for different battery sizes. Recall that θ 2 is a tuning parameter in the predictive controller allowing to scale the forecasted PV power production. Two observations can be made: Firstly a higher battery size generally results in a higher mean revenue as already visualized in figure 7.8. However this mean revenue is upper-bounded and from a certain battery size on, the mean revenue does not increase significantly anymore. Secondly the figure shows that the maximal mean revenue is achieved if the forecasted PV power production profiles are assumed to be slightly higher (θ 2 > 1) in case the battery capacity is rather small. In case the battery is large however, θ 2 < 1 results in the maximal mean revenue. This result underlines the importance of optimally tuning the control scheme by taking into account the uncertainty, in order to maximize the revenue of such an installation. 7.6. Simulation results

C bat = 1kWh C bat = 500kWh C bat = 1000kWh C bat = 1500kWh C bat = 2000kWh C bat = 5000kWh C bat = 10000kWh

ROI (return-on-investment) study

In the following we provide a sensitivity study which aims to help answer the following questions:

• What is the optimal battery size for a given PV plant subject to the regulations [CRE 2015]?

• Under which conditions is it cost-effective to install batteries associated to PV plants?

Note that all the results are obtained under the assumption that the regulatory framework described in section 7.2 applies. Additionally the assumptions are made that no specific battery technologies are considered and that the battery life-time is fixed to 10 years. The impact of the following parameters is investigated:

• investment cost of the battery (in e/kWh).

• basic vs. peak power option of the regulatory framework.

Impact of the battery investement cost:

The cost of storage capacity depends a lot on the battery technology which is used. In [START_REF] Divya | Battery energy storage technology for power systems -an overview[END_REF] capacity costs in the range of 150 -1000U SD/kW h are reported, depending on the technology. Moreover it is likely that the battery capacity cost is going to decrease during the coming years due to the rapid advances in the battery storage technology.

In the following the optimal battery size for a 5M W PV plant is investigated for battery capacity costs in the range of 0 -1000 e/kWh. After applying our proposed method, the obtained guaranteed lower limits on the to-be-expected revenues are scaled to 10 years (which corresponds to the assumed battery life-time) and the battery investment costs are subtracted. Figure 7.10 shows the so obtained guaranteed profit for a 10 year period for different battery sizes and for different battery capacity costs. From the figure one can determine that the optimal battery size that maximizes the profit of the installation is 200kW h if the capacity cost is 100 e/kWh. At higher capacity costs however it is not profitable to install a battery at all with the basic option of the regulatory framework and the assumed flat energy tariff of 0.10 e/kWh. In the following the same study is applied for the peak hour option of the regulatory framework which was briefly introduced in section 7.2.

Impact of the battery investement cost with the peak power option and a variable energy price:

In the peak power option a variable tariff is proposed where the PV plant operator One can see that at a capacity cost of 100 e/kWh the optimal battery size is 200 kWh, while at higher battery capacity costs it is basically not profitable to install a battery. is remunerated 0.50 e/kWh during the peak hours between 19:00-21:00. Figure 7.11 shows the applied price profile. Additionally the PV plant operator is obliged to declare a grid power injection profile ≥ 20% • P nom during the peak hours. In figure 7.12 an exemplary result of the control scheme applied to one day and for one realization of the uncertainty is provided. The battery capacity in the example is 4000kW h. One can see how the battery stores a part of the energy produced by the PV panels during the day in order to be able to supply it to the grid during the peak hours where the energy price is higher. Figure 7.13 shows the guaranteed profit of the installation over 10 years with the peak power option. The same configuration is used as in the previously presented results for the basic option of the regulatory framework, i.e.

P nom = 5M W and the same battery capacity costs between 0 -1000 e/kWh. One can see that the optimal battery sizes that maximize the ROI are much higher (between 1500kW h and 2500kW h depending on the battery capacity cost) than in the results for the basic option. This is due to the fact that with the peak option the declared power profile P opt G has to be at least 20% of the PV plant's nominal power during the peak period. In case the battery is too small this required energy cannot be delivered and the resulting penalties reduce the to-be-expected profit significantly. An additional conclusion one can draw from the comparison with the basic option is that the to-beexpected profit is generally higher with the peak option which can be explained with power option is applied. The optimal battery size is between 1500 and 2500kW h depending on the battery capacity cost.

the higher energy price during the peak hours. For instance at a battery storage cost of 300 e/kWh the guaranteed profit with the peak option is around 5000000e while with the basic option it is only 4300000e.

Conclusion

In this chapter a stochastic optimization framework for PV power plants with associated battery storage has been proposed. More precisely, PV plants which are subject to regulations are addressed.

The framework allows to compute guaranteed lower bounds on the to-beexpected revenue of the installation for different sizes of the associated battery storage and at a configurable probability. The particular strength of the proposed method is that the uncertainty in the PV power predictions are explicitly taken into account. The complete method consists of a randomized algorithm formulation, an advanced control scheme and a method to generate realizations of the uncertain PV power production. Putting these three elements together, the framework is a valuable tool to estimate the optimal battery size that maximizes the to-be-expected profit for a PV plant under regulations.

From the results obtained in the case study one can see that the optimal battery size can vary quite importantly with the nature of the underlying regulatory framework.

General conclusion

This work was dedicated to the design of energy management algorithms for smart grids. The contributions can be divided into two parts: Distributed Model Predictive Control algorithms for a class of resource sharing problems and stochastic optimization methods for explicitly dealing with uncertainty.

In part I two hierarchical MPC frameworks are proposed, the first one being based on primal and the second one on dual decomposition. The underlying large-scale MPC problem includes coupling constraints between the subsystems' consumed resources as well as a coupling term in the objective function. As it has been shown, both frameworks are able to solve the initial large-scale problem to optimality. This is achieved by using an efficient implementation of the bundle method that relies on determining the optimal aggregation level of the underlying cutting plane model. Moreover, the advantages and drawbacks of both frameworks were discussed in detail: While the appealing interpretation of dual variables as shadow prices makes dual decomposition very attractive for smart grid applications, the technical limitation to strictly convex problems may be a relevant reason to opt for a primal decomposition approach in order to avoid convergence issues. However, when the system becomes very large-scale, then the dual decomposition approach is computationally more efficient, and the primal decomposition framework may even become computationally intractable. In an extensive case study for an existing smart grid, potential financial savings of 17% could be achieved thanks to the proposed DMPC approaches. Finally, a cloud-based implementation on two test sites has been conducted which demonstrated the feasibility of the proposed DMPC solutions in a real-life context.

In part II energy management systems dealing explicitly with uncertainty have been proposed for electric vehicle charging stations and for photovoltaic power plants. In both cases, the underlying stochastic optimization method is a randomized algorithm. In the case of the charging station, an upper bound profile on its day-ahead power consumption is computed, taking into account a statistic model of the uncertain electric vehicle behavior, that guarantees the customer satisfaction at the same time. It has been shown that the obtained upper bound is very close to the actually consumed power in real-time, which is of great value for distribution grid operators. For the photovoltaic power plant an economic optimization in the context of regulatory constraints is proposed. The method allows to optimally choose the size of an associated battery storage device, taking into account an uncertainty model of the photovoltaic power forecast. Moreover, the approach comprises an efficient realtime MPC controller which is optimally parametrized with respect to the uncertainty. A very similar MPC controller has been developed within this work and successfully implemented for two 1MW photovoltaic power plants, each equipped with a 1MWh Li-ion battery.

Perspectives

The work presented in this manuscript opens a great number of perspectives both on research and application levels.

Research

In this work DMPC algorithms for resource sharing problems were developed and efficiently solved using bundle methods. In order to further reduce the computational burden, parametrization techniques might be an interesting approach. Parametrization is a well-known method in MPC applications, allowing to reduce the number of degrees of freedom in the optimization problem without reducing the prediction horizon length as discussed in [START_REF] Qin | A survey of industrial model predictive control technology[END_REF]. The impact of such parametrization techniques on the closed-loop performance would have to be investigated in detail. In [START_REF] Lamoudi | Distributed model predictive control for energy management in buildings[END_REF]] this method has been successfully applied in a building MPC application, which suggests that similar results may be expected for the smart grid DMPC algorithms proposed in this work.

To the present day it remains an open question how the realized economic savings/benefits which were obtained thanks to the proposed DMPC controllers, can be fairly distributed amongst the actors according to their respective contributions. Different ways can be imagined: One way is to estimate each actor's contribution based on the measured historic consumption/production profiles which might serve as a base-line. Another possibility is to additionally constrain the sub-system's optimization problems in such a way that they are guaranteed to have at least the same gain as if they were operated independently from the other actors. In [START_REF] Vinot | Decentralized optimization of energy exchanges in an electricity microgrid[END_REF] the second method is applied in the context of a similar distributed optimizations framework which is based on the ADMM method.

A further perspective, which would be an extension of the proposed DMPC frameworks scope is to take the network topology through transmission losses and line capacity limitations into account. This becomes particularly important when the net-

General conclusion

work load at distribution level changes. This is typically the case when high amounts of PV panels are introduced at household level or when the number of EVs increases. The second case is addressed by [START_REF] Richardson | Optimal charging of electric vehicles in low-voltage distribution systems[END_REF] where a linear programming formulation is proposed that optimally coordinates the EV charging process of a large number of vehicles while respecting the network capacity constraints limits. Clearly, this would result in a much more complicated centralized MPC controller due to additional coupling constraints. The scalability of the approach would be challenged in this case and evolutions of the proposed DMPC frameworks would probably become necessary in order to maintain the computational efficiency and the scalability of the approach.

In this work, the proposed DMPC frameworks for resource sharing problems have been applied to smart grid systems composed of buildings, EV charging stations, renewable energy sources and battery storage systems. For further increasing the energy efficiency in smart grids, district heating networks and their coupling with the electricity grid through CHP (combined heat and power) plants should be incorporated into the approach. Furthermore, industrial sites represent an important load in many smart grids and could be integrated into the proposed DMPC frameworks as local MPC controllers. Especially their manufacturing processes often provide a large inherent flexibility which may be exploited by intelligent management systems (see [START_REF] German | Energy optimization in a manufacturing plant[END_REF] for instance), allowing to importantly contribute to the overall energy efficiency in a smart grid.

Application

Several perspectives are open in terms of application both for the DMPC frameworks and the two energy management systems based on randomized algorithms.

In the scope of the Ambassador project the two DMPC frameworks were tested on real test sites and the practicability of this type of solutions has been demonstrated. In order to obtain meaningful experimental results in terms of energetic performance, several technical issues which are not directly related to the concepts provided in this thesis need to be resolved. For instance, more reliable data flow between the MPC algorithms which are running on a server in the cloud and the different sub-systems is necessary. Moreover, the quality of weather forecasts and the forecasting models of certain uncontrollable loads should be improved.

Although the DMPC algorithms allow to distribute the execution of the different local MPC controllers on different machines, they were all hosted on the same server when applying the algorithms on the test sites in order to avoid communication issues during the iterative convergence process. In the future, the physical separation of the algorithms should be experimented and the necessary routines to deal with potential information losses should be developed.

For the energy management systems presented in part II, the statistic models for the uncertain EV behavior and the PV power forecasts were assumed to be available. In order to confirm the actual performance of the proposed methods, these statistic models should be calibrated based on real data.

• J(θ) représente la borne inférieure sur le revenu attendu qu'on cherche à maximiser et qu'on voudrait garantir à une probabilité configurable.

• w ∈ W représente une réalisation du profil de production de puissance incertain de la centrale photovoltaique.

• g(θ, w) représente la fonction d'indicateur qui évalue si, pour une réalisation donnée w du profil de production photovoltaïque et pour une paramétrisation de la stratégie de contrôle donnée θ, le revenu réalisé est au-dessus d'un certain seuil.

A.4 Conclusion générale

Les travaux présentés dans ce manuscrit sont dédiés au développement de stratégies de contrôle pour les smart grids. Les contributions peuvent être divisées en deux parties: La première partie propose l'application des méthodes de MPC distribué pour une classe de problèmes de partage de ressource. La deuxième partie propose l'application d'algorithmes randomisés permettant de prendre en compte explicitement des incertitudes dans le contrôle.

Dans la première partie une décomposition primale et une décomposition duale sont appliqués pour diviser un contrôleur centralisé en un coordinateur et plusieurs contrôleurs locaux. Il a été montré que les deux approches permettent de résoudre un problème de grande échelle à optimalité. Les avantages et inconvénients des deux approches ont été discutés en détail: Tandis que l'interprétation intéressante des variables duales en tant que prix d'énergie virtuels fait que la décomposition duale est très attirant pour des applications smart grid, sa limitation technique à des problèmes strictement convexes peut être une raison importante d'opter pour une décomposition primale afin d'éviter des problèmes de convergence. D'autre part, si le système est de très grande échelle, la décomposition duale est plus efficace d'un point de vue de temps de calcul et la décomposition primale pourrait même dépasser les capacités de calcul.

Lors d'une étude de cas extensive dans le cadre du projet Ambassador, des économies de coûts de 17% ont été réalisés grâce aux approches DMPC proposées dans ce manuscrit. Dans ce même projet européen, une implémentation basé sur le calcul à distance des approches proposés a été réalisée sur deux sites de test démontrant la faisabilité de ces approches en conditions réels.

Dans la deuxième partie de ce manuscrit deux systèmes de gestion d'énergie prenant en compte explicitement l'incertitude ont été proposés pour une station de "Energy management strategies for smart grids" Ph.D. thesis -Grenoble University Peter Pflaum

The increasing level of renewable energies in the electric grids and the foreseeable deployment of electric vehicles challenge the traditional ways of managing energy in those grids. While traditionally a centralized energy management paradigm has been applied, a tendency towards more decentralized control mechanisms, aiming to better exploit flexibilities at a local scale, can be observed.

In this thesis, two issues concerning the energy management in smart grids are addressed. In the first part of this thesis, two Distributed Model Predictive Control (DMPC) methods are proposed which allow a more efficient coordination of a group of actors in a smart grid. The focus in this first part is on the qualitative comparison and on the comparison in terms of computational efficiency of the two methods. The second part of this thesis deals with energy management systems that explicitly take into account uncertainties. For two systems, photovoltaic power plants and electric vehicle charging stations, energy management systems relying on randomized algorithms are proposed and their performances compared to deterministic strategies.

"Stratégies de gestion d'énergie pour les smart grids" Thèse de Doctorat -Université de Grenoble Peter Pflaum

Le taux croissant de sources d'énergies renouvelables dans les réseaux électriques et l'apparition prévisible de voitures électriques remettent en cause les mécanismes traditionnels de gestion de ces réseaux. Alors que les réseaux électriques ont été traditionnellement gérés de manière centralisée, on s'oriente de plus en plus vers une gestion décentralisée avec l'objectif d'exploiter au mieux les flexibilités à un niveau local.

Dans cette thèse, deux problématiques concernant la gestion de l'énergie au niveau des smart grids sont adressées : La première partie de cette thèse propose deux algorithmes de commande prédictive distribués pour coordonner de manière plus efficace un ensemble d'acteurs dans un smart grid. Le focus est sur la comparaison qualitative de ces deux méthodes ainsi que sur leurs performances en termes de temps de calcul. Dans la deuxième partie de cette thèse, des méthodes de gestion d'énergie prenant en compte explicitement l'incertitude sont proposées pour une centrale photovoltaïque et pour une station de recharge de véhicules électriques. Les méthodes reposent sur des algorithmes randomisés qui permettent d'obtenir des garanties probabilistes de performance.

  de commande prédictive distribuées (DMPC) sont proposées et comparées. Les deux méthodes misent sur la division d'un problème d'optimisation de grande échelle en plusieurs contrôleurs MPC locaux et un contrôleur de coordination. Les deux méthodes sont basées sur une décomposition primale et sur une décomposition duale respectivement. L'efficacité en termes de temps de calcul des deux méthodes est démontrée, ceci en vue de la grande échelle des systèmes étudiés. De plus, la modularité, la robustesse et la protection des données sont des avantages qu'offrent ces stratégies de MPC distribuées par rapport à un contrôleur MPC centralisé. Un autre défi important dans la gestion des réseaux électriques est la maitrise des incertitudes croissantes dans les réseaux d'énergie. Ces incertitudes sont principalement dues à l'intermittence des sources d'énergies renouvelables et à l'apparition des véhicules électriques avec leur besoin d'énergie fluctuant. Pour gérer ces incertitudes, des solutions techniques innovantes seront requises pour maintenir la stabilité et la qualité de service des réseaux électriques. Pour répondre à ce défi, deux systèmes de gestion d'énergie prenant en compte l'incertitude explicitement sont proposés dans cette thèse. Le premier est dédié à la gestion et au dimensionnement d'une centrale de production photovoltaïque, et le deuxième à la gestion de stations de recharge de fossil fuels enabled the industrial revolution and led to tremendous changes in the way we are living today. It has probably been the most radical transformation of society in human history.

Figure 1 . 2

 12 Figure 1.2 Predicted world energy consumption for three different policy scenarios. The "New Policies Scenario" takes into account both existing and planned policies (source [IEA 2014]).

N

  stored bundle at the s-th iteration J(s) cutting plane model of objective function J at the s-th iteration n B number of cuts in one cutting plane model D γ (s) stabilizing term in the master problem Chapter 2. Primal & dual decomposition x • concatenation of several profiles defined as x • := x T 1 , ..., C number of cutting plane models N B number of sub-systems approximated by one cutting plane model x optimal solution of an optimization problem

Figure 2 . 1

 21 Figure 2.1 Objective function J l and its piece-wise linear approximation Jl (r l ) after 4 iterations.

Figure 3 . 1

 31 Figure 3.1 Smart grid overview.

Figure 3 . 2

 32 Figure 3.2 Upper-and lower bounds defining the occupant comfort in abuilding. One can see how that it is linked with the predicted occupancy schedules for the building.

Chapter 4 .

 4 Numerical & real-life validation Global Limited transformer capacity P G = 75 kW Buildings 10 residential buildings of different sizes and inertia. Typical power consumption lies in the range of 0-15kW Batteries Bat 1 capacity: 50 kWh efficiencies η + = η -= 0.85 Bat 2 capacity: 50 kWh efficiencies η + = η -= 0.95 Bat 3 capacity: 25 kWh efficiencies η + = η -= 0.95 PV panels PV 1 nominal power P nom = 60 kW PV 2 nominal power P nom = 100 kW EVCS EVCS 1 consisting of 20 charging points nominal charging power P nom = 3

Figure 4 . 1

 41 Figure 4.1 Energy tariff profile Γ + for buying energy from the external grid.

Figure 4 . 2 Figure 4 . 3

 4243 Figure 4.2 Closed-loop simulation results of a district composed of 10 build-ings, 3 batteries, 1 EVCS and 2 PV systems simulated for a period of hours. The underlying DMPC scheme is the dual decomposition approach provided in section 3.5.

Figure 4 . 5

 45 Figure 4.5 Iterative convergence process in the primal decomposition framework for a smart grid composed of 500 sub-systems. It shows that the more sub-system cost functions are aggregated in a common cutting plane model, the higher is the necessary number of iterations to converge to the global optimum.

Figure 4 . 6

 46 Figure 4.6 View on the two test-sites in Chambéry, France and in Lavrion, Greece.

  Figure 4.7 Architecture of the system to deploy the proposed DMPC algorithms on the test sites of the "Ambassador" project.

Figure 4 . 8

 48 Figure 4.8 Screenshot from the SCADA system of the INES test site. The power profiles of the different sub-systems are visualized as well as the state-of-charge of the battery. The global power exchanged with the external grid is shown in blue. One can see that during certain periods the smart grid is consuming energy from the external grid and during others it is re-injecting energy into the grid.

  Ê(θ, w) empirical mean approximating E(θ) w set containing N uncertainty realizations w (1) , ..., w(N ) constraints P lim (θ) day-ahead upper limit profile on the EVCS's power consumption

Figure 6 . 2

 62 Figure 6.2 Figure showing how the aggregated model would be built from five EVs which are charged at three different charging points during one exemplary day.

Figure 6 . 3

 63 Figure 6.3 Figure illustrating the design parameter vector θ = [θ 1 , ..., θ 4 ] T for the EVCS located at a company site.

Figure 6 . 4

 64 Figure 6.4 Robust upper limit prediction profile of the EVCS's power consumption (black) and the actual power consumption after affecting the upper limit profile to 3 different 24h-scenarios. Note that all 3 scenarios are feasible in the sense of the customer satisfaction definition from section 6.3.2.

Figure 6 . 5

 65 Figure 6.5 Relation of each EV's charging time with its actually charged energy being expressed as the percentage of its initially demanded energy at arrival. Points which lie left of the blue dashed line represent EVs which are unsatisfied in the sense of equation (6.3.1).

Figure 6 . 6

 66 Figure6.6 Direct charging strategy applied to the same 3 scenarios as with the robust charging strategy shown in figure6.4. It becomes obvious that with the direct charging strategy the power consumption can differ importantly from one day to another due to the uncertainty. Moreover it is impossible to respect a pre-defined upper limit profile on the power consumption with such a non-robust strategy.

Figure 6 . 7

 67 Figure 6.7 Predicted mean over-consumption as a function of the number of charging points n CP and the robustness parameter η. It shows that the approach is particularly well-suited for large charging stations.

Figure 6 . 8

 68 Figure 6.8 Predicted mean over-consumption as a function of the parame-ter c satis which is the threshold defining the customer satisfaction (see eq. 6.3.1)).

Figure 7 . 2

 72 Figure 7.2 Visualization of the remuneration which is a function of the inadvance declared power injection into the grid P G and the actually realized power injection P G,r . This remuneration scheme is imposed by the regulations [CRE 2015] and the underlying equations are provided in table 7.1.

PFigure 7 . 5

 75 Figure 7.5 Example of a bounding envelop on the predicted PV power profile. The figure additionally shows the underlying historical measured power..... P hist sampled at τ r = 1min and its re-sampled version at sampling period τ p = 15min. Note that in order to create the uncertainty bounds B, B, the profile P hist is additionally filtered in order to eliminate the dayspecific variations of the historic data profile in the uncertainty bounds.

Figure 7 . 8

 78 Figure7.8 Guaranteed lower bound on the to-be-expected revenue J opt (θ) at a probability of 1η = 90% and with confidence 1δ = 95% and the mean revenue 1 N

  PV power forecast scaling factor θ 2 average annual revenue[e]

Figure 7 . 9

 79 Figure 7.9 Mean revenue of the N = 234 uncertainty realizations as a function of the battery size and the scaling factor θ 2 of the amplitude of the PV power forecasts P .→24 in the planning problem.

Figure 7 .

 7 Figure 7.10 Guaranteed profit over 10 years as a function of the battery sizeand for different battery capacity costs in the range 0-1000 e/kWh. One can see that at a capacity cost of 100 e/kWh the optimal battery size is 200 kWh, while at higher battery capacity costs it is basically not profitable to install a battery.

SOC

Figure 7 .

 7 Figure7.12 Exemplary results of the control scheme with the peak hour option. The battery capacity is 4000kW h. The battery stores the energy produced by the PV panels during the day in order to sell it to the grid during the peak hours where the energy price is higher.

  ]. Already

	Chapter 1. General Introduction 01023 567 8269 69 5539 s t t u v
	30 ...	789 : ; = 8= >: ?9 @ A>9 B CDC9 EB F G??: B H 9 8A IJKI = 8 LMMJ NB H GC: O P= 8CQ
	3/ ...
	3. ...
	2 ...
	1 ...
	0 ...
	/ ... . 3453 3456 342. 3426	344.	3446	/... /..6 /..4
	(# )* ,-& #		! "! #$ %& '		+
	+ .n4p	,-&# 3n2p	IJKo "! #$ %& ' 3.n1p	.n3p	(# )* /0n1p	,-&# /nqp 6n2p +	LMMJ "! #$ %& ' 3.n/p .n2p	(# )* /5n/ p
	31n.p					! 01n.p	/.n4p		! q/n2p
	w

RSTU WXY Z[[S \ ]^_ ` aWb ^` c\ defg hRRR ij c^RZRk[ ij c ! %+ & # l m # m '! %&m m +n

Figure 1.1 World energy consumption (source [IEA 2011a]).

  Pflaum, M. Alamir, & M. Y. Lamoudi. Comparison of a primal and a dual decomposition for distributed MPC in smart districts. In IEEE International Con-Bourry, W. Audrey, D.-L. Ha, P. Béguery, N. Rousset, P. Pflaum. Simulation for the evaluation of energy management algorithms at the district level-Example of use case from the AMBASSADOR project. In IEEE PowerTech, 2015.

	Chapter 1. General Introduction
	Conferences
	1. P. ference on Smart Grid Communications, 2014.
	2. P. Pflaum, M. Alamir, & M. Y. Lamoudi. Scalability study for a hierarchical NMPC scheme for resource sharing problems. In European Control Conference Chapter 2
	(ECC), 2015.
	3. F. Part I Primal & dual decomposition
	Distributed MPC for resource sharing
	problems
	Patents
	1. P. Pflaum and M. Alamir. Procédé de gestion en énergie d'une station de
	recharge de véhicules électriques, 2015.

2. P. Pflaum and M. Alamir. Procédé de contrôle d'une centrale de production électrique, 2016. Nomenclature H number of time intervals of length τ in the prediction horizon N S number of sub-systems S set of sub-systems 1, ..., N S

  Master increases. The trade-off between theses two effects can be tuned through the two parameters n B and N C .

	0 Figure 2.2 This figure shows that the time t Master to solve the master problem 100 200 300 400 500 600 700 800 900 1,000 10 -3 10 -2 10 -1 10 0 10 1 number of constraints in master problem, N ctr = n B • N C t Master [sec] increasing n B , N S = 20, disaggregated bundle increasing N C , N S = 100, semi-aggregated increases quasi exponentially with the number of constraints. The compu-tation time measures are obtained in the context of a dual decomposition framework where the sub-systems are buildings of different size and iner-tia. N ctr t t 2 = n iter × t Master t 1 = n iter × (t Subsys + t Comm ) t total = t 1 + t 2 N ctr,opt Figure 2.3 Qualitative impact of the number of constraints N ctr = n B • N C on the total efficiency, i.e. on the total computation time of the DMPC frame-work. When N ctr increases, the precision of the cutting plane approxima-tions increases as well. As a consequence, for an increasing N ctr , the re-quired number of iterations n iter decreases, but the time to solve the master problem t Chapter 2. Primal & dual decomposition are discussed in the following.

Chapter 3 Resource sharing problem in the smart grid context

	Nomenclature
	ϑ	building indoor temperature
	ϑ 0	initial building indoor temperature
	ϑ, ϑ	lower-and upper thermal comfort bounds
	ϑ ext	external temperataure
	σ	ambient conductivity coefficient
	c	building heat capacity
	η	efficiency
	τ	sampling period
	E	stored energy in a battery
	E 0	initial stored energy in a battery
	P Bat	battery charging power
	η + , η -	battery charging-and discharging efficiencies
	t arr,v , t dep,v arrival-and departure time of the v-th vehicle
	E req,v	required energy of the v-th vehicle
	N EV	number of vehicles connecting to the EVCS
	P Bat,v	battery charging power of the v-th vehicle
	E v	charged energy in the battery of the v-th vehicle
	P EVCS	power consumption of the EVCS
	P max,Ev	maximal charging power which can be absorbed by a vehicle's battery

Chapter 3. Resource sharing problem in the smart grid context

	P max,v	upper limit profile on the power supplied to the v-th vehicle
	B v , B v	lower/upper limit profile on the energy supplied to the v-th vehicle
	P	forecasted renewable power production profile
	P G	power exchanged with the grid
	P G	upper limit on the consumed power from the grid
	J l	objective function of the l-th sub-problem
	P l	consumed/produced power of the l-th sub-system
	P	consumed/produced power of a sub-system
	P , P	lower-and upper power limits
	Φ	lower triangular matrix with all values equal to 1
	P

+ , P -profiles with respectively the positive and negative elements of P P G,cons profile of consumed energy from the grid P G,prod profile of power injected into the grid m linear weight vector for the implementation of soft constraints z 1 , ..., z 4 slack variables for the implementation of soft constraints ρ 1 , ρ 2 weights in quadratic cost function terms dP profile of rate variations of the profile P P i i-th element of profile P dP Bat,v profile of rate variations of the profile P Bat,v

Centralized MPC controller

	charged energy [kWh]	0 2 4 6 8 10	0	2	4	6	8 10 12 14 16 18 20 22 24
							time [h]

  Resulting optimal solution of a district composed of 1000 buildings. The optimal power and temperature profiles of randomly chosen buildings are provided in the second and third sub-figures. The first sub-figure shows the global power consumption of the district and that the global power limit is respected. Finally in the fourth sub-figure the dual variable λ is plotted. Computation time t Master to solve the master problem for an increasing number of cutting plane approximations N C .

	0 0 0 0 Figure 4.4 Chapter 4. Numerical & real-life validation 2 4 6 8 10 12 14 16 20 22 24 0 5 10 15 20 P Build [kW] 2 4 6 8 10 12 14 16 20 22 24 0 2 4 6 8 10 P grid [MW] 2 4 6 8 10 12 14 16 20 22 24 0 10 20 30 40 Temp. [ • C] 2 4 6 8 10 12 14 16 20 22 24 0 0.05 0.1 0.15 0.2 Time [hour] λ number of cutting plane models N C t Master 1 0.003 2 0.004 5 0.005 10 0.009 20 0.019 40 0.037 100 0.250 200 1.164 Table 4.2

Remark 2 :

 2 The computation time of the master problem is much smaller in the Total computation time of the primal decomposition scheme estimated by the equation t total = n iter •(t Master +t Comm +t Subsys ). The time to solve the sub-system optimization problems in parallel is about t Subsys = 0.1sec and the communication time t Comm is assumed to be negligible. Note that the time to solve the master problem in the dual decomposition framework is much lower (see table4.2), because the number of variables in the dual master problem is independent from the number of sub-systems.

	Chapter 4. Numerical & real-life validation
	number of cutting
	plane models N C t Master [sec] n iter t total [sec]
	1 2 5	0.56 0.71 0.91	∞ ∞ 793	∞ ∞ 801
	10	1.18	607	777
	25	1.77	285	533
	50	2.60	241	651
	100	3.05	202	636
	250	5.11	152	790
	500	8.47	157	1346
	Table 4.3

  ].

	Chapter 6
	Energy management under uncertainty
	for EV charging stations
	Nomenclature
	E charged energy supplied to a vehicle
	E req	required energy of a vehicle's battery to become fully charged
	τ const	time constant
	c satis	satisfaction threshold (in %)
	t connected time a vehicle remains connected at the charging station
	n arr	number of vehicles arriving during one time interval
	t arr	arrival time of a vehicle
	t dep	departure time of a vehicle
	τ	sampling period
	H	number of time intervals of length τ in the prediction horizon
	n CP	number of charging points at a charging station
	n EV	number of electric vehicles in a scenario
	n occ	number of occupied charging points.

Chapter 6. Energy management under uncertainty for EV charging stations

	1 CP 2 CP CP 3	0.4 0.4 1 0.8 0.6 0.2 0 1 0.8 0.6 0.2 0 0 0.2 0.4 1 0.8 0.6	CP schedule SOC arrival (%) 0 2 4 6 8 10 12 14 16 18 20 22 24 0 2 4 6 8 10 12 14 16 18 20 22 24 0 2 4 6 8 10 12 14 16 18 20 22 24
			time [h]

7. PV power plants under regulatory constraints and uncertainties

  W (P hist ) Probability measure allowing to generate uncertainty realizations w := { P 0→24 , P 6→24 , P 12→24 , P 16→24 , P} based on historic measured PV power profiles

	P nom	nominal (maximal) power of the PV panels
	B	bound on the forecasted PV power profile
	dP G	variation in the power-to-grid profile P G
	SoC	state-of-charge of the battery
	SoC d	desired state-of-charge
	E	battery efficiency
	Γ	energy tariff
	J r (θ, w)	realized revenue for one realization of the uncertainty w
	P C k	predictive controller for control period k
	RT C	real-time controller
	P r

Table 7 .1

 7 Calculation of the remuneration.

7.5. PV power uncertainty generator

  Results obtained when applying the control strategy composed

	P [kW]	500 1,000					P G ± 5% • P nom P G,r P G,old
	P [kW]	0 500 1,000 0	0	2	4	6	P P G,r P Bat 8 10 12 14 16 18 20 22 24
	E [kWh]	0 200 400	0 0	2 2	4 4	6 6	8 10 12 14 16 18 20 22 24 8 10 12 14 16 18 20 22 24 SOC
								time [h]
	Figure 7.3

  Realization of the uncertain PV power predictions P(P hist ), the lower-and upper bounds B and B as well as the historic measured PV power P hist . Realization of the uncertainty w consisting of the PV power predictions P 0→24 , P 6→24 , P 12→24 and P 16→24 and the actually realized power profile P.

	0 0 4 6 8 10 12 14 16 18 20 22 24 5 10 15 20 25 0 1,000 2,000 3,000 4,000 5,000 16 : 00 (J-1) 5 10 15 20 25 0 1,000 2,000 3,000 4,000 5,000 10 : 00 0 1,000 2,000 3,000 4,000 5,000 6,000 J-1, 16:00 4 6 8 10 12 14 16 18 20 22 24 0 1,000 2,000 3,000 4,000 5,000 6,000 10:00 Figure 7.6 7.6. Simulation results 0 5 10 15 20 25 0 1,000 2,000 3,000 4,000 5,000 04 : 00 P hist P .→24 B, B 0 5 10 15 20 25 0 1,000 2,000 3,000 4,000 5,000 14 : 00 4 6 8 10 12 14 16 18 20 22 24 0 1,000 2,000 3,000 4,000 5,000 6,000 04:00 P P .→24 4 6 8 10 12 14 16 18 20 22 24 0 1,000 2,000 3,000 4,000 5,000 6,000 14:00 Figure 7.7

123 Chapter 7. PV power plants under regulatory constraints and uncertainties

	profit [e]	4 • 10 6 4.05 • 10 6 4.1 • 10 6 4.15 • 10 6 4.2 • 10 6 4.25 • 10 6 4.5 • 10 6 4.45 • 10 6 4.4 • 10 6 4.35 • 10 6 4.3 • 10 6	0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 battery capacity [MWh] capacity cost: 0 e/kWh capacity cost: 100 e/kWh capacity cost: 300 e/kWh capacity cost: 500 e/kWh capacity cost: 1000 e/kWh

  Figure 7.11 Variable tariff profile Γ which is applied if the PV operator chooses the peak hour option. During the peak period lasting from 19:00 to 21:00 the remuneration is five times higher than during the rest of the day and the PV plant operator is obliged to declare a power P G ≥ 20% • P nom .

								7.6. Simulation results
			0.6
	tariff [e/kWh]	0 0.2 0.4	0 2 4 6 8 10 12 14 16 18 20 22 24
								time [h]
	P [kW]	2,000 4,000			P G ± 5% • P nom P G,r P G,old
			0
				0	2	4	6	8 10 12 14 16 18 20 22 24
	P [kW]	0 2,000 4,000				P Bat P G,r P
	-2,000 4,000	0	2	4	6	8 10 12 14 16 18 20 22 24
	E [kWh]	0 1,000 2,000 3,000	0	2	4	6	8 10 12 14 16 18 20 22 24
								time [h]

Remark:In most PV plant installation Maximum Power Point Tracker (MPPT) converters are used to convert the direct current (DC) delivered by the PV panels into alternating current (AC). These converters have the possibility to arbitrarily limit the amount of power converted to AC. For this reason it is assumed that the case

General conclusion

Remerciements

Chapter 4. Numerical & real-life validation can see that in order to respect the global power limitation P G in the district, the EVs' batteries are charged during the less congested periods. For instance from 22h-26h, at charging point 1, an EV becomes fully charged although it remains connected until 31h. Thanks to this anticipation, the upper bound on the global power consumption can be respected during the period from 26h-31h where the buildings require all the available power to maintain their quality of service. Finally, in the last plot, the tariff profile and the dual variables λ and µ are depicted. The blue line represents the sum Γ + + λµ which is the modified energy tariff applying in the sub-systems' MPC controllers in the dual decomposition approach. Recall that this information is the same for all sub-system controllers, independently of their total number, and that this information alone makes the sub-systems converge to the globally optimal behavior. This is one great advantage of the dual decomposition framework over the primal one where the number of decision variables in the master problem increases linearly with the number of sub-systems.

Performance equivalence of the primal and dual decomposition schemes

In the previous section the closed-loop performance of the dual decomposition scheme was presented for an exemplary district composed of 16 sub-systems. In the following we aim at demonstrating that the dual and the primal decomposition schemes result in equally good performances and that both of them recover the globally optimal behavior of the corresponding centralized MPC controller.

For this purpose the same closed-loop simulation which was provided in the previous section for the dual decomposition approach, is also performed with the DMPC approach based on the primal decomposition and with the centralized MPC controller. Figure 4.3 shows the evolution of the objective values of the three control schemes over time. More precisely, at each time-step, the optimal objective values of the open-loop controllers are plotted. One can see very nicely that the cost value of the primal decomposition scheme constitutes an upper bound on the optimal cost value of the centralized MPC controller, while the dual decomposition scheme approaches the optimal cost value from below.

Financial savings

It is a very difficult task to estimate the potential financial savings which can be achieved thanks to the proposed DMPC frameworks, since it is very context dependent. In fact, for a given smart grid configuration, two different energy tariff contracts Chapter 5. Randomized algorithm approach Using this notion, randomized algorithms focus on solving the robust problem

where J : Θ → (-∞, ∞) is a measurable function which represents the controller performance and η ∈ (0, 1) is a probabilistic accuracy. Given the confidence δ ∈ (0, 1), the main point of the randomized algorithm is to determine probabilistic solutions θ feas satisfying E(θ feas ) ≤ η with probability no smaller than 1δ.

Usually, computing the exact value of the probability of violation E(θ) for a given θ is difficult, because this requires solving a multiple integral with a usually non-convex domain of integration. However, its value can be approximated by the empirical mean Ê(θ, w) which is defined as

with w = {w (1) , ..., w (N ) }. The empirical mean Ê(θ, w) is a random variable which is always within the closed interval [0, 1]. Moreover, in order to minimize the performance index J(θ), one idea underlying randomized algorithms is to allow for some violations of the constraints. This is expressed by the m-level randomized strategy which is defined as

Note that this is equal to minimizing J(θ) subject to the constraint that the empirical mean is not larger than m N . The main result of randomized algorithms for finite sets of the design parameter vector is that if one fixes η, δ and m ≥ 0 and then draws N i.i.d. samples of the uncertainty w (1) , ..., w (N ) , with

and then solves the m-level randomized strategy (5.2.4), then with probability no smaller than 1δ, the probability of violation E(θ feas ) is no larger than η, i.e.

Pr w ∈ W :

Note that the lower bound on the required number of samples N which is determined by inequality (5.2.5) strongly depends on the choice of the parameters η, δ, m and the cardinality n C of the design parameter vector set Θ. They should be chosen in such a way that the sample size N does not become unnecessarily large. Chapter 6. Energy management under uncertainty for EV charging stations

The profiles B v and B v account for two purposes: First, through B v , it is guaranteed that at the departure of the v-th EV its required energy has been allocated by the EVCS. Second, profile B v assures that no more energy is allocated than the battery of the vth vehicle can absorb. In other words, any profile b v of supplied energy to the v-th vehicle that fulfills B v ≤ b v ≤ B v is feasible in the sense that it supplies the required energy E req,v without violating the constraints on the battery's state-of-charge.

Furthermore the aggregated profiles P (S) max , B (S) and B (S) are defined as:

Figure 6.2 illustrates how the aggregated EVCS model would be built for the availability schedules of the three exemplary charging points shown in figure 6.1.

Based on the previous definitions the aggregated EVCS optimization problem for a given scenario S is defined in problem (6.3.9). It computes the optimal power consumption profile P opt,(S) for the charging station. It is important to keep in mind that this problem is valid only in the ideal situation where the uncertain EV behavior was known in advance.

where Γ is the energy tariff profile and p is the decision variable of the problem representing the total power consumption profile of the EVCS. b is the profile of allocated energy for the EVCS, η the charging efficiency and Φ is a lower triangular matrix where all values are equal to 1. Φ accounts for the integration of the consumed power profile over the prediction horizon, resulting in the consumed energy profile b. The Chapter 7

PV power plants under regulatory constraints and uncertainties

Nomenclature X bold-faced variables represent profiles of X. X forecasted profile of X.

X, X lower-and upper bound on X.

i-th element of profile X.

X (i) i-th realization of X. X (t=hh:mm) element of profile X at time hh : mm.

X opt

optimal solution of an optimization problem. X hist profile of historic measured data.

mean derivative profile over n S consecutive samples of X.

Regulatory framework

The regulatory framework being addressed in this work is imposed by the Energy Regulatory Board of France for PV installations with a nominal power P nom greater than 100kW. The principle of the regulatory framework is that PV plant operators have to declare their day-ahead predicted power injection profile P G (sampled at τ r = 1min) to the grid operator. The declared profile additionally has to respect the following ramping constraints:

If the actually realized power injection into the grid does not follow the previously declared one within some tolerance margin, financial penalties do apply. During the day J itself the PV plant operator may re-declare the predicted profile three times which allows him to react to changes in the weather forecast as described in the following.

Steps to (re-)declare the predicted power injection P G :

• J-1, before 16:00 : Declare profile P G,0→24 .

• J, before 04:00 :

Declare profile P G,6→24 .

• J, before 10:00 : Declare profile P G,12→24 .

• J, before 14:00 : Declare profile P G,16→24 .

An additional requirement on the re-declared profiles is that the first point in the re-declared profiles has to be the same value as the one in the previously declared one as illustrated by the following equations:

Remuneration scheme:

The plant operator is paid for his injected energy according to the formulas provided in table 7.1 which incorporate the penalties for not respecting the previously declared power profile. Figure 7.2 illustrates this remuneration scheme.

Chapter 7. PV power plants under regulatory constraints and uncertainties the binary constraint satisfaction function g(θ, w) is defined as

with J r (θ, w) being the realized revenue for one realization of the uncertainty w. In other words, g(θ, w) is a measure whether for a given θ and w, the realized revenue is greater than J(θ) = θ 1 .

The considered uncertainty w represents the fact that the actually realized PV power production differs from the one that was previously forecasted and used to compute the declared power-to-grid profile P G . For generating one realization of the uncertainty w the following two principle steps are performed:

• Generate a realization of the forecast of the PV power P (sampled at τ p ) based on historic measured data.

• Generate N realizations P of the actually produced PV power (sampled at τ r ) based on the previously generated P.

In order to solve the problem described in this section, we apply the randomized algorithm method for finite sets of the design parameter vector described in chapter 5. More precisely, it consists in solving the m-level randomized problem (5.2.4) which is described in detail in the following.

Solving the robust design problem

For a given battery size, the m-level randomized strategy (5.2.4) corresponding to problem (7.3.1) is solved in the following way:

1. Fix the finite set Θ = {θ (1) , ..., θ (n C ) } of design parameter vectors of cardinality n C as well as the randomized algorithm parameters η, δ and m.

2. Generate N realizations of the uncertainty w (1) , ..., w (N ) with N obeying inequality (5.2.5 ).

Compute the failure indicator

For each simulation corresponding to (θ (k) , w (i) ), the resulting failure indicator:

is computed where g(•, •) is defined by (7.3.2). Similarly for any candidate parameter θ (k) (revenue bound, forecast scaling factor), the corresponding cost matrix J (k) can be computed. battery is already at its lower limit at this moment. Also it is interesting to see how the originally declared profiles P G,old differ from the finally declared P opt G due to the updated PV power forecasts.

As mentioned in section 7.3.2, the computationally time-consuming part of the whole framework lies in simulating the control scheme in closed-loop in order to compute the realized revenue J r (θ (k) , w (i) ). In algorithm 3 the steps involved in the computation of J r (θ (k) , w (i) ) are illustrated in detail.

In the following section the uncertainty model allowing to generate i.i.d. uncertainty realizations of the PV power production w := { P 0→24 , P 6→24 , P 12→24 , P 16→24 , P} is introduced.

PV power uncertainty generator

When applying the control strategy described in the previous section in real-time, at every day J the 4 forecasted PV power production profiles P 0→24 , P 6→24 , P 12→24 , P 16→24 are provided based on a weather forecast service at the times t 0 = {J-1 at 16:00, 04:00, 10:00, 14:00}. Since our proposed framework serves as an a priori battery sizing tool these information have to be created artificially. More-Algorithm 3: Computation of J r (θ, w).

1 Inputs: w, N days , SoC 0 , C bat , θ 2 ;

(Recall w := { P 0→24 , P 6→24 , P 12→24 , P 16→24 , P})

2 Init: SoC = SoC 0 , J r (θ, w) = 0, interval 1 = {00 : 00} : {06 : 00}, interval 2 = {00 : 60} : {12 : 00}, interval 3 = {12 : 00} : {16 : 00}, interval 4 = {16 : 00} : {24 : 00};

9 Outputs: J r (θ, w) ;

The principle steps of the method are as follows:

• Based on P hist the 4 forecasts P .→24 are generated.

• Once the 4 forecasts P .→24 are created, N realizations of the actually produced PV power P are generated based on these forecasts.

The method used to create both, the forecasts and the realized power profiles, is the same. It will be introduced in detail for the case of the forecasts P .→24 (P hist ), but works similarly for the realized PV power P( P .→24 ). Note that for notational conciseness P .→24 will be replaced by P if no ambiguity occurs. The PV power uncertainty generation method is based on the following assumptions:

• The uncertainty in the forecasted PV power profiles increases the further a predicted instant lies in the future. This is realized through a bounding envelop of increasing width for instants lying further in the future.

• The dependency of a sample P t on the previous samples P 1 , ..., P t-1 is taken into account through bounds on the mean derivative over several sampling instants.

Bounding envelop on the profile P : As mentioned above a bounding envelop on the PV power prediction profile P of increasing width represents the fact that predicted samples lying further in the future are more uncertain. The upper and lower bounds B, B on the predicted profile P are defined as follows:

where the -operator is the element-wise product of two vectors of same length and with C envelop being parameterizable through a 0 , a 1 , a 2 , a 3 as follows:

where t 0 is the current time. Figure 7.4 illustrates the resulting shape of vector C envelop . Additionally also the envelop chosen for generating P( P) is plotted. Note that the latter has an uncertainty equal 0 at the current time t 0 which accounts for the fact that the forecasted value for time t 0 is the actually measured one. In figure 7.5 the resulting envelop bounds B, B, as well as the profile P hist (sampled at τ r = 1min and re-sampled at τ p = 15min) are illustrated exemplarily.

Bounded mean derivatives on the profile P:

In order to implement the assumption that the predicted power P t at instant t is not independent of the previous samples ( P 1 , ..., P t-1 ), the mean derivatives over several sampling periods of the profile P are bounded. Définition 7.5.1. The mean derivative vector D n S (X) ∈ R N for vector X ∈ R N over n S consecutive time steps is defined as follows:

Note that in the case-study provided in section 7.6 the values chosen for n S are n S = {1, 2, 4, 10} which correspond to the intervals of 15 minutes, 30 minutes, 1 hour Moreover the importance of optimally tuning the control scheme in order to maximize the to-be-expected revenue has been demonstrated.

Appendices

Appendix A

Résumé en français

Résumé

Cette partie est un résumé en français du manuscrit de thèse. Le résumé ne prétendant pas être exhaustif, le lecteur est prié de se reporter à la version anglaise pour plus de détails techniques.

A.1 Introduction

Défi énergétique

Les sources d'énergie fossiles ont donné lieu à la révolution industrielle qui a influencé de manière forte la façon dont nous vivons aujourd'hui. Elle a probablement été la transformation de société la plus profonde dans l'histoire de l'homme.

Le prix que nous sommes en train de payer pour l'amélioration de la qualité de vie obtenue, est le réchauffement climatique dû aux émissions CO 2 . Pour limiter ce réchauffement à 1.5°C, une forte diminution des émissions CO 2 a été décidé lors de la conférence COP21 à Paris. En considérant le fait que la consommation énergétique ne cesse pas d'augmenter (figure A.1), des efforts considérables seront nécessaires pour réaliser cet objectif ambitieux.

Transformation des réseaux électriques

Une mesure clé pour répondre à ce défi énergétique est l'introduction forte de sources d'énergie renouvelables dans le réseaux électrique existant. Cette évolution de moyens de production grands et centralisés vers un grand nombre de moyens de production renouvelables et décentralisés met en question la façon dont le réseau est opéré actuellement. Surtout la nature intermittente des renouvelables peut perturber la qualité et la stabilité du réseau électrique. Un autre aspect qui posera de nombreux défis à la gestion de l'énergie est l'émergence des véhicules électriques. Ces charges supplémentaires et souvent difficiles à prédire peuvent poser un problème au niveau du réseau de distribution, surtout dans des régions où le réseau n'a pas été conçu pour accueillir des grandes charges supplémentaires.

Pour une intégration efficace de ces nouveaux acteurs qui permettra d'assurer la qualité de service dans les réseaux énergétiques, des méthodes de gestion d'énergie distribuées et avancées seront nécessaires.

Objectif de la thèse

Cette thèse a pour objectif de proposer des stratégies de gestion d'énergie avancés, capables d'améliorer l'efficacité de ces systèmes, d'améliorer la robustesse malgré les fortes incertitudes introduites par les nouveaux acteurs et de proposer des solutions génériques, modulaires et qui permettent le passage à l'échelle.

Dans ces travaux de thèse deux types de solutions ont sont proposés et validés à travers des simulations et partiellement à travers d'expérimentations. Le premier type de solution est l'application de la commande prédictive distribuée pour la gestion d'énergie au niveau d'un quartier intelligent. Le principe de la commande prédictive étant l'anticipation d'événements futurs fait que cette approche est particulièrement bien adaptée pour améliorer l'opération efficace des systèmes énergétiques. Le choix d'une approche distribuée finalement permet le passage à l'échelle et assure la modularité de la méthode.

Malgré le fait que la commande prédictive permet de compenser un certain niveau lution globalement optimale et réalisable [START_REF] Diehl | Report of literature survey, analysis, and comparison of on-line optimization methods for hierarchical and distributed MPC[END_REF]]. Ceci peut être problématique pour des applications temps-réel où la capacité de calcul et de communication qui est disponible à chaque instant de contrôle est limitée. Pour gérer cette difficulté nous utilisons une implémentation efficace de la méthode des faisceau dans laquelle la précision de l'approximation en coupes linéaires est choisie de manière optimale.

A.3 Stratégies de contrôle basés sur des algorithmes randomisés

Incertitudes ont un impact important sur la performance des systèmes de gestion d'énergie dans le contexte des smart grids. Les incertitudes fortes qui sont inhérentes aux sources d'énergie renouvelables ainsi qu'au comportement des véhicules électriques constituent une menace pour la stabilité des réseaux électriques.

Dans la deuxième partie de cette thèse, deux systèmes de gestion d'énergie prenant en compte l'incertitude de manière explicite, sont proposés. Le premier s'adresse aux incertitudes liés aux stations de recharge de véhicules électriques, et le deuxième s'adresse aux incertitudes rencontrés aux centrales photovoltaïques. Les deux stratégies de contrôle reposent sur une méthode d'algorithme randomisé dont l'idée est de relâcher une contrainte robuste et de trouver une solution réalisable qui garantit la satisfaction de cette contrainte avec une forte probabilité. Le problème robuste est très difficile à résoudre à cause du nombre infini de scénarios potentiels w. En relâchant la contrainte robuste, les algorithmes randomisés proposés par [START_REF] Alamo | Randomized methods for design of uncertain systems: Sample complexity and sequential algorithms[END_REF]

A.3.1 Station de recharge de véhicules électriques

Vu par le réseau, une station de recharge de véhicules électriques (EVCS) peut être considérée comme une charge électrique. Pour son intégration dans le réseau, le DSO ou n'importe quelle autre entité qui est responsable du réseau de distribution, a besoin d'une prédiction du profil de charge.

Le système de gestion d'énergie pour des EVCS proposé dans cette thèse part de l'hypothèse qu'il est impossible d'obtenir des prédictions du comportement individuel des véhicules, mais qu'un modèle statistique de l'occupation de la EVCS est disponible. Dans ce contexte la méthode de contrôle proposée permet de:

• Calculer un profil de limitation en puissance supérieure pour la EVCS qui peut être communiqué la veille pour le lendemain au DSO.

• Respecter en temps-réel ce profil de limitation en puissance à travers un contrôleur basé sur des règles simples qui contrôle le processus de recharge pour toutes les bornes de la EVCS.

• Garantir à une probabilité configurable 1η la qualité de service (i.e. la satisfaction des clients de la EVCS).

L'idée principale derrière l'approche proposée est de trouver le compromis optimal entre la sur-estimation du besoin d'énergie de la EVCS et la garantie de la qualité de service. En effet, si on cherchait à garantir pour tous les scénarios, même pour les moins probables, la qualité de service, alors le profil de borne supérieure sur la consommation de la station serait très conservateur dans le sens qu'il allouerait une grande quantité d'énergie à tout moment, même si ce ne serait quasi jamais utilisé.

En termes du problème robuste (A.1), ce problème s'exprime de la façon suivante:

• J(θ) représente l'énergie pré-alloué pour la journée. Cette fonction dépend du vecteur de conception θ qui permet de varier l'allure du profil de limitation supérieure en puissance P lim (θ) pour la EVCS.

• w ∈ W représente une réalisation de l'occupation incertaine de la EVCS pour les 24h de la journée.

• g(θ, w) représente la fonction d'indicateur qui permet d'évaluer si pour un vecteur de conception donné θ et pour un scénario w, la qualité de service est garantit. Pour évaluer g(θ, w), le contrôleur temps-réel de la EVCS est simulé dont la logique est de distribuer à chaque pas de temps la puissance disponible P lim (θ) aux véhicules connectés. Ensuite, la qualité de service est évalué (g(θ, w) = 0 si la qualité de service est atteinte).

A.3.2 Photovoltaic power plant problem

Les profils de production de centrales photovoltaïques sont difficilement prévisibles, car ils dépendent fortement des conditions météorologiques. Pour cela il est devenu difficile pour les gestionnaires de réseau d'assurer l'équilibre entre production et consommation et d'assurer la qualité et la stabilité du réseau électrique. Une mesure prise par les commissions de régulation de l'énergie de différents pays est d'imposer des régulations aux opérateurs des centrales qui les forcent à déclarer en avance leur profil d'injection de puissance journalière. En cas où ces profils déclarés ne peuvent pas être réalisés, des amandes financières appliquent.

Dans ce contexte nous proposons un système de gestion d'énergie pour des centrales photovoltaïques disposant d'une batterie. L'idée principale est de déterminer la paramétrisation optimale d'une stratégie de contrôle de la batterie afin de maximiser une borne inférieure sur le revenu auquel on peut s'attendre. Dans l'approche proposée, l'incertitude des prévisions de la production photovoltaïque ainsi que les régulations sont prises en compte explicitement dans le contrôle.

En termes du problème robuste (A.1), ce problème s'exprime de la façon suivante: recharge de véhicules électriques et pour des centrales photovoltaïques. Les deux approches sont basés sur un algorithme randomisé.

Dans le cas de la station de recharge, un profil de limitation sur la consommation en puissance de la station de recharge est calculé, prenant en compte un modèle statistique du comportement incertain des véhicules électriques, qui garantit à une probabilité configurable la satisfaction des clients. Il a été montré que ce profil de limitation peut être assez proche du profil réellement réalisé, ce qui représente une grande valeur pour les gestionnaires de réseau de distribution.

Pour les centrales photovoltaïques une optimisation économique a été proposée dans le contexte de contraintes régulatrices. La méthode permet de choisir la taille optimale d'une batterie associée à la centrale en prenant en compte un modèle de l'incertitude des prévisions de production photovoltaïque. Par ailleurs l'approche comprend un contrôleur de commande prédictive efficace qui est paramétré de manière optimale en vue de l'incertitude.