Mario Levorato
email: mlevorato@ic.uff.br

Rosa Figueiredo
email: rosa.figueiredo@univ-avignon.fr

Y Frota

Robust microgrid energy trading and scheduling under budgeted uncertainty

Keywords: OR in energy, Robust Optimization, Real-time energy scheduling, Microgrid, Flexible commitments

The advent of smart grids came with several technological developments including new electricity market rules and regulation mechanisms. Microgrids can trade energy with the main grid to either sell its production surplus (from renewable energy sources) or buy an additional amount to support local consumers' demand, which includes flexible loads, such as smart appliances and electric vehicles. In this scenario, smart control devices are important elements, executing real-time energy scheduling according to fluctuations in production and consumption. As we might expect, the main grid's power generation and

supply becomes more unscheduled and risky as energy trading quantities oscillate over time. This work studies a flexible energy contract subscription framework, coupled with a real-time command strategy, suited for energy scheduling of microgrids with uncertainty in both production and consumption. Our main contributions are a Robust Optimization model under budgeted uncertainty for contract subscription and a set of heuristic control strategies for the real-time energy scheduling. The robust model is capable of providing solutions for multiperiod-ahead trading of energy, while minimizing the worst-case cost. We run an extensive computational case study on a real microgrid instance to confirm the efficacy of our solution approach.

Introduction

A microgrid consists of a small-scale integrated energy system that can manage its own generation and storage resources to dynamically supply local consumers' electricity demands [START_REF] Lasseter | Microgrid: a conceptual solution[END_REF]. Since a microgrid can integrate various sources of distributed generation, especially Renewable Energy Sources (RES), an increasing participation of microgrids can help relieve the supply tension of conventional generators in the main grid. However, the high fluctuation of RES production makes energy management more complex and uncertain. Consider, for example, a microgrid powered by a photo-voltaic system. Even if energy consumption follows a regular pattern, its renewable generation is subject to sudden weather changes, difficult to predict with accuracy. Consequently, the microgrid will present a volatile production profile and sometimes its energy storage capacity may not be able to cope with the instant demand for energy. The subsequent decision, how much electricity to buy, will therefore inherit a considerable level of uncertainty, which is also undesirable for the main grid, since it introduces risk and higher operational costs.

Other relevant issues concerning microgrids have arised with the introduction of free energy markets. Consumers became able to produce energy (thus being called prosumers) and, in parallel, contract types, market models and pricing schemes have evolved [START_REF] Mitter | Dynamic Pricing and Stabilization of Supply and Demand in Modern Power Grids[END_REF][START_REF] Joe-Wong | Optimized day-ahead pricing for smart grids with device-specific scheduling flexibility[END_REF][START_REF] Morstyn | Bilateral contract networks for peer-to-peer energy trading[END_REF][START_REF] Aussel | A trilevel model for best response in energy demand-side management[END_REF]. In liberalized markets, large-scale generators, suppliers, industrial consumers and other financial intermediaries trade energy in wholesale markets, including day-ahead auctions, where agents submit their bids and offers for delivery of electricity for each hour of the following day, before market closing time. Small-scale prosumers, on the other hand, are currently serviced by large suppliers in the retail market. Nonetheless, the introduction of forward energy trading is expected to happen at the local level, with microgrids and actively managed distribution networks becoming more widespread [START_REF] Cazalet | Transactive energy models[END_REF]. As new challenges related to local purchasing fluctuations of prosumers arise, it is imperative for the main grid to regulate and stabilize the microgrids' energy purchasing behaviors. One way to accomplish this objective is through the introduction of flexible commitments contracts [START_REF] Tal | Supplier-retailer flexible commitments contracts: A robust optimization approach[END_REF].

This work addresses a new framework for microgrid energy trading, with the novel introduction of flexible commitments in a multiple contract setting.

The impacts of this contract-based framework are also investigated, from the viewpoint of microgrid energy management. Consider a time horizon, divided into discrete time periods. For each period, one or more contracts are offered, each one defining either selling or purchasing commitments, and providing the flexibility to trade energy between minimum and maximum amounts. Bearing in mind the uncertain nature of the renewable resources, the prosumer must choose the contracts for the whole time horizon, with the objective of minimizing the worst-case cost, at the same time guaranteeing that each commitment will be honored. In a second level of decision, in each time period, following the list of engaged contracts and minimum/maximum commitment constraints, a realtime scheduler coordinates the microgrid's systems, making energy trading and transfer operations, according to current storage units' status and instantaneous information regarding local electricity production and demand.

Although microgrid energy dispatch has been well studied in the literature, existing methods do not investigate the subscription to multiple and flexible electricity contracts, or even committing to future amounts of energy usage, according to forward markets. The same holds true for works focused on dynamic electricity pricing [START_REF] Mitter | Dynamic Pricing and Stabilization of Supply and Demand in Modern Power Grids[END_REF][START_REF] Joe-Wong | Optimized day-ahead pricing for smart grids with device-specific scheduling flexibility[END_REF]. The closest work is the one by [START_REF] Duan | Dynamic contract to regulate energy management in microgrids[END_REF], which, based on Stochastic Optimization, proposed a dynamic contract mechanism to smooth out fluctuations of microgrids' purchasing from the main grid, with time-specific commitments. Their research, however, assumes a single dynamic contract for the whole time horizon, in which the microgrid buys electricity from the energy company.

Among the benefits of flexible contracts, it enables small customers to engage in a set of short-term contracts and spread energy purchasing decisions over a period of time. Besides avoiding the risk of relying on a single energy contract, the client also has the option to sell the contracted energy back to the grid and start over, which could be used to hedge against risk.

Flexible contract engagement may have drawbacks as well. Intelligent energy scheduling strategies are needed, a smart meter is essential to make accurate readings, and purchasing decisions are often more complex, with the client more exposed to risk, as market prices can go up or down. Moreover, if the client needs to buy out of any engaged contract, the energy price will be higher than existing contract prices. For these reasons, the choice of energy contracts should be robust enough to protect the consumer even in the worst-case scenario, given its operational constraints. Traditional modeling approaches for handling uncertainty include Robust Optimization (RO) and Stochastic Optimization (SO). In this work, RO was chosen for two main reasons. First, for recently-installed microgrid energy systems, probability distributions for energy production/consumption are generally unknown. Second, SO methods typically rely on scenario trees for modeling uncertainty, which makes them computationally expensive [START_REF] Narayan | Risk-averse stochastic programming approach for microgrid planning under uncertainty[END_REF]. By applying a RO approach, the obtained models have improved tractability with less computational effort.

In a conference work [START_REF] Levorato | Real-time command strategies for smart grids based on the robust contractbased collaboration problem[END_REF], we introduced a first robust microgrid energy management model based on an electricity contract subscription framework with flexible commitments. In that previous work, we assumed a conservative box-shaped uncertainty set and obtained preliminary computational results on a single realistic case-study instance. In the present work, we extend both model and real-time command strategies: a budgeted uncertainty robust counterpart, which controls the level of solution conservatism, is described [START_REF] Bertsimas | The price of robustness[END_REF] and used in a look-ahead strategy for the real-time energy scheduling. We also present extensive computational experiments on a set of multiyear and seasonal case-studies based on data from a Japanese research center microgrid recently described by [START_REF] Vink | Multiyear microgrid data from a research building in tsukuba, japan[END_REF].

The main features of this paper are summarized as follows. Section 2 intro-duces the Contract Collaboration Problem and the underlying framework. Once the problem has been formally defined, Section 3 presents the state of the art on microgrid energy trading and management as well as on related works on Robust Optimization. In the context of the forward electricity market for microgrids, we describe in Section 4 a mathematical model for multi-contract energy trading with flexible commitments. A robust version of this model is then presented in Section 5, providing protection by minimizing the costs against the worst-case realization of local production and consumption of electricity, under budgeted uncertainty. Then, in Section 6, we describe real-time command strategies for energy scheduling within the microgrid, taking into account the contracts previously selected by our model. Finally, we present a case study, based on a real microgrid, detailing the results of these scheduling strategies, when coupled with the robust model solution (list of engaged contracts), in contrast with a deterministic approach to solve the problem. The first level of decision concerns the list of contracts the client can subscribe, at each time period, given the microgrid's energy demands and opera-tional constraints (Contract table in Figure 1). The solution to the so-called Contract Collaboration Problem (CCP), formally described in Section 2.1, provides the client with a commitment planning for the time horizon (i.e. which contracts to engage at each time period). Once this decision has been made, the list of engaged contracts, for the whole time horizon, cannot be changed.

The Contract Collaboration Framework

CONTRACTS

In a second level of decision, inside each time period, a Real-time Command Strategy (RTCS) is responsible for performing on-line energy scheduling (item 2

in Figure 1). As explained in Section 2.2, the RTCS follows a predefined strategy to balance energy demand and supply at each instant of time, considering renewable energy sources, storage devices, drivable systems and deciding how much energy will be traded via each engaged contract.

The Contract Collaboration Problem (CCP)

The contract collaboration is established between two entities, both producers and consumers of a same kind of energy resource. One entity is called the client (individuals, households or businesses) and the other one the partner (energy supplier). These two entities have to collaborate in order to balance their consumption and production over a given time horizon. We consider a set {T 0 , T 1 , . . . , Tt} of time points dividing the given time horizon into a set I = {I 0 , . . . , It -1 } of t time periods where

I t = [T t , T t+1 ), for each t ∈ {0, 1, 2, . . . , t -1}.
The collaboration between the entities is established by the use of a set C of contracts of consumption or production, both offered by the partner. Let C t ⊆ C be the subset of contracts offered by the partner at time period I t . Each contract c ∈ C t has its own functional constraints and its own gain/cost functions. The partner determines the set C t and sets a price to engage each contract c ∈ C t .

On each time period I t ∈ I, the client is free to enter into a commitment with the partner through any subset of C t . However, these commitments have to be taken by the client at the beginning of the time horizon and must be honored.

At any time period, the client also has the option to buy energy out of any engaged contract, but at a higher cost which can vary with the time period.

The client's microgrid is composed by a set of systems S that produce/consume energy, each one with its own functional constraints and a cost/gain of consuming/producing over the time periods. In particular, the consumption/production can be driven for a subset of these systems (drivable systems) while the consumption/production is already planned for the other ones (non-drivable systems). Drivable systems are devices that allow being turned on/off or that must be loaded/unloaded from time to time (e.g., batteries, electric car), whereas non-drivable systems must be permanently turned on. Additionally, some of the drivable systems can store the energy resource under a capacity constraint and provide it when it is needed, thus being called storage systems. The uncertainty considered in the problem lies in a subset of the non-drivable systems, for which only uncertain previsions of the consumption/production are known.

The so-called uncertain non-drivable systems include, for example, renewable generation and variable energy consumption.

The Contract Collaboration Problem (CCP) consists in determining a costminimizing contract subscription from the client to the partner that satisfies all client-side consumer demands over the time horizon, and also guarantees that each commitment taken by the client with the partner is honored. For a detailed description of the CCP models, we refer the reader to Sections 4 and 5.

The Real-Time Command Strategy (RTCS)

In the first level of decision, the list of engaged contracts (i.e., the solution of the CCP problem) is set. The second level of the framework is in charge of defining a Real-Time Command Strategy (RTCS) that guarantees these contracts will be honored. The RTCS operates on smart control devices, being in charge of making scheduling decisions according to instantaneous energy supply and demand fluctuations observed on customers' premises. Thanks to the development of advanced metering and communication infrastructure, these control devices have the ability to regulate energy consumption by directly communicating to the energy supplier and to other devices in the microgrid so as to prevent system overloads. Interesting examples would be the load reduction of a set of electric vehicle charging stations and the automatic activation of a group of electric generators.

The RTCS consists of a heuristic strategy that schedules, in real-time, the set of actions to be taken in order to properly manage the client's microgrid. From a real-time point of view, inside each time period I t ∈ I, the instantaneous production/consumption of each microgrid system is measured every ∆ time units. It is also at this time scale that drivable systems are driven, i.e, every ∆ time units a scheduling decision has to be taken by the control device, embedded in the client's microgrid, considering its state. For example, according to energy load and in real time, a group of generators (a type of drivable system) may be switched on during a period of higher demand and, analogously, a set of storage systems such as batteries can store energy during off-peak times in order to ease high demand supply in peak periods.

Regarding the energy contracts, the RTCS is in charge of deciding how much energy will be bought or sold, given each engaged contract and its minimum and maximum commitments. For instance, given a time period, if the client engages contract c, energy quotas (for buying or selling electricity) are established for each time period and, analogously, for each time slot.

The main objective of the RTCS is to reduce power consumption costs and promote load balance, while dealing with the effects of uncertainty in both production and consumption of energy. As we can expect, the RTCS operates subject to the CCP constraints, guaranteeing both contract commitments and energy balance at each moment. A full description of the real-time command strategies developed in this work is available in Section 6.

Literature Review

In this section, we highlight existing works involving the two subjects addressed in the paper: microgrid energy scheduling (RTCS) and electricity trading models (such as the CCP).

Various approaches have been proposed to optimize microgrid operational schedules, with distinct objectives, constraints, and methods for handling uncertainty. As a consequence, different terms have been used to refer to similar real-time control mechanisms: microgrid energy scheduling, real-time scheduling, real-time control system, real-time power management, energy management policies, energy dispatching policies, microgrid energy management and operation. Some authors have also studied the islanded-mode operation of microgrids.

In this review, we will focus on grid-connected microgrids, since energy trading with the main grid is a main premise of our work depicted in [START_REF] Olivella-Rosell | Optimization problem for meeting distribution system operator requests in local flexibility markets with distributed energy resources[END_REF][START_REF] Khorasany | Microgrids and local markets[END_REF].

To our knowledge, only two authors present research directions similar to ours. From the viewpoint of multiple energy contracts, in Van Ackooij et al.

(2018) different Generation Companies can offer buy/sell contracts to the microgrid. However, although the microgrid can receive contract offers from different competing companies, it can select at most one contract for the whole time horizon. As far as contract flexibility is concerned, [START_REF] Zachar | Microgrid/Macrogrid Energy Exchange: A Novel Market Structure and Stochastic Scheduling[END_REF] explored the stochastic scheduling of microgrids where energy exchange must be made with day-ahead commitments. In the proposed market structure, the microgrid may be either rewarded for respecting existing commitments, or penalized for deviating too much from them. Despite this flexibility, their work assumes a single long-term contract with the utility company.

As far as RO is concerned, besides the works listed in Table 1, which directly involve microgrids, we also refer the reader to additional RO works on related problems with uncertain demand and production of electricity. The first one involves the application of constraint generation and duality-based reformulation to solve the robust multistage Unit Commitment Problem, using both budgeted uncertainty and a customized dynamic uncertainty set [START_REF] Lorca | Multistage adaptive robust optimization for the unit commitment problem[END_REF]. The second work [START_REF] Correa-Florez | Comparative analysis of adjustable robust optimization alternatives for the participation of aggregated residential prosumers in electricity markets[END_REF] involves an aggregator of residential prosumers, which participates in the day-ahead energy market to minimize operation costs. Budgeted uncertainty is considered in energy prices, demand and PV production, and Adjustable Robust Optimization is employed. The model takes into account energy purchases in the wholesale market, with the possibility of buying additional blocks of energy. However, no flexible commitments were considered in this framework.

A deterministic version of the CCP

In this section, we will present a simpler, deterministic model version of the CCP, denoted as DCCP, where the value of the uncertain parameters are assumed to be known in advance. The formulation comprises each microgrid component, its operational constraints, as well as the underlying contract subscription framework. The main idea of the CCP model is to find a cost-minimizing solution which provides the client with a list of energy contracts to engage in each time period, considering the whole time horizon. In the rest of this text, time is discretized into periods as indicated by I 0 , .., It -1 and energy units are assumed to be in kWh. Moreover, we will often write t for a time period I t . Given a set of contracts offered by the partner, each contract c ∈ C t is associated with a time period I t and its fixed (v t c ) and variable prices (α t c ) may vary if the period is in peak hours or off-peak. By engaging in a contract, the client must respect the established energy quotas Π - t,c and Π + t,c , that may be positive (if the client purchases energy from the partner) or negative (the client sells energy to the partner). The partner can also sell energy to the client out of any engaged contract at a specific unit price β t .

Nomenclature

The information about energy consumption (or production) P t s of all drivable and non-drivable systems is discretized into time periods I t . Moreover, in the microgrid's energy scheduling, each time period I t is further subdivided into δ t time slots of size ∆, where ∆ is an input parameter. At this time scale, the instantaneous production/consumption of each microgrid system is measured.

Each system s ∈ S D ∪ S N D ∪ B may have an associated operational cost v s (e.g. energy produced by a fuel generator has positive cost). This cost can also be zero (e.g. consumer system such as a building). Additionally, for each drivable system s ∈ S D , we define minimum requirements for energy production/consumption at time period I t . In other words, for each consumer drivable system s, P min t s > 0 means system s must be supplied with P min t s units of energy before the end of time period I t (e.g. when charging an electric car). Normally, P min t s = 0 if s is a producer drivable system. Last but not least, the storage systems are a key component for the success of the contract subscription framework. A set of batteries can store energy during off-peak time periods in order to ease high demand supply in peak periods.

Besides the unit cost, there are several battery-specific parameters related to the storage levels, capacity and efficiency: u min s , u max s , u 0 s , λ s , θ abs s and θ ref s . Based on the model variables defined above, we now present a Mixed-Integer Linear Programming (MILP) model, whose optimal solution provides the client with a commitment planning for the whole time horizon: which contracts to engage in each time period.

t ≤t P t s x t s ≤ P min t s , ∀ t ∈ T, ∀ s ∈ S D : P t s < 0 (3) h t s ≤ r t s , ∀ t ∈ T, ∀ s ∈ B (4) r 0 s = u 0 s , ∀ s ∈ B (5) u min s ≤ r t s ≤ u max s , ∀ t ∈ T ∪ { t}, ∀ s ∈ B (6) r t+1 s = r t s -h t s + λsg t s , ∀ t ∈ T, ∀ s ∈ B (7) g t s ≤ θ abs s δ t , ∀ t ∈ T, ∀ s ∈ B (8) h t s ≤ θ ref s δ t , ∀ t ∈ T, ∀ s ∈ B (9) Π - t,c y t c ≤ q t c ≤ Π + t,c y t c , ∀ t ∈ T, ∀ c ∈ Ct : Π + t,c > 0 (10) Π + t,c y t c ≤ q t c ≤ Π - t,c y t c , ∀ t ∈ T, ∀ c ∈ Ct : Π - t,c < 0 (11) c∈C t q t c + s∈S N D P t s + s∈S D x t s P t s + s∈B λsh t s + e t ≥ s∈B g t s , ∀ t ∈ T (12)
The objective function (1) includes, respectively: (i) the fixed costs involved in the client-partner engagement through a set of contracts; (ii) the sum of costs/gains of consuming/providing the amounts of electricity predicted by the set of engaged contracts; (iii) the costs of using drivable systems; (iv) the costs of using storage systems (including depreciation); (v) the costs of consuming extra amounts of electricity not predicted in the set of engaged contracts.

There are also costs associated with the use of non-drivable systems. However, since these costs are fixed, they do not need to be included in the objective function to be minimized.

Constraints ( 2)-( 3) ensure the minimum usage of drivable system s, in case it produces [START_REF]Determinisitc RTCS performance comparison for summer and winter scenario groups[END_REF] or consumes (3) electricity. Constraints (4) restrict the amount of electricity consumed from storage system s during a time period to be at most the amount stored. Additionally, constraints ( 5)-( 6) state that the initial, minimum and maximum capacities of storage system s must be respected.

Constraints (7) determine the amount of electricity stored on storage system s at the next time period. It must take into account its loss coefficient λ s , i.e., when storing g t s kWh of energy, only λ s % is effectively stored in s. Remark that h t s includes the amount of energy provided by s as well as the energy lost during this operation. The maximum quantity of energy that can be stored by storage system s during a time period t is guaranteed by constraints (8), while constraints (9) ensure the maximum quantity of energy that can be provided by a storage system s during a time period t.

Constraints (10)-( 11) establish minimum and maximum quotas for contracts.

They also guarantee that a non-zero consumption/production related with a contract available at a certain time period will imply an engagement to it.

Finally, constraints (12) define the electricity balance at each time period.

When calculating the energy refunded by storage systems s, these inequalities must take into account the amount of energy lost during discharge, therefore h t s must be reduced proportionally to λ s %. Besides, at any time period, total consumption may be greater than the energy available from the microgrid's production, storage systems and currently engaged contracts. In this case, the microgrid can buy additional energy e t from the partner in order to fulfill unforeseen demand. We also assume a dissipation system is available with no cost of use associated.

We denote by MIP(DCCP) the formulation defined by objective function (1), constraints (4)-( 12) and appropriated integrality and bounding constraints.

With |T |(|S D | + 5|B| + |C|) constraints and 2|C| + |T ||S D | + 3|T ||B| + |T |
variables, this formulation is classified as a Mixed-Integer Programming (MIP) model [START_REF] Wolsey | Integer and combinatorial optimization[END_REF], whose solution can be obtained with both commercial and open-source solvers, using well-known branch-and-bound algorithms. As seen in the experiments with case study instances, the solution to the deterministic CCP is returned by CPLEX solver in less than a second.

A robust formulation of the CCP

We consider in this section the robust version of the CCP, denoted as RCCP, in which the uncertainty of non-drivable systems will be treated via Robust Optimization methods. The developed model is capable of protecting against the worst-case realization of production and consumption of electricity, within a provided uncertainty set, considering all uncertain non-drivable systems, denoted as S N D ⊆ S. Once again, the model solution consists of a list of contracts to engage in each time period, for the whole time horizon.

Regarding the uncertainty in non-drivable devices' production/consumption, the only information required by the model are the lower and upper bound parameters, namely {P t s , P t s }, ∀t ∈ T, ∀s ∈ S N D , which can be determined via inference schemes based on historical data:

∀ t ∈ T , ∀ s ∈ S N D :
P t s lower bound on energy consumption(<0)/production(>0) of s in the whole period t P t s upper bound on energy consumption(<0)/production(>0) of s in the whole period t

Similarly to drivable and non-drivable devices, uncertain devices s ∈ S N D also have associated operational costs v s , per energy unit consumed/produced.

Definition of the uncertainty sets

In this work, we adopt a min-max criterion to assess the cost of feasible solutions to the problem. This means that we look for a solution that is feasible for each attribution of the uncertain parameters and that minimizes the cost function in the worst case scenario. The uncertain data are assumed to be varying in a given uncertainty set.

The formulation of the Robust Optimization model is connected with the definition of this uncertainty set and this definition depends on the suppositions made on the problem being solved. In our problem, the set U(t, s) describes how the uncertainty is defined.

∀ t ∈ T , ∀ s ∈ S N D : P t s ∈ U(t, s)
energy consumption(<0)/production(>0) of s in the whole time period t

Consider a vector v ∈ n×m . This text uses the vector notation v i = (v i j ; j = 1, . . . , m) and v j = (v i j ; i = 1, . . . , n). Hence, P t = (P t s ; s ∈ S N D ) and P s = (P t s ; t ∈ T ). If we presume that each uncertain parameter belongs to an interval, i.e, U(t, s) = [P t s , P t s ], the box uncertainty set [START_REF] Soyster | Convex programming with set-inclusive constraints and applications to inexact linear programming[END_REF], denoted here by U box , can be defined as:

U box = × s∈ S N D U s , where U s = [P s , P s ], s ∈ S N D .
Assuming that the uncertain parameter belongs to an interval is equivalent to say that it lies between a mean value and peak values, i.e.,

U(t, s) = { P t s = vt s + ∆ t s v t s | -1 ≤ ∆ t s ≤ 1},
with v t s = (P t s -P t s )/2 and v t s = P t s + v t s . Now suppose that, given all uncertain devices s ∈ S N D and time periods t ∈ T , at most Γ uncertain parameters P t s may reach peak values in the whole time horizon. We can then define the budget uncertainty set, studied in [START_REF] Bertsimas | The price of robustness[END_REF]) and largely applied [START_REF] Agra | The robust vehicle routing problem with time windows[END_REF][START_REF] Lorca | Multistage adaptive robust optimization for the unit commitment problem[END_REF][START_REF] Correa-Florez | Comparative analysis of adjustable robust optimization alternatives for the participation of aggregated residential prosumers in electricity markets[END_REF]:

U Γ = { P ∈ U box : s∈ S N D t∈T | ∆ t s |≤ Γ}.
The purpose of the budget of uncertainty is to control the level of conservatism of the robust solution, in terms of deviations in the uncertain model parameters. It allows an intuitive interpretation for the decision maker, pro-viding a trade-off between the nominal performance of the deterministic model and the risk protection of the most conservative model. Additionally, the obtained robust counterpart remains efficiently solvable, provided that the original nominal problem can be effectively solved.

In the context of the RCCP, with the objective of simplifying the model and the analysis of the obtained results, we opted for a single budget parameter Γ. It controls the total number of deviated parameters regarding both energy consumption ( P t s < 0) or production ( P t s > 0) of all uncertain devices s ∈ S N D , over all time periods t ∈ T .

Robust counterpart

Similarly to the DCCP, we describe a formulation for the robust version of the problem based on time decomposition, in which decisions are made for every time period I t . The Min-Max Adjustable Robust Counterpart (ARC) formulation, used in this work, ensures feasibility of the constraints for any realization of the uncertainty, through the appropriate selection of the second stage decision variables. For more details on Adjustable RO for multi-stage optimization problems, we refer the interested reader to [START_REF] Gorissen | A practical guide to robust optimization[END_REF].

In the robust version of our problem, the RCCP, variables y (defined in Section 4) are non-adjustable ones, i.e, they consist of "here and now" decisions, or first-stage variables, before having any knowledge of the actual value taken by the uncertainty. The other variables, namely q, r, h, g, x and e, are adjustable ones, i.e, they consist of "wait and see" decisions (i.e., second-stage variables) and define a set of decisions that depend on the uncertain parameters.

The Min-Max ARC, based on formulation MIP(DCCP) from Section 4, is as follows:

(

+ s∈B λsh t s ( Pt) + e t ( Pt) ≥ s∈B g t s ( Pt), ∀ P ∈ U , ∀ t ∈ T, (15)
h t s ( Pt) ≤ r t s ( P t-1 ), ∀ P ∈ U , ∀t ∈ T, ∀s ∈ B, (16)
r 0 s = u 0 s , ∀ s ∈ B, (17)
u min s ≤ r t s ( P t-1 ) ≤ u max s , ∀ P ∈ U , ∀ t ∈ T ∪ { t}, ∀ s ∈ B, (18)
r t+1 s ( Pt) = r t s ( P t-1 ) -h t s ( Pt) + λsg t s ( Pt), ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ B, (19)
g t s ( Pt) ≤ θ abs s δ t , ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ B, (20)
h t s ( Pt) ≤ θ ref s δ t , ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ B, (21)
Π - t,c y t c ≤ q t c ( Pt) ≤ Π + t,c y t c , ∀ P ∈ U , ∀ t ∈ T, ∀ c ∈ Ct : Π + t,c > 0, (22)
Π + t,c y t c ≤ q t c ( Pt) ≤ Π - t,c y t c , ∀ P ∈ U , ∀ t ∈ T, ∀ c ∈ Ct : Π - t,c < 0, (23)
t ≤t P t s x t s ( Pt) ≥ P min t s , ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ S D : P t s > 0, (24)
t ≤t P t s x t s ( Pt) ≤ P min t s , ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ S D : P t s < 0, (25)
y t c ∈ {0, 1}, ∀ t ∈ T, ∀ c ∈ Ct, (26)
r t s ( P t-1 ), h t s ( Pt), g t s ( Pt) ≥ 0, ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ B, (27)
e t ( Pt) ≥ 0, ∀ P ∈ U , ∀ t ∈ T, (28)

0 ≤ x t s ( Pt) ≤ 1, ∀ P ∈ U , ∀ t ∈ T, ∀ s ∈ S D , ( 29
)
where U is the uncertainty set chosen. For a given t ∈ T , variables q t , h t , g t ,

x t , and e t depend on the vector of uncertain parameters P t while variables r t depend on P t -1 .

In a previous work [START_REF] Levorato | Real-time command strategies for smart grids based on the robust contractbased collaboration problem[END_REF], we assumed a conservative U box uncertainty set and obtained preliminary computational results on a single case study instance. In the next subsection, we will explain how the dualization approach was employed to derive a robust counterpart for the U Γ uncertainty set.

Notice that the cost associated with the use of uncertain non-drivable systems,

given by s∈ S N D v s t∈T P t s , must be included in the robust model. Different from the cost of certain non-drivable systems, P t s values are not constant and vary with the uncertain parameters. Also notice that constraints (19) can be used to eliminate variables h t s , reducing the set of second-stage variables. An approach proposed in the literature to make model (ARC) tractable consists of restricting the functional relations q t c , r t s , g t s , x t s and e t to be affine by replacing them with linear decision rules (LDR) [START_REF] Ben-Tal | Adjustable robust solutions of uncertain linear programs[END_REF]. Also known as affine policies, LDRs have been commonly used in the literature as an effective approximation to multistage RO problems [START_REF] Jabr | Adjustable robust opf with renewable energy sources[END_REF][START_REF] Warrington | Rolling unit commitment and dispatch with multi-stage recourse policies for heterogeneous devices[END_REF][START_REF] Lorca | Multistage adaptive robust optimization for the unit commitment problem[END_REF], with each recourse decision taking the form of an affine function of the uncertain parameters.

This way, we restrict recourse variables, say g t s ( P t ), to be affinely dependent on the primitive uncertainties, considering all uncertain devices ς ∈ S N D and all time periods prior to t. Of course, only in very rare occasions, linear decision rules are optimal. Indeed, the main motivation for linear decision rules is its tractability. The following decision rules were applied for the set of adjustable variables in our problem:

r t s = r 0 ts + t-1 τ =0 ς∈ S N D r τ ς ts P τ ς , ∀t ∈ T \ {0} ∪ { t}, ∀ s ∈ B, (30)
g t s = g 0 ts + t τ =0 ς∈ S N D g τ ς ts P τ ς , ∀t ∈ T, ∀ s ∈ B, (31)
x t s = x 0 ts + t τ =0 ς∈ S N D x τ ς ts P τ ς , ∀t ∈ T, ∀ s ∈ SD, (32)
q t c = q 0 tc + t τ =0 ς∈ S N D q τ ς tc P τ ς , ∀t ∈ T, ∀ c ∈ Ct, (33)
e t = e 0 t + t τ =0 ς∈ S N D e τ ς t P τ ς , ∀t ∈ T. ( 34
)
As seen in the next subsection, after bringing the linear decision rules to the formulation, by taking U = U Γ , each constraint holding uncertain parameters is transformed by means of strong duality theory. As a result, we obtain a linear approximation to the model, called (ARC-L1). Each inequality will be characterized in terms of max/min values, and later replaced by its corresponding dual equivalent. In this process, a new set of continuous variables and a new set of constraints will be added to the formulation. This final product is a MILP model to the robust problem, which will be called MIP(RCCP), and whose solution can be obtained with commercial optimization solvers.

RCCP under budgeted uncertainty

Given the definition of the budget uncertainty set U Γ , we now present a dualization rule that can be applied to each constraint of the robust counterpart. Each ARC constraint can be written either in form (a) f 0 + t∈T s∈ S N D P t s f t s ≤ 0, or (b) f 0 + t∈T s∈ S N D P t s f t s ≥ 0, where f 0 is the independent term and f t s is the term that depends on the uncertain parameters P t s ∈ U Γ . In form (a), each problem constraint can be rewritten as:

f 0 + max P ∈UΓ t∈T s∈ S N D P t s f t s ≤ 0, (35)
with the second term being reformulated as:

max ∆ + t,s , ∆ - t,s s t f t s v t s + ∆ + t,s . v t s -∆ - t,s . v t s : (36)
∆ + t,s + ∆ - t,s 1, s ∈ SND, t ∈ T, (µ t s ) ( 37
) s t ∆ + t,s + ∆ - t,s Γ, (ρ) (38) ∆ + t,s 0, ∆ - t,s 0, s ∈ SND, t ∈ T 0 (39)
Where variables ∆ + t,s and ∆ - t,s indicate that the uncertain parameter P t s has oscillated above (or below) its nominal value P t s . Constraints (37) limit the oscillation according to the maximum value allowed ( v t s ) and constraints (38) limit the budget of uncertainty to Γ.

Analogously, for each problem constraint in form (b), we derive:

min ∆ + t,s , ∆ - t,s s t f t s v t s + ∆ + t,s . v t s -∆ - t,s . v t s : s.t. (37)-(39) 0. ( 40
)
The inclusion of the above robustified equations in the tractable MILP model is possible via dualization. In both cases above, dual variables µ t s and ρ can be derived, along with dual objective function: s t µ t s + ρ.Γ + s t f t s .v t s . In the first case (a), the dual constraints are:

µ t s + ρ | v t s .f t s | ≡          µ t s + ρ v t s .f t s (∆ + t,s ) (41)
µ t s + ρ -v t s .f t s (∆ - t,s ) (42)
µ t s 0, ρ 0 (43)
And, in the second case (b), the dual constraints are:

µ t s + ρ | v t s .f t s | ≡          µ t s + ρ v t s .f t s (∆ + t,s ) (44)
µ t s + ρ -v t s .f t s (∆ - t,s ) (45)
µ t s 0, ρ 0 (46)
In form (a), after dualization, each constraint is replaced by the following constraints in the tractable MILP model:

f 0 + s t µ t s + ρ.Γ + s t f t s .v t s 0
, and ( 41)-( 43).

While, in form (b), each constraint is replaced by constraints:

f 0 + s t µ t s + ρ.Γ + s t f t s .v t

Real-time energy scheduling with the RTCS

The solution of the CCP (either the deterministic version in Section 4 or the robust version from Section 5) provides the client a decision for the first level in our framework: the contract subscription for the whole time horizon. However, for the success of the proposed contract framework, an efficient real-time energy scheduling mechanism is needed, so that distributed energy resources, storage devices and drivable loads within the microgrid are operated in a coordinated and coherent way, together with the energy exchange with the main grid.

Recall the RTCS definition given in Section 2. In order to perform energy scheduling, each time period I t is further subdivided into δ t time slots of size ∆. At this time scale, the instantaneous production/consumption of each microgrid system is measured. For certain (drivable and non-drivable) systems, the consumption/production, for each time period I t , is known beforehand. And every ∆ time units a scheduling decision has to be made by the control device, according to the state of the microgrid.

In this sense, the RTCS consists of a scheduling heuristic that, based on the microgrid state and the energy contracts engaged by the client, solves an online optimization problem, selecting in real-time the set of actions to be taken, with the objective of reducing energy consumption costs and promoting load balance, while, at the same time, dealing with the effects of uncertainty. Remark that the solution approaches commonly used to solve off-line scheduling problems are not appropriate for the on-line scheduling case.

Since the RTCS operates according the Contract Collaboration Framework, we remark that, once the heuristic starts, the set of subscribed energy contracts y 0 , for the whole time horizon, has already been established. Such decision is made by the client after running one of the previously presented CCP models. According to the microgrid energy balance, the following operations must be considered: (a) turn on/off a production/consumption drivable system; (b) buy/sell a quantity of energy under an engaged contract; (c) recharge/retrieve energy from a storage system; (d) buy energy out of engaged contracts; (e) throw energy away (if remaining energy cannot be sold back to the grid). Also, a subset of actions taken in a specific moment must obey the Contract Collaboration Problem constraints.

Naïve RTCS policy

This section describes the most straightforward approach to perform energy scheduling. The proposed naïve control strategy can be used as a baseline strategy to schedule the use of the Battery Energy Storage Systems (BESS) and the energy exchange via contracts. The naïve strategy relies on two assumptions.

First, the microgrid should only sell energy via contracts as a last resort because the selling price is typically lower than the contract buying price. Besides, most of the time, the production obtained from renewables does not match the microgrid's energy demand. As a result, the microgrid will eventually buy energy from the power grid.

The proposed naïve RTCS policy works as follows. At each time step, the current demand for electricity is determined as the sum of the amount of energy required by the consumer drivable and non-drivable systems minus the amount of energy actually produced by the microgrid. In case the produced energy outweighs the demand, the resulting surplus is used to charge the battery. If the BESS is already full or the surplus exceeds the charging rate, the excess energy is sold via contracts. On the contrary, if existing demand goes beyond the available produced energy, the difference is provided by discharging the battery. If the stored energy is not enough, then the remaining required energy is bought from the grid, first via available engaged contracts (provided they still have existing capacity), or bought out of any engaged contracts, possibly at a higher price.

Using model solution as a look-ahead policy to guide RTCS

The solution of the CCP models provide not only a list of contracts to engage, but also a set of values that can be used as a look-ahead (LA) policy to guide the RTCS energy dispatch operations, at each time period I t . The policy is defined by the optimal value of all model variables, except y variables.

When using the deterministic model, look-ahead values are obtained directly from the model solution, while for the robust models, the LDRs ( 30)-( 34) are used to derive the look-ahead values for the current time period I t . In Section 7, we will show that the look-ahead policies based on the robust models can effectively enhance the performance of the RTCS. Among the advantages, the better utilization of storage devices and greater protection against uncertainty, when compared to the deterministic model.

We propose different heuristics for the RTCS, each one with a distinct behavior. As previously mentioned, the RTCS operates based on a predefined set of engaged contracts, obtained from a specific CCP model solution. Therefore, in the remainder of this section, we refer to X-RTCS as the general RTCS that can be executed based on an existing CCP model solution X.

Algorithm 1 depicts the X-RTCS executed inside a given time period I t , every ∆ time units or, analogously, at each time slot d ∈ {1, . . . , δ t }. At this time, the uncertainty concerning energy production/consumption has been revealed for all time periods before I t , and the microgrid configuration is given by its battery storage levels, drivable system requirements, load demand and renewable production. Let X(y 0 , t ) be the X model obtained by fixing y = y 0 and all variables and parameters related with t < t . The optimal solution of X(y 0 , t ) serves as a policy for all t ≥ t . Two different parameters, named reoptimize and gap policy, define how the X(y 0 , t ) solution will be used as a policy in the X-RTCS heuristic.

The first one concerns the usage of model X. The reoptimize option determines which model X solution will be used as a forecast tool to determine the initial quantities regarding how much energy will be consumed or how much excess energy will be sent to the grid, via engaged contracts1 , and how long drivable systems should remain powered on. If reoptimize is enabled (line 1), model X will be reoptimized at each time period I t , for the remaining time periods t ≥ t (line 2), and the new solution obtained will guide the initial energy quantities (line 3). Otherwise, as listed on line 5, the RTCS policy will be based on the initial solution at the start of the time horizon (t = 1), i.e., the optimal solution of X(y 0 , 1).

The next step of the algorithm is the calculation of the current microgrid energy gap (i.e., total consumption minus total production) at the current time slot d (line 9), based on collected data regarding instantaneous energy production/consumption, minimum contract engagements, as well as model predictions regarding batteries and drivable systems (lines 6-8). We denote by q t ,d c as the amount of energy that will be bought or sold via the contract c in time slot d; and

x t ,d s as the percentage of time in which drivable system s will be on at time slot d. Also assume P t ,d s is an estimation of the uncertain production/consumption of device s at time slot d.

Finally, according to this information, X-RTCS must decide which additional dispatch operations will be executed to balance supply and demand, by applying a gap policy (Table 2). These operations involve, for example, seling (line 15) or buying (line 24) additional energy to/from the partner, turning on/off drivable systems (lines 16&23) and interacting with an energy storage system (lines 14&25).

In summary, the combination of reoptimize and gap policy parameters Buy from engaged contracts first, then use batteries Table 2: X-RTCS policy executed at each time slot d (inside period I t ), according to the microgrid energy gap, defined as (Production)-(Consumption). A positve gap (+) means there is energy surplus in the current time slot, while a negative gap (-) represents lack of energy (more power needs to be bought from the partner or produced by the microgrid).

yield 4 different look-ahead heuristics, whose behavior is determined by which CCP model predictions are used (from reoptimized model or not), along with a strategy to either fulfill demands greater than the microgrid's own production (negative gap) or use the available energy surplus (positive gap).

Remark that the algorithm takes into account the cost of purchasing additional blocks of energy (negative imbalance) and the revenue from selling surplus energy (positive imbalance) due to deviations with respect to the forecast of energy contract usage, made in the beginning of X-RTCS. Additionally, the amount of electricity bought out of any contract e(•) presumes an indirect penalization on price, since they are less attractive than settled day-ahead prices.

Experimental results

This section sets up a realistic microgrid and conducts simulations with different sets of scenarios, comprising uncertain electricity production and consumption in a given time horizon. The main objective is to evaluate the impact of adopting a robust approach for engaging in flexible energy contracts. This is achieved through the performance assessment of the RTCS approaches proposed in the previous section, based on contract decisions taken by either the deterministic or the robust CCP model solution.

Computational environment and simulation details

The mathematical models and numerical simulations were coded in Julia 1.6.0 using CPLEX solver 20.1.0, and their source code is available at https: Reoptimize ccpm with t 0 := t and fix engaged contracts y = y 0 ; 3 Let {q t , x t , g t , h t } be the reoptimized ccpm solution at t = t 0 = t ; 4 else // Use initial CCP model solution at t0 = 1 5 Let {q t , x t , g t , h t } be the initial ccpm solution at t = t ; Remember that, in order to obtain a deterministic solution for the CCP model, it is necessary to establish a fixed value for the uncertain parameters. In this study, we solved the deterministic model by using three sets of values for uncertain parameters P s of each system s ∈ S N D .

//
6 q t ,d c := q t c /δ t ,

Microgrid in a research building in Tsukuba, Japan

This case study involves the microgrid of a research building in Tsukuba, Japan. A multiyear dataset [START_REF] Vink | Multiyear microgrid data from a research building in tsukuba, japan[END_REF] provides microgrid statistics in full details (every second) and summarized (per hour), for the period between april 2015 and april 2018. Supplied data includes the Battery Energy Storage System (BESS) installed (active power, voltage, current, state of charge), the power generation from the four operating solar arrays, as well as purchased electricity (voltage, active power), solar irradiance, list of holidays and electricity prices (including surcharges).

Four problem instances were generated, one for each season of the year.

Thus the lower and upper bounds for uncertain consumption and production were calculated as a function of the historical data for the corresponding season.

Problem instance generation

The considered planning horizon comprises 24 time periods of 1 hour, each one with δ t = 6. Given all periods, a total of 457 contracts were proposed, inspired by Électricité de France price distribution (EDF, 2021), allowing the client to buy electricity from the partner at different quantities and costs.

Concerning uncertain devices demand and production of electricity at each time period t, historical data of the microgrid is used to calculate the lower and upper bounds of these values. Moreover, instead of applying simple min/max approach, we use the 10th and 90th quantiles to determine the P min and P max values, which guarantees robustness against outliers. The determination of BESS kWh price is based on the cost model of [START_REF] Börjesson | Cost models for battery energy storage systems[END_REF].

RTCS simulation and scenario types

Based on the production and consumption history of the Tsukuba microgrid, the simulation objective is twofold: to evaluate how the solutions provided by the two CCP models proposed (robust and deterministic) behave under uncertainty, and to assess the performance of the RTCS policies defined in Section 6.2.

A particular scenario contains, for each uncertain system, the realization

Performance of the robust solution method

The study performed in this section analyses several cost and reliability metrics obtained from simulations of the proposed RTCS policies. By mimicking the real-time operation of the microgrid energy management system, each simulation was based on a specific solution provided by either the robust or the deterministic CCP model. The solution statistics for each model are presented on Table 3. The obtained results show that, when solving the first-stage problem to determine the list of contracts to engage, optimal solutions for robust models with different budget parameter values can be obtained in less than an hour with an 8-core CPU.

Regarding the simulation results, according to the season of the year, for each of the 4 RTCS policies proposed in the previous section, Tables 4 and5 present A statistical analysis was also performed to assess the cost difference between each pair of simulations, considering every combination of CCP model and RTCS policy. For this purpose, we applied the Wilcoxon signed-rank test [START_REF] Wilcoxon | Individual comparisons by ranking methods[END_REF], a non-parametric alternative to the paired Student's t-test, which does not depend on the assumption that the data is normally distributed. This test is based upon the ranks of the paired differences of measurements, and the null hypothesis H 0 is that two related paired samples come from the same distribution. If valid, H 0 indicates that there is no tendency for the outcome in one group of simulations to be higher or lower than in the other group. In a pair-wise comparison with a significance level α = 0.05, considering all pairs of RTCS simulations, in only 3 cases it is not possible to reject the null hypothesis. These cases are related with the autumn, spring and summer instances, with no significant statistical difference when comparing the scenario costs of the Conservative+ReOpt RTCS based either on the Det-RTCS solution with Φ = 50% or on the Rob-RTCS with Γ = 40%. All other simulation comparisons yielded P-values inferior to 0.05, which indicates there is enough evidence to reject the null hypothesis and conclude that the tested samples were likely drawn from populations with differing distributions.

As a final remark, we refer the reader to the last two measures in Tables 4 and5. According to the average and standard deviation of BESS State Of Charge, the robust-based policies rely more on the use of batteries to regulate the microgrid's system load than Det-RTCS. For the winter instance, this means that, to retain the same level of average cost, the robust budget model with conservative+ReOpt policy achieves the lowest std (i.e., the highest reliability); or, conversely, to maintain the same level of std (i.e., reliability), this policy incurs the lowest average cost. That is, robust budget / conservative+ReOpt dominates every other policy.

2 0 1 5 -0 1 2 0 1 5 -0 5 2 0 1 5 -0 9 2 0 1 6 -0 1 2 0 1 6 -0 5 2 0 1 6 -0 9 2 0 1 7 -0 1 2 0 1 7 -0 5 2 0 1 7 -0 9 2 0 1 8 -0 1 2 0 1 8 -0 5 strategies, according to scenario types. For specific protection levels, the robust RTCS was able to dominate the deterministic RTCS in all operational cost and system reliability metrics.

The main conclusions can be highlighted as follows. The CCP robust model under budgeted uncertainty provides a pool of solutions, with different protection levels, the decision-maker can choose from. The effectiveness of each robust solution will depend on the microgrid's load profile and renewable production, which vary according to the season of the year.

There are essentially three avenues for future research. The first one is application oriented and comprises additional testing with selling contracts. In this sense, the energy exchange between multiple microgrids could be seen as a game-theoretic model. The second avenue would be extending the methodology itself, considering alternative ways of representing uncertainty in the robust program, in addition to forecasting techniques that have added improved results in similar problems. In particular, reinforcement learning could prove useful inside the RTCS, with the objective of making better decisions on energy-related operations. For example, the scheduling heuristic could predict which kind of operation would be better suited at a given period (e.g. store or sell surplus energy; retrieve from storage or buy from engaged contracts). Finally, a third path involves model refinements, such as the addition of ramping constraints for generators and an improved battery efficiency and degradation model.

Figure 1 :

 1 Figure 1: The Contract Collaboration framework Considering the context of demand response and smart grids (Siano, 2014), we propose a Contract Collaboration framework, established in two phases (Figure 1). It consists of an approach to handle energy management in microgrids, along with purchase/sell contracts based on flexible commitments.

SetsI

  Time periods: I = {I 0 , .., It -1 } T Time period indexes: T ={0, .., t -1} Ct ⊆ C Contracts offered by partner at period It S D ⊆ S Certain drivable systems S N D ⊆ S Certain non-drivable systems by the client for engaging contract c ∈ Ct at period It, ∀ t ∈ T α t c ≥ 0 cost per energy unit consumed/provided according to contract c ∈ Ct at period It Π - t,c minimal energy quota for contract c ∈ Ct during period It Π + t,c maximal energy quota for contract c ∈ Ct during period It β t ≥ 0 cost per energy unit consumed by the client at period It not provided by engaged contracts, ∀ t∈T Input parameters -Client δ t ≥ 0 length of period It: how many slots of ∆ time units compose this time period P t s energy consumption(< 0)/production(> 0) of s ∈ (S D ∪ S N D ) during the whole time period It vs cost per energy unit produced(> 0)/consumed(< 0) when using system s ∈ (S D ∪ S N D ) P min t s minimum energy to be produced(> 0)/consumed(< 0) by drivable system s ∈ S D before the end of period It vs ≥ 0 cost of energy unit charged/discharged by storage system s ∈ B u min s ≥ 0 minimal storage level of system s ∈ B u max s ≥ 0 storage capacity of system s ∈ B u 0 s ≥ u min s initial storage level (at period I 0 ) 0 ≤ λs ≤ 1 the loss coefficient of system s ∈ B θ abs s > 0 maximum energy stored in s ∈ B during ∆ time units θ ref s > 0 rated capacity, i.e., maximum energy delivered during ∆ time units sold (< 0) / bought (> 0) by the client at time period It related with contract c ∈ Ct 0 ≤ x t s ≤ 1 percentage of time period It drivable system s ∈ S D is used g t s ≥ 0 energy fed into storage system s ∈ B during period It h t s ≥ 0 energy consumed from storage system s ∈ B during period It r t s ≥ 0 amount of energy stored in s ∈ B at time period t ∈ T ∪ { t} e t ≥ 0 extra amount of energy requested by the client (out of any engaged contract) at time period It

s 0 ,

 0 and (44)-(46). The resulting tractable robust MILP model has (5 + |T || S N D |)(2|C| + |T ||S D | + 3|T ||B| + |T |) constraints and |T | 2 | S N D |(2|B| + |C| + 1) + (6|T ||S D | + 8|C| + 14|T ||B| + |T ||C|) variables.

  24 gap := Consume-energy-via-contracts({c ∈ C t : Π - t ,c > 0}); 25 gap := Discharge-batteries({s ∈ S B }); 26 e t ,d := gap ; // Consume remaining energy out of contracts if needed 18.04 LTS. As defined in Section 6.2, each RTCS heuristic can use either the deterministic or the robust CCP model solution as input. We denote by Det-RTCS the RTCS based on the deterministic model, and Rob-RTCS the one based on the robust budgeted model. The RTCS simulation is based on sets of realistic scenarios from the case study defined in this section.

  of the uncertain electricity production (or consumption) values for each time slot, over the whole time horizon. Given a list of engaged contracts (previously obtained with the solution of the CCP model), the simulation iterates over each time step, executing the chosen RTCS policy. As explained in the previous section, at this point, real-time energy scheduling actions are taken, according to the current state of the microgrid and the realization of energy production and consumption values. Among these values, the ones concerning the uncertain systems are obtained through the given scenario data in the current simulation.For the Tsukuba microgrid, an individual set of scenarios was generated for each of the four seasonal instances, based on real values of PV production and building consumption provided in the dataset. The spring instance scenarios, for example, encompass all information recorded between March 20th until June 21st, given the dataset's 3-year time horizon.In summary, for each microgrid instance, the simulation process consists in testing, the RTCS policies based on each CCP model solution. The combination of 2 types of gap policy (Cheapest and Conservative), with or without model reoptimization, yields a total of 4 possible X-RTCS procedures for each model X, deterministic or robust. Simulation is then performed by executing each pair of model X and X-RTCS heuristic on the proposed microgrid instances and their associated scenario groups. For each of the 4 seasonal Tsukuba instances, simulation will be executed on a specific scenario set from each season.

  the proportion of the maximum allowed deviation of uncertain parameters regarding production or consumption of energy, as defined in Section 5.1. As a baseline for comparison, the deterministic CCP model was tested with 3 different sets of values regarding uncertain devices. When Φ = 0%, the model is based on the most optimistic scenario, assuming minimal consumption and maximal production for uncertain consumer and producer devices, respectively.The exact opposite situation is represented by Φ = 100%, apparently the most pessimistic one. Finally, the scenario where Φ = 50% depicts the middle interval, with average values of uncertain devices. Bearing in mind that the Γ and Φ values used to parametrize the deterministic and robust models have different meanings, a general comparison will be conducted in this section to determine which model behaves best under uncertainty.

Figure 2 :

 2 Figure2: Winter instance: daily cost std and cost average obtained with simulations of cheapest, cheapest+ReOpt, conservative, convervative+ReOpt and naïve policies, based on either deterministic or robust budget models with Φ = 0%, 50%, 100% and Γ = 0%, 20%, 40%, 60%, 80%, 100%, respectively.the daily cost (x-axis) versus the average of this cost (y-axis) for deterministic and robust model policies, where each point denotes a specific value of Φ or Γ, respectively. On each curve, the right most point corresponds to Φ = 0% in the deterministic-based policies or Γ = 0% in the robust-based ones. Note that every point of each curve can be strictly improved in both average and std of cost by changing to a different value of Γ, without the need to trade off between average and std of the cost. In other words, each point is dominated by the points to its left. Therefore, the left-most part of each curve shows the Pareto frontier of cost average vs. cost standard deviation performance of the associated model policy. This evaluation framework can be applied to choose a suitable value of Φ or Γ, making sure the system operates on the Pareto frontier.

ScenarioFigure 3 :

 3 Figure 3: Cumulative total costs and out-of-contract (OC) costs of the best deterministic (Det) and robust (Rob) CCP models (and associated policies) of each season, obtained after simulation over the whole time horizon (from January 2015 until May 2018).

Finally, in Figure 3 ,

 3 we present a graph which highlights some advantages of the robust model in the long run, by comparing the accumulated costs obtained after simulating the best set of deterministic and robust CCP models and policies for each season instance, over the whole time horizon (from January 2015 until May 2018). In this analysis, at the end of the simulation time horizon, the system running with the robust model decisions incurs in no out-of-contract costs as well as significantly cheaper accumulated total cost, 21% less when compared to the best deterministic model.8. Concluding remarksThis work presented the Contract Collaboration Problem (CCP), a multicontract energy trading framework based on flexible commitments, coupled with a Real-Time Command Strategy (RTCS) for usage in microgrid energy trading and scheduling. As the main component, we developed a robust model under budgeted uncertainty which provides protection against the worst-case realization of the microgrid's production and consumption of electricity, by presenting a cost-effective contract commitment planning for a given time horizon.A case study was conducted on a real microgrid, with a total of four problem instances, one for each season of the year. Monte-Carlo simulations were used to assess the performance of the proposed CCP robust model solution (against the deterministic alternative), when used as input for real-time energy scheduling strategies. Relying on a set of real-world-inspired energy purchase contracts, simulation results have confirmed the efficacy of different robust-based RTCS

Client Drivable Systems Non Drivable Systems Non Drivable Uncertain Systems produces consumes Time horizon min max

		② Real-
	t =0	t =1	t =2	Time
		Power		horizon
	t =0	t =1	t =2
		Power

Time Command Strategy ① Partner Contract Subscription via a set of contracts Period Engage Cost Unit Cost Min kWh

					Max
					kWh
	1	0.033	0.009	5k	7k
	1	0.125	0.010	8k 11k
	2	0.022	0.016	2k	5k
	2	0.022	0.018	4k	5k
	2	0.437	0.004	9k 15k
	3	0.321	0.004 15k 18k
	3	0.875	0.004 30k 36k
	...

Table 1 :

 1

	. As far as grid-connected

Summary of the works listed in literature review. SO (Stochastic Opt model), RO (Robust Opt model). Uncertainty: list of uncertain parameters. REN (Renewable energy production), CHP (Combined Heat and Power), PEV (Plug-in Electric Vehicle), Wind (Wind Generator), PV (Photo-Voltaic). Contract: type of contract used to buy and sell energy.

  ARC) min y t

	c ,E	E						(13)
	s.t. E ≥ t∈T c∈C t (v t c y t c + α t c q t c ( Pt)) + s∈S D vs t∈T P t s x t s ( Pt)
	+	vs	P t s +	vs	(g t s ( Pt) + h t s ( Pt)) +	β t et( Pt), ∀ P ∈ U ,	(14)
	s∈ S N D	t∈T	s∈B	t∈T		t∈T
	c∈C t q t c ( Pt) + s∈S N D P t s + s∈ S N D	P t s + s∈S D P t s x t s ( Pt)

  github.com/levorato/ccp_rtcs. All experiments were performed on a workstation with an Intel Xeon CPU X5355 × 8 with 64 GB RAM, under Ubuntu Algorithm 1: RTCS algorithm that runs at each time slot d ∈ {1, . . . , δ t }, inside time period I t .

	Input: CCP model ccpm, initial ccpm solution X(y 0 , 1), gap policy, Reoptimize
	Result: Set of policies qc(•), xs(•), hs(•), e(•)
	1 if Reoptimize is enabled then
	2

  ∀c ∈ C t ;

												// Initial contract usage according to y 0
	7 x t ,d s	:= max x t s ,	P min t s s P maxt	, ∀s ∈ S D ;	// Power drivable according to CCP solution
	8 h t ,d s	:= h t s /δ t ; g t ,d s	:= g t s /δ t ;	// Use batteries according to CCP solution
	/* Sum energy consumption/production for all devices (certain and uncertain)	*/
	9 gap :=	s∈ S N D	P t ,d s	+	s∈S N D	P t s δ t +	c∈C t	q t ,d c	+	s∈S D	x t ,d s δ t	P t s	+	s∈S B	(h t ,d s	-g t ,d s );

10 if gap > 0 then // energy left over 11 if gap policy = cheapest then 12 Execute dispatch operations (Charge batteries, Sell via contracts, Power drivable consumers) following smallest energy cost first; 13 else // conservative gap policy 14 gap := Charge-batteries({s ∈ S B }); 15 gap := Sell-energy-surplus-via-contracts({c ∈ C t : Π - t ,c < 0}); 16 gap := Power drivable consumers({s ∈ S D : P min t s < 0}); 17 e t ,d := 0; 18 Throw remaining energy away; 19 else // Negative gap, need for additional energy 20 if gap policy = cheapest then 21 Execute operations (Turn on drivable producer, Use batteries, Consume from contracts, Consume out of contract) according to smallest cost first; 22 else // conservative gap policy 23 gap := Turn-on-drivable-producer-devices({s ∈ S D : P min t s > 0});

Table 3 :

 3 Robust vs. Determinisitc model result comparison for different budget parameters. The first value indicates the objective function value obtained, followed by the time spent (in seconds) to obtain the optimal solution. CPLEX default optimality gap of 10 -4 was applied.

Table 4 :

 4 statistical measures based on the operational cost (Cost Avg, Cost Std, Robust vs. Deterministic RTCS performance comparison for autumn and spring scenario groups. Cost Avg is the average scenario cost over all simulations. Cost Std represents the standard deviation of scenario cost. Cost CVaR is the conditional value at risk of scenario cost at 80% confidence level (i.e., the average scenario cost of the 20% highest scenario costs). OC Cost Avg is the average cost from Out of Contract (OC) energy consumption. Penalty Freq is the proportion of time periods with OC consumption. SOC Avg and SOC Std are the average and standard deviation of BESS State Of Charge (SOC).

	Cost CVaR), as well as Out of Contract (OC) energy consumption cost (OC
	Cost Avg), penalty frequency (i.e., the proportion of time periods where OC
	consumption occurred) and the State of Charge (SOC) of the microgrid's BESS
	(SOC Avg and SOC Std). In robust and deterministic CCP models, higher

the best economic performance of Det-RTCS (Cheapest+ReOpt policy with Φ = 50%), Rob-RTCS with Γ = 40% achieves a reduction of 0.1% in Cost Avg, 22.7% in Cost Std and 3.5% in Cost CVaR.

In spring season instance, the look-ahead Rob-RTCS policies with Γ = 40% and Γ = 80% outperform the deterministic counterparts in average cost and CVaR cost metrics. When compared to the previous set of scenarios, Rob-RTCS performance is further improved, with Γ = 40% and Γ = 80% budgetbased RTCS achieving the best economic performance (Cost Avg), with zero OC cost and thus zero penalty frequency. In this case, when compared to the Det-RTCS models whose policy has the lowest average cost (Cheapest+ReOpt), the Rob-RTCS with Γ = 40% is 17.6% cheaper on average, with a 3.6% decrease in Cost CVaR.

It is worth noting, however, that the amount of electricity bought or sold via each engaged contract may be more than the initial values proposed by the model policy, depending on the actual energy demand.

Acknowledgments

Research conducted during a visiting period at Avignon Université by means of a Doctoral Exchange Program sponsored by CAPES Foundation, Ministry of Education, Brazil (Process No.: 88881.187708/2018-01).

Best options for CCP model and RTCS policy

The presented results confirm the overall superiority of the RTCS simulations derived from the robust CCP model results, according to the value of the budgeted uncertainty parameter Γ. Such value will depend on the scenario type and, therefore, the season of the year. For the microgrid under study, an intermediate value of Γ = 40% proved to be the best parameter option for the robust model during spring, summer and autumn, while the maximum hedge (Γ = 100%) fits best during winter season. It is worth noting that only the Rob-RTCS policies which incorporated the look-ahead mechanism obtained improved results when compared to the deterministic-based policies.

As a complimentary evaluation, based on each season and the best performing robust CCP models presented above, we now investigate the differences among the proposed RTCS policies. Once again, we turn ourselves to Tables 4 and5, restricting our analysis to fixed values of Γ. For each combination of season and Γ value, we split the policies into 3 groups: naïve, look-ahead without model re-optimization (ReOpt) and look-ahead with re-optimization applied.

As far as the robust models are concerned, it is possible to observe that the naïve policy is not able to perform well according to cost and reliability metrics, and its simulation results are inferior to those obtained by the look-ahead policies. Regarding LA policies, both average and CVaR values of scenario cost improve in re-optimization-based policies, when compared to non-re-optimized ones. As an example, considering the summer instance, re-optimized models provide an improvement of 3% in average scenario cost and 1% in CVaR. Out of Contract (OC) costs also decrease in most cases. One possible explanation for this behaviour is related to how the look-ahead policy works when the CCP model is re-optimized. At each time period, the LA mechanism updates the values regarding uncertain energy parameters and linear decision rules, based on a new run of the optimization model. Using these updated predictions inside the RTCS policy seems to be more cost-effective than not using them.

A second analysis, based on Pareto frontier, can also be used to determine the best-performing policy. In Figure 2, we plot the standard deviation of


Fabienne Anfosso-Lédée
email: fabienne.anfosso@lcpc.fr

The effect of road absorption on tyre-road horn effect

come

The effect of road absorption on tyre-road horn effect

Fabienne Anfosso Ledee

Introduction

Horn effect is an amplification phenomenon of the tyre-road noise generated at the contact patch, caused by multiple reflections between the tyre belt and the road surface. This effect can reach more than 10 dB, but may be drastically reduced when the pavement is sound absorbing, which is the case for porous pavements. A 2D BEM model was used to predict this effect in which a non local absorption condition was introduced to take into account the effect of porous road surfaces. A theoretical validation was made previously for purely reflecting boundary conditions. This paper presents an experimental validation made on porous and non-porous real pavements, using the principle of reciprocity.

The 2D-BEM model approach

Purely reflecting boundary conditions

The tyre is approximated by an infinite rigid cylinder, with the same diameter as a tyre (0.60 m), laying on an infinite rigid plane. This cylinder is assumed to be rigid, not distorted by the contact with the plane surface, and with perfectly reflecting boundary conditions. The road pavement represented by the plane surface -roughness is neglectedhas purely reflecting boundary conditions in a first approach. In this 2-dimension problem, only a section is considered, and the contact between the tyre and the road is reduced to a point.

The acoustic source can be a velocity distribution on the contour Γ t , but in this paper, an equivalent point monopole source S located near the contact patch is used. It can represent the "air-pumping" source due to successive compressions and dilatations of air trapped in road and tyre cavities. The resulting sound can be calculated at one or many receiver points (R) located in the air-filled horn. The sound pressure at the receiver point p(R) is expressed by the integral formulation :

( ) ∫ Γ Γ         ∂ ∂ - ∂ ∂ + = (M) d n p(M) M) (R, G p(M) n M) G(R, R p ) R ( p i (1)
where p i (R) is the incident sound pressure, G the free-field Green function, the total boundary

Γ = Γ t ∪ Γ r .
This integral equation is expressed as a boundary equation, and solved by numerical procedures using boundary elements. In case the road surface is assumed perfectly reflecting, the use of semi-free-field Green function reduces drastically the calculation, and a set of linear equations of unknown the nodal pressure vector {p} is derived :

[H] {p} = {p i } (2)
The model has been successfully compared with the analytical model developed by Kropp, and with other BEM models [START_REF] Anfosso-Lédée | Tyre/road noise horn effect, 7th ICSV[END_REF], [START_REF] Anfosso-Lédée | Comparison of 2D and 3D models for horn effect[END_REF].

Porous layer absorption boundary condition

In the case of porous road surface, the boundary condition is not straightforwardly introduced in the BEM model, because the assumption of local reaction can not be made : the surface impedance depends on the angle of incidence, i.e. for a given source location, the surface impedance varies along the interface. The error committed when considering a local reaction is even more important than the incidence is grazing. In the present case, the sound source is close to the contact patch, and consequently, the incidence of acoustic wave propagating in the horn is typically grazing.

A coupling between two boundary equations was then developed : one in the air medium (equation ( 1)), the other describing the sound propagation inside the porous medium. The coupling of the two equations is achieved by the continuity of sound pressure and particle velocity at the interface between air and porous material. The numerical solving of this system gives a system of linear equations of unknown the nodal pressures {p} and nodal pressure gradients {∂p/∂n} on the boundary :

   [H 0 ] {p} -[G 0 ] {∂p/∂n} = {p i } [H p ] {p} -[G p ] {∂p/∂n} = {0} (3)
The subscripts "0" (respectively "p") stands for air (respectively porous) medium quantities. The Green function and its normal gradient inside the porous medium are derived by using the phenomenological model developed by Hamet [3]. This model requires 4 parameters : porosity, specific flow resistance, tortuosity, and layer thickness.

Typical predictions of horn effect on porous road surface can be found in [START_REF] Anfosso-Lédée | Tyre/road noise horn effect, 7th ICSV[END_REF] and [START_REF] Anfosso-Lédée | Comparison of 2D and 3D models for horn effect[END_REF].

Experimental validation

Description of the experiment

The 2D tyre was simulated by a 3 m long concrete tube, diameter 0.60 m, rigid and acoustically reflecting. It was placed first on a reflecting road surface (BBSG), and later, on a porous road surface (BBDr). The principle of reciprocity was used by placing a sound source S in the horn in front of the tube, and a microphone R flush on the surface of the tube, near the contact with the road surface. Different positions of the microphone were tested, for angle α with the vertical ranging from 5° to 45°. The centre of the source was located at h = 0.3 m above the road surface, and d = 1 m from the centre of the tube (Figure 1 where S and R are inverted). A M.L.S. signal was driven through the loudspeaker, and the impulse response was measured at the microphone. The transfer function was derived by Fourier analysis. The amplification horn effect was evaluated with reference to semi-free field condition above the road surface, i.e. as the ratio of transfer functions with and without the tube at the same microphone position. The edge influence of the finite tube is removed by the time windowing.

Estimation of the road acoustic impedance

In parallel, the amplification was calculated with the BEM model. For the porous road surface, the 4 physical parameters introduced in the boundary conditions were deduced from in situ measurements of sound absorption coefficient at normal incidence. The measuring method is described in [START_REF]Acoustics -Procedure for measuring sound absorption properties of road surfaces in situ -part1 : extended surface method[END_REF]. The best fit between the measured and the predicted coefficient of absorption with the phenomenological model [START_REF] Hamet | Acoustical characteristics of porous pavements, InterNoise[END_REF], gave the parameters : porosity Ω = 0.17 ; specific flow resistance R s : 37000 MKS Rayls ; tortuosity factor K = 2.5 ; Porous layer thickness e = 0.04 m.

Comparison between model and experiment

Experimental results and model predictions of horn effect amplification brought by the tube are shown in Figure 4 for the purely reflecting road surface, and in Figure 5 for the porous one. The results at 2 microphone positions are presented : the nearest to the contact patch (α = 5°, green curves) and an intermediate one (α = 30°, black curves). The overall comparison is fairly good, the curve shapes are similar, the orders of magnitude of amplification are comparable. The agreement is lower when getting closer to the contact patch (α = 5°). This can be explained by the difficulty to position accurately the microphone at the exact location (1mm above the surface). This inaccuracy explains the interference deep displacement in Figure 5 for instance. At higher source position, the positioning is more accurate, and a better agreement is obtained.

Conclusion

A 2D BEM model was used to predict the horn effect amplification, both for reflecting and sound absorbing properties of the road surface. This model can contribute to the optimisation of road properties for tyre-road noise reduction. An experiment on real road surface was made for the model validation, and a good agreement was found both for reflecting and porous road surfaces. It is confirmed that the amplification effect relative to semi-free field condition is significantly reduced when the road surface is porous.

Figure 1 :

 1 Figure 1: 2D geometrical description.

Figure 2 :

 2 Figure 2: experimental set-up : concrete tube filled with glasswool to avoid mode propagation inside the tube

Figure 3 :

 3 Figure 3: Absorption coefficient of the tested porous road surfacecomparison between measurement and predictions.

Figure 4 :Figure 5 :

 45 Figure 4: horn amplification by the tube on REFLECTING road surface -comparison measurement / calculation for source at 5° and 30°-