Virtual Organization Structure for Agent-Based Local Electricity Trading

End-users are more active because of demand response programs and the penetration of distributed energy resources in the bottom-layer of the power systems. This paper presents a virtual organization of agents of the power distribution grid for local energy trade. An iterative algorithm is proposed; it enables interaction between end-users and the Distribution Company (DisCo). Then, the performance of the proposed algorithm is evaluated in a 33-bus distribution network; its effectiveness is measured in terms of its impact on the energy trading scenarios and, thus, of its contribution to the energy management problem. According to the simulation results, although aggregators do not play the role of decision makers in the proposed model, our iterative algorithm is profitable for them.


Introduction
Smart grids are based on connected IoT and embedded devices that communicate with each other in the power network.Thus, improving the functionality of smart grids, smart buildings, and their IoT devices (e.g., energy management) has become a major research concern [1].According to the infrastructure provided by smart grids, Demand Response (DR) programs introduce active players into the power distribution system.Hence, end-users wish to participate as bidirectional energy customers, which are called prosumers, in the distribution network [2].Therefore, new market structures are needed to provide energy based on decentralized approaches.Here, there are several studies in the literature that have worked on the energy transaction approach in power distribution grids.
Pratt et al. [3] proposed energy transaction nodes that connect buildings and the local electricity market.Jokic et al. [4] proposed a price-based method for energy management.In [5][6][7], a multi-agent-based transactive energy market was designed to decentralize decisions.Shafie-khah et al. [8] proposed a price-based method for solving the energy management problem locally based on supervision of the central price controller.
In addition, there are several research papers that have discussed the interplay between agents in the distribution grid based on demand response programs.In [9], the DR program was performed considering several suppliers and consumers.Deng et al. [10] presented a distributed framework based on a dual decomposition technique, which regulates the demand of end-users.In [11], a distributed model was described to determine optimal power flow in radial networks.Bahrami et al. [12] proposed centralized energy trading as a bi-level model.In [13], a decentralized DR framework was presented.The local electricity market defined in [14] gave independence to market agents, enabling them perform energy transactions freely among each other.In [15], a trading mechanism was designed among micro-grids.Zhang et al. [16] proposed a hierarchical structure for energy exchange in distribution grids.In [17], the energy trading problem was addressed among the agents in the power distribution system where the authors modeled the energy flexibility by the Ising-based model.In [18] and [19], the authors presented decentralized approaches from the perspective of end-users and other relevant decision makers to manage energy flexibility based on the desired reliability level in the distribution network.
Even though several works in the literature have modeled the bidirectional behavior of players to produce/consume energy in the distribution networks, an interplay model has not been addressed for energy trade management between end-users, aggregators, and the Distribution Company (DisCo).In this paper, a virtual organization structure for agents in the power distribution system is proposed for energy transactions between end-users and the DisCo based on an iterative algorithm.Thus, energy transactions are based on a bottom-up hierarchical structure from end-users to aggregators, from the aggregator to the DisCo, and from the DisCo to the wholesale electricity market, respectively.In this way, the main contributions of this paper can be summarized as follows:

•
A new virtual organization of agents' structure in the distribution network.
• A novel iterative algorithm for energy trade between end-users and the DisCo in the power distribution system.

•
The evaluation of energy trading scenarios through the proposed model.
In the following, the organization of this paper is described.In Section 2, agents and their corresponding virtual organizations are defined.The problem formulation is described in Section 3. Section 4 discusses our findings on the basis of the simulation results.Finally, the paper is concluded in Section 5.

Virtual Organization of Agents in the Power Distribution Grid
After the restructuring of power systems, different players emerged in the system.In this paper, the proposed agent structure in the distribution network is described.Thus, different organizations of agents are defined in the system, which consist of end-users, aggregators, and the DisCo.In the following, each of these agents and their interconnections are described.

End-Users
End-users are agents in the bottom layer of the power distribution system that act as consumers, producers, or prosumers in the system.In this paper, a bottom-up approach is presented to trade energy through end-users, aggregators, the DisCo, and the wholesale market.Thus, end-users manage their energy production/consumption on the basis of their interactions with the aggregators and the DisCo.Furthermore, the end-users have several agents (e.g., Information Provider (IP), Prediction Engine (PE), and Decision Maker System (DMS)), which make up an organization of agents.Each of these agents are described below.

•
The Information Provider (IP) records information of all other agents, as well as the environmental conditions.Furthermore, the IP is responsible for sending/receiving information to/from the external agents that correspond to its organization, as shown in Figure 1.

•
The Prediction Engine (PE) forecasts the uncertain variables (e.g., the energy generated from distributed energy resources, electrical consumption, electricity price, etc.) of end-users based on information provided by the IP.In this way, the values predicted by the PE are the inputs of the DMS.

•
The Decision-Making System (DMS) is in charge of making optimum decisions for its corresponding organization (e.g., end-user, aggregator, and the DisCo).On the one hand, the inputs of the DMS are received from the IP and the PE.On the other hand, the outputs of the DMS are sent to the IP, which exchanges them with the external agents from the corresponding organization.Figure 1 shows interactions between agents in the end-user's organization.

Aggregators
Aggregators (AGG) are one type of reseller player in the restructured power system.In this paper, aggregators are defined as agents that are in charge of trading energy with end-users in their corresponding regions.Furthermore, they are able to conduct energy transactions with the DisCo in this model.In the proposed agent-based structure, aggregators have several agents such as IP and End-Users (EU) for creating agent organizations in each region of the distribution network.Furthermore, according to Figure 2, each aggregator conducts data transactions with the DisCo (as an external agent of its organization) through its IP agent.

Distribution Company
The DisCo is the only agent that trades energy with the wholesale market.Moreover, the DisCo has the IP and the DMS agents for data exchange with the aggregators and end-users as external agents and makes optimum decisions, respectively, as shown in Figure 3.

Problem Formulation
In this section, the proposed energy trading problem is described; it is based on the iterative algorithm designed to conduct energy transactions between the end-users and the DisCo as decision makers in the system.In other words, the decision-making problems for the DMSs of end-users and the DisCo are presented in this section.

Energy Trading Model
In this structure, end-users can trade energy with the DisCo, P D2L jt , and their corresponding aggregators, P L2A jt , at prices λ D2L and λ L2A kt , respectively.Then, aggregators exchange energy, P A2D kt , with the DisCo.However, the wholesale market can only trade with the DisCo, P M t , as shown in Figure 4. Equation (1) represents the balancing equation for energy trade between end-user j and the DisCo and its corresponding aggregator.Here, P jt and L jt represent energy production and consumption of end-user j and time step t.End-users play the role of consumers (L net jt ≥ 0) or producers (L net jt < 0) according to (2) and (3).Here, γ P j and γ C j are defined as coefficients, which present the potential of end-user j as a producer and a consumer, respectively.Furthermore, Equation (4) expresses that the end-user can only buy electricity from the DisCo, and there is a one-way energy transaction between end-users and the DisCo.Equation ( 5) represents shiftable limits to constrain end-users as active agents in the bottom layer of the distribution network.
According to our bottom-up energy trading approach, the summation of the energy exchanged between end-users and aggregators is traded with the DisCo as represented in (6).The maximum and minimum constraints for the price of energy traded between aggregators and the DisCo, λ A2D kt , are represented in (7).Here, λ M t represents electricity price in the wholesale market, and δ kt is defined as a coefficient to guarantee the profit of the energy transaction for aggregators (δ kt ≥ 1).Besides, the balancing equation in the layer of the DisCo for energy exchange between the DisCo and the wholesale market is presented in (8).
Here, the objective functions of end-users, aggregators, and the DisCo are represented in ( 9), (10), and (11), respectively.In (9), the objective function of end-user j consists of two terms and states the end-user's expected cost.The first term represents the expected cost of the energy sold by the DisCo, and the second term expresses the expected profit from the energy sold to the aggregator (P L2A jt > 0) or the expected cost of the energy purchased from the aggregator (P L2A jt < 0).In (10), OF a k consists of two terms, which are the expected cost of energy transactions with the end-users and the expected profit from exchanging energy with the DisCo.In (11), OF d includes three terms consisting of the expected cost of energy transaction with aggregators, the expected cost of energy traded with the wholesale market, and the expected profit from energy sold to end-users.

Proposed Iterative Algorithm
In this section, an iterative algorithm is proposed that models the energy trade through the interaction between end-users and the DisCo.Here, the end-users and the DisCo are defined as agents who manage energy in the power distribution network.In the following, the energy management problems of both end-user and the DisCo are represented:

•
End-users energy trading problem (Problem E): min EC e = ∑ j OF e j s.t.: (1)-( 3), ( 5)-( 6). .Passed to problem E: P D2L jt , λ A2D kt .On the one hand, in Problem E, end-users manage their own energy independently and control energy traded through aggregators and the DisCo, P A2D kt , hierarchically.On the other hand, the DisCo determines the price of the energy it trades with the aggregators, λ A2D kt , in Problem D through the proposed algorithm, which has been presented in Figure 5

Case Study
In this paper, a 33-bus test system was used [19,20] to assess the proposed energy trading problem as shown in Figure 6.As shown in Figure 6, three regions have been considered, which are managed by their corresponding aggregators.A1-A3 represent Aggregator 1-Aggregator 3 as shown in Figure 4.The energy price that was traded in each of those regions was different as shown in Table 1.Furthermore, we assumed that λ D2L = 0.6 ( In this paper, a 33-bus test system is used [16]- [20] to assess proposed energy trading proble 144 as shown in Fig. 6.As shown in Fig. 6, three regions have been considered which are managed 145 their corresponding aggregators.A1 to A3 present Aggregator 1 to Aggregator 3 as shown in F 146 4. The energy price which is traded in each of those regions is different as shown in Table 1.Also we assume that λ D2L = 0.6 e /kWh] and δ kt = 1.1 according to Refs.[16]- [19].Also, it is assumed that γ P j = γ C j = 0.1 to cover electrical demand of end-users electrical demand from 90% to 110%

Evaluation of the proposed iterative algorithm 151
In this section, we assess the performance of the proposed iterative algorithm for energy tra 152 between end-users and the DisCo is assessed.Thus, two scenarios are defined for evaluation.
153 scenario 1, S 1 , Eq. ( 5) is not considered in the problem.In other words, in S 1 , electrical load

166
/kWh) and δ kt = 1.1 according to [16][17][18][19].Furthermore, it was assumed that γ P j = γ C j = 0.1 to cover the electrical demand of end-users' electrical demand from 90%-110% by shaving their demand in the peak-time and shifting them (or not) in the off-peak time via their energy storage systems.In this paper, a 33-bus test system is used [16]- [20] to assess proposed energy trading problem 144 as shown in Fig. 6.As shown in Fig. 6, three regions have been considered which are managed by 145 their corresponding aggregators.A1 to A3 present Aggregator 1 to Aggregator 3 as shown in Fig. 146 4. The energy price which is traded in each of those regions is different as shown in Table 1.Also, 147 we assume that λ D2L = 0.6 e /kWh] and δ kt = 1.1 according to Refs.[16]- [19].Also, it is assumed that γ P j = γ C j = 0.1 to cover electrical demand of end-users electrical demand from 90% to 110% by

Evaluation of the proposed iterative algorithm 151
In this section, we assess the performance of the proposed iterative algorithm for energy trade 152 between end-users and the DisCo is assessed.Thus, two scenarios are defined for evaluation.In

Evaluation of the proposed iterative algorithm 151
In this section, we assess the performance of the proposed iterative algorithm for energy t 152 between end-users and the DisCo is assessed.Thus, two scenarios are defined for evaluation 153 scenario 1, S 1 , Eq. ( 5) is not considered in the problem.In other words, in S 1 , electrical loa

Evaluation of the Proposed Iterative Algorithm
In this section, we assess the performance of the proposed iterative algorithm for energy trade between end-users and the DisCo.Thus, two scenarios were defined for evaluation.In Scenario 1, S 1 , Equation ( 5) is not considered in the problem.In other words, in S 1 , the electrical load of end-users is modeled as an interruptible load.Hence, end-users shave their peak load to minimize their cost for energy transaction in S 1 .However, Scenario 2, S 2 , includes all constraints of the problem.In other words, in S 2 , the electrical load of end-users is modeled as a shiftable load.In this way, the total amount of energy shifted by end-users in 24 h should be equal to zero.Therefore, if end-users shave N% of their desired electrical consumption in the peak time, they should shift their shaved consumption (N% of their desired demand) to the off-peak time.In this way, the total expected costs of end-users (EC e ), aggregators (EC a = ∑ k OF a k ), and the DisCo (EC d ) were compared in two cases with the aim of finding an energy trading solution.In Case 1, the energy trading problem was solved from the perspective of end-users as independent agents.Hence, end-users manage energy in the distribution network without the interplay with the DisCo and aggregators.However, in Case 2, the energy trading problem was solved based on the interaction between end-users and the DisCo by our proposed iterative algorithm.
As seen in Table 2, in Case 1, EC e , EC a , and EC d are negative in S 1 .In other words, Case 1 was profitable for all end-users, aggregators, and the DisCo.This is because of the bottom-up energy trading flow from end-users to aggregators, from aggregators to the DisCo, and from the DisCo to the wholesale market.In S 2 , the total expected costs of aggregators was positive in Case 1.However, EC a was negative in S 2 of Case 2.

Conclusions
This paper has proposed a virtual organization structure for energy trade between the agents of the distribution network.Furthermore, an iterative algorithm has been proposed for energy transaction management between end-users and the DisCo.The proposed algorithm has been evaluated in terms of its impact on the energy trade scenarios.According to the simulation results, it has been found that:

•
If all end-users participate as interruptible loads in the distribution network, the energy trade was more profitable for all the agents.
• Our proposed algorithm was profitable for aggregators and the DisCo, who are policy makers in the power distribution system.

•
The proposed algorithm was costly for all end-users in comparison with the decentralized approach (which is not practical in current power systems) to manage energy by end-users in the distribution network, because the DisCo is in charge of determining the amount of energy that can be traded between the DisCo and end-users.
In future work, we are going to discuss how to model the uncertainty of distributed energy resources that are decentralized and how a distributed energy management system can be modeled considering peer-to-peer energy trading among end-users and aggregators based on a mathematical program with equilibrium constraints and mixed complementarity problems.

Figure 1 .
Figure 1.Organization of end-user agents.

Figure 3 .
Figure 3. Organization of the DisCo agents.

Figure 4 .
Figure 4. Agents and energy trading framework for the distribution network adapted with permission from [19].
. Therefore, P A2D kt is a fixed variable in Problem D, and P D2L jt and λ A2D kt are fixed variables in Problem E. EC e and EC d represent total expected costs of end-users and the DisCo, respectively.Note that the proposed energy trading problem is not the Mathematical Program with Equilibrium Constraints (MPEC) problem and Mixed Complementarity Problem (MCP).Thus, no complementarity has been defined between equations and variables in the proposed problem.The price of energy traded between the DSO and aggregators, λ A2D kt , is just limited to Equation (7), and it is not a dual variable of the balancing equation.Furthermore, λ A2D kt is determined by the DSO.

Figure 5 .
Figure 5. Proposed iterative algorithm for energy trade between end-users and the Distribution Company (DisCo).
154 end-users is modelled as an interruptible load.Hence, end-users shave their peak load to minim 155 their cost for energy transaction in S 1 .However, Scenario 2, S 2 , includes all constraints of the proble 156 In other words, in S 2 , the electrical load of end-users is modelled as a shiftable load.In this way, to 157 amount of energy shifted by end-users in 24 hours should be equal to zero.Therefore, if end-us 158 shave N% of their desired electrical consumption in the peak time, they should shift their shav 159 consumption (N% of their desired demand) in the off-peak time.In this way, the total expected co 160 of end-users (EC e ), aggregators (EC a = ∑ k OF a k ), and the DisCo (EC d ) are compared in two cases w 161 the aim of finding an energy trading solution.In Case 1, the energy trading problem is solved fro 162 perspective of end-users as independent agents.Hence, end-users manage energy in the distributi 163 network without the interplay with the DisCo and aggregators.However, in Case 2, the energy tradi 164 problem is solved based on the interaction between end-users and the DisCo by our proposed iterat 165 algorithm.

Table 2 .Figure 8 .
Figure 8. Energy trading flow between agents in the distribution network in Case 2 (proposed iterative algorithm).

Table 1 .
[19]es of energy traded between consumers and aggregators adapted with permission from[19].