Jonathan Coignard
email: jonathan.coignard@gmail.com

Rémy Rigo-Mariani
email: remy.rigo-mariani@grenoble-inp.fr

Vincent Debusschere
email: vincent.debusschere@grenoble-inp.fr

Individual and collective objectives in an energy community with network constraints

Keywords: Local energy communities, Optimal Power Flow, Multi-objective optimization, Second Order Cone Programming, Battery systems

The issue at play is to facilitate the deployment of renewable energy sources by coordinating privately owned batteries to also support local power systems. Battery systems most often exclusively answer the individual objective of their owner (e.g., a reduction in the energy bill).

This study intends to explore whether both paradigms, (i) minimizing individual costs and (ii) mitigating network constraints, are achievable for individual battery systems, and if not, what trade-offs are available. Most studies in the literature take a subjective stand in their valuation of individual costs versus grid constraints. A set of Pareto optimal solutions is explored to provide a full picture of the aforementioned trade-off. As such, a novel Multi-Objective Optimal Power Flow (MO-OPF) algorithm is developed to solve a convexified battery control problem.

Results show the ability of the proposed methodology to provide a frame of reference to compare online battery controllers, e.g., if a controller can exploit synergies between individual and collective objectives or not. Further, and for the proposed scenario, local energy communities provide a strictly better set of Pareto optimal solutions than individually operated systems.

Introduction

At the scale of individual retail consumers, commercial solutions exist to install 'behind the meter' battery systems. Often, those systems are supplied with an Energy Management System (EMS) that answers individual objectives such as an energy bill reduction or greater use of local renewable generation (i.e., self-consumption). However, those privately-owned battery systems could also address collective objectives when users are connected to the public distribution network. In particular, those individual systems can provide ancillary services to alleviate grid constraints on local distribution networks [START_REF] Lokeshgupta | Multi-objective home energy management with battery energy storage systems[END_REF]. As such, the study carried out in this paper intends to explore whether both paradigms: (i) minimizing individual costs and (ii) mitigating network constraints, are compatible with a battery management strategy, and if not, what trade-offs are available.

The issue at play is to facilitate the deployment of renewable energy sources by coordinating privately owned batteries to also support local power systems. The first goal of this research is to provide a frame of reference to compare the abilities of battery controllers: (i) to lower endusers' energy costs and (ii) to act in a direction that mitigates grid constraints. This is relevant to evaluate the marginal gains of battery controllers [START_REF] Hossain | Energy management of community energy storage in grid-connected microgrid under uncertain real-time prices[END_REF]) and, in particular, AIbased controllers [START_REF] Kang | A bi-level reinforcement learning model for optimal scheduling and planning of battery energy storage considering uncertainty in the energy-sharing community[END_REF], which may not guarantee a global optimum. This work does not constitute an EMS as in [START_REF] Ali | Optimum control strategies for short term load forecasting in smart grids[END_REF] but it rather provides a theoretical bound on what can be achieved by an EMS within the aforementioned frame of reference.

The second goal of the research is to assess the influence of end-users trading power within a local energy community on the distribution grid. This is particularly relevant with the rapid growth of local energy communities in Europe, e.g., in the form of Renewable Energy Community (REC) or "collective self-consumption" communities in France [START_REF] Roy | A comparison of energy allocation rules for a collective self-consumption operation in an industrial multi-energy microgrid[END_REF].

Due to the additional community layer, the compromise between individual and collective objectives (e.g., related to network constraints, but also collective costs) is more pregnant than outside of communities. Further, if only individual objectives are considered when trading power, it may become a source of concern for Distribution System Operators (DSO) [START_REF] Berg | Quantifying the benefits of shared battery in a DSOenergy community cooperation[END_REF].

Before diving into further modeling methodologies, it is worth noting that the two paradigms investigated (i.e., minimizing individual costs and collective network constraints) intrinsically share a common objective: to balance local production and local consumption at every moment, i.e., to self-consume electricity. On the one hand, individual costs are reduced as self-consumed electricity from local generation assets (e.g., renewable-based) is less expensive than electricity purchased from conventional energy providers. On the other, constraints on grid equipment are reduced since self-consumed power remains behind the meter and, as such, never transits on the network (i.e., potentially reducing losses, and/or voltage fluctuations).

Nonetheless, lower individual costs do not necessarily imply that grid constraints are perfectly mitigated. The two aforementioned paradigms have a fundamental difference. Minimizing individual costs depends on the cumulative values of power (i.e., energy), while grid constraints/performances depend on instantaneous values of power. Thus, from the perspective of a retail consumer, a lower energy bill does not imply a reduction of the network peak demand if it costs the same to reduce consumption during on or off-peak hours. In addition, using batteries to reduce the network peak demand incurs additional costs because of efficiency losses when batteries are charged from the grid. As such, lower energy bills are not strictly equivalent to fewer occurrences of grid constraints, even though some synergies exist between the two.

Related work

The trade-off problem of minimizing individuals' energy costs and minimizing grid constraints can be seen as a multi-objective economic dispatch as it amounts to scheduling controllable loads to minimize several objectives, e.g., generation costs, tap change variation, voltage deviations, or line losses while fulfilling network constraints.

This type of multi-objective problem is typically addressed by assigning a financial cost to each sub-objective to assess its relative importance. For instance, [START_REF] Olivella-Rosell | Centralised and Distributed Optimization for Aggregated Flexibility Services Provision[END_REF] proposed an optimization problem decomposed via an Alternating Direction Method of Multipliers (ADMM) to solve such economic dispatch. In this approach, grid constraints are indirectly mitigated through a flexibility reserve that the DSO can use. The optimal solution to such a problem partially depends on the rate of buying electricity versus the rate of providing flexibility reserve. In [START_REF] Alrumayh | Flexibility of Residential Loads for Demand Response Provisions in Smart Grid[END_REF], grid constraints are explicitly represented with power flow equations, and the problem is solved through a bi-level non-linear optimization to represent both end-users and the DSO. Instead of the previous cooperative approaches based on maximizing social welfare, [START_REF] Guerrero | Decentralized P2P Energy Trading under Network Constraints in a Low-Voltage Network[END_REF] proposed a competitive approach between end-users. As such, a local energy market is defined where the impact of each bid on the network is considered in a market clearing mechanism.

The previously cited literature focuses on providing a single optimal solution to the Multi-Objective Optimal Power Flow (MO-OPF) problem, e.g., between minimizing individual costs and minimizing grid constraints, i.e., a single point on the red curve presented in Fig. 1. To provide a full picturealso referred to as the Pareto optimal solutions represented by the red curve in Fig. 1 the MO-OPF problem is extended to cover all candidate optimal solutions. The Pareto optimal solutions of the MO-OPF problem provide a bounded domain for possible EMS outcomes in terms of energy costs and grid constraints. Further, the Pareto front reveals the synergies between sub-objectives, e.g., how much grid constraints can be mitigated without additional cost.

MO-OPF problems, in themselves, are often challenging nonlinear problems as shown by the numerous meta-heuristic approaches proposed in the recent literature. To solve the Pareto optimal solutions of the MO-OPF problem two widely used approaches consist of the weighting method and the Ɛ-constraint method [START_REF] Mavrotas | Effective implementation of the ε-constraint method in Multi-Objective Mathematical Programming problems[END_REF]. The weighting method mixes both objective functions in a multi-criteria approach with a weighted sum of the objectivesintroducing α and (1-α) coefficients [START_REF] Salgado | Optimal power flow solutions through multi-objective programming[END_REF]. Alternatively, the 𝜖-constraint method used in [START_REF] Ahmadi-Nezamabad | Multi-objective optimization based robust scheduling of electric vehicles aggregator[END_REF]), proposes to model sub-objectives as constraints. In [START_REF] Ali | Solution of constrained mixed-integer multi-objective optimal power flow problem considering the hybrid multi-objective evolutionary algorithm[END_REF], a short literature review reveals at least 28 different metaheuristic algorithms to address the MO-OPF problem, but only a single reference for a convex optimization approach [START_REF] Davoodi | An efficient covexified SDP model for multi-objective optimal power flow[END_REF].

In [START_REF] Ali | Solution of constrained mixed-integer multi-objective optimal power flow problem considering the hybrid multi-objective evolutionary algorithm[END_REF], the Pareto front is determined through a multi-objective evolutionary algorithm using a hybrid weighting method. This approach enables complex objective functions mixing costs, greenhouse gas emissions, tap change variations, and more. In [START_REF] Barakat | Multi-objective optimization of grid-connected PV-wind hybrid system considering reliability, cost, and environmental aspects[END_REF]), a particle swarm optimization is proposed to consider three objectives: the cost of energy, the loss of power supply probability, and the renewable energy fraction. In [START_REF] Chen | Solving the Multi-Objective Optimal Power Flow Problem Using the Multi-Objective Firefly Algorithm with a Constraints-Prior Pareto-Domination Approach[END_REF]) a firefly algorithm is developed with a constraints-prior Pareto-domination approach to ensure a non-violation of various inequality constraints. In [START_REF] Rawat | Multi-objective techno-economic operation of smart distribution network integrated with reactive power support of battery storage systems[END_REF], authors propose a mixed-integer second-order cone program associated with the 𝜖-constraint method. Those approaches enable solving an accurate version of the multi-objective economic dispatch, e.g., preserving the non-linearity of power flow equations. However, they do not guarantee to achieve a global optimum and additionally may prove computationally intensive.

To guarantee the global optimality of Pareto solutions within a deterministic time [START_REF] Davoodi | An efficient covexified SDP model for multi-objective optimal power flow[END_REF][START_REF] Davoodi | Multiobjective Optimal Power Flow Using a Semidefinite Programming-Based Model[END_REF][START_REF] Ding | A bi-objective DC-optimal power flow model using linear relaxation-based second order cone programming and its Pareto Frontier[END_REF] propose a convexified MO-OPF which minimizes a quadratic cost function at each node of the system. However, the semi-definite programming approach they propose was not extended to the problem of controlling a storage unit, and in particular to account for battery efficiency losses.

Specifically to local energy communities, [START_REF] Mustika | A two-stage management strategy for the optimal operation and billing in an energy community with collective selfconsumption[END_REF]) explores how individual and collective objectives are expressed within EMS, but also through 10 different rules for sharing local production. Further, [START_REF] Norbu | Modeling Economic Sharing of Joint Assets in Community Energy Projects Under LV Network Constraints[END_REF] proposes an EMS and sharing rules that include the notion of distribution grid constraints. However, even though those heuristics often constitute a good basis for operating battery systems, they do not provide an optimal Pareto front to assess the domain of all possible outcomes.

Contribution statement

To the best of authors knowledge, the literature does not cover convex algorithms to determine the Pareto front of a MO-OPF when decision variables model the operation of a battery system.

The first contribution of this research is to provide such an algorithm in an open-source and reproducible manner. This contribution is applied to finding a set of Pareto optimal battery controls (i.e., power schedules) for the offline trade-off problem of minimizing individual costs versus distribution grid constraints, as illustrated in Fig. 1.

The second contribution of this research is to solve the trade-off problem when considering that end-users can exchange power within a community, e.g., within REC. This contributes to understanding the impact of REC schemes on distribution grid constraints -when users can share power within their community given some network fees. This contributes to answering if community schemes yield additional grid constraints compared to individually operated systems (e.g., single end-users). This publication is divided into three sections. The proposed methodology is described and then

illustrated on an open-source dataset from the SimBench library including network data and time-series consumption. Finally, the findings and limits of the approach are discussed to highlight when this Pareto analysis is pertinent.

Methodology

Problem description

The methodology is organized into five sub-sections. The first section defines individual costs and collective network constraints in this framework. The following two sub-sections describe the minimization problems for both costs and network aspects. The fourth sub-section assembles both minimizations in a single trade-off problem. Finally, the last sub-section describes an alternative cost model when end-users are part of a local energy community.

Individual costs are defined for retail consumers that may or may not produce energy on the distribution grid (i.e., equipped or not with energy resources behind the meter). Their energy bills typically consist of two main components, (i) a fixed connection rate in €/kW and (ii) a variable cost based on energy consumption. The latter includes a price for buying electricity 𝜋 𝑏𝑢𝑦 (𝑡), and a price for selling any surplus of production 𝜋 𝑠𝑒𝑙𝑙 (𝑡) in c€/kWh. The fixed connection cost depends on the maximum power (i.e., subscribed power) a consumer can absorb or inject on the network denoted 𝑝 𝑛 ̅̅̅. The fixed connection cost is considered set, and as such, consumers remain within the power bounds allowed by their contract. In essence, individual energy costs are therefore described by Eq. ( 1) over timethe typical billing period is one month:

𝑐𝑜𝑠𝑡 𝑛 (𝑡) = (𝜋 𝑏𝑢𝑦 (𝑡) × 𝑝 𝑛 + (𝑡) -𝜋 𝑠𝑒𝑙𝑙 (𝑡) × 𝑝 𝑛 -(𝑡)) × ∆𝑡 ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇} ( 1 )
Where 𝑝 𝑛 + (𝑡) is the consumption of participant n at time t, and 𝑝 𝑛 -(𝑡) is the production surplus of participant n. Note that those two power flows at time t transit through the energy meter and cannot be simultaneously positive. This cost equation is further completed in section 2.5 when power exchanges within a REC are allowed.

While energy costs modeled from Eq. ( 1) are often found in the literature [START_REF] Mustika | A two-stage management strategy for the optimal operation and billing in an energy community with collective selfconsumption[END_REF], grid constraints, on the other hand, may take various forms. They are typically represented as mathematical constraints in optimization problems and not necessarily embedded into an explicit objective. Indeed, grid constraints represent a multi-dimensional space that can hardly be boiled down to a single scalar metric. For instance, experience from distribution system operators shows that several aspects are relevant:

• to keep voltage deviation at delivery nodes within some tolerance of a reference voltage,

• to remain below the transformer rated power,

• to reduce power losses on the lines,

• to remain below line loading limits,

• to avoid back feed power into the upper voltage level.

Nonetheless, if one metric is to be selected to minimize most aspects of grid constraints, the literature shows different options. In [START_REF] Floch | Optimal Charging of Electric Vehicles for Load Shaping: A Dual-Splitting Framework With Explicit Convergence Bounds[END_REF], the square power consumption at the transformer is used to both lower the consumption (i.e., remain below the transformer-rated power) and flatten its shape in time (i.e., avoid/limit back feed power, reduce the system losses).

This metric only considers the flows at the point of common coupling, and as such it simplifies power flow equations -yet it often positively improves network-dependent variables such as voltage deviations, line loading, or power losses. In [START_REF] Guerrero | Decentralized P2P Energy Trading under Network Constraints in a Low-Voltage Network[END_REF], the authors consider a voltage sensitivity coefficient using an analytical derivation method to avoid running a full power flow every time the state of the network changes. In [START_REF] Grover-Silva | Optimal sizing and placement of distribution grid connected battery systems through an SOCP optimal power flow algorithm[END_REF]), the sum of power losses on the lines is the representative metric being minimized in a convex optimal power flow.

To include the complexity of the network topology, and potentially the heterogeneity of producers and consumers within a distribution feeder, the sum of power losses on the lines is defined as the metric to minimize grid constraints in this research. This option requires including load flow equations; however, it is possible to adopt a second-order cone programming method to convexify those equations (section 2.3). Further, line losses calculated for the network of interest are easily paired with estimated losses from the upstream network (i.e., beyond the slack bus) to include some representation of the complete transmission and distribution system.

Minimizing individual costs

Minimizing individual costs consists of an optimal operation of end-users' assets, such as a battery system that charges from the most affordable electricity (e.g., from a surplus of solar production in the afternoon) and discharges when the price of electricity is the highest -which may vary with time of use pricing schemes. This problem is typically formulated as a convex optimization in Eqs.

( 2 ) to ( 5 ).

Min. ∑ ∑ 𝑐𝑜𝑠𝑡 𝑛 (𝑡) 𝑛∈𝑁 𝑡∈𝑇

( 2 ) Subject to: Eq. ( 1 ) and:

𝑝 𝑛 + (𝑡) -𝑝 𝑛 -(𝑡) = 𝑢𝑛𝑐𝑡𝑟𝑙 𝑛 (𝑡) + (𝑝 𝑛 𝑠+ (𝑡) -𝑝 𝑛 𝑠-(𝑡)) ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇} ( 3 )
-𝑝 𝑛 ≤ 𝑝 𝑛 + (𝑡) -𝑝 𝑛 -(𝑡) ≤ 𝑝 𝑛 ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇} ( 4 )
𝑝 𝑛 + (𝑡) ≥ 0, and 𝑝 𝑛 -(𝑡) ≥ 0 ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇}

Where 𝑢𝑛𝑐𝑡𝑟𝑙 𝑛 (𝑡) corresponds to the uncontrolled netload at time t from participant n (i.e., the consumption minus any potential local production of participant n). The battery power charging and discharging are represented respectively by 𝑝 𝑛 𝑠+ (𝑡) and 𝑝 𝑛 𝑠-(𝑡) for the battery of participant n. The charging and discharging powers are further constrained by the battery capabilities, expressed in Eq. ( 6) to Eq. ( 10): Where 𝑝 𝑛 𝑠-(𝑡) and 𝑝 𝑛 𝑠+ (𝑡) are limited by a maximum charging and discharging power 𝑝 𝑛 𝑠 .

0 ≤ 𝑝 𝑛 𝑠-(𝑡) ≤ 𝑝 𝑛 𝑠 , and 0 ≤ 𝑝 𝑛 𝑠+ (𝑡) ≤ 𝑝 𝑛 𝑠 ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇} ( 6 )
𝐸 𝑛 𝑠 ≤ 𝐸 𝑛 𝑠 (𝑡) ≤ 𝐸 𝑛 𝑠 ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇} ( 7 )
𝐸 𝑛 𝑠 (0) = 𝐸 𝑛 𝑠 (𝑇) = 𝐸 𝑛 𝑠 𝑖𝑛𝑖𝑡 ∀𝑛 ∈ 𝑁 ( 8 ) 𝐸 𝑛 𝑠 (𝑡) = 𝐸 𝑛 𝑠 (𝑡 -1) + ∆𝑡 60 × (𝑝 𝑛 𝑠+ (𝑡 -1) × 𝜂 𝑠 - 𝑝 𝑛 𝑠-(𝑡 -1) 𝜂 𝑠 ) ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇 -{1}} (
Similarly, the energy in the battery 𝐸 𝑛 𝑠 (𝑡) is limited by minimum and maximum bounds 𝐸 𝑛 𝑠 and 𝐸 𝑛 𝑠 . The initial state of charge in kWh is defined as 𝐸 𝑛 𝑠 𝑖𝑛𝑖𝑡 and the evolution of the state of charge is defined in Eq. ( 9) where 𝜂 𝑠 represents the charge and discharge efficiency of the battery.

To ensure unit consistency between power values and energy values in kWh, ∆𝑡 is introduced which corresponds to the time resolution of time series in minutes. As the charging and the discharging power at T are never constrained by the remaining energy in the batterie in Eq. ( 9), 𝑝 𝑛 𝑠-(𝑇) and 𝑝 𝑛 𝑠+ (𝑇) are ensured to be equal to zero.

This implemented Linear Programming (LP) formulation minimizes the sum of individual costs. Note that this problem is equivalent to minimizing the cost of every participant taken individually. This can be easily shown as there are no contractual interactions between participants (e.g., no power exchanges, or no constraints from neighbours on the network). The overall cost is the sum of all the bills computed from the flows through every meter. In other words, the proposed optimization problem could be split into N optimizations without loss of optimality, as each participant n is solving an independent problem. Remind that at this stage, there are no questions of cost allocation and sharing between participants and/or mitigating system constraints.

Before closing this section, it should also be noted that this LP formulation implicitly considers two linear complementary constraints [START_REF] Yu | Solving linear programs with complementarity constraints using branch-and-cut[END_REF], which would result in a nonconvex optimization if enforced explicitly. In particular, the problem implicitly considers orthogonality conditions for 𝑝 𝑛 -(𝑡) ⊥ 𝑝 𝑛 + (𝑡) and for 𝑝 𝑛 𝑠-(𝑡) ⊥ 𝑝 𝑛 𝑠+ (𝑡). In other words, the netload of participant n cannot be positive and negative at the same time, and the battery cannot be charged and discharged at the same time t. This results in the following constraints, expressed in Eq. ( 11):

𝑝 𝑛 -(𝑡) 𝑇 . 𝑝 𝑛 + (𝑡) = 0, and 𝑝 𝑛 𝑠-(𝑡) 𝑇 . 𝑝 𝑛 𝑠+ (𝑡) = 0 ∀(𝑛, 𝑡) ∈ {𝑁, 𝑇}

In this LP formulation, a binary variable to enforce Eq. ( 11) is not necessary, as the optimal solution of the problem guarantees those conditions. Indeed, if the conditions are not met, two additional costs are incurred. First, an additional cost proportionally to 𝜋 𝑏𝑢𝑦 (𝑡) -𝜋 𝑠𝑒𝑙𝑙 (𝑡), which implies that the price of buying electricity must be greater than the price of selling electricity 𝜋 𝑏𝑢𝑦 (𝑡) > 𝜋 𝑠𝑒𝑙𝑙 (𝑡), ∀𝑡 ∈ 𝑇. Secondly, simultaneously charging and discharging the batteries would incur an additional mathematical cost from battery losses due to the charging/discharging efficiency 𝜂 𝑠 which is strictly positive. As the optimal solution does not benefit from additional costs the complementary constraints are then naturally respected.

Minimizing power losses on a radial network

The power loss minimization problem consists of scheduling batteries such that the magnitude of the power transiting on the network reduces losses over a time horizon T. However, the Optimal Power Flow (OPF) problem at t is nonconvex and NP-hard due to the nonlinear relationship between the powers and the voltages [START_REF] Magnússon | A Distributed Approach for the Optimal Power Flow Problem Based on ADMM and Sequential Convex Approximations[END_REF]. Therefore, practical algorithms must rely on some approximations and model relaxations to converge faster and test a wide range of system setups.

In this subsection, the steady-state network power flow is described in Eqs. ( 12) to ( 15) with the branch flow model first proposed by [START_REF] Baran | Optimal capacitor placement on radial distribution systems[END_REF], and schematically illustrated in Fig. 2, for radial grids. Given a directed graph 𝐺 = (B, 𝐿), a link in l is denoted by (i, j) if it points from a head node i to a tail node j. Constraints expressed in Eq. ( 13) and ( 14) describe nodal active power and reactive power balancing conditions, and Eq. ( 15) describes forward voltage drop on each line. This model is further explained by [START_REF] Farivar | Branch Flow Model: Relaxations and Convexification (Parts I[END_REF].

Where 𝑃 𝑏 (𝑡) represents the total active power demand at bus b from the set of participants 𝑁 𝑏 connected to it. The total active power demand depends on uncontrolled net load profiles and control actions of batteries. The active power flow on line 𝑙 ∈ 𝐿 from node i to node j is denoted 𝑝 𝑖,𝑗 𝑙 (𝑡) and depends on the active demand at bus j, the losses in line l, and the power flow from lines downstream of node j. The reactive power flow on line l denoted 𝑞 𝑖,𝑗 𝑙 (𝑡) follows the same logic, 𝜏(𝑏) represents a function that returns the set of busses downstream a given node b. In practice, the implemented equations embed matrixes that allow to map each user to a bus, they are not represented here for the sake of clarity.

The voltage magnitude at bus j at time t denoted 𝑢 𝑗 (𝑡) depends on the voltage magnitude at the previous node i, the impedance (𝑟 𝑖,𝑗 𝑙 + j𝑥 𝑖,𝑗 𝑙 ) and the power flow on line l. Note that this model is already a relaxed version of the full OPF as voltage angles are not considered. Nonetheless, [START_REF] Farivar | Branch Flow Model: Relaxations and Convexification (Parts I[END_REF] show that this relaxed version is equivalent to the full problem for radial networks, which is the intended scope. To convexify power flow equations, the literature proposes several approaches [START_REF] Molzahn | A Survey of Relaxations and Approximations of the Power Flow Equations[END_REF]. One classic approach to solving those equations is to perform a relaxation of the nonlinear terms in the form of a Second Order Conic Program (Rigo-Mariani et Vai 2022).

The symbol 𝐼 𝑖,𝑗 𝑙 (𝑡) represents the square of the current magnitude on line l at time t. Similarly, for the voltages, 𝑈 𝑏 (𝑡) = 𝑢 𝑏 (𝑡) 2 represents the square of the voltage magnitude at node b at time t. The equality constraint Eq. ( 16) for the current on a line is then converted into an inequality and rewritten following a second-order cone constraint Eq. ( 17

Note that this relaxation requires an objective function that is convex and monotonically increasing with the square current 𝐼 𝑖,𝑗 𝑙 (𝑡), which is coherent with the objective of minimizing line losses. In this study, in addition to power losses on the line, power losses from the upstream network are included to ensure that consumption at the point of common coupling would still involve some losses. In particular, without this upstream loss term, the power production at the edges of the radial network would be penalized from traveling a greater distance than the production from the upstream network. As such, the objective function of the loss minimization problem is ultimately formulated as follows from Eqs ( 19) to ( 22 Where 𝑝 𝐻,𝑘 𝑙 (𝑡) represents the active power flow from the slack bus denoted H to node k at time t. The efficiency of the upstream network is denoted 𝜂 𝑢𝑝𝑠𝑡𝑟𝑒𝑎𝑚 . The value for this parameter is justified in section 3.1. Furthermore, the upstream losses term is ensured to remain positive.

Since the possibility of negative losses from 𝑝 𝐻,𝑘 𝑙 (𝑡) < 0 would encourage back feed power into the upstream network, which is not desirable.

Last but not least, the optimization problem is subject to Eq. ( 6) -( 10) representing the battery model as previously defined in the cost minimization. Once again this implies complementary constraints to ensure that 𝑝 𝑛 𝑠-(𝑡) 𝑇 . 𝑝 𝑛 𝑠+ (𝑡) = 0. However, in this optimization, complementarity may not be guaranteed in every case. Indeed, if a large surplus of solar power occurs, the optimal solution to reduce the current and losses in the lines may consist of simultaneously charging and discharging the battery at t to virtually create an additional load in the systems thanks to the battery's efficiency.

One option to ensure complementarity constraints is to add a binary variable to denote either the charging or discharging mode of the storage. However, this solution implies adding a binary variable at each time step and for each battery of the problem, which may result in a prohibitive computational time. As such, the efficiency of the battery 𝜂 𝑠 is relaxed if complementarity constraints are not respected. Hence, the optimization problem is solved one more time with 𝜂 𝑠 = 1 if complementary constraints are not respected from a posteriori analysis of the first run. Note that those constraints are not respected only on days when production surplus is beyond the sum of battery capacities and there is a 'mathematical' need for an additional load to improve the objective. The hypothesis is made that, on those days, removing battery efficiency does not significantly impact costs as local production is in surplus. This hypothesis is later verified in Appendix A, where it is also suggested to reduce the battery capacity by 14 % and the discharging power by 20 % to counterbalance the gain from relaxing battery efficiencies to 𝜂 𝑠 = 1.

Forming the trade-off problem

Forming the trade-off problem consists of assembling both minimization problems to obtain a continuous domain of solutions from a cost minimization (section 2.2) to a loss minimization (section 2.3). To obtain the trade-off curvealso referred to as the set of Pareto optimal solutionstwo widely used approaches consist of the weighting method and the Ɛ-constraint method [START_REF] Mavrotas | Effective implementation of the ε-constraint method in Multi-Objective Mathematical Programming problems[END_REF]. The weighting method is problematic with the SOCP relaxation of power flow equations. As the SOCP relaxation requires the loss minimization sub-objective to be a dominant term in the overall trade-off objective, i.e., it is not possible to explore weights that give more importance to the cost minimization sub-objective.

Instead of mixing loss and cost minimizations in the objective function, the Ɛ-constraint method proposes to model sub-objectives as constraints. Compared to the weighting method, the Ɛconstraint approach avoids the influence of scaling sub-objectives, and redundant runs from different weights leading to the same result [START_REF] Mavrotas | Effective implementation of the ε-constraint method in Multi-Objective Mathematical Programming problems[END_REF].

Following the Ɛ-constraint method, the trade-off problem corresponds to the loss minimization problem (section 2.3), to which an equality constraint Ɛ 𝑐𝑜𝑠𝑡 is added, representing the sum of individual costs Eq. (. Note that the objective function of the trade-off problem is Eq. ( 19)

unchanged from the loss minimization problem.

Ɛ 𝑐𝑜𝑠𝑡 = ∑ ∑ 𝜋 𝑏𝑢𝑦 (𝑡) × 𝑝 𝑛 + (𝑡) -𝜋 𝑠𝑒𝑙𝑙 (𝑡) × 𝑝 𝑛 -(𝑡) 𝑛∈𝑁 𝑡∈𝑇 ( 23 )
Where Ɛ 𝑐𝑜𝑠𝑡 is a cost value between a lower bound (obtained from the cost minimization problem), and an upper bound (from the loss minimization problem). The complete process of drawing the trade-off between minimizing individual costs and collective network losses is summarized in Fig. 3.

Fig. 3 -Construction of the trade-off curve between minimizing individual costs and minimizing network losses.

The trade-off methodology consists of running a power losses minimization (step 1.1) and a cost minimization (step 1.2) to place the boundaries of the problem in the costs/losses diagram (step 1). Note that after a cost minimization, power losses are recovered via a traditional power flow algorithm (e.g., Newton-Raphson). Then, drawing the trade-off curve consists of solving the loss minimization while respecting a given cost within the trade-off's bounds (step 2). Since solving the trade-off problem over an entire year is intractable, the trade-off problem is solved over a shorter interval of time, e.g., two days which covers the daily cycle of battery systems.

Solving shorter intervals of time is then repeated and the results are summed to obtain trade-off results for an entire year.

Alternative cost formulation for a community

In the previous formulation, for cost considerations, each consumer could buy power from or sell to an energy provider, but not from/to another consumer in the network. To account for potential exchanges and trading between users, notably within a REC, an alternative cost formulation is proposed.

In a community setup, it is not only a question of coordinating batteries, but also of fairly sharing the value created among the community members. To avoid making assumptions about how power is shared within the community, the considered objective is to minimize the overall community cost as if the community is a single consumer, which is a necessary condition of the optimal sharing problem. As such the cost equation for the community is a function of energy imports from outside of the community and fees from using the distribution grid, Eq. ( 24).

𝑐𝑜𝑠𝑡 𝑁 (𝑡) = 𝜋 𝑏𝑢𝑦 (𝑡) × max (0, ∑ 𝑝 𝑛 𝑛∈𝑁 (𝑡)) -𝜋 𝑠𝑒𝑙𝑙 (𝑡) × min (0, ∑ 𝑝 𝑛 𝑛∈𝑁 (𝑡)) + 𝜋 𝑒𝑥𝑐ℎ𝑎𝑛𝑔𝑒 × [∑ max(0, 𝑝 𝑛 (𝑡)) -max (0, ∑ 𝑝 𝑛 𝑛∈𝑁 (𝑡)) 𝑛∈𝑁 ] ( 24 )
Where the cost of the energy exchanged within the community priced 𝜋 𝑒𝑥𝑐ℎ𝑎𝑛𝑔𝑒 is simply the difference between energy imports of the community as a whole, max (0, ∑ 𝑝 𝑛 𝑛 (𝑡)), and the sum of individual members' imports, ∑ max(0, 𝑝 𝑛 (𝑡)) 𝑛 . In the community version of the tradeoff problem, the cost Eq. ( 24) replaces Eq. ( 23), and in the cost minimization optimization, Eq. ( 1) is replaced by Eq. ( 24).

Results

Case study and input data

The objective of this section is to illustrate the proposed methodology in a realistic but hypothetical French scenario. Even though absolute results have a limited scope in this section, they demonstrate the types of questions that may be answered, as well as the perspectives opened when mixing individual and collective objectives. Inputs and outputs are summarized in Fig. 4. Note that the trade-off algorithm is deployed as an open-source Python package easily accessible on GitHub under "multi-obj-optimal-powerflow". The methodology is applied to a network topology taken from the SimBench open-source dataset [START_REF] Meinecke | SimBench-A Benchmark Dataset of Electric Power Systems to Compare Innovative Solutions Based on Power Flow Analysis[END_REF]. A rural network is selected with 13 buses supplied by a 160 kVA transformer at a rated voltage of 0.4 kV. This network is illustrated in Fig. 5. The transformer is represented by an equivalent impedance corresponding to the copper losses in the windings.

The voltage at the slack bus is set to 1 p.u. At each bus of the network, two residential houses are connected with realistic load demands from an open-source database of residential load profiles. The database includes a collection of 173 load profiles from France for a full year at a 15-min resolution [START_REF] Quoilin | Quantifying self-consumption linked to solar home battery systems: Statistical analysis and economic assessment[END_REF]. A collection of 26 profiles were selected with a yearly energy consumption between 8.5 MWh and 14 MWh which represent on average the consumption of an all-electric household between 70 m 2 and 100 m 2 in France. This set of profiles leads to a maximum power demand of 115 kW which is below the transformer rated power. The reactive power consumption at each house follows the active power consumption with a constant power factor of 0.9 during the simulated year. However, power factors are not limited to static values and may vary in time to accurately represent a specific scenario.

Separately, PV production data is extracted from the open-source PVGIS platform [START_REF] Huld | A new solar radiation database for estimating PV performance in Europe and Africa[END_REF] for Lyon, France. A fixed 3 kWp PV is considered per household. This PV capacity installed per household ensures a sufficiently large production to justify having batteries for increased self-consumption. The battery capacity per household is set to 5 kWh which represents a mid-range commercial device with rated power for charging and discharging set to 2.5 kW and an efficiency 𝜂 = 0.95. Electricity is considered to be bought and sold from an external energy provider at respectively 22.76 c€/kWh and 13 c€/kWh. The difference between consumption and production for the 26 households over the year results in a netload profile summarized in Fig. 6. For each hour of the day, the distribution of netload values is represented by a box plot highlighting the median, lower, and upper 5 % quantiles.

The dots outside of the box plot represent outliers not accounted for in the distribution. Fig. 6 provides an overview of the power demand expected at the slack bus without control. In particular, households' production leads to a 49 kW back-feed into the upstream network for several days at 10 a.m. Further, Fig. 6 shows that 5 a.m. is the last hour where the netload is never negative; as such, it provides a good start time to solve the proposed optimization problems without risking cutting the diurnal pattern of solar production.

In addition to the line losses within the distribution grid, upstream network losses are considered to represent 2 % of the demand at the slack bus. This value corresponds to the estimated losses by the French Transmission System Operator RTE in 2019 (RTE 2019). Note that all the datasets are available in open source. The Python code for the methodology presented, as well as the Jupyter Notebook to set up this illustrative example, are available online under the MIT license1 . Optimization problems are written and solved using Pyomo and Gurobi on an Intel Core i5-1135G7 at 2.40 GHz with 16 Go of RAM. The Pareto analysis for a full year at a resolution of 15 minutes for a 13-bus network takes under 4 h.

Results without local energy communities

When batteries are coordinated to minimize individual costs (section 2.2), or alternatively to reduce grid losses (section 2.3) charging and discharging schedules differ. To illustrate those differences, Fig. 7 shows the amount of energy stored in batteries as a result of the two different optimization objectives. The schedules from the cost minimization show that batteries are not charging on the first day, as there is no surplus from local solar production. However, the schedules from the loss minimization show that batteries are incentivized to charge to flatten the netload as much as possible, hence reducing power losses. Any trade-off solutions then fall in between those two extreme scenarios depending on the cost constraint Ɛ 𝑐𝑜𝑠𝑡 applied. Note that on the second day, both schedules for the costs and losses minimization are closer which shows the potential synergy between those two objectives. Extending from those illustrative two days, Fig. 8 provides the full trade-off curve over a year.

Firstly, it shows a strong synergy between cost and loss minimization, as the trade-off curves nearly achieve the best of both objectives (i.e., the lower left corner of the figure). In particular, there exists a solution denoted trade-off #2 in Fig. 8 which achieves 100 % of the maximum cost reduction and lowers overall network losses by 5.5 %. In other words, the minimum cost solution is not unique and can be oriented towards a solution that reduces grid constraints at little additional cost.

It is important to note that the network losses are also a proxy for other constraints on the network. For instance, the cost minimization solution leads to 5.7 % of the lowest 95 % percent voltage under 0.95 p.u. and a power demand experienced at the transformer between 94.7 kW and -30.7 kW. On the other hand, the loss minimization solution leads to 0.5 % of the lowest 95 % percent voltage under 0.95 p.u. and limits the power at the transformer between 59.9 kW and -16.6 kW. Although the loss minimization improves the operation of the distribution grid, the outcomes of the cost minimization might be sufficient for the distribution grid operator.

Overall, Fig. 8 illustrates the domain of possible outcomes for any EMS applied to the considered battery systems. It enables stakeholders to understand what outcomes are achievable in the best-case scenario, and further, to compare the performances of different EMS in a unified frame of reference. Note that in [START_REF] Davoodi | An efficient covexified SDP model for multi-objective optimal power flow[END_REF] where a convex methodology is also applied, the authors provide a similar cost versus loss figure, however, it focuses on "fuel cost" in $/h rather than the retail cost of electricity after operating battery systems. The loss minimization problem tends to increase the overall cost. At the scale of end-users, some houses might participate more in the effort due to their position on the network and their uncontrolled netload. Fig. 9 illustrates the disparities of gains for each household relative to the scenario without batteries and for both cost and loss minimization problems. The cost minimization shows that all the houses are grouped around an average relative gain of 93 €/year, whereas the losses minimization gains are evenly spread between -5 € and 80 €/year. The fact that one of the houses at bus 12 (denoted "n12" in Fig. 9) has a negative gain in the effort of limiting network losses is potentially unfair in comparison with other households. As such, the grey area in Fig. 9 represents the additional cost of minimizing grid constraints that should be shared among the different households for fair participation in grid support.

Results for a local energy community

In this section, a similar MO-OPF Pareto is solved while considering the community setup from section 2.5 -i.e., households can share power production with their neighbors for a grid fee of 3.15 c€/kWh as represented in the cost Eq. ( 24). In other words, households can sell their surplus power at 22.76 c€/kWh minus a network fee of 3.15 c€/kWh instead of selling to their energy supplier at 13 c€/kWh. As surplus power is more efficiently traded, REC necessarily lowers the overall cost of energy. However, their impact on grid constraints is uncertain. Fig. 10 shows the trade-off curve from Fig. 8 along with the trade-off results from the methodology applied to the community setup. The trade-off curve from the community shows a minimum cost lowered by 500 € compared to the previous trade-off curve. The cost corresponding to the loss minimization case for the community is also closer to the minimum cost (i.e., the trade-off curve has a smaller vertical spam). This is due to a higher payoff when discharging batteries to support the network as this energy is also sold at a higher cost within the community.

The resulting losses of the cost minimization in the community scheme are also reduced compared to the losses without community, as less power is imported from the upstream grid thanks to the coordination of batteries at the community level. Note that secondary metrics such as percentage of under voltages, and maximum and minimum power demands remain the same in both scenarios with and without community. For this illustrative test case, the community scheme has a higher potential, i.e., a lower energy cost for the same grid constraints. Overall, as local energy communities provide the additional flexibility of directly selling power to a neighbor, energy costs tend to be lowered, and less subjected to the volatility of energy suppliers. Potentially, additional gains from the community scheme could be redirected to support the missions of DSO, even if communities do not necessarily create more distribution grid constraints. To further extend the scope of the presented research, both with and without local energy communities, the proposed MO-OPF is scalable to larger networks as demonstrated in [START_REF] Venkatasubramanian | Scalability Analysis of Convex Relaxation Methods for Branch Flow AC Optimal Power Flow[END_REF], where the SOCP complexity is shown to grow linearly with the network's size below 3000 nodes. Additionally, if three-phase unbalanced systems must be represented the proposed SOCP relaxation can be extended to such a model while keeping storage elements [START_REF] Nazir | Optimal Multi-Period Dispatch of Distributed Energy Resources in Unbalanced Distribution Feeders[END_REF]). To complete the proposed framework, there exist multiple methodologies to select the best solution on a Pareto front [START_REF] Kizielewicz | pymcdm-The universal library for solving multi-criteria decision-making problems[END_REF]). However, this is somewhat out of the scope of the paper as the Pareto front is seen as a theoretical bound to provide a reference for other EMS, rather than a series of solutions to choose from.

Conclusion

In this paper, a convex Multi-Objective Optimal Power Flow (MO-OPF) algorithm is developed and illustrated to address the trade-off between minimizing individual energy costs and lowering collective grid constraints on a low-voltage network.

For the illustrated scenario, providing grid support from battery systems is highly synergistic with reducing individual energy costs. Including network losses in the coordination of batteries can lower overall network losses by 5.5 % at no additional cost. Yet, from another perspective, the trade-off curve shows that network constraints remain within normal bounds of operation in any case. As such, for this scenario, this suggests that network constraints could be simplified to reduce the complexity of battery controllers. This trade-off approach provides a framework to compare the efficiency of any controller in a two-dimensional space with individual benefits versus collective constraints. In particular, this framework enables to assess the performance of data-driven approaches that do not provide a theoretical best-case reference. As local energy communities become more common, the importance of considering individual versus collective objectives grows, hence the proposed frame of reference becomes a key aspect towards the acceptability of EMS by end-users.

In addition to operational control, this methodology is relevant at the planning stage to assess what placement of systems is relevant. In particular, what placement of resources would ensure that local energy communities are not at risk of increasing grid constraints when coordinated through a cost-minimization approach? A perspective of this work is to provide a larger analysis of networks, cost scenarios with timeof-use pricing, and flexible devices like electric vehicles. This tool is available in open source. Funding 0.8 × 𝑝 𝑛 𝑠 ) is a good solution to solve the optimization problem with efficiency 𝜂 𝑠 = 0.95 without adding binary variables (which render the problem much less tractable).

To test the selected hypothesis, the relaxed problem and the "complete" problem are compared on days when complementary constraints are not problematic. From the potential days to test the hypothesis, the four days with the highest solar production are selected to resemble the conditions of a day when complementary constraints are problematic.

Fig. 11 shows that simply relaxing battery efficiency without decreasing battery capacity provides an optimistic trade-off curve in terms of network losses compared to the "complete" problem. However, the solution which consists in relaxing the efficiency but decreasing the battery capacity by 14 % and discharging power by 20 % (values obtained through manual iterations) provides a result close to the full problem both in terms of individual costs and network losses.

  line l (buses i,j) Acronyms:

Fig. 1 -

 1 Fig. 1 -Contributions towards understanding the trade-off between individual energy costs and

  9 ) 𝑝 𝑛 𝑠-(𝑇) = 0, and 𝑝 𝑛 𝑠+ (𝑇) = 0 ∀𝑛 ∈ 𝑁 ( 10 )

Fig. 2 -

 2 Fig. 2 -Branch model in a radial distribution grid.

Fig. 4 -

 4 Fig. 4 -Overview of inputs and outputs of the proposed open-source algorithm.

Fig. 5 -

 5 Fig. 5 -Low-voltage network adapted from the SimBench dataset.

Fig. 6 -

 6 Fig. 6 -Distribution of the total active power (i.e., total netload) for each hour of the day over a year.

Fig. 7 -

 7 Fig. 7 -Illustration of the trade-off between lowering network losses (orange line) and minimizing

Fig. 8 -

 8 Fig. 8 -Trade-off curve for 5 kWh batteries and 3 kWp solar panels equipped at every household.

Fig. 9 -

 9 Fig. 9 -Relative gains per household compared to a scenario without batteries. The orange dots

Fig. 10 -

 10 Fig. 10 -Theoretical trade-off curves for two scenarios: in blue each house is billed independently of

Fig. 11 -

 11 Fig. 11 -Trade-off results in three different scenarios for four days without complementary constraints

  ). Lastly, lower and upper bounds 𝑢 𝑏 and 𝑢 𝑏 are added to constraint the square magnitude of voltages at each node in Eq. (18).

					( 17 )
	𝑢 𝑏 2 ≤ 𝑈 𝑏 (𝑡) ≤ 𝑢 𝑏	2 ∀(𝑏, 𝑡) ∈ {𝐵, 𝑇}
	𝑝 𝑖,𝑗 𝑙 (𝑡) 2 + 𝑞 𝑖,𝑗 𝑙 (𝑡) 2 = 𝑈 𝑖 (𝑡) × 𝐼 𝑖,𝑗 𝑙 (𝑡) ∀(𝑙, 𝑡) ∈ {𝐿, 𝑇}
					( 16 )
		2. 𝑝 𝑖,𝑗 𝑙 (𝑡)
	𝐼 𝑖,𝑗 𝑙 (𝑡) + 𝑈 𝑖 (𝑡) ≥ ‖	2. 𝑞 𝑖,𝑗 𝑙 (𝑡)	‖	∀(𝑙, 𝑡) ∈ {𝐿, 𝑇}
		𝐼 𝑖,𝑗 𝑙 (𝑡) -𝑈 𝑖 (𝑡)	2

https://github.com/Jonathan56/multi-obj-optimal-powerflow

The work has been carried out in the framework of the AI4DG project -Artificial Intelligence for Distribution Grids, a French-German initiative co-funded by ANR and BMBF.

Appendices A

In this supplementary material, the impact of relaxing the battery efficiency to 𝜂 𝑠 = 1 is assessed when otherwise binary constraints would have been needed to enforce the complementarity (i.e., 𝑝 𝑛 𝑠-(𝑡) 𝑇 . 𝑝 𝑛 𝑠+ (𝑡) = 0). Intuitively, any battery should be prevented from charging and discharging at the same time, which would create virtual losses if 𝜂 𝑠 < 1. The objective function of the trade-off problem benefits from virtual losses when there is a surplus of solar power which creates additional losses on the lines.

The selected hypothesis is that relaxing the battery efficiency (i.e., 𝜂 𝑠 = 1) while decreasing the battery capacity (i.e., 𝐸 𝑛 𝑠 ′ = 0.86 × 𝐸 𝑛 𝑠 ) and decreasing discharging power (i.e., 𝑝 𝑛 𝑠 ′ =