# Loads scheduling for demand response in energy communities

Mariam Sangaré, Eric Bourreau, Bernard Fortz, Amaury Pachurka, Michael Poss

► To cite this version:

Mariam Sangaré, Eric Bourreau, Bernard Fortz, Amaury Pachurka, Michael Poss. Loads scheduling for demand response in energy communities. Computers and Operations Research, 2023, 160, pp.106358. 10.1016/j.cor.2023.106358. hal-03880548v4

HAL Id: hal-03880548

https://hal.science/hal-03880548v4

Submitted on 20 Jul 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Loads scheduling for demand response in energy communities

Mariam Sangaré¹, Eric Bourreau¹, Bernard Fortz²,³,⁴, Amaury Pachurka⁵, and Michael Poss¹

¹LIRMM, University of Montpellier, Montpellier, France, Ⓔ {eric.bourreau,michael.poss,msangare}@lirmm.fr

²HEC - Management School of the University of Liège, University of Liège, Belgium

³Département d'informatique, Université libre de Bruxelles, Belgique, Ⓔ bernard.fortz@ulb.be

⁴INOCS, INRIA Lille-Nord Europe, France

⁵Smart Lou Quila, Gard, France, Ⓔ smartlouquila@gmail.com

## Abstract

This paper focuses on optimizing the collective self-consumption rate in energy communities by scheduling members' loads. The community remains connected to the public grid and comprises prosumers, traditional consumers, and distributed storage units. Prosumers can exchange their energy with the public grid or other members. The proposed strategy aims at implementing a Demand Side Management program taking advantage of controllable loads' characteristics. A MILP formulation of the problem allows, on the one hand, to give the optimal planning for electrical devices' operations. On the other hand, it provides optimal solutions for managing the storage units, peer-to-peer exchanges, and interactions with the public grid to minimize the energy flows from the public grid over time. However, this MILP only allows for solving small problem instances. Thus, we develop a column generation-based heuristic for large problem instances. Our numerical experiments based on real data collected in the south of France show that joining an energy community saves money on energy bills and reduces the total energy drawn from the primary grid by at least 15%.

**keywords:** Energy communities, Loads scheduling, Column generation heuristic

## 1 Introduction

Increasing environmental concerns and European Union's commitment to sustainability have led to the Clean Energy Package's approval in 2019 [5], which provides a regulatory framework for Renewable and Citizens Energy Communities. Instead of operating as a single Renewable self-consumer and dealing with the associated disadvantages, economic agents in the same locality can form energy communities and share the impacts. Since the package's approval by the European Commission, projects in member countries like France, Spain, and Portugal try to implement the package's directives. Therefore, we assist in increasing efforts by legislators, researchers, practitioners, and citizens to implement projects to generate, manage, and consume locally produced electricity to support the energy transition.

### 1.1 Renewable Energy Communities

An energy community is a group of at least two physical or legal persons who combine their efforts to make the best use of locally produced energy. We focus on RECs, which involve entities that jointly invest in producing, consuming, selling, and distributing renewable energy. Some benefits of RECs are efficient storage and peer-to-peer exchanges. Indeed, when a producer operates alone, i.e., produces, consumes, and injects the surplus into the primary grid, the surplus is necessarily injected into the primary grid after charging the batteries. Being in a community helps increase storage capacities. In addition, members can exchange in the community at more attractive rates than the public grid offers. The authors of [16] highlight the advantages of sharing outputs of collective systems between consumers. In [14], the authors aggregate heterogeneous demand profiles to maximize load matching, which induces a smooth load curve that increases the self-consumption rate by about 20%. Similarly, [17] shows that aggregating individual loads leads to a global load curve more adapted to the photovoltaic generation
profile and thus increases collective self-consumption. Unlike classical consumers, the members are more involved in decision-making, especially in energy-sharing.

We are witnessing a continuous increase in global energy demand. Residential consumption alone accounts for 40% of global energy consumption [6]. Energy communities are an alternative way to reduce the carbon footprint for members. Indeed, expanding energy communities would help reduce fossil fuel consumption by increasing the use of green energy. However, this requires building smart buildings in which almost all devices are remotely manageable. It also involves studies to develop advanced solutions to support the paradigm shift from the traditional energy systems paradigm of “generation-follows-load” to the new paradigm of “load-follows-generation”, which has led to the development of Demand Side management methodologies [4].

## 1.2 Demand side management

Demand-side management (DSM) plans, implements, and monitors activities to incentivize consumption profile modification. It allows consumers' involvement in grid management through informed decision-making regarding their energy consumption, which helps the energy providers reduce the peak load demand and reshape the load profile [13]. DSM was first introduced in the 70s in response to rising energy costs and has been used in different ways. The first approach is based on mutual agreement between consumers and the network operator. Through this agreement, some consumers authorize network operators (NO) to disconnect some devices when the cumulative consumption reaches a threshold. This approach is called Direct Load Control (DLC) and may be effective in some cases, but not where NO manages several consumers. Hence, the second approach is where NO, through various mechanisms, encourages consumers to consume during specific periods (Decentralized Control, DC). Among these mechanisms are the energy prices that variate according to different parameters: the general state of the market, the global load level, and the global level of energy production. The consumer is thus periodically confronted with arbitration between consuming or making savings. Unlike the DLC, DC allows consumers to base their decisions on information. However, although advantageous for both parties, this second approach may only be effective if it is accompanied by the consumer's efficient scheduling of energy generation, storage, and consumption. Therefore, integrating planning algorithms into a management system would allow autonomous and optimal production, consumption, and storage management.

This paper focuses on community members' simultaneous planning, consumption, and storage activities. The community remains connected to the public grid, and members may own a green generation and storage system. Moreover, each member performs a set of controllable loads (i.e., with flexible and programmable execution) and non-controllable loads (i.e., with fixed power profile) [4] during a given time horizon. Finally, members who generate energy can exchange their surplus with others and/or feed it into the public grid.

The community's main objective is to maximize the local consumption of renewable energy, or in other words, to minimize the exchanges with the public grid. Therefore, we focus on scheduling members' loads by taking advantage of these loads' specific characteristics.

## 1.3 Related works

Load scheduling to optimize energy efficiency is a well-assimilated practice in the industrial context. Authors of [9] study a multi-objective flow shop to minimize tardiness and the total energy cost. Likewise, the literature abounds with works on load scheduling in residential, microgrid, and energy communities. Typically, the approaches for solving the problems can be categorized into offline and online. The online approach reveals the decisions at period $h$ at the beginning of that period. That approach, which requires increased consumer participation, may be ineffective because of the fatigue phenomenon described by [18]. In the offline case, the optimization is performed once before the planning horizon starts. Thus, members execute their tasks during horizon according to the returned scheme. Our work belongs to the offline approach. Energy communities can take several forms. Their members may consist of a mix of prosumers and consumers [10], whether members have individual storage units or a central storage unit [22], only prosumers not having batteries [11], etc. As shown in Figure 1, the community in this paper is composed of prosumers and consumers, each of whom may own a storage unit. In addition, the works related to energy communities seek answers to various questions, and the technical
solving tools that are used strongly depend on these questions. These tools include linear programming, mixed-integer programming, bi-level programming, and game theory.

When game theory or bi-level models are involved, it is often as Stackelberg games. The latter consists of a leader and followers' interactions where the leader is an entity similar to the primary grid that sets the energy buying/selling prices to optimize the gain (positive or negative) or incentivize followers to prioritize green energy consumption. Then, followers decide to optimize their earnings and ensure their comfort regarding the leader's decisions.

Among the works that adopt a bi-level approach, [11] presents a model for a community of prosumers who trade among peers. There is no individual storage system; a centralized storage entity can buy surplus generation. The prosumers can exchange their surplus with neighbors, the centralized storage unit, or the main grid. Similarly, [23] presents a system comprising energy suppliers and small microgrids. Microgrids can have batteries but require an energy supplier in case of production or demand surplus. The paper considers a supplier named Genco that interacts with the microgrids via power purchase/sale contracts. Genco aims to offer the best contracts to avoid losing customers to competitors. The microgrids seek to minimize the total cost of interactions with Genco. A deterministic model is formulated, then a stochastic model considers the uncertainty of intermittent energy sources. In [1], authors consider an environment composed of consumers and a system operator (SO). SO's goal is to maximize its payoff. Consumers have loads that can be delayed but executed within specific time windows, with certain penalties. Thus, consumers' aim to minimize their costs composed of energy bills and inconvenience, which conflicts with SO's goal. In addition to the bi-level model, they propose a single-level reformulation and two heuristics relying on the problem's structure.

Regarding game theory, [22] proposes a peer-to-peer trading scheme for a community of prosumers and consumers. Consumers draw their needs from the main network. The primary grid sets buying and selling prices so that prosumers have the least incentive to trade with it. The followers respond by forming coalitions of neighbors who trade their surplus with those needing energy. The paper studies the properties of the Stackelberg game and shows that prosumers have no interest in going it alone and that prosumers will only form two coalitions. They finally show that there is a stable Stackelberg equilibrium.

Turning to linear programming, [10] seeks the percentage of prosumers to include in a community that maximizes the financial gain. To answer such a question, the authors introduce a cost-optimization model for peer-to-peer energy-sharing communities, making continuous decisions while using a forecast for the input data. Based on real-world data, they deduce that we can achieve cost-saving and increased collective self-consumption for small communities of 2-5 members. Similarly, [21] proposes a data-driven flexibility optimizer model for day-ahead energy profile scheduling. First, this optimizer estimates the green energy production and energy consumption of heat pumps and cooling appliances using a prediction model based on the fully connected neural network architecture. Then, an optimization problem is formulated to minimize flexibility procurement to reduce peak demand and increase green energy consumption. Finally, day-ahead scheduling is performed according to the optimization model results. Also, [7] proposes load planning in hospital sensitive to electrical failures. The network comprises hospital beds, PV generation, and repurposed EV storage system. The presented model is tested under different scenarios; the results show that an electricity bill reduction of 9.4% and energy reduction drawn from the main grid are achievable.

## 1.4 Contributions

In this paper, we seek to optimize the collective self-consumption rate by scheduling: controllable devices' loads, exchanges between peers, and storage. Unlike many models from the literature, where one seeks to optimize profit, this work aims at optimizing the energy drawn from the public grid. In other words, we wish to minimize the consumption of non-green energy.

The problem is modelled as a mixed-integer linear programming model (MILP), which, in addition to returning optimal schedules, gives a plan of energy exchanges and a management scheme for the storage units during a given planning horizon. Our starting point is the model proposed in [15], which we significantly enrich by considering more realistic modelling of the temperature evolution in the rooms and water heaters, following Newton's cooling law. As the resulting MILP is hardly solvable to optimality, even for small instances, we developed a column generation-based heuristic that convexifies the set of feasible schedules for the heating tasks.

Experiments reported in this paper show that the amount of energy drawn from the network is
reduced by at least 15% when individuals operate as a community compared to the cumulative energy drawn from the primary grid when they act individually. They also show that the MILP method is more efficient for solving small problems, while the heuristic provides high-quality solutions for large instances.

The remainder of the paper is organized as follows: after describing the problem under study in Section 2, Section 3 presents the mixed-integer programming model to acquire the exact solutions to the problem. Section 4 presents the heuristic based on column generation, returning the efficient solution of large problem instances. Section 6 presents the experimental results, Section 7 presents numerical improvements of the models. The paper concludes with a conclusion and perspectives for future works in Section 8.

# 2 Problem description

Consider a set of $N$ agents forming an energy community. Each member may have power generation and/or storage assets. During a time horizon $H$ sliced into periods of equal length, each member wishes

<figure><img src="image_2.png" /><figcaption>Figure 1: Community architecture (GES: green energy supplier).</figcaption></figure>

to perform a set of tasks with electrical devices. Each task belongs to one of the following categories based on its characteristics.

## 2.1 Loads categorization

According to [4], controllable loads have flexible and programmable operations. The controllable loads are grouped into two categories: type A and B loads. The reorganization of controllable loads over time increases the community's energy efficiency. We use the same loads nomenclature as [15].

**Type A loads** are related to tasks whose execution allows regulating the temperature of certain environments for human comfort. This type includes heating, ventilation, air conditioning, and water heaters. The execution of these tasks may be interrupted for certain periods before being resumed while ensuring that the targeted temperature objectives are met. In practice, an individual regulates the temperature of a room to reach a comfort zone and maintains it until a specific time. For example, an individual may want the temperature of a space to be between 22 °C and 24 °C from 6 pm to 11 pm. This paper aims to determine each type A load's starting time and periodic consumption levels during the planning horizon.

**Type B loads** must be performed within some given time windows with fixed periodic consumption levels. These loads are related to appliances such as washing machines, dryers, and electric vehicles. For each task, the user indicates the time windows during which the task could be performed and the periodic consumption levels in each time window. The model returns the best schedule to operate the tasks while respecting the community's constraints.

**Type C loads** have an uncontrollable starting time and consumption levels. In other words, these loads must be executed without delay after the request and necessarily with the required electrical
consumption levels. Type C tasks include lighting, cooking, television, fridge, internet box, and appliances on standby. Therefore, each member has to estimate the periodic accumulation of the consumption of the corresponding tasks on the planning horizon.

Figure 2 presents an example of three type B tasks in a planning horizon of 24h, sliced into periods of 1 hour. These tasks correspond to charging an electric vehicle (green), using a washing machine (gray) and a dryer (blue), and two schedules for each task, as presented in Figure 2. The first plan is for washing in three periods: in the first period, the washing machine will use 2kWh and then 1 kWh in the following periods. The second plan foresees washing in two periods, with 2 kWh per period. The reasoning is the same for the two other tasks.

<table><caption>Figure 2: Example of type B tasks.</caption><thead><tr><th>Tasks</th><th>01</th><th>02</th><th>03</th><th>04</th><th>05</th><th>06</th><th>07</th><th>08</th><th>09</th><th>10</th><th>11</th><th>12</th><th>13</th><th>14</th><th>15</th><th>16</th><th>17</th><th>18</th><th>19</th><th>20</th><th>21</th><th>22</th><th>23</th><th>24</th></tr></thead><tbody><tr><td>Washing</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>2</td><td>1</td><td>1</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dryer</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>2</td><td>2</td><td></td></tr><tr><td>EV</td><td>2</td><td>2</td><td>2</td><td>2</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

According to this categorization, the problem has to determine two types of decisions. First, decide when to start the type A tasks and which power levels to use periodically to reach the comfort zones. Second, choose the best schedules the members provide to perform type B tasks. These decisions must satisfy individual and global operational constraints. Recall that type C tasks are uncontrollable; no further decision is required.

## 2.2 Energy network model

In this paper, members can have different generation and storage asset ownership characteristics, as shown by Figure 1. The members generating energy can exchange their surplus at fixed rates known by all members. Indeed, these members, called prosumers, can sell their surplus to other community members or green energy supplier. Furthermore, a generator owning a storage unit can store the surplus and consume or sell it later. However, members holding only storage units cannot sell energy. Instead, they buy energy for their usage. Each individual is directly linked to the public grid and can subtract/inject energy from/into it when needed. Let $C_{ih}$ be the amount of energy drawn from the network by member $i \in N$ at time period $h \in H$. The objective is to minimize the amount drawn from the primary grid by the members over the planning horizon $H$.

Section 3 presents the problem's formulation as mixed-integer linear program.

## 3 Loads scheduling model

This section introduces a mixed-integer linear program to get the exact solutions of the loads scheduling problem. The data used in the model are:

### Sets

* $N$ set of members in the community

* $B_i$ set of batteries of member $i \in N$

* $J^A$ set of types of type A tasks

* $J_i^B$ set of tasks of type B of member $i \in N$

* $H$ set of the periods in the planning horizon

* $K_{ij}^A$ set of rooms of member $i$ where task $j \in J^A$ can be performed

* $S_{ij}$ set of schedules given by $i \in N$ for the execution of task $j \in J_i^B$

* $P_{ijk}^A$ set of the power levels available to perform task $j \in J^A$ in room $k \in K_{ij}^A$ of $i \in N$

### Params
$\Delta_h$ length of period $h$ (hour)

$\pi_i$ subscribed power level of member $i \in N$

$\Gamma_{ib}$ capacity of battery $b \in B_i$ of member $i \in N$

$\xi_{bi}$ initial amount of electricity in battery $b \in B_i$ of member $i \in N$

$\eta_{bi}$ automatic discharge rate of battery $b \in B_i$ of member $i \in N$

$\phi_{bi}$ maximum number of cycles for the battery $b \in B_i$ of member $i \in N$

$\beta$ maximum spending degradation threshold allowed (%)

$\Omega_i$ equal to 1 if member $i$ is allowed to exchange electricity, 0 otherwise

$d_{bih}, c_{bih}$ discharge and charging efficiencies of battery $b \in B_i$ of member $i \in N$ at period $h$ (%)

$\nu_{ijk}$ equal 1 if task $j \in J^A$ is executed by member $i$ in room $k \in K_{ij}^A$, 0, otherwise

$\theta_j(p)$ function modeling the temperature variation when performing task $j \in J^A$ according to power $p$

$[t_{ijk}^{\text{low}}, t_{ijk}^{\text{up}}]$ comfort temperature targeted by member $i$ when performing task $j \in J^A$ in room $k$ (°C)

$[h_{ijk}^{\text{low}}, h_{ijk}^{\text{up}}]$ time where member $i$'s comfort zone must be reached when performing task $j \in J^A$

$\bar{T}_{i1k}^{\text{room}}$ initial temperature of room $k \in K_{i1}^A$ where member $i$ wants to perform task for $j = 1$

$\bar{T}_{i2k}^{\text{water}}$ initial water's temperature in heater $k \in K_{i2}^A$ where member $i$ wants to perform task for $j = 2$

$\bar{T}_{ijk}^{\text{init}} = \bar{T}_{i1k}^{\text{room}}$ if $j = 1$, $\bar{T}_{ijk}^{\text{init}} = \bar{T}_{i2k}^{\text{water}}$ if $j = 2$

$T_h^{\text{out}}$ outside temperature at time period $h \in H$ (°C)

$T_{kh}^{\text{room}}$ ambient temperature of the room where is placed the water heater $k \in K_{i2}^A$ at period $h \in H$ (°C)

$P_{ih}^{\text{Gen}}$ energy production of member $i$ at period $h$ (kW)

$P_{ijhs}^{\text{B}}$ power consumption of task $j \in J_i^B$ of member $i$ at period $h$ in the schedule $s \in S_{ij}$ (kW)

$P_{bih}^{\text{in}}, P_{bih}^{\text{out}}$ charging and discharging power of battery $b \in B_i$ of member $i \in N$ at time period $h$ (kW)

$p_{ih}^{\text{C}}$ cumulative power consumption of type C tasks at time period $h \in H$

$G_i$ gain of member $i \in N$ when operating outside a community(€)

$v_h^{\text{MG}}$ unit purchase price of electricity from the primary grid during period $h \in H$ (€/kWh)

$\tilde{v}_h^{\text{MG}}$ unit sale price of electricity to the primary grid during period $h \in H$ (€/kWh)

$v_h^{\text{Com}}$ unit purchase price of electricity in the community during period $h \in H$ (€/kWh)

$\tilde{v}_h^{\text{Com}}$ unit sale price of electricity in the community during period $h \in H$ (€/kWh)

$v_h^{\text{GES}}$ unit purchase price of electricity to the green energy supplier at period $h \in H$ (€/kWh)

$\tilde{v}_h^{\text{GES}}$ unit sale price of electricity to the green energy supplier at time period $h \in H$ (€/kWh)

Note that the prices $\tilde{v}_h^{\text{GES}}$ and $v_h^{\text{GES}}$ apply when individuals are in the community. In addition, $\tilde{v}_h^{\text{MG}}$ and $v_h^{\text{MG}}$ are the selling and buying prices when the members are outside the community. Prices with index $C$ are intra-member transaction prices.

Type A tasks are heating tasks, performed to regulate the temperature. Without loss of generality, we consider two types of heating tasks: heating houserooms and water heaters i.e. $|J^A| = 2$. We model the variation of temperature for a task according to the power level as follows. Let $p_h$ be the power level at which the device operates at time period $h$.

* For a house room, $j \in J^A$ equals 1. Based on Newton's law of cooling [2], the temperature variation function $\theta_1$ can be written as

$$ \theta_1(p_h) = \theta_1(p_{h-1}) + \frac{\Delta}{C_r}(p_h - U(\theta_1(p_{h-1}) - T_h^{\text{out}})) $$

where $C_r$ is heat capacity (J/K), parameter $U$ designates the heat loss coefficient of a room in (W/K), and $\Delta$ is the heating time in second. $T_h^{\text{out}}$ is the external temperature at period $h \in H$.

* For a water heater ($j = 2$), using the method from [19], the temperature variation function $\theta_2$ is
given by

$$ \theta_2(p_h) = \frac{\Delta_h}{Mc_p} \left( -\frac{S}{R} [\theta_2(p_{h-1}) - T_h^{\text{room}}] - 1000M_w c_p [\theta_2(p_{h-1}) - T_{in}] + \nu p_h \right) + \theta_2(p_{h-1}), $$

where $c_p$ is the isobaric specific heat capacity of water (kcal/kg.°C), $\nu$ is the efficiency of the electricity-to-heat transformation, $M$ is the weight of the water (kg). Parameter $S$ is related to the exchange surface of the water container with the external area, $R$ is the thermal resistance of the tank insulation in $m^2$.°C/W and $M_w$ is the average hot water demand rate during the time interval, which we assume to be equal to zero since we don't have that information. Parameter $T_{in}$ is the supply domestic cold water temperature, and recall that $T^{\text{room}}$ is the temperature of the ambient environment. Finally, $\Delta_h$ is the heating time in seconds.

Notice that schedules start at period 1. We have a initial period $h = 0$ where no decision is required, i.e., $p_0 = 0$. The initial state of house rooms ($T^{\text{room}}$) and water heaters ($T^{\text{water}}$) are known. In addition, each task $j \in J^A$ performed in room $k$ of member $i$ has a power $p_{ijk}^* > 0$ in kW. Thus, in practice, the device's used power is continuous on interval $[0, p_{ijk}^*]$. We discretize $[0, p_{ijk}^*]$ by considering only the integer values in $[1, p_{ijk}^*]$ (notice that 0 is not considered as in that case, the device is turned off). Our numerical experiments consider devices with $p_{ijk}^* = 2$.

Given these data and heating model, our problem can be formulated with the following variables:

$x_{ijkhp}^A \in \{0, 1\}$ is equal to 1 if and only if task $j \in J^A$ is in progress at period $h \in H$ in room $k \in K_{ij}^A$ of member $i \in N$, and the devise is on power level $p$,

$x_{ij}^s \in \{0, 1\}$ is equal to 1 if and only if schedule $s \in S_{ij}$ is chosen for the execution of task $j \in J_i^B$ of community's member $i$,

$z_{bih} \in \{0, 1\}$ is equal to 1 if and only if battery $b \in B_i$ of member $i \in N$ is charging in time period $h \in H$,

$w_{bih} \in \{0, 1\}$ is equal to 1 if and only if the operation of battery $b \in B$ of $i \in N$ changes from discharging or inactive to charging in period $h \in H$,

$T_{ijkh} \ge 0$ represents the temperature in room $k$ of member $i \in N$ reached by performing task $j \in J^A$ in period $h \in H$,

$q_{bih} \in \mathbb{R}$ is the amount of energy injected into/out of battery $b \in B_i$ of $i \in N$ in time period $h \in H$, with $q_{bih} \le 0$ if $b$ discharges, $q_{bih} \ge 0$ if $b$ charges, and $q_{bih} = 0$ if $b$ is inactive,

$E_{bih} \ge 0$ is the amount of electricity available in battery $b \in B_i$ of member $i \in N$ at the end of period $h$,

$f_{ieh} \ge 0$ is the amount of energy produced by member $i$ and sent to member $e$ in period $h \in H$,

$I_{ih} \ge 0$ is the amount of photovoltaic energy injected in the public grid by member $i \in N$ in period $h \in H$,

$C_{ih} \ge 0$ is the amount of energy withdrawn from the grid by member $i \in N$ in period $h \in H$,

$\dot{G}_i \in \mathbb{R}$ is the gain of member $i \in N$ when operating in the community.

The load scheduling problem is formulated as :

$$ \min \sum_{i \in N} \sum_{h \in H} C_{ih} \qquad (1a) $$

$$ \text{s.t.} \quad \sum_{j \in J^A} \sum_{k \in K_{ij}^A} \sum_{p \in P_{ijk}^A} p \cdot x_{ijkhp}^A + \sum_{j \in J_i^B} \sum_{s \in S_{ij}} P_{ijhs}^B x_{ij}^s + p_{ih}^c + \sum_{b \in B_i} \frac{q_{bih}}{\Delta_h} \\ = P_{ih}^{\text{Gen}} + \sum_{\substack{i' \in N \\ i' \neq i}} (f_{i'ih} - f_{ii'h}) + C_{ih} - I_{ih} \quad i \in N, h \in H \quad (1b) $$

$$ \sum_{p \in P_{ijk}^h} x_{ijkhp}^A \le 1 \qquad i \in N, j \in J^A, k \in K_{ij}^A, h \in H \quad (1c) $$

$$ \sum_{s \in S_{ij}} x_{is}^s = 1 \qquad j \in J_i^B, i \in N \quad (1d) $$
$$ \sum_{i' \in N, i' \neq i} f_{ii'h} + I_{ih} \leq P_{ih}^{\text{Gen}} + \sum_{b \in B_i} \frac{E_{bih}}{\Delta_h} \Omega_i \qquad i \in N, h \in H \quad (1e) $$

$$ \tilde{G}_i = \sum_{h \in H} \left[ \sum_{\substack{i' \in N \\ i' \neq i}} (v_h^{\text{Com}} f_{ii'h} - \tilde{v}_h^{\text{Com}} f_{i'ih}) + v_h^{\text{GES}} I_{ih} - \tilde{v}_h^{\text{GES}} C_{ih} \right] \Delta_h \qquad i \in N \quad (1f) $$

$$ \frac{\tilde{G}_i - G_i}{|G_i|} \geq \beta \qquad i \in N \quad (1g) $$

$$ \sum_{i' \in N, i' \neq i} f_{i'ih} + C_{ih} \leq \pi_i \qquad i \in N, h \in H \quad (1h) $$

$$ \sum_{i' \in N, i' \neq i} f_{ii'h} + I_{ih} \leq \pi_i \qquad i \in N, h \in H \quad (1i) $$

$$ T_{ijkh} = \theta_j \left( \sum_{p \in P_{ijk}^k} p \cdot x_{ijkhp}^A \right) \qquad i \in N, j \in J^A, k \in K_{ij}^A, h \in H \quad (1j) $$

$$ t_{ijk}^{\text{low}} \leq T_{ijkh} \leq t_{ijk}^{\text{up}} \qquad i \in N, j \in J^A, k \in K_{ij}^A, h \in [h_{ijk}^{\text{low}}, h_{ijk}^{\text{up}}] : \nu_{ijk} = 1 \quad (1k) $$

$$ T_{ijk0} = \bar{T}_{ijk}^{\text{init}} \qquad i \in N, j \in J^A, k \in K_{ij}^A \quad (1l) $$

$$ \Delta_h d_{bih} P_{bih}^{\text{out}} (z_{bih} - 1) \leq q_{bih} \leq \Delta_h c_{bih} P_{bih}^{\text{in}} z_{bih} \qquad i \in N, b \in B_i, h \in H \quad (1m) $$

$$ z_{bih} - z_{bi(h-1)} \leq w_{bi(h-1)} \qquad i \in N, b \in B_i, h \in 2, \dots, |H| \quad (1n) $$

$$ \frac{E_{bih} - q_{bi(h-1)}}{E_{bi(h-1)}} = \eta_{bi} \qquad i \in N, b \in B_i, h \in 1, \dots, |H| \quad (1o) $$

$$ \sum_{h \in H} w_{bih} \leq \phi_{bi} \qquad i \in N, b \in B_i \quad (1p) $$

$$ E_{bih} \leq \Gamma_{bi} \qquad i \in N, b \in B_i, h \in H \quad (1q) $$

$$ E_{bi0} = \xi_{bi} \qquad i \in N, b \in B_i \quad (1r) $$

$$ E_{bih} = \xi_{bi} \qquad i \in N, b \in B_i \quad (1s) $$

$$ x_{ijkhp}^A \in \{0, 1\} \qquad i \in N, j \in J^A, h \in H, p \in P_{ijk}^A, k \in K_{ij}^A \quad (1t) $$

$$ x_{ij}^s \in \{0, 1\} \qquad i \in N, j \in J_i^B, s \in S_{ij} \quad (1u) $$

$$ z_{bih}, w_{bih} \in \{0, 1\} \qquad i \in N, b \in B_i, h \in H \quad (1v) $$

$$ E_{bih} \geq 0 \qquad i \in N, b \in B, h \in H \quad (1w) $$

$$ C_{ih} \geq 0 \qquad i \in N, h \in H \quad (1x) $$

$$ I_{ih} \geq 0 \qquad i \in N, h \in H \quad (1y) $$

$$ f_{ii'h} \geq 0 \qquad i, i' \in N, h \in H. \quad (1z) $$

The MILP's objective is to minimize the cumulative energy collected from the main grid over the planning horizon (1a). Constraints (1b) enforce that, for each member $i \in N$, at any time period $h$, the sum of the energies received, and the energy produced is equal to the energy consumed plus the energy injected into the grids (public and community). On the left-hand side of the equality, the two sums represent respectively the consumption of type A and B tasks, $p_{ih}^c$ is the total consumption of type C tasks in period $h$. The third sum represents the extractions into/out of batteries. The right-hand side represents the energy exchanges between the community members. Constraints (1c) impose that at most one power level is chosen in period $h \in H$ to regulate the temperature of room $k \in K_{ij}^A$ of member $i \in N$. Constraints (1d) guarantee that only one schedule is selected to perform task $j \in J_i^B$ of member $i$ during planning horizon $H$. Community members can only feed photovoltaic energy into the public grid. Therefore, members who do not generate energy should only receive the amount needed for instant consumption or charging the batteries. Hence, constraints (1e) enforce that non-generator do not send energy. Constraint (1f) calculates the economic gain $\tilde{G}_i$ for each member $i$. In addition, membership in the energy community should not degrade an individual's situation beyond a certain threshold. Constraints (1g) enforce that a member's gain can deteriorate by at most $\beta\%$. Constraints (1h) and (1i) are related to the subscribed power levels of members. Indeed, a member can only inject or withdraw a predefined amount of energy
per period. Constraints (1j)-(1l) are related to type A tasks for temperature regulation. Constraints (1j) define the temperature for each room and each period. Constraints (1k) enforce that the temperature of a room must be in a specific interval during a given time interval. Finally, constraints (1l) set the initial temperature of the rooms.

Turning to battery usage, constraints (1m) ensure that $q_{bih}$ lies between the minimum and maximum power levels allowed for discharging/charging battery $b$ of member $i$ at period $h \in H$. The number of cycles allowed is limited to limit the degradation of a battery. Constraints (1n) set variables $w_{bih}$ to track the changes in $z_{bih}$. Constraint (1o) is related to the batteries' state. The energy in the battery is equal to the remaining energy after the automatic discharge plus the energy charged/discharged at each period. Constraints (1p) enforce the desired maximum number of cycles. Constraints (1q) enforce capacity constraints on batteries, and constraints (1r) and (1s) imply that the initial and final states of batteries are the same. Finally, constraints (1t) to (1z) define the domain of the variables.

**Remark.** Note that nothing prevents an individual $i$ from selling to the community member $i'$ energy drawn from the main grid. However, if such a solution is returned by the model, one can readily obtain a solution that is not less efficient by letting $i'$ draw that energy directly in the main grid instead of $i$.

# 4 Column generation-based heuristic

MILP (1) can hardly be solved optimally for large problem instances, often not even finding feasible solutions. To overcome this, we propose a column generation-based heuristic, in which the columns are the schedules to perform the type A tasks. This heuristic allows us to generate the schedules with minimum costs (through a pricing problem) that are likely improve the restricted master problem (RMP) instead of explicitly generating them. The approach we propose is a heuristic because new columns are generated only at the root node of the branch-and-bound tree.

## 4.1 Dantzig-Wolfe reformulation

The heuristic relies on a Dantzig-Wolfe reformulation [8] where the scheduling constraints related to type A loads are put into a pricing problem, in this case, the temperature constraints (1j), (1k) and (1l). All other constraints of (1) are placed into the restricted master problem. The latter includes the same MILP variables except those associated with type A tasks. Indeed, instead of choosing a power level at each period, we must determine which schedule to select among those returned by the pricing problem over the iterations.

Let $X_{ijk}$ denotes the set of feasible schedules for the requested task $j \in J^A$ in room $k \in K_{ij}^A$ of member $i \in N$ i.e. such that the temperature constraint is satisfied:

$$X_{ijk} = \left\{ \begin{array}{l} \chi^A \in \{0,1\}^H : T_{ijk0} = \bar{T}_{ijk}^{\text{init}}, T_{ijkh} = \theta_j \left( \sum_{p \in P_{ijk}^A} p \cdot x_{ijkhp}^A \right) \text{ and } t_{ijk}^{\text{low}} \le T_{ijkh} \le t_{ijk}^{\text{up}} \vspace{0.2cm} \\ h \in [h_{ijk}^{\text{low}}, h_{ijk}^{\text{up}}] \end{array} \right\}$$

$\forall i \in N, j \in J^A, k \in K_{ij}^A$. Let us introduce a binary variable $\sigma_{ijk}^{\chi^A}$ that is equal to 1 if schedule $\chi^A \in X_{ijk}$ has been selected to perform task $j$ in the $k^{th}$-room of member $i$. Performing a Dantzig-Wolfe reformulation of the constraints corresponding to $X_{ijk}$, namely (1j)-(1l), we obtain the following reformulation:

$$\min \sum_{i \in N} \sum_{h \in H} C_{ih} \qquad (2a)$$

$$\text{s.t.} \quad \sum_{j \in J^A} \sum_{k \in K_{ij}^A} p \cdot \left( \sum_{\chi^A \in X_{ijk}} \chi_{ijkhp}^A \sigma_{ijk}^{\chi^A} \right) + \sum_{j \in J_i^B} P_{ijhs}^B x_{ij}^s + P_{ih}^C + \sum_{b \in B_i} \frac{q_{bih}}{\Delta_h} = P_{ih}^{\text{Gen}} + \sum_{\substack{i' \in N \\ i' \neq i}} (f_{i'ih} - f_{ii'h})$$
$$+C_{ih} - I_{ih} \qquad \forall i \in N, h \in H \qquad (2b)$$

$$\sum_{\chi^A \in X_{ijk}} \sigma_{ijk}^{\chi^A} = 1 \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A : \nu_{ijk} = 1 \qquad (2c)$$

(1d) to (1i), (1m) to (1z),

$$\sigma_{ijk}^{\chi^A} \in \{0, 1\} \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A \qquad (2d)$$

where we denote respectively the dual values of constraints (2b) and (2c) by {$\alpha_{ih}$}$_{i \in N, h \in H}$ and {$\tau_{ijk}$}$_{i \in N, j \in J^A, k \in K_{ij}^A}$. The Restricted Master Problem (RMP) is obtained from the above reformulation considering only subsets of elements in $X_{ijk}$, which we denote $\tilde{X}_{ijk}$.

The pricing problem aims at determining the feasible schedules for the required type A tasks in the planning horizon. In other words, it aims at determining schedules that satisfy the temperature constraints of these tasks. Mathematically, the pricing problem searches for the cheapest vector in $X_{ijk}$ based on the reduced costs obtained from RMP. The reduced cost associated to $\sigma_{ijk}^{\chi^A}$ for $i \in N, j \in J^A, k \in K_{ij}^A$ is $\sum_{h \in H} \sum_{p \in P_{ijk}^A} (-p \cdot \alpha_{ih} \cdot \chi_{ijkhp}^A) - \tau_{ijk}$. Therefore, the pricing problem is defined by (3).

$$\min \left\{ \sum_{h \in H} \sum_{p \in P_{ijk}^A} -\alpha_{ih} \cdot p \cdot \chi_{ijkhp}^A - \tau_{ijk} \quad \text{s.t.} \quad \chi^A \in X_{ijk} \right\} \quad \forall i \in N, j \in J^A, k \in K_{ij}^A. \qquad (3)$$

To optimize over $X_{ijk}$, it is convenient to re-introduce variables $x^A$ and $T$ from the original formulation, leading to the following pricing problem for each $i \in N, j \in J^A, k \in K_{ij}^A$:

$$\tilde{z}_{ijk} = \min \sum_{h \in H} \sum_{p \in P_{ijk}^A} -\alpha_{ih} \cdot p \cdot x_{ijkhp}^A - \tau_{ijk} \qquad (4a)$$

$$\text{s.t. } T_{ijkh} = \theta_j \left( \sum_{p \in P_{ijk}^A} p \cdot x_{ijkhp}^A \right) \quad \forall h \in H \qquad (4b)$$

$$t_{ijk}^{\text{low}} \le T_{ijkh} \le t_{ijk}^{\text{up}} \quad \forall h \in [h_{ijk}^{\text{low}}, h_{ijk}^{\text{up}}] : \nu_{ijk} = 1 \qquad (4c)$$

$$T_{ijk0} = \bar{T}_{ijk}^{\text{init}} \qquad (4d)$$

$$\sum_{p \in P_{ijk}^A} x_{ijkhp}^A \le 1 \quad \forall h \in H \qquad (4e)$$

$$x_{ijkhp}^A \in \{0, 1\} \quad \forall h \in H, p \in P_{ijk}^A. \qquad (4f)$$

A schedule $x_{ijk}^{A*}$ returned by (4) possibly improves the restricted master problem if $\tilde{z}_{ijk}^* < 0$. In this case, the corresponding column is added to the restricted master problem.

## 4.2 The algorithm

This section describes the column generation-based heuristic detailed in Algorithm 1. We determine initial feasible schedules by solving (1) with $f_{ii'h} = 0$ for each $i, i' \in N$ and $h \in H$; it corresponds to the case where there are no internal links between members. We add these schedules to $\tilde{X}$ and solve RMP to recover the dual values $\alpha$ and $\tau$. That concludes the initial phase. The following instructions are repeated until a stopping criterion is met: solve the pricing problem, which returns the feasible schedules of all required tasks. If the reduced cost of a feasible schedule is negative, add this schedule to the relaxed RMP and solve it to get the dual values.

Algorithm 1 stops if the pricing problem returns only schedules with positive or null reduced costs, or if a fixed maximum iteration number maxIter is reached. When a stopping criterion is satisfied, the last step consists of solving the RMP with the integrality constraints to get the final solution of the heuristic.

Due to the community's size and the number of type A tasks, instead of solving the pricing problem for each task $j \in J^A$, in each room $k \in K_{ij}^A$ of each member $i \in N$, we may solve a unique pricing problem.
problem. We will see later which is the most efficient way to proceed. After solving the pricing problem at once, we get a feasible schedule for each required task. Only those with negative reduced cost will be kept. The pricing problem is then:

$$ \min \sum_{i \in N} \sum_{j \in J^A} \sum_{\substack{k \in K_{ij}^A \\ h \in H}} -\alpha_{ih} \cdot p \cdot x_{ijkhp}^A - \tau_{ijk} \quad (5a) $$

$$ \text{s.t.} \quad T_{ijkh} = \theta_j \left( \sum_{p \in P_{ijk}^A} p \cdot x_{ijkhp}^A \right) \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A, h \in H \quad (5b) $$

$$ T_{ijkh} \in [t_{ijk}^{\text{low}}, t_{ijk}^{\text{up}}] \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A, h \in [h^{\text{low}}, h^{\text{up}}]_{ijk} : \nu_{ijk} = 1 \quad (5c) $$

$$ T_{ijk0} = \bar{T}_{ijk}^{\text{init}} \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A \quad (5d) $$

$$ \sum_{p \in P_{ijk}^A} x_{ijkhp}^A \le 1 \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A, h \in H \quad (5e) $$

$$ x_{ijkhp}^A \in \{0, 1\} \qquad \forall i \in N, j \in J^A, k \in K_{ij}^A, h \in H, p \in P_{ijk}^A. \quad (5f) $$

The algorithm is schematized in Algorithm 1, in which c, and PP denote, respectively, the matrix of reduced costs and the pricing problem. $F^{MILP}$ refers to the MILP formulation presented in Section 3.

<caption>**Algorithm 1:** Column generation-based heuristic's algorithm.</caption>

**input** : maxIter
**output** : best solution found

**Function Main( maxIter):**

solve $F^{MILP}$ without internal links to get $X^{init}$, a tuple of feasible schedules, add $X^{init}$ to $\tilde{X}$; iter = 0;

**do**
  iter + +;
  solve (RMP) to get the dual values $\alpha$ and $\tau$;
  solve (PP) with these dual values to get tuple $X^{iter}$ and matrix $c$;
  **for** i $\in$ N, j $\in$ J$^A$, k $\in$ K$_{ij}^A$ **do**
    **if** $\nu_{ijk} > 0$ **then**
      **if** $c_{ijk} < 0$ **then**
        add $X_{ijk}^{iter}$ to $\tilde{X}_{ijk}$;
      **end**
    **end**
  **end**
  **while** iter $\le$ maxIter **or** ($c \ge 0$) $== 0$;
  solve (RMP) with integrality constraints to get Solution;
**return** Solution.

## 4.3 Pricing problem's complexity

Let us now study the complexity of PP.

**Proposition 1.** PP is polynomially solvable if $|H| = 1$.

*Proof.* Suppose that $m \ge 1$ tasks are required by a single member to heat houserooms, $j = 1$. Thus, to alleviate notations, we drop indices i, j and h in the rest of the proof. The problem comes to choose one power in the set $P_k^A$ of available powers for each houseroom k. Assuming the required temperature variation is feasible, an answer of the decision problem is obtained by performing at most $\sum_{k=1}^{k=m} 3|P_k^A|$ operations. $\square$
We consider next the special case with a unique member and a unique type of tasks to be executed, so we drop indexes $i$ and $j$. A unique task is considered then, we also drop index $k$. We further assume that $t^{\text{low}} = t^{\text{up}} = \tilde{\theta}$, $h^{\text{low}} = h^{\text{up}} = |H|$ and $\tilde{T}^{\text{init}} = 0$. We also consider that $(\Delta/Cr) = 1$ for the room, so the temperature variation function $\theta$ turns to:

$$T_h = T_{(h-1)} + p_h - T_h^{\text{loss}},$$

where $p_h$ is the power used to perform the task in the room and $T_h^{\text{loss}}$ is the heat lost by the room at period $h$. Then,

$$T_{|H|} = \sum_{h \in H} (p_h - T_h^{\text{loss}}),$$

which must be equal to $\tilde{\theta}$. With these simplifications, PP becomes:

$$\tilde{z} = \min \sum_{h \in H} \sum_{p \in P^A} -\alpha_h \cdot p \cdot x_{hp}^A - \tau \quad (6a)$$

$$\text{s.t.} \quad \sum_{h \in H} \left( \sum_{p \in P^A} p \cdot x_{hp}^A - T_h^{\text{loss}} \right) \geq \tilde{\theta} \quad (6b)$$

$$\sum_{p \in P^A} x_{hp}^A \leq 1 \qquad \forall h \in H \quad (6c)$$

$$x_{hp}^A \in \{0, 1\} \qquad \forall h \in H, p \in P^A. \quad (6d)$$

**Proposition 2.** If $|H| > 1$, PP is NP-hard even if a single task has to be planned.

*Proof.* We will show that the well-known Multiple-Choice Subset Sum Problem (MCSSP) (known to be NP-hard [12]) is polynomially reducible to PP. Recall that, given a set of $m$ classes $N_1, \dots, N_m$, each class containing weights $w_{i1}, \dots, w_{in_i}$, the MCSSP aims at selecting at most one weight from each class such that the total weight sum is maximized without exceeding the capacity $c$. Introducing binary variables $x_{ij}$ denoting which weights are taken, MCSSP can be cast as

$$W = \max \sum_{i=1}^{m} \sum_{j \in N_i} w_{ij} x_{ij} \quad (7a)$$

$$\text{s.t.} \quad \sum_{i=1}^{m} \sum_{j \in N_i} w_{ij} x_{ij} \leq c \quad (7b)$$

$$\sum_{j \in N_i} x_{ij} \leq 1 \qquad \forall i = 1, \dots, m \quad (7c)$$

$$x_{ij} \in \{0, 1\} \qquad \forall i = 1, \dots, m, j \in N_i. \quad (7d)$$

The maximization form of MCSSP may be transformed into minimization form by finding for each class $N_i$: $\bar{w}_i = \min_{j \in N_i} w_{ij}$, by setting $\tilde{w}_{ij} = w_{ij} - \bar{w}_i \quad \forall j \in N_i$, and $\tilde{c} = c - \sum_{i=1}^{m} \bar{w}_i$. The minimization problem is defined in $\tilde{w}$ and $\tilde{c}$.

Let us now consider an instance of PP with $\tilde{c} = \tilde{\theta}$, $m = |H|$, $N_i = P^A \quad \forall i = 1, \dots, m$, $\tau = 0$, $\alpha_h = -1 \quad \forall h \in H$, and $T_h^{\text{loss}} = 0 \quad \forall h \in H$. Finally, $\tilde{w}_{ij} = \tilde{w}_{hp}$ where $\tilde{w}_{hp}$ denotes the power selected in $N_h$. PP formulated in (6) becomes:

$$\tilde{z} = \min \sum_{h=1}^{m} \sum_{p \in N_h} \tilde{w}_{hp} x_{hp}^A \quad (8a)$$

$$\text{s.t.} \quad \sum_{h=1}^{m} \sum_{p \in N_h} \tilde{w}_{hp} x_{hp}^A \geq \tilde{c} \quad (8b)$$

$$\sum_{p \in N_h} x_{hp}^A \leq 1 \qquad \forall t = 1, \dots, m \quad (8c)$$

$$x_{hp}^A \in \{0, 1\} \qquad \forall t = 1, \dots, m, p \in N_h. \quad (8d)$$

We see that the above instance of PP corresponds to the considered instance of MCSSP, written in the minimization form, proving the reduction and thus, the hardness of PP. □
# 5 Extension to multiple days

This section is devoted to load scheduling over several successive days. This study is relevant if accurate energy production and consumption forecasts are available. Indeed, the temperature variation functions are continuous, and members' temperature preferences are predictable. Furthermore, predictions can be made for the other load categories. Thus, let $D$ be the set of successive days we wish to solve the planning problem. Solving the multiple-day load scheduling problem can be approached in two ways. The first approach adds an index $d$ indexing day $d \in D$ to the decision variables of the previously described MILP (1) while ensuring rooms' and the batteries' state of charge continuity. The result is a unique MILP to be solved over several days.

The second method is a heuristic approach, where we solve the initial MILP by modifying the objective function for each day of time horizon $|D|$. Indeed, in the model described in Section 3, there is a trade-off between injecting into the public grid or charging the batteries each time there is a surplus of global energy production of the community. However, since we do not have a view on the events of days $d+1, \dots, |D|$, it would be better to prioritize battery charging in such a case. We do this prioritization using $\sum_{i \in n} \sum_{h \in H} (C_{ih} + I_{ih})$ as the objective function for each day $d \in D$. Algorithm 2 describes how that heuristic works. Each day $d$ one solves the MILP when there is no exchange between the members to acquire data $G_i \forall i \in N$ because we must ensure that constraint (1g) is satisfied each day. Then, the initial model is solved for day $d$, with the initial temperature and state of charge of the batteries equal to their final state on day $d-1$. Furthermore, for the water heaters, since the water of day $d-1$ is consumed, and we do not have a hot water consumption function, we assume that the water temperature is reset at period, $h_{\rho} = 10$ of each day. In Algorithm 2, $G, E, T_H$ represent, respectively, the vector of earnings, the vector of batteries' final state of charge, and the final temperature vectors of day $d$ when there is no exchange between the members. The model with no member exchange corresponds to the case where $f_{ieh} = 0 \forall i, e \in N, h \in H$. Furthermore, $\tilde{E}$ and $\tilde{T}_H$ represent the batteries' state of charges and the final temperature vectors at day $d$, respectively, when the individuals exchange energy. We

<caption>**Algorithm 2:** Heuristic for solving the scheduling problem on several days.</caption>

for $d$ in $D$ do
    include data for day $d$;
    solve the model when there are no exchanges between members to get $G, E, T_H$;
    solve the model when the members exchange their energy surplus to get vectors $\tilde{E}, \tilde{T}_{Hd}$;
    update the data for next day by adding $G, E, T_H, \tilde{E}$ and $\tilde{T}_{Hd}$;
    return the best solution found for day $d$
end

report and compare the numerical results returned by the approaches to solve the several days problem in the next section.

# 6 Experimental results

We present in this section the experimental results of the solution approaches presented previously. We adopt the following notations in what follows.

* $F^{MILP}$: the mixed-integer linear program formulation presented in Section 3.

* $F_{index}^{MILP}$: refers to the several consecutive days solving approach presented in Algorithm 2.

We propose a column generation-based heuristic to solve the large scheduling problems. The pricing problem is separable by member. As we show later, separating by member is time and memory consuming. Thus, we compare two pricing problem solving approaches, PPo and PPs. In PPs we solve a pricing problem for each member per column generation's iteration. In PPo we solve a unique global pricing problem per iteration. Thus,

* $CG^{PPo}$: refers to the column generation-based heuristic presented in Algorithm 1 while using PPo to solve the pricing problem.
* $CG^{PPS}$: refers to the column generation-based heuristic presented in Algorithm 1 while using PPs to solve the pricing problem.

To assess the impact of joining a collective self-consumption community, we compare two scenarios: community with and without internal links between members.

* The scenario without internal links corresponds to the case when no link exists between the members except the main grid. In this case, the photovoltaic energy producers inject their surplus directly into the main grid.

* The scenario with internal links corresponds to the case where the individuals operate in a community. They can exchange their surplus with other members of the community. They then have to make arbitrage between injecting into the community or injecting into the grid.

This section is divided into two subsections. In the first subsection, we present an instance used to assess the solving approaches. The instances are based on realistic data from Smart Lou Quila (Figure 3 present the members’ locations at “Le Cailar”, village, France). The input data and the formulations presented in this paper are available at https://github.com/MsangL/schedEnergyCom. The second subsection presents the numerical results obtained on these instances. Notice that the latter subsection also contains scalability experiments that assess the MILP and the column generation heuristics on larger instances obtained by multiplying the available data several times.

<figure><img src="image_3.png" /><figcaption>Figure 3: Smart Lou Quila’s initial members.</figcaption></figure>

# 6.1 Instance

## 6.1.1 Storage and generation assets

Each instance is generated over a day of 24 hours sliced into periods of 30 minutes. The community contains seven members, each with equipment whose characteristics are presented in Table 1. Members 1 and 2 possess both energy production assets and storage units. The third member has only a battery. The three members, 4, 5, and 6, have only the energy generation asset. The last member does not have any equipment. Finally, the subscribed power per member in kVa is, respectively, 6, 36, 6, 9, 9, 6, and 9. To ensure model consistency, we fix the parameter $\Omega_i \in N$ so that $\Omega_i = 1$ if and only if the member $i$ has a power generation system.
<table><caption>Table 1: Production and storage assets description in the community.</caption><thead><tr><th colspan="2">Member 1</th><th colspan="2">Member 2</th></tr></thead><tbody><tr><td>Photovoltaic (PV)</td><td>Yes</td><td>PV</td><td>Yes</td></tr><tr><td>PV Capacity</td><td>3.2kWp</td><td>PV Capacity</td><td>6.12kWp</td></tr><tr><td>Battery</td><td>Yes</td><td>Battery</td><td>Yes</td></tr><tr><td>Number</td><td>1 unit</td><td>Number</td><td>1 unit</td></tr><tr><td>Capacity</td><td>9.8kWh</td><td>Capacity</td><td>9.8kWh</td></tr><tr><td>Initial state of charge</td><td>4.5kWh</td><td>Initial state of charge</td><td>4.5kWh</td></tr><tr><td>Efficiency</td><td>97.5%</td><td>Efficiency</td><td>97.5%</td></tr><tr><td>Power</td><td>3.7kW</td><td>Power</td><td>5kW</td></tr><tr><td>Periodic discharge rate</td><td>1%</td><td>Periodic discharge rate</td><td>1%</td></tr><tr><th colspan="2">Member 3</th><th colspan="2">Member 4</th></tr><tr><td>PV</td><td>No</td><td>PV</td><td>Yes</td></tr><tr><td>PV Capacity</td><td>0kWp</td><td>PV Capacity</td><td>3.2kWp</td></tr><tr><td>Battery</td><td>Yes</td><td>Battery</td><td>No</td></tr><tr><td>Number</td><td>1 unit</td><td>Number</td><td>0 unit</td></tr><tr><td>Capacity</td><td>9.8kWh</td><td>Capacity</td><td>0kWh</td></tr><tr><td>Initial state of charge</td><td>4.5kWh</td><td>Initial state of charge</td><td>0kWh</td></tr><tr><td>Efficiency</td><td>97.5%</td><td>Efficiency</td><td>0%</td></tr><tr><td>Power</td><td>3.7kW</td><td>Power</td><td>0kW</td></tr><tr><td>Periodic discharge rate</td><td>1%</td><td>Periodic discharge rate</td><td>0%</td></tr><tr><th colspan="2">Member 5</th><th colspan="2">Member 6</th></tr><tr><td>PV</td><td>Yes</td><td>PV</td><td>Yes</td></tr><tr><td>PV Capacity</td><td>3.2kWp</td><td>PV Capacity</td><td>3.2kWp</td></tr><tr><td>Battery</td><td>No</td><td>Battery</td><td>No</td></tr><tr><th colspan="2">Member 7</th><td colspan="2"></td></tr><tr><td>PV</td><td></td><td>No</td><td></td></tr><tr><td>Battery</td><td></td><td>No</td><td></td></tr></tbody></table>

Figure 4 presents the periodic real total generation of Smart Lou Quila [3], initially composed of seven members: 6 residences and a municipal stadium located in the south of France. It also presents the community's total energy production. The data are taken from date January 08 and 09, 2022.

<figure><img src="image_4.png" /><figcaption>Figure 4: Smart Lou Quila's total production in kW on two time horizons.</figcaption></figure>

## 6.1.2 The loads

We present in this section realistic data for the loads, built up together with our partner Smart Lou Quila and inquiries realized among Smart Lou Quila's members. We present next the requested tasks by the members during the planning horizon according to the three described loads categories. The planning
horizon consists of a day sliced into 48 equal-length periods. As mentioned previously, we consider two type A tasks: room and water heating. Each member has at most three rooms. The following array $\nu$ indicates the requested type A tasks by the members. Member 1 (in bold) wants to regulate the temperature of three rooms and one water heater. Member 2 did not request any type A task during the horizon. Member 3 has three tasks, two-room heating, one water heating, and so on for the next members. Thus, $\nu_{ijk}$ is equal to 1 if task $j \in J^A$ is executed by member $i$ in room $k$, 0 otherwise. In addition, $j = 1$ means that the corresponding task is room heating, and $j = 2$ means that the requested task is water heating.

$$ \nu_1 = \begin{pmatrix} \mathbf{1} & \mathbf{1} \\ 0 & 0 \\ 1 & 1 \\ 1 & 1 \\ 1 & 1 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} \quad \nu_2 = \begin{pmatrix} \mathbf{1} & \mathbf{0} \\ 0 & 0 \\ 0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 1 & 0 \\ 1 & 0 \end{pmatrix} \quad \nu_3 = \begin{pmatrix} \mathbf{1} & \mathbf{0} \\ 0 & 0 \\ 1 & 0 \\ 0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 1 & 0 \end{pmatrix}. $$

Matrices $t^{\text{low}}$ and $t^{\text{up}}$ represent the desired temperature of the members in their corresponding rooms during intervals $[h_{ki}^{\text{low}}, h_{ki}^{\text{up}}]$ knowing that the initial temperature in the rooms is depicted in $\bar{T}^{\text{room}}$.

$$ t^{\text{low}} = \begin{pmatrix} 19 & 0 & 16 & 17 & 20 & 22 & 19 \\ 22 & 0 & 19 & 22 & 23 & 22 & 19 \\ 16 & 0 & 19 & 17 & 20 & 22 & 19 \end{pmatrix} \quad t^{\text{up}} = \begin{pmatrix} 22 & 24 & 19 & 20 & 21 & 24 & 21 \\ 24 & 24 & 24 & 23 & 24 & 24 & 21 \\ 20 & 21 & 24 & 20 & 22 & 24 & 21 \end{pmatrix} $$

$$ h^{\text{low}} = \begin{pmatrix} 20 & 1 & 20 & 20 & 34 & 18 & 20 \\ 20 & 1 & 20 & 20 & 34 & 18 & 20 \\ 20 & 1 & 20 & 20 & 34 & 18 & 20 \end{pmatrix} \quad h^{\text{up}} = \begin{pmatrix} 30 & 48 & 40 & 40 & 47 & 34 & 42 \\ 30 & 48 & 40 & 40 & 47 & 34 & 42 \\ 30 & 48 & 40 & 40 & 47 & 34 & 42 \end{pmatrix} $$

$$ \bar{T}^{\text{room}} = \begin{pmatrix} 12 & 14 & 16 & 12 & 14 & 12 & 15 \\ 15 & 14 & 12 & 11 & 14 & 12 & 8 \\ 12 & 14 & 10 & 12 & 14 & 12 & 10 \end{pmatrix} $$

We now present the physical characteristics of the rooms in Table 2, while Table 3 presents these for the water heaters. In Table 2, column Surface designates the room's surface of rooms, $C_r$ the heat capacity, and $U$ the heat loss coefficient. We calculate $C_r$ and $U$ according to the information given by the members.

<table><caption>Table 2: Rooms physical characteristics.</caption><thead><tr><th>Member</th><th>room</th><th>Surface</th><th>C<sub>r</sub></th><th>U</th><th>Member</th><th>room</th><th>Surface</th><th>C<sub>r</sub></th><th>U</th></tr></thead><tbody><tr><td rowspan="3">Member 1</td><td>room 1</td><td>9m<sup>2</sup></td><td>297</td><td>12</td><td rowspan="3">Member 3</td><td>room 1</td><td>18m<sup>2</sup></td><td>594</td><td>24</td></tr><tr><td>room 2</td><td>15m<sup>2</sup></td><td>495</td><td>20</td><td>room 2</td><td>9m<sup>2</sup></td><td>297</td><td>12</td></tr><tr><td>room 3</td><td>18m<sup>2</sup></td><td>594</td><td>24</td><td>room 3</td><td>9m<sup>2</sup></td><td>297</td><td>12</td></tr><tr><td rowspan="3">Member 4</td><td>room 1</td><td>12m<sup>2</sup></td><td>396</td><td>16</td><td rowspan="3">Member 5</td><td>room 1</td><td>25m<sup>2</sup></td><td>825</td><td>33.3</td></tr><tr><td>room 2</td><td>20m<sup>2</sup></td><td>660</td><td>26.6</td><td>room 2</td><td>10m<sup>2</sup></td><td>330</td><td>13.3</td></tr><tr><td>room 3</td><td>12m<sup>2</sup></td><td>396</td><td>16</td><td>room 3</td><td>12m<sup>2</sup></td><td>396</td><td>16</td></tr><tr><td rowspan="3">Member 6</td><td>room 1</td><td>18.5m<sup>2</sup></td><td>610.5</td><td>24.6</td><td rowspan="3">Member 7</td><td>room 1</td><td>15m<sup>2</sup></td><td>495</td><td>20</td></tr><tr><td>room 2</td><td>9m<sup>2</sup></td><td>297</td><td>12</td><td>room 2</td><td>10m<sup>2</sup></td><td>330</td><td>13.3</td></tr><tr><td>room 3</td><td>10m<sup>2</sup></td><td>330</td><td>13.3</td><td>room 3</td><td>14m<sup>2</sup></td><td>462</td><td>18.6</td></tr></tbody></table>

We collect the external temperature data for the selected time horizons: July 23 to 25 and January 08 to 09, 2022 on [20], which reports the weather data of the closest station to the community. The temperature data $T_h^{\text{out}} \forall h \in H$ is presented in Figure 5.

Each member has a single water heater; the following table presents their physical characteristics. The parameter $c_p = 1$ is the specific heat capacity of water. Column $M$ shows the weight of the water (kg), column $S$ designates the exchange surface of the water container with the external area, $K$ is the exchange coefficient (kcal/hm$^2$°C). Finally, recall that $T^{\text{room}}$ is the temperature of the ambient environment and the efficiency of the electricity-to-heat transformation $\nu = Mc_p/(Mc_p r + \Delta SKr)$.
<figure><img src="image_5.png" /><figcaption>Figure 5: External temperatures for January 08 to 09, 2022, and July 23 to 25, 2021.</figcaption></figure>

<table><caption>Table 3: Water heaters characteristics.</caption><thead><tr><th>Member</th><th>S</th><th>M</th><th>K</th><th>r</th></tr></thead><tbody><tr><td>1</td><td>15</td><td>75</td><td>1</td><td>1.2</td></tr><tr><td>2</td><td>7</td><td>350</td><td>1</td><td>1.2</td></tr><tr><td>3</td><td>2</td><td>100</td><td>1</td><td>1.2</td></tr><tr><td>4</td><td>3.75</td><td>200</td><td>1</td><td>1.2</td></tr><tr><td>5</td><td>2.4</td><td>150</td><td>1</td><td>1.2</td></tr><tr><td>6</td><td>2</td><td>100</td><td>1</td><td>1.2</td></tr><tr><td>7</td><td>2.6</td><td>150</td><td>1</td><td>1.2</td></tr></tbody></table>

At period $h^{water} = 36$, the water's temperature in the heater of each member must be between 55 and 60 °C for initial temperatures represented in $\bar{T}^{water} = (9, 8, 8, 9, 5, 8, 9)$ for the winter instance, and $\bar{T}^{water} = (15, 17, 18, 19, 10, 10, 8)$ for summer instance. For simplicity, we set the ambient temperature $T_{kh}^{room} = 17$ °C for each member at period $h$ in room $k \in K_{i2}^A$. For these instances, we don't have type B tasks without lost of generality. As periodic cumulative consumption of type C tasks, we take 10% of the real energy consumption of the considered days for each member. Finally, the energy buying and selling prices per kWh are:

$$ \begin{aligned} v_h^{MG} &= 0.1685, \quad \tilde{v}_h^{MG} = 0.1 \\ v_h^{Com} &= 0.1400, \quad \tilde{v}_h^{Com} = 0.12 \\ v_h^{GES} &= 0.1685, \quad \tilde{v}_h^{GES} = 0.065. \end{aligned} $$

and the threshold of economic degradation which must not be exceeded is $\beta = 15$.

### 6.1.3 Instance 7 ex

Here we present a seven members instance called: **7 ex**, which we use to illustrate our remarks. Instance 7 ex characteristics in terms of assets possession, is described in Table 1. The planning horizon is 24 hours sliced into periods of 30 minutes. The periodic total production and the external temperature for instance 7 ex are presented by Figure 6.

Each member has at most three houserooms of 9 $m^2$ and three water heater of 100 litres. The array
<figure><img src="image_6.png" /><figcaption>Figure 6: Values for illustrative instance.</figcaption></figure>

$\nu$ present the required type A task by members.

$$ \nu_1 = \begin{pmatrix} 1 & 1 \\ 0 & 0 \\ 1 & 1 \\ 1 & 1 \\ 1 & 1 \\ 0 & 1 \\ 1 & 1 \end{pmatrix} \quad \nu_2 = \begin{pmatrix} 1 & 0 \\ 0 & 0 \\ 0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 1 & 0 \\ 1 & 0 \end{pmatrix} \quad \nu_3 = \begin{pmatrix} 1 & 0 \\ 0 & 0 \\ 1 & 0 \\ 0 & 0 \\ 0 & 0 \\ 1 & 0 \\ 1 & 0 \end{pmatrix} $$

The temperature preferences values for houserooms are respectively $h^{low} = (22, 12, 22, 22, 22, 22, 19)$, $h^{up} = (24, 24, 24, 24, 24, 24, 24)$, $t^{low} = (10, 16, 20, 20, 34, 18, 20)$, $t^{up} = (30, 46, 40, 40, 47, 34, 42)$.

Next section presents the results of the solution approaches on the described instance and the instance obtained by duplicating the real instance of seven community members.

## 6.2 Experimental results

This section reports the computational tests to evaluate the solution approaches presented in the previous sections. These tests have been carried out on a processor Intel Xeon E312 (Sandy Bridge) CPU2.29GHz, the MILP’s solving time is $t_l = 5600s$, the column generation’s pricing problem has a maximum time $time\_limit = 200s$, and the maximum number of column generation iterations is $maxIter = 10$ for each instance. Finally, the RMP with integrality constraints has a time limit of $time\_limit = 3600s$. Notice that we consider two ways of solving the pricing problem: solving the pricing problem for all tasks at once or solving one pricing problem per task at each iteration. Let us denote these approaches as PPo and PPs, respectively. We limit the cumulative time of the CG iterations in both cases to $time\_limit = 2000s$, which includes an initialization time of 200s.

The experiment shows that $CG^{PPo}$ quickly finds a good solution. However, the method does not converge because, from one iteration to the other, the objective value of the RMP improves very little, as can be seen in Figure 7, which presents the evolution of the said value for instance 7 ex. For $CG^{PPs}$, which consists, at each iteration of solving the pricing problem for each task, the solution is improved quickly, and we can even find an optimal solution if the total number of tasks to be performed is small. The disadvantage is that solving a pricing problem for each task can be time-consuming. It is, therefore, necessary to make a trade-off between time and quality of the solution. If there is a need to save time, $CG^{PPo}$ may be more appropriate, while $CG^{PPs}$ may be interesting for small instances where one may want to wait longer to get a better solution.

We conducted a scalability experiment by constructing larger instances, duplicating the initial members up to 32 times, leading to $|N| = 224$ members in the community. The MILP returns no integer solution for these larger instances after the time limit. On the other hand, the heuristic based on the column generation algorithm can return good solutions, even for the largest problem instances. The results of the solving approaches are reported in Table 4 where $|N|$ denotes the number of members in the
<figure><img src="image_7.png" /><figcaption>Figure 7: Objective value variation for the pricing problem solve ways.</figcaption></figure>

community. *obj* and *obj<sub>CG</sub>* represent the sum of the electricity extracted from the primary grid during the planning horizon by the MILP and the column generation-based heuristic. *Bb* is the best bound obtained when executing *F*<sup>MILP</sup> on the instances. Columns *Gap* are the gap between the objective and the best bound. Output "***" means no feasible solution has been found after the time limit.

<table><caption>Table 4: Comparison between the solutions of the resolution approaches.</caption><thead><tr><th rowspan="2">|N|</th><th colspan="4">F<sup>MILP</sup>'s solutions</th><th colspan="3">CG<sup>PPo</sup>'s solutions</th><th colspan="3">CG<sup>PPs</sup>'s solutions</th></tr><tr><th>obj kWh</th><th>Gap %</th><th>Bb kWh</th><th>CPU (s)</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th></tr></thead><tbody><tr><td>7 ex</td><td>107.74</td><td>0.56</td><td>107.18</td><td>t<sub>l</sub></td><td>108.53</td><td>1078.52</td><td>1.33</td><td>107.73</td><td>300.01</td><td>0.55</td></tr><tr><td>7</td><td>233.74</td><td>1.26</td><td>230.79</td><td>t<sub>l</sub></td><td>234.24</td><td>2010.31</td><td>1.54</td><td>234.24</td><td>577.73</td><td>1.54</td></tr><tr><td>28</td><td>938.96</td><td>1.19</td><td>927.81</td><td>t<sub>l</sub></td><td>940.98</td><td>2023.66</td><td>1.41</td><td>938.96</td><td>2394.09</td><td>1.19</td></tr><tr><td>56</td><td>1877.92</td><td>1.20</td><td>1855.44</td><td>t<sub>l</sub></td><td>1881.94</td><td>2036.56</td><td>1.41</td><td>1877.94</td><td>2381.98</td><td>1.20</td></tr><tr><td>112</td><td>***</td><td>***</td><td>3598.52</td><td>t<sub>l</sub></td><td><strong>3675.90</strong></td><td><strong>2188.07</strong></td><td><strong>2.11</strong></td><td><strong>3663.03</strong></td><td><strong>2419.62</strong></td><td><strong>1.76</strong></td></tr><tr><td>224</td><td>***</td><td>***</td><td>7198.23</td><td>t<sub>l</sub></td><td><strong>7360.32</strong></td><td><strong>2362.23</strong></td><td><strong>2.20</strong></td><td><strong>7321.15</strong></td><td><strong>2464.65</strong></td><td><strong>1.68</strong></td></tr></tbody></table>

Figure 8 presents the results of the discussed methods on instance 7 ex. Figure 8a corresponds to the first scenario: there are no energy exchanges between the community members. In this case, prosumers inject the surplus (if it happens) into the battery or the primary grid. Classical consumers draw their needs from the public grid. When there are no internal links between members, the total amount collected from the primary grid equals 132.11 kWh. Suppose they form a community (second scenario Figures 8b to 8d), for instance 7 ex. In that case, there is almost no injection into the primary grid; the prosumers' surplus is locally consumed. As a result, the community collects 107.75 kWh, corresponding to a decrease of almost 18.5% in non-green power. The members make savings because the purchase price in the community is more attractive than the purchase price in the primary grid.

## 6.3 Several consecutive days

In what follows, we present the results when the planning horizon increases. We compare the solution approaches: $F^{MILP}$ with the day's index, the heuristic presented in Algorithm 2: $F_{index}^{MILP}$, and the column generation-based heuristics $CG^{PPo}$ and $CG^{PPs}$. We compare consider three instances for which the horizon's size $|H|$ is in {48, 96, 144} and data collected from January 8 to 9, 2022, and from July 23 to 25, 2021. Table 5 presents these results for $time\_limit = t_l = 5600$s for each case.

Summer instances sometimes are easier to solve than winter ones. Indeed, the external temperatures are a short distance from the target temperatures when type A tasks are performed, except for heat waves. Moreover, knowing that the problem's difficulty comes from planning, the problem is easier in this case because no planning is required. Besides, $CG^{PPs}$ remains more efficient concerning solution

<footnote n="1">¹The case where we add the day index to the decision variables.</footnote>
<figure><img src="image_8.png" /><figcaption>(a) Community without internal links.</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>(c) Community with internal links: $CG^{PPo}$.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>(b) Community with internal links: $F^{MILP}$.</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>(d) Community with internal links: $CG^{PPs}$.</figcaption></figure>

<table><caption>Figure 8: Solutions for instance 7 ex.</caption><thead><tr><th colspan="11">For January 8 to 9,2022</th></tr><tr><th colspan="5">F<sup>MILP</sup>'s solutions with day index <sup>1</sup></th><th colspan="2">F<sup>MILP</sup>'s solutions</th><th colspan="2">CG<sup>PPo</sup>'s solutions</th><th colspan="2">CG<sup>PPs</sup>'s solutions</th></tr><tr><th>|H|</th><th>obj kWh</th><th>Gap %</th><th>Bb kWh</th><th>CPU (s)</th><th>obj<sub>H</sub> kWh</th><th>CPU (s)</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th></tr></thead><tbody><tr><td>48</td><td>233.74</td><td>1.26</td><td>230.79</td><td>t<sub>l</sub></td><td>233.74</td><td>0.5t<sub>l</sub></td><td>234.74</td><td>2010.31</td><td>234.24</td><td>577.73</td></tr><tr><td>96</td><td>431.05</td><td>0.99</td><td>426.78</td><td>t<sub>l</sub></td><td>432.04</td><td>t<sub>l</sub></td><td>431.97</td><td>2014.65</td><td>431.46</td><td>2279.72</td></tr></tbody><thead><tr><th colspan="11">For July 23 to 25, 2021</th></tr><tr><th colspan="5">F<sup>MILP</sup>'s solutions with day index</th><th colspan="2">F<sup>MILP</sup>'s solutions</th><th colspan="2">CG<sup>PPo</sup>'s solutions</th><th colspan="2">CG<sup>PPs</sup>'s solutions</th></tr><tr><th>|H|</th><th>obj kWh</th><th>Gap %</th><th>Bb kWh</th><th>CPU (s)</th><th>obj<sub>H</sub> kWh</th><th>CPU (s)</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th></tr></thead><tbody><tr><td>48</td><td>109.17</td><td>0.31</td><td>108.83</td><td>t<sub>l</sub></td><td>109.17</td><td>0.5t<sub>l</sub></td><td>114.83</td><td>2824.74</td><td>109.17</td><td>1924.12</td></tr><tr><td>96</td><td>521.14</td><td>0.17</td><td>520.26</td><td>t<sub>l</sub></td><td>521.04</td><td>0.5t<sub>l</sub></td><td>523.37</td><td>2001.81</td><td>521.27</td><td>1639.83</td></tr><tr><td>144</td><td>614.60</td><td>0.32</td><td>612.63</td><td>t<sub>l</sub></td><td>613.54</td><td>0.5t<sub>l</sub></td><td>621.73</td><td>2056.48</td><td>614.20</td><td>2358.28</td></tr></tbody></table>

<caption>Table 5: Comparison between the solutions of the resolution approaches.</caption>

quality if one is willing to allow more solution time, while the quality of $CG^{PPo}$'s solutions degrades as the time horizon increases. On the other hand, Algorithm 2 can be used for small communities but not for large problem instances for the previously discussed reasons.

# 7 Numerical improvements

## 7.1 Special Ordered Set variables

We discuss here an enhancement that reduces the solving times of the models. Notice that at each period and for each task we can choose at most one power level to perform type A tasks. We can thus replace inequality constraint (1c) by an equality constraint by adding a dummy power level $p_0 = 0$ in
each set $P_{ijk}^A$. Then, we sort the powers in ascending order and introduce a binary variable $\hat{x}_{ijkh(pos(p))}$ for $p \in P_{ijk}^A \cup \{0\}$ that is related to variables $x_{ijkhp}^A$ through the relations:

$$x_{ijkhp}^A = \hat{x}_{ijkh(pos(p))} - \hat{x}_{ijkh(pos(p)+1)} \quad \forall i \in N, j \in J^k, k \in K_{ij}^A, h \in H, p \in P_{ijk}^k. \quad (9)$$

Thus, constraint (1c) is replaced by constraints (10) and (11),

$$\hat{x}_{ijkh(pos(p))} \ge \hat{x}_{ijkh(pos(p)+1)} \quad \forall i \in N, j \in J^k, k \in K_{ij}^A, h \in H, p \in P_{ijk}^k \quad (10)$$

$$\hat{x}_{ijkh0} = 1 \quad \forall i \in N, j \in J^k, k \in K_{ij}^A, k \in T \quad (11)$$

Finally, constraint (1j) becomes constraint (12) where $v(p)$ is the power level directly superior to $p$ (that is, $pos(v(p)) = pos(p) + 1$)

$$T_{ijkh} = \theta_j \left( \sum_{p \in P_{ijk}^k} (p - v(p)) \hat{x}_{ijkh(pos(p))} \right) \quad \forall i \in N, j \in J^k, k \in K_{ij}^A, h \in H. \quad (12)$$

Table 6 reports the results obtained with the different solving approaches after that replacement.

<table><caption>Table 6: Comparison between the solutions of the resolution approaches.</caption><thead><tr><th colspan="5">F<sup>MILP</sup>'s solutions</th><th colspan="3">CG<sup>PPo</sup>'s solutions</th><th colspan="3">CG<sup>PPs</sup>'s solutions</th></tr><tr><th>|N|</th><th>obj kWh</th><th>BB kWh</th><th>Gap %</th><th>CPU (s)</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th></tr></thead><tbody><tr><td>7 ex</td><td>107.73</td><td>107.25</td><td>0.45</td><td>t<sub>l</sub></td><td>108.80</td><td>226.32</td><td>1.53</td><td>107.73</td><td>339.85</td><td>0.45</td></tr><tr><td>7</td><td>233.74</td><td>231.79</td><td>0.83</td><td>t<sub>l</sub></td><td>233.74</td><td>241.82</td><td>0.83</td><td>233.74</td><td>2242.34</td><td>0.83</td></tr><tr><td>28</td><td>938.96</td><td>931.28</td><td>0.82</td><td>t<sub>l</sub></td><td>938.96</td><td>243.18</td><td>0.82</td><td>939.47</td><td>2221.61</td><td>0.88</td></tr><tr><td>56</td><td>1877.92</td><td>1861.71</td><td>0.82</td><td>t<sub>l</sub></td><td>1877.92</td><td>312.17</td><td>0.82</td><td>1878.95</td><td>2358.13</td><td>0.92</td></tr><tr><td>112</td><td>3659.84</td><td>3624.90</td><td>0.95</td><td>t<sub>l</sub></td><td>3659.84</td><td>412.75</td><td>0.95</td><td>3659.90</td><td>2244.12</td><td>0.95</td></tr><tr><td>224</td><td>***</td><td>7219.16</td><td>***</td><td>t<sub>l</sub></td><td>7380.25</td><td>2464.28</td><td>2.18</td><td>7334.55</td><td>2425.97</td><td>1.57</td></tr></tbody></table>

Comparing Table 6 to Table 4, we notice an improvement in the solving time and the solution's quality for heuristic PPO, in opposition to PPs. We also see that F<sup>MILP</sup>'s Best bound are slightly better than before.

## 7.2 Heuristic enhancement

An improving track for the heuristics is to return the first integer solution returned by the pricing problems. Since an improving solution for a task must have a negative reduced cost, we add constraints $A \le \epsilon$, where $\epsilon$ represents the reduced costs. Then, we set up CPLEX to return the first integer solution. Table 7 contains the results of that improving track, where maxIter = 10, and $\epsilon = 10^{-2}$.

Comparing Table 7 to Tables 4 and 6 we note that the resolution times are generally improved. Specifically, $CG^{PPo}$ is more efficient regarding time before and after replacing $x^A$ by $\hat{x}$. However, we notice a difference for $CG^{PPo}$ according to whether we consider $x^A$ or $\hat{x}$. Indeed, the replacement of $x^A$ by $\hat{x}$ increases the CPU. Also $CG^{PPs}$ is faster with this trick compared to Tables 4 and 6. However, PPs does not find better solutions at relatively small iteration numbers. This trick does not improve the quality of the solutions of either $CG^{PPo}$ or $CG^{PPs}$. Moreover, the quality of the solutions degrades more when $x^A$ is replaced by $\hat{x}$ for both $CG^{PPo}$ and $CG^{PPs}$.

As expected, introducing SOS may improve the problem resolution. Specifically, we notice on the one hand, that the resolution times are significantly improved for $CG^{PPo}$ and $CG^{PPs}$. On the other hand, by returning the first integer solution for the heuristic we notice an improvement of the resolution time before and after replacing $x^A$ by $\hat{x}$ compared to Table 4. However, the quality of $CG^{PPs}$'s solution is deteriorated when $x^A$ is replaced.

## 8 Conclusions and perspectives

This paper addresses the collective self-consumption rate's maximization problem in energy communities. We have illustrated how the operation scheduling of electrical appliances and the smooth simulation of
<table><caption>Table 7: Returning the first integer solution found by PP.</caption><thead><tr><th colspan="7">Before replacing x<sup>A</sup> by x̂</th></tr><tr><th colspan="4">CG<sup>PPo</sup>'s solutions</th><th colspan="3">CG<sup>PPs</sup>'s solutions</th></tr><tr><th>|N|</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th></tr></thead><tbody><tr><td>7</td><td>233.74</td><td>430.93</td><td>0.83</td><td>233.74</td><td>413.14</td><td>0.83</td></tr><tr><td>28</td><td>938.96</td><td>447.52</td><td>0.82</td><td>938.96</td><td>475.88</td><td>0.82</td></tr><tr><td>56</td><td>1877.84</td><td>491.71</td><td>0.82</td><td>1877.82</td><td>482.83</td><td>0.82</td></tr><tr><td>112</td><td>3674.84</td><td>698.4</td><td>1.36</td><td>3659.92</td><td>624.29</td><td>0.95</td></tr><tr><td>224</td><td>7319.67</td><td>789.88</td><td>1.37</td><td>7353.02</td><td>1093.38</td><td>1.82</td></tr></tbody></table><table><thead><tr><th colspan="7">After replacing x<sup>A</sup> by x̂</th></tr><tr><th colspan="4">CG<sup>PPo</sup>'s solutions</th><th colspan="3">CG<sup>PPs</sup>'s solutions</th></tr><tr><th>|N|</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th><th>obj<sub>CG</sub> kWh</th><th>CPU (s)</th><th>Gap %</th></tr></thead><tbody><tr><td>7</td><td>233.74</td><td>426.09</td><td>0.83</td><td>233.74</td><td>419.22</td><td>0.83</td></tr><tr><td>28</td><td>938.96</td><td>436.09</td><td>0.83</td><td>938.96</td><td>474.24</td><td>0.82</td></tr><tr><td>56</td><td>1877.92</td><td>456.77</td><td>0.82</td><td>1877.92</td><td>478.07</td><td>0.82</td></tr><tr><td>112</td><td>3659.84</td><td>606.99</td><td>0.95</td><td>3659.92</td><td>404.53</td><td>0.82</td></tr><tr><td>224</td><td>7320.08</td><td>1239.01</td><td>1.38</td><td>7319.87</td><td>1031.89</td><td>1.37</td></tr></tbody></table>

electric devices' owned by members modify the global consumption curve while satisfying members' global and individual constraints. We developed a mixed-integer linear programming model to obtain the optimal schedules for planning problems. Faced with the inability of this MILP to solve large problem instances, we developed a column generation-based heuristic. Numerical experiments show the strategy of scheduling loads brings significant advantages (economic, sustainable, and social), which validates Smart Lou Quila's economic model and ensures a bigger community will still collect benefice from this technology.

We consider a community of $|N|$ individuals, and we encounter difficulties when $|N|$ is large, which is predictable. One solution is to consider $m$ sub-communities. While optimizing each community separately does not lead to optimized management of the large community, this may lead to more realistic decentralized implementations, so this would be an interesting avenue for future research. On the other hand, our current work assumes that everything takes place in a certain environment. Nevertheless, in practice, the uncertainty on the energy generation and/or demand can significantly impact the members' behaviors making the day-ahead obsolete. Another line for future work could consider uncertainty and explore stochastic optimization counterparts of our models.

## References

[1] Sezin Afşar, Luce Brotcorne, Patrice Marcotte, and Gilles Savard. Revenue optimization in energy networks involving self-scheduled demand and a smart grid. *Computers & Operations Research*, 134:105366, 2021.

[2] Anonymous. Scala graduum caloris. calorum descriptiones & signa. *Philosophical Transactions*, 22:824–829, 1701.

[3] Beoga/Le Cailar. External temperature. https://voir-plus.com/2021/05/26/smart-lou-quila-la-premiere-communaute-energetique-de-la-start-up-beoga/.

[4] Raffaele Carli, Mariagrazia Dotoli, Jan Jantzen, Michael Kristensen, and Sarah Ben Othman. Energy scheduling of a smart microgrid with shared photovoltaic panels and storage: The case of the ballen marina in samsø. *Energy*, 198, 2020.

[5] European Commission. Clean energy for all europeans package. https://ec.europa.eu/energy/topics/energy-strategy/clean-energy-all-europeans_en, (accessed:30.11.2021).

[6] Giuseppe Tommaso Costanzo, Guchuan Zhu, Miguel F. Anjos, and Gilles Savard. A system architecture for autonomous demand side load management in smart buildings. *IEEE Transactions on Smart Grid*, 3(4):2157–2165, 2012.
[7] Guven Denizhan, Kayalica M. Ozgur, and Kayakutlu Gulgun. Critical power demand scheduling for hospitals using repurposed ev batteries. *Technology and Economics of Smart Grids and Sustainable Energy*, 6, 2021.

[8] Jacques Desrosiers, Franpis Sournis, and Martin Desrochers. Routing with time windows by column generation. *Networks*, 14:545–565, 1984.

[9] Junwen Ding, Sven Schulz, Liji Shen, Udo Buscher, and Zhipeng Lü. Energy aware scheduling in flexible flow shops with hybrid particle swarm optimization. *Computers & Operations Research*, 125:105088, 2021.

[10] Romaric Duvignau, Verena Heinisch, Lisa Göransson, Vincenzo Gulisano, and Marina Papatriantafilou. Benefits of small-size communities for continuous cost-optimization in peer-to-peer energy sharing. *Applied Energy*, 301:117402, 2021.

[11] Edstan Fernandez, M.J. Hossain, Khizir Mahmud, Mohammad Sohrab Hasan Nizami, and Muhammad Kashif. A bi-level optimization-based community energy management system for optimal energy sharing and trading among peers. *Journal of Cleaner Production*, 279:123254, 2021.

[12] Hans Kellerer, Ulrich Pferschy, and David Pisinger. *Introduction to NP-Completeness of Knapsack Problems*, pages 483–493. Springer Berlin Heidelberg, 2004.

[13] Thillainathan Logenthiran, Dipti Srinivasan, and Tan Zong Shun. Demand side management in smart grid using heuristic optimization. *IEEE Transactions on Smart Grid*, 3(3):1244–1252, 2012.

[14] G. Pontes Luz, M.C. Brito, J.M.C. Sousa, and S.M. Vieira. Coordinating shiftable loads for collective photovoltaic self-consumption: A multi-agent approach. *Energy*, 229:120573, 2021.

[15] Anjos F. Miguel, Luce Brotcorne, Martine Labbé, and Maria Restrepo Ruiz. Load Scheduling for Residential Demand Response on Smart Grids. Optimization Online eprints (6384).

[16] Ricardo Moura and Miguel Centeno Brito. Prosumer aggregation policies, country experience and business models. *Energy Policy*, 132:820–830, 2019.

[17] Vera Reis, Rita H. Almeida, José A. Silva, and Miguel C. Brito. Demand aggregation for photovoltaic self-consumption. *Energy Reports*, 5:54–61, 2019.

[18] Miadreza Shafie-Khah and Pierluigi Siano. A stochastic home energy management system considering satisfaction cost and response fatigue. *IEEE Transactions on Industrial Informatics*, 14(2):629–638, 2018.

[19] Gulai Shen, Zachary E. Lee, Ali Amadeh, and K. Max Zhang. A data-driven electric water heater scheduling and control system. *Energy and Buildings*, 242:110924, 2021.

[20] Météo station Nîme/Courbessac. External temperature. https://prevision-meteo.ch/climat/journalier/nimes-courbessac/2021-07(accessed:11.04.2022).

[21] Anuradha Tomar, D.S. Shafiullah, P.H. Nguyen, and Marcel Eijgelaar. An integrated flexibility optimizer for economic gains of local energy communities — a case study for a university campus. *Sustainable Energy, Grids and Networks*, 27:100518, 2021.

[22] Wayes Tushar, Tapan Kumar Saha, Chau Yuen, Thomas Morstyn, Nahid-Al-Masood, H. Vincent Poor, and Richard Bean. Grid influenced peer-to-peer energy trading. *IEEE Transactions on Smart Grid*, 11(2):1407–1418, 2020.

[23] Wim van Ackooij, Jérôme De Boeck, Boris Detienne, Stefania Pan, and Michael Poss. Optimizing power generation in the presence of micro-grids. *Eur. J. Oper. Res.*, 271(2):450–461, 2018.