Sustainable Operation of Active Distribution Networks

<jats:p>The present and future conditions in the energy market impose extremely high standards to the operation of building energy systems. Moreover, distribution networks face new operational and technical challenges as a result of the rapid penetration of renewable energy sources (RES) and other forms of distributed generation. Consequently, active distribution networks (ADNs) will play a crucial role in the exploitation of smart building prosumers, smart grids, and RES. In this paper, an optimization method for the sustainable operation of active distribution networks hosting smart residential building prosumers, plug-in electric vehicle (PEV) aggregators, and RES was developed. The thermal and electrical loads of the residential buildings were modeled in detail and an aggregation method was implemented to the hosted PEVs. Moreover, smart power dispatch techniques were applied at each building prosumer and PEV aggregator hosted by the active distribution network. Simultaneously, all the operational limitations of the active distribution network, building energy systems, and the hosted PEVs were satisfied. The constrained optimal power flow (OPF) algorithm was exploited to keep the voltages of the hosting distribution network between the permissible bounds. A significant operation cost reduction of 17% was achieved. The developed models were verified through detailed simulation results.</jats:p>

section_content: The increasing penetration of distributed energy resources (DERs) in power systems affects their reliability, efficiency, and operation cost. Therefore, it is essential to promote, optimally operate, and control active distribution networks in order to achieve the qualitative and cost-effective operation of future electric power systems. 

The study of residential building power management and control has received a lot of attention. The home energy management systems (EMSs) studied in [1, 2] were exclusively used to optimally control only the power of a residence with renewable energy sources and an energy storage system (ESS). Aiming to decrease the power consumption, the EMS presented in [3] exploits the load and generation forecast, in contrast to [4]. In [5], a fuzzy logic controller was designed for the power management of residential microgrids including distributed generation and energy storage units. However, their ability to control the energy demand was not examined, contrary to studies [6, 7] that considered controllable house appliances that are optimally scheduled to reduce the amount of grid-supplied energy. The EMSs examined in [8, 9] were deployed in smart residential buildings and aimed at the minimization of the electricity cost and peak load shaving by the appropriate operation scheduling of household devices. In [10, 11], the researchers optimally managed the power consumption by regulating heating, ventilation and air conditioning (HVAC) systems of residential buildings with suitable load shifting methods and analyzed the HVAC power demand profile for various building characteristics. The maximum energy cost saving was achieved, while a sufficient level of thermal comfort was ensured. A proper modeling of the thermal and electrical loads as well as the energy storage system of a smart home was developed in [12]. A strategy to optimize energy usage through the appropriate scheduling of domestic appliances, while maintaining user comfort levels within a predetermined range was also proposed. Algorithms for the efficient energy management of residential RESs and battery energy storage systems and the optimal sizing of these units were developed in [13]. The main objective of this work was the maximization of the energy use produced by the RESs and the reduction in the system's overall cost. Studies [14, 15] have also focused on the analysis of building energy consumption profiles. Specifically, the authors in [14] evaluated the influence of the occupants' age on the energy consumption of the residential sector. Daily energy consumption habits and trends in residential buildings were identified in [15], mainly through statistical methods and smart metering systems. In [16], a method for the coordinated operation of an active distribution network (ADN) comprising a microgrid of large office building prosumers and PEVs was examined. This method focuses on the interaction of the microgrid and the active distribution network and enables them not to disclose to each other their respective internal technical characteristics and information. In contrast, the work presented in this paper examined the optimization of distributed small residential prosumers of a distribution network, which is a completely different problem. 

The operation scheduling and control of PEVs has been the subject of extensive research. In [17], a vehicle to grid (V2G) operation was exploited. The PEVs inject power to the electric grid in order to reduce PEV charging cost. Nevertheless, the network constraints were not considered and the proposed method was applied only to each PEV. Numerous research works have focused on the PEVs' charging management, taking into account the distribution network constraints [18] [19] [20] [21]. In [21], PEV aggregation techniques were employed for the most effective control of the distribution network. A hierarchical multi-agent system (MAS) was developed in [22] for the efficient real-time control of large electric ports with a high integration of PEVs, while in [23], the optimal operation of distribution networks comprising PEVs was achieved with the implementation of demand response strategies. To optimally dispatch the total active power of a population of PEVs to each PEV, an effective definition of a PEV's flexibility to adjust its exchanged power was developed in [24]. The power management method suggested in [25] is suitable for real-time application to distribution networks hosting large clusters of PEVs. In this work, simple flexibility indicators were proposed for both PEVs and clusters of PEVs. Additionally, the optimal reactive power dispatch to each PEV was accomplished in realtime. Moreover, a strategy for incorporating energy storage units into ADNs was developed in [26, 27]. The ESSs were suitably designed to take into account their potential to support the ADN by exploiting both active and reactive power. In [28], the batteries used in the examined ADN were optimally designed and scheduled in order to maximize the penetration of the distributed generation units. 

A brief description of this work and its novel aspects are presented in the following.
section_name: Introduction

section_content: The work presented in this paper examines the optimization of distributed small residential prosumers of a distribution network. A large number of operation and technical limitations of the ADN and its components was ensured and the proposed algorithm achieved the highest possible reduction in the daily operation cost of the ADN.
section_name: •

section_content: The implementation of the proposed method was based on the exploitation of a hierarchical MAS that allows for the optimization of the complex examined power system in a single optimization level. The goals of each type of agent (smart residential building prosumers, PEV aggregators, and RES) and how they cooperated to accomplish them were fully outlined. The coordinated optimal operation of all types of agents was achieved and the suggested approach for ADN's optimal operation aligns with the growing need for sustainable development.
section_name: •

section_content: The thermal and electrical loads of residential buildings and an aggregate battery of numerous plug-in electric vehicles were modeled in detail.
section_name: •

section_content: A simple and effective definition of the buildings' cluster flexibility to adjust their power by exploiting fuzzy logic was first proposed in this article.
section_name: •

section_content: Smart power dispatch techniques were applied to buildings and PEV clusters as well as to single residential buildings and PEVs. This kept the needed computation time very low, as the minimum possible number of decision variables was achieved. 

The proposed method for the optimal operation of the ADN was aligned with the increasing need for sustainable development. The examined system included RES that generate clean energy. Moreover, the autonomous operation of the ADN was ensured, mainly through the hosted PEVs and RES, and there was no need for extra investment to conventional polluting auxiliary power generation units. This contributes to a reduction in greenhouse gas emissions and enhances the environmental friendliness of the proposed system. Another significant aspect of the suggested method is the minimization of the daily operation costs of the examined ADN, ensuring its sustainability in this way. Another sustainable feature of the method is the qualitative operation of the ADN as it can ensure the maintenance of the ADN voltages within their permissible bounds. 

The remainder of the article is structured as follows. Section 2 provides the description of the suggested hierarchical MAS. Section 3 includes the models of the agents and the connection among them. Finally, Section 4 presents the results received by the simulation of the examined active distribution network and evaluates them; while Section 5 draws the general conclusions.
section_name: •

section_content: The layout of the examined ADN and the structure of the hierarchical MAS developed in this work are shown in Figure 1. In the examined MAS, the agents used were classified into three major types: (1) local agents; (2) cluster agents; and (3) the active distribution network management agent. Local agents are accountable to model an individual module of the ADN, and cluster agents are accountable to gather and properly handle the responses of a cluster of local agents and forward information back to them. All cluster agents are supervised and managed by the active distribution network management agent (ADNM/A). ADNM/A is accountable for the optimal coordination of the MAS according to the responses received by cluster agents and possesses a higher place in the MAS hierarchy, as depicted in Figure 1. It can be concluded by Figure 1 that a bidirectional communication system should be available to each agent. A variety of communication technologies (i. e., DSL, Power Line Communication, Wi-Fi, GPRS, etc. ) can be exploited. Their pros and cons can be found in [29]. Usual communication protocols include: AMI, SCADA, cellular communications, and other wireless communication technologies. Smart meters and PMUs can be installed at carefully selected points of the network. A low-cost PMU for smart distribution networks was proposed in [30]. Next, a brief explanation of each type of agent is provided, while their detailed operation is presented in the following section. 

stored energy and the active and reactive power it exchanges with the distribution network. These quantities are forwarded to the CPEV/A, which supervises the cluster of PEVs. RES/A carries out extremely short-run predictions of the power produced by the renewable energy units it is assigned to. L/A is applied to each node of the distribution network and also estimates the node's active and reactive power requirement by performing very short-run predictions. RES/A and L/A provide their responses to ADNM/A.
section_name: Description of the Suggested Multi-Agent System Structure

section_content: Cluster of Building Thermal Loads Agent (CBTL/A), Cluster of Building Electrical Loads Agent (CBEL/A), and Cluster of Plug-in Electric Vehicles Agent (CPEV/A) belong to the category of cluster agents and they are hierarchically located just above the agents BTL/A, BEL/A, and PEV/A, respectively. They are regularly placed on medium voltage/low voltage (MV/LV) transformers that supply clusters of residential buildings and/or PEVs. Their primary aim is the aggregation of the responses they receive from the BTL/As, BEL/As, and PEV/As in their control areas. Moreover, CBTL/As and CPEV/As define suitable flexibilities exploiting fuzzy logic based on information regarding the respective node voltage and the flexibility of the supervised BTL/As and PEV/As, respectively. Cluster agents are also responsible for the optimal dispatch of their power to the local agents they supervise
section_name: Cluster Agents

section_content: The building thermal load agent (BTL/A), building electrical load agent (BEL/A), plug-in electric vehicle agent (PEV/A), renewable energy sources agent (RES/A), and load agent (L/A) belong to the type of local agents. The inherent quantities of the distribution network components are calculated by local agents. Specifically, BTL/A and BEL/A were assigned to each building of the network and to model its thermal and electrical loads, respectively. Additionally, BTL/A calculates the indoor temperature of each building over the optimization horizon. The estimated indoor temperature of the building was used with its upper and lower limits to suitably calculate the flexibility of each building to increase or decrease its thermal power demand. Afterward, BTL/A and BEL/A send the necessary data to the supervising cluster agents CBTL/A and CBEL/A, respectively. PEV/A calculates the flexibility of each individual PEV to adjust its power and the bounds of its stored energy and the active and reactive power it exchanges with the distribution network. These quantities are forwarded to the CPEV/A, which supervises the cluster of PEVs. RES/A carries out extremely short-run predictions of the power produced by the renewable energy units it is assigned to. L/A is applied to each node of the distribution network and also estimates the node's active and reactive power requirement by performing very short-run predictions. RES/A and L/A provide their responses to ADNM/A.
section_name: Local Agents

section_content: Cluster of Building Thermal Loads Agent (CBTL/A), Cluster of Building Electrical Loads Agent (CBEL/A), and Cluster of Plug-in Electric Vehicles Agent (CPEV/A) belong to the category of cluster agents and they are hierarchically located just above the agents BTL/A, BEL/A, and PEV/A, respectively. They are regularly placed on medium voltage/low voltage (MV/LV) transformers that supply clusters of residential buildings and/or PEVs. Their primary aim is the aggregation of the responses they receive from the BTL/As, BEL/As, and PEV/As in their control areas. Moreover, CBTL/As and CPEV/As define suitable flexibilities exploiting fuzzy logic based on information regarding the respective node voltage and the flexibility of the supervised BTL/As and PEV/As, respectively. Cluster agents are also responsible for the optimal dispatch of their power to the local agents they supervise and control. Finally, they forward the necessary data to the active distribution network management agent.
section_name: Cluster Agents

section_content: The Active Distribution Network Management Agent (ADNM/A) is at the higher level of the proposed hierarchical MAS. ADNM/A gathers the aggregated responses from the cluster agents and also information for the forecasted price of electricity, the node loads of the network, and the power produced by RESs and it exploits an optimization technique to optimally schedule the operation of the ADN. The proposed method aims to reduce the daily operation cost of the network by shifting the power demand in time periods with a low electricity price. At the same time, all the operational constraints of the ADN, building energy systems, and hosted PEVs should be satisfied. The constrained optimal power flow algorithm (OPF) was exploited to keep the voltages of the ADN within the permissible bounds. Then, the active and reactive power set-points resulted from the OPF exploitation were forwarded back to the respective cluster agents to be optimally dispatched to the local agents they supervise.
section_name: Active Distribution Network Management Agent

section_content: In this section, the models of local, cluster and ADNM/A are presented.
section_name: Agents' Modeling

section_content: 3. 1. 1. Building Thermal Load Agent (BTL/A) BTL/A calculates the internal temperature of each residential building it supervises over the optimization horizon according to the thermal model described below [16]. 

. 

. 

. 

. 

where the b index denotes the building's number; the y index denotes the yth external wall/window; ε is the external walls set τ win is the window glass transmission coefficient; a w is the external wall absorbance coefficient; C b is the specific heat capacity; F wall(win)

is the wall (window) surface area; I T,b is the total solar radiation on the bth building; ρ denotes the air density; Q HVAC,b denotes the power production for the cooling of the bth building;

. Q ex,wall,b denotes the external walls' heat exchange of the bth building; Q in,b denotes the internal heat gains of the bth building;

. Q sg,b denotes the solar radiation through the windows of the bth building;

. Q sw,b denotes the heat gain by the external walls' solar radiation of the bth building;

. Q win,b denotes the heat transfer across the windows of the bth building; R se is the heat resistance of the external surface; T in,b denotes the bth building's internal temperature ( • C); T out denotes the bth building's outdoor temperature ( • C); SC denotes the shading coefficient of the windows; and U wall(win) denotes the factor of the heat exchange of the external wall (window). 

The estimated indoor temperature of the building was used with its upper and lower limits to suitably define the flexibility of each building to increase (FL ↑ b ) or decrease (FL ↓ b ) its thermal power demand, as in the following equations. 

3. 1. 2. Building Electrical Load Agent (BEL/A) BEL/A is assigned to each building of the network and the model electrical loads of the building. The modeling of the energy consumption profiles in residential buildings was developed taking into consideration the number, age, and the activity level of the occupants as well as the number, type, and the usage of electric household appliances [14, 15].
section_name: Local Agents

section_content: PEV/A calculates the boundaries of each PEV's state of charge and the active and reactive power it trades with the distribution network. According to these characteristics, the area the PEV is permitted to operate is derived [16], and is shown in Figure 2. 

Appl. Sci. 2023, 13, x FOR PEER REVIEW 6 of 22 temperature (°C); denotes the shading coefficient of the windows; and ( ) denotes the factor of the heat exchange of the external wall (window). 

The estimated indoor temperature of the building was used with its upper and lower limits to suitably define the flexibility of each building to increase ( ↑ ) or decrease ( ↓ ) its thermal power demand, as in the following equations. 

3. 1. 2. Building Electrical Load Agent (BEL/A) BEL/A is assigned to each building of the network and the model electrical loads of the building. The modeling of the energy consumption profiles in residential buildings was developed taking into consideration the number, age, and the activity level of the occupants as well as the number, type, and the usage of electric household appliances [14, 15].
section_name: Plug-in Electric Vehicle Agent (PEV/A)

section_content: PEV/A calculates the boundaries of each PEV's state of charge and the active and reactive power it trades with the distribution network. According to these characteristics, the area the PEV is permitted to operate is derived [16], and is shown in Figure 2. The time that the EV is plugged to the network and unplugged from it is denoted with t 0 and t f, respectively. SoC max and SoC min are the maximum and the minimum values of the PEV's battery state of charge. SoC 0 is the initial state of charge (kWh) of each PEV. P max and P min (kW) are the maximum and minimum power that the PEV's battery can exchange with the network, respectively. SoC target (kWh) is the stored energy target that the driver has defined the PEV should reach at its disconnection time. The dynamic lower and upper bounds of the PEV's SoC, SoC low, and SoC high are generally defined by 4 points where they start to decrease or increase with a constant rate of change P min or P max, respectively. These points are (t 0, SoC 0 ), (t L 1, SoC min ), (t L 2, SoC min ), and (t f, SoC target ) for SoC low and (t 0, SoC 0 ), (t H 1, SoC max ), (t H 2, SoC max ), (t f, SoC target ) for SoC high. 

t L 1, t H 1, t L 2 and t H 2 are estimated as in the following:

Moreover, PEV/A determines the flexibility of each individual PEV to adjust its power, f lex PEV (i, t) [25]. These quantities are forwarded to the CPEV/A that supervises the cluster of PEVs. 

where t (i, t) is the time point at which the SoC trajectory crosses the SoC high or SoC low limits provided that the ith PEV absorbs or injects active power P min (i) or P max (i), respectively, as described in [25]. 

According to Equation ( 13 ), the flexibility of the ith PEV to increase (reduce) its active power at a certain time point is the time required to reach the SoC high(low) limit if it absorbs (injects) the maximum active power, respectively. 

If P(i, t) ≥ 0, then t (i, t) is calculated in Equation (14). 

If P(i, t) < 0, then t (i, t) is calculated in Equation (15). 

If P(i, t) is the optimal active power of the ith PEV (generator convention) and the n ch, n dis charging and discharging efficiencies, then the SoC (kWh) of the ith PEV at the end of the next time interval is estimated according to Equation (16). 

The state of charge calculated in Equation ( 16 ) is used in Equations ( 13 )-( 15 ) to estimate the flexibility of the ith PEV, f lex PEV (i, t + ∆t), at time t + ∆t.
section_name: Plug-in Electric Vehicle Agent (PEV/A)

section_name: Cluster Agents

section_content: The primary goal of CBTL/As is to aggregate the responses they receive from the BTL/As being in their control areas. The flexibility of a cluster of buildings to increase (FL ↑ CB ) or decrease (FL ↓ CB ) its power is the respective weighted average of the flexibilities of the buildings it supervises, as described in Equations ( 17 ) and (18). V b is the air volume of the bth building. 

Moreover, CBTL/As define suitable flexibilities (FL CB, f z ) by exploiting fuzzy logic based on information regarding the respective node voltage and their primary flexibility to adjust their power, as shown in Figure 3. Initially, the inputs and outputs were mapped into fuzzy sets using the respective membership functions. Both inputs were fuzzified using five sets with linguistic variables for the node voltage deviation from its upper or lower bound and the flexibility of the cluster of buildings to change its power. These variables were defined as very small (VS), small (S), medium (M), large (L), and very large (VL). The output of the fuzzy logic was determined by defining the rules indicated in Table 1. 

Appl. Sci. 2023, 13, x FOR PEER REVIEW 8 of 22
section_name: Cluster of Building Thermal Loads Agent (CBTL/A), Cluster of Building Electrical Loads Agent (CBEL/A)

section_content: The primary goal of CBTL/As is to aggregate the responses they receive from the BTL/As being in their control areas. The flexibility of a cluster of buildings to increase ( ↑ ) or decrease ( ↓ ) its power is the respective weighted average of the flexibilities of the buildings it supervises, as described in Equations ( 17 ) and (18). is the air volume of the bth building. 

Moreover, CBTL/As define suitable flexibilities (, ) by exploiting fuzzy logic based on information regarding the respective node voltage and their primary flexibility to adjust their power, as shown in Figure 3. Initially, the inputs and outputs were mapped into fuzzy sets using the respective membership functions. Both inputs were fuzzified using five sets with linguistic variables for the node voltage deviation from its upper or lower bound and the flexibility of the cluster of buildings to change its power. These variables were defined as very small (VS), small (S), medium (M), large (L), and very large (VL). The output of the fuzzy logic was determined by defining the rules indicated in Table 1.
section_name: Cluster of Building Thermal Loads Agent (CBTL/A), Cluster of Building Electrical Loads Agent (CBEL/A)

section_content: ( )

BEL/As aggregate the responses they receive from the BEL/As they control in order to model the electrical load profiles of the clusters of residential buildings.
section_name: Cluster of buildings flexibility

section_content: An innovative flexibility of cluster PEVs to adjust its active power at time, (, ), is suggested in [25], and was also followed in the present work as defined in Equation (19). 

where (, ) is the moment in time when the SoC trajectory passes SoC or SoC bounds, assuming that the cluster of PEVs absorbs or injects active power or, respectively, as shown in Figure 4. The CEV index denotes the cluster of PEVs; BEL/As aggregate the responses they receive from the BEL/As they control in order to model the electrical load profiles of the clusters of residential buildings.
section_name: Cluster of Plug-In Electric Vehicles Agent (CPEV/A)

section_content: An innovative flexibility of cluster PEVs to adjust its active power at time t, f lex CPEV (c, t), is suggested in [25], and was also followed in the present work as defined in Equation (19). 

where t (c, t) is the moment in time when the SoC trajectory passes SoC high or SoC low bounds, assuming that the cth cluster of PEVs absorbs or injects active power P min or P max, respectively, as shown in Figure 4. The CEV index denotes the cluster of PEVs;

SoC high, SoC low are the maximum and minimum stored energy by CEV; and P max, P min are the active power boundaries of CEV. Moreover, CPEV/As define suitable flexibilities (, ) by exploiting fuzzy logic in a similar way to the flexibilities (, ) defined by CBTL/As. Both inputs and the output were fuzzified using five sets with linguistic variables. The inputs of the fuzzy logic system are the flexibility of a cluster of PEVs to adjust its active power at time, (, ), and the node voltage deviation from its upper or lower bound. The output of the fuzzy logic was determined by defining the rules indicated in Table 1. The obtained flexibility, was used by ADNM/A to optimally dispatch the total active power of the aggregate battery of PEVs to each CPEV/A.
section_name: Cluster of Plug-In Electric Vehicles Agent (CPEV/A)

section_content: ADNM/A gathers the aggregated responses from the cluster agents as well as the information for the forecasted price of electricity, the node loads of the network, and the power produced by RESs. 

Equations ( 20 )-( 27 ) can be used to estimate the time-varying maximum and minimum bounds of the buildings' electric power consumption. Moreover, CPEV/As define suitable flexibilities (FL CPEV, f z ) by exploiting fuzzy logic in a similar way to the flexibilities (FL CB, f z ) defined by CBTL/As. Both inputs and the output were fuzzified using five sets with linguistic variables. The inputs of the fuzzy logic system are the flexibility of a cluster of PEVs to adjust its active power at time t, f lex CPEV (c, t), and the node voltage deviation from its upper or lower bound. The output of the fuzzy logic was determined by defining the rules indicated in Table 1. The obtained flexibility FL CPEV, f z was used by ADNM/A to optimally dispatch the total active power of the aggregate battery of PEVs to each CPEV/A.
section_name: Active Distribution Network Management Agent (ADNM/A)

section_content: ADNM/A gathers the aggregated responses from the cluster agents as well as the information for the forecasted price of electricity, the node loads of the network, and the power produced by RESs. 

Equations ( 20 )-( 27 ) can be used to estimate the time-varying maximum and minimum bounds of the buildings' electric power consumption. 

P HVAC,total,min (t) = ∑ CB P HVAC,CB,min (t)

P EL,total,max (t) = ∑ CB P EL,CB,max (t)

P EL,total,min (t) = ∑ CB P EL,CB,min (t)

with

P HVAC,CB,min (t) = ∑ b P HVAC,b,min (t)

P EL,CB,min (t) = ∑ b P EL,b,min (t) (27) where P HVAC,b,max,P HVAC,b,min are the bth building's HVAC system power consumption boundaries; P HVAC,CB,max,P HVAC,CB,min are the respective boundaries of CBTL/A; P HVAC,total,max,P HVAC,total,min are buildings' total HVAC power consumption boundaries; P EL,b,max,P EL,b,min are the bth building's electrical load consumption boundaries; P EL,CB,max,P EL,CB,min are the respective boundaries of CBEL/A; and P EL,total,max,P EL,total,min are the total electrical loads' power consumption boundaries. Equations ( 28 )-( 35 ) can be used to estimate the time-varying maximum and minimum bounds of the power and stored energy of the aggregate battery. 

with

The PEVs' plugging and unplugging over time affects the total stored energy of the dynamic equivalent aggregate battery. The resulting change of the aggregate SoC is indicated by SoC PB,di f f and estimated in Equations ( 36 )-(38). 

Equation (39) indicates the total stored energy of the equivalent PEVs' battery at the next time interval, assuming that P PB,total (t) is the optimal total active power of the aggregate battery and by adopting a generator convention. 

where n ch, n disch are the PEVs' charging (discharging) efficiency coefficients; SoC 0 is the level of energy at the beginning of charging; SoC target is the target level of the stored energy at the end of charging; SoC 0,CEV is the level of the stored energy of a cluster of PEVs at t o ; SoC T,CEV is the target level of the stored energy of a cluster of PEVs at time t f ; SoC PB,high, SoC PB,low are the maximum/minimum stored energy by the PEVs' aggregate battery, respectively; SoC CEV,high, SoC CEV,low are the maximum/minimum stored energy by a cluster of PEVs; P CEV,max, P CEV,min are the active power boundaries of a cluster of PEVs; and P PB,max, P PB,min are the power boundaries of the PEVs' aggregate battery. Then, the ADN exploits an optimization technique for the optimal scheduling of its operation. Specifically, ADN uses particle swarm optimization (PSO), which is one of the most highly efficient heuristic methods and is remarkably simple to implement. PSO has been proven to be very robust and efficient for application in complex optimization problems as it does not depend on the selected initial point and leads to a global optimum with a high rate of success. However, it should be noted that no optimization method can guarantee convergence to the global optimum with a 100% rate of success. ADN provides the optimal total electric power consumption of the HVAC systems of all of the hosted residential buildings and the optimal active power of the PEVs' aggregate battery. The structure of each particle of the swarm with its different parts comprising the respective decision variables of the optimization of the ADN is given in Figure 5. Constrained OPF can be exploited to keep the voltages of the active distribution network and the currents of the power lines between the permissible boundaries. Then, the active and reactive power set-points that resulted from the OPF exploitation are forwarded back to the appropriate cluster agents to be suitably dispatched to the local agents they manage.
section_name: Active Distribution Network Management Agent (ADNM/A)

section_content: where, are the PEVs' charging (discharging) efficiency coefficients; is the level of energy at the beginning of charging; is the target level of the stored energy at the end of charging;, is the level of the stored energy of a cluster of PEVs at to;, is the target level of the stored energy of a cluster of PEVs at time tf;,,, are the maximum/minimum stored energy by the PEVs' aggregate battery, respectively;,,, are the maximum/minimum stored energy by a cluster of PEVs;,,, are the active power boundaries of a cluster of PEVs; and,,, are the power boundaries of the PEVs' aggregate battery. Then, the ADN exploits an optimization technique for the optimal scheduling of its operation. Specifically, ADN uses particle swarm optimization (PSO), which is one of the most highly efficient heuristic methods and is remarkably simple to implement. PSO has been proven to be very robust and efficient for application in complex optimization problems as it does not depend on the selected initial point and leads to a global optimum with a high rate of success. However, it should be noted that no optimization method can guarantee convergence to the global optimum with a 100% rate of success. ADN provides the optimal total electric power consumption of the HVAC systems of all of the hosted residential buildings and the optimal active power of the PEVs' aggregate battery. The structure of each particle of the swarm with its different parts comprising the respective decision variables of the optimization of the ADN is given in Figure 5. Constrained OPF can be exploited to keep the voltages of the active distribution network and the currents of the power lines between the permissible boundaries. Then, the active and reactive power setpoints that resulted from the OPF exploitation are forwarded back to the appropriate cluster agents to be suitably dispatched to the local agents they manage. where EP denotes the variable price of electricity (m. u. /MWh) and is the power of the main electric grid. 

Then, ADNM/A optimally dispatches the total HVAC electric consumption of residential buildings (, ) to the CBTL/As it supervises according to Equation (41) and the obtained active and reactive power set-points are delivered back to these clusters. Afterward, CBTLAs dispatch their power to the local agents BTL/As they supervise and control, as formulated in Equation (42). The augmented cost function used by the PSO incorporating the imposed constraints is provided in Equation (40). The objective of the optimization procedure is to minimize the ADN's overall daily operational costs in accordance with the cost of electricity, while also fully satisfying all of the ADN components' constraints incorporated into the term (Penalty) of the objective function. 

TC ADN = min P PB,total, P HVAC,total

where EP denotes the variable price of electricity (m. u. /MWh) and P grid is the power of the main electric grid. Then, ADNM/A optimally dispatches the total HVAC electric consumption of residential buildings (P HVAC,total ) to the CBTL/As it supervises according to Equation (41) and the obtained active and reactive power set-points are delivered back to these clusters. Afterward, CBTLAs dispatch their power to the local agents BTL/As they supervise and control, as formulated in Equation (42). 

where V CB is the sum of the volumes of the buildings belonging to the respective cluster of buildings denoted by CB. The process of the HVAC system's optimal power dispatch to the CBTL/As and then to the local agents BTL/As and more specifically to each hosted residential building is depicted in Figure 6. The average execution time of this process was 0. 035 s for the examined system.
section_name: 𝑆𝑜𝐶 (𝑡

section_content: , () =

where is the sum of the volumes of the buildings belonging to the respective cluster of buildings denoted by CB. The process of the HVAC system's optimal power dispatch to the CBTL/As and then to the local agents BTL/As and more specifically to each hosted residential building is depicted in Figure 6. The average execution time of this process was 0. 035 s for the examined system. A last optimization problem was solved for the optimal dispatch of the total power of the dynamic equivalent aggregate battery to CPEV/As and then to each PEV as formulated and described in detail in [25]. The optimization problem that optimally dispatches the active power of a cluster of PEVs to each PEV it supervises in a way that the sum of PEV flexibilities is maximized and all the technical and operational constraints of the PEVs are satisfied is described next. The augmented objective function of the examined optimization problem is given in Equation (43).
section_name: 𝑃

section_content: The optimization process for the optimal operation scheduling of the examined ADN is subjected to the following constraints. A last optimization problem was solved for the optimal dispatch of the total power of the dynamic equivalent aggregate battery to CPEV/As and then to each PEV as formulated and described in detail in [25]. The optimization problem that optimally dispatches the active power of a cluster of PEVs to each PEV it supervises in a way that the sum of PEV flexibilities is maximized and all the technical and operational constraints of the PEVs are satisfied is described next. The augmented objective function of the examined optimization problem is given in Equation (43). 

The optimization process for the optimal operation scheduling of the examined ADN is subjected to the following constraints. 

where V and θ are the vectors representing the amplitudes and the angles of the distribution network voltages and Y is the network admittance matrix. |V(k)| denotes the voltage amplitude of the kth node; θ(k) is the voltage angle at the kth node; and I max (k, l) is the maximum current flowing in the electric line connecting the kth and lth node. The S inj vector comprises the complex apparent power injections at the nodes of the network, while the P inj and Q inj vectors comprise the active and reactive power injections at all network nodes, respectively. MatPower was used to solve the optimal power flow (OPF) problem subject to the constraints defined in Equations ( 65 )-(70).
section_name: 𝑚𝑎𝑥 ( , ) 𝑓𝑙𝑒𝑥 (𝑖, 𝑡 + 𝛥𝑡) (43)

section_content: The suggested approach was applied to a case study comprising the IEEE 33-bus radial distribution network with 1000 residential building prosumers, 32 clusters of PEVs, one wind park, and three photovoltaic parks integrated to it. The developed models were verified through detailed simulation results. 

Four types of residential buildings and PEVs with different technical specifications were considered in this work. Probability density functions (PDFs) were used to obtain the arrival and dwell periods of the PEVs and can be found in [16]. Figure 7a shows the total number of connected PEVs to the distribution network, while Figure 7b shows the number of connected PEVs to each node of the network. In order to take into consideration the stochastic behavior of the ambient temperature, various trajectories were generated and used. Figure 8a displays the base trajectory of the dataset selected for demonstration purposes together with its variation area. Similarly, various trajectories of the actual electricity price were randomly generated and the respective data are shown in Figure 8b. where and are the vectors representing the amplitudes and the angles of the distribution network voltages and is the network admittance matrix. |()| denotes the voltage amplitude of the node; () is the voltage angle at the node; and (, ) is the maximum current flowing in the electric line connecting the and node. The vector comprises the complex apparent power injections at the nodes of the network, while the and vectors comprise the active and reactive power injections at all network nodes, respectively. 

MatPower was used to solve the optimal power flow (OPF) problem subject to the constraints defined in Equations ( 65 )-(70).
section_name: Case Study

section_content: The suggested approach was applied to a case study comprising the IEEE 33-bus radial distribution network with 1000 residential building prosumers, 32 clusters of PEVs, one wind park, and three photovoltaic parks integrated to it. The developed models were verified through detailed simulation results. 

Four types of residential buildings and PEVs with different technical specifications were considered in this work. Probability density functions (PDFs) were used to obtain the arrival and dwell periods of the PEVs and can be found in [16]. Figure 7a shows the total number of connected PEVs to the distribution network, while Figure 7b shows the number of connected PEVs to each node of the network. In order to take into consideration the stochastic behavior of the ambient temperature, various trajectories were generated and used. Figure 8a displays the base trajectory of the dataset selected for demonstration purposes together with its variation area. Similarly, various trajectories of the actual electricity price were randomly generated and the respective data are shown in Figure 8b. Various trajectories of the total ADN load consumption as well as of the total power generated by the wind park and the photovoltaics were randomly generated and the respective data are shown in Figure 9a,b, respectively. In addition to the proposed optimization approach, a typical ADN operation case study was considered, in which the residential building thermal loads as well as the hosted electric vehicles were not subject to any optimization. In this case, the objective of the operation of the HVAC system is to maintain the internal temperature of buildings at a predetermined set point. Electric vehicles only absorb power in order to charge their batteries and attain the desired energy level and they do not have a V2G operation ability. The examination of this case study was taken into account in order to compare its results with the respective results of the proposed strategy for the optimization of the operation of the ADN. 

The total HVAC electrical power consumption and electrical power consumption of the other building loads of all residential buildings hosted in the examined active distribution network are given in Figure 10a. As can be observed, the residential buildings absorbed the largest amount of thermal power around 15:00 p. m., when the electricity price was very low, as the proposed algorithm aims to reduce the total operation cost of the examined system. Moreover, in this time period, the ambient temperature is high enough, and obviously the cooling requirements of the residences are increased. Figure 10b provides the comparison of the total buildings' HVAC power consumption between the Various trajectories of the total ADN load consumption as well as of the total power generated by the wind park and the photovoltaics were randomly generated and the respective data are shown in Figure 9a,b, respectively. In addition to the proposed optimization approach, a typical ADN operation case study was considered, in which the residential building thermal loads as well as the hosted electric vehicles were not subject to any optimization. In this case, the objective of the operation of the HVAC system is to maintain the internal temperature of buildings at a predetermined set point. Electric vehicles only absorb power in order to charge their batteries and attain the desired energy level and they do not have a V2G operation ability. The examination of this case study was taken into account in order to compare its results with the respective results of the proposed strategy for the optimization of the operation of the ADN. 

The total HVAC electrical power consumption and electrical power consumption of the other building loads of all residential buildings hosted in the examined active distribution network are given in Figure 10a. As can be observed, the residential buildings absorbed the largest amount of thermal power around 15:00 p. m., when the electricity price was very low, as the proposed algorithm aims to reduce the total operation cost of the examined system. Moreover, in this time period, the ambient temperature is high enough, and obviously the cooling requirements of the residences are increased. Figure 10b provides the comparison of the total buildings' HVAC power consumption between the In addition to the proposed optimization approach, a typical ADN operation case study was considered, in which the residential building thermal loads as well as the hosted electric vehicles were not subject to any optimization. In this case, the objective of the operation of the HVAC system is to maintain the internal temperature of buildings at a predetermined set point. Electric vehicles only absorb power in order to charge their batteries and attain the desired energy level and they do not have a V2G operation ability. The examination of this case study was taken into account in order to compare its results with the respective results of the proposed strategy for the optimization of the operation of the ADN. 

The total HVAC electrical power consumption and electrical power consumption of the other building loads of all residential buildings hosted in the examined active distribution network are given in Figure 10a. As can be observed, the residential buildings absorbed the largest amount of thermal power around 15:00 p. m., when the electricity price was very low, as the proposed algorithm aims to reduce the total operation cost of the examined system. Moreover, in this time period, the ambient temperature is high enough, and obviously the cooling requirements of the residences are increased. Figure 10b provides the comparison of the total buildings' HVAC power consumption between the proposed optimization examined case study and the typical scenario of the ADN's operation. It was observed that when the suggested optimization algorithm was implemented, a significant reduction in the HVAC systems' required power was achieved. Figure 11 depicts the HVAC system's power consumption of the clusters of the buildings connected to the distribution network nodes as a result of the optimal dispatch of the respective total HVAC system's power consumption. These vary due to the fact that each node comprises a different number of residential buildings with different technical specifications. proposed optimization examined case study and the typical scenario of the ADN's operation. It was observed that when the suggested optimization algorithm was implemented, a significant reduction in the HVAC systems' required power was achieved. Figure 11 depicts the HVAC system's power consumption of the clusters of the buildings connected to the distribution network nodes as a result of the optimal dispatch of the respective total HVAC system's power consumption. These vary due to the fact that each node comprises a different number of residential buildings with different technical specifications. 

(a) (b) Figure 12a,b presents the indoor temperatures of all buildings hosted by the ADN obtained by the proposed ADN optimal operation scheduling technique and the execution of the typical ADN operation, respectively. All temperatures were maintained within the considered permissible comfort range of 21 -26 °C. Figure 13 depicts the power consumed by the non-flexible electrical loads of two indicative residential buildings hosted in the examined ADN. These energy consumption profiles were obtained by the building electrical agent that belongs to the category of MAS local agents. proposed optimization examined case study and the typical scenario of the ADN's operation. It was observed that when the suggested optimization algorithm was implemented, a significant reduction in the HVAC systems' required power was achieved. Figure 11 depicts the HVAC system's power consumption of the clusters of the buildings connected to the distribution network nodes as a result of the optimal dispatch of the respective total HVAC system's power consumption. These vary due to the fact that each node comprises a different number of residential buildings with different technical specifications. Figure 12a,b presents the indoor temperatures of all buildings hosted by the ADN obtained by the proposed ADN optimal operation scheduling technique and the execution of the typical ADN operation, respectively. All temperatures were maintained within the considered permissible comfort range of 21 -26 °C. Figure 13 depicts the power consumed by the non-flexible electrical loads of two indicative residential buildings hosted in the examined ADN. These energy consumption profiles were obtained by the building electrical agent that belongs to the category of MAS local agents. Figure 14a,b depicts the total active power and the stored energy of the aggregated batteries of the PEVs together with their respective upper and lower limits. These trajectories were obtained by the application of the proposed ADN optimal operation scheduling technique and the business-as-usual ADN operation scenario. Positive power means that the equivalent aggregate battery injects power to the main grid. Figure 14a,b depicts the total active power and the stored energy of the aggregated batteries of the PEVs together with their respective upper and lower limits. These trajectories were obtained by the application of the proposed ADN optimal operation scheduling technique and the business-as-usual ADN operation scenario. Positive power means that the equivalent aggregate battery injects power to the main grid. Figure 14a,b depicts the total active power and the stored energy of the aggregated batteries of the PEVs together with their respective upper and lower limits. These trajectories were obtained by the application of the proposed ADN optimal operation scheduling technique and the business-as-usual ADN operation scenario. Positive power means that the equivalent aggregate battery injects power to the main grid. Figure 14a,b depicts the total active power and the stored energy of the aggregated batteries of the PEVs together with their respective upper and lower limits. These trajectories were obtained by the application of the proposed ADN optimal operation scheduling technique and the business-as-usual ADN operation scenario. Positive power means that the equivalent aggregate battery injects power to the main grid. The energy stored in the equivalent aggregate battery of the PEVs as well as the respective upper and the lower limits shown in Figure 14b vary with time because of the continuously changing number of PEVs and the electricity price variations. In the optimal operation scenario, it was observed that the proposed algorithm stores energy in time periods of low electricity price (e. g., at 15:00), as the goal of the applied optimization strategy is to minimize the daily operation cost of the ADN. In the business-as-usual scenario, "dump charging" was applied to the PEVs. As shown in Figure 14a, the total power of the equivalent aggregate battery took exclusively negative values, which means that given the used generator convention, the PEVs only absorb the necessary amount of energy from the main grid in order to charge their batteries and reach the desired energy target at their disconnection time. In both of the examined scenarios, the obtained results verified that all PEVs reached their stored energy target, while all of their technical and operational constraints were satisfied. 

Figures 15a and 16a depict the active power of two indicative clusters of PEVs located at nodes 21 and 31 of the examined ADN, while Figures 15b and 16b depict their stored energy, respectively. Moreover, their corresponding limits are given in the same figures. It was noticed that both the active power that clusters of PEVs share with the network and their battery energy were kept between their permitted ranges. These quantities were obtained by the implementation of the optimal dispatch of the total active power of the network's equivalent aggregate PEV battery, according to the proposed flexibilities of the PEV clusters to change their power. The energy stored in the equivalent aggregate battery of the PEVs as well as the respective upper and the lower limits shown in Figure 14b vary with time because of the continuously changing number of PEVs and the electricity price variations. In the optimal operation scenario, it was observed that the proposed algorithm stores energy in time periods of low electricity price (e. g., at 15:00), as the goal of the applied optimization strategy is to minimize the daily operation cost of the ADN. In the business-as-usual scenario, "dump charging" was applied to the PEVs. As shown in Figure 14a, the total power of the equivalent aggregate battery took exclusively negative values, which means that given the used generator convention, the PEVs only absorb the necessary amount of energy from the main grid in order to charge their batteries and reach the desired energy target at their disconnection time. In both of the examined scenarios, the obtained results verified that all PEVs reached their stored energy target, while all of their technical and operational constraints were satisfied. 

Figures 15a and 16a depict the active power of two indicative clusters of PEVs located at nodes 21 and 31 of the examined ADN, while Figures 15b and 16b depict their stored energy, respectively. Moreover, their corresponding limits are given in the same figures. It was noticed that both the active power that clusters of PEVs share with the network and their battery energy were kept between their permitted ranges. These quantities were obtained by the implementation of the optimal dispatch of the total active power of the network's equivalent aggregate PEV battery, according to the proposed flexibilities of the PEV clusters to change their power. The energy stored in the equivalent aggregate battery of the PEVs as well as the respective upper and the lower limits shown in Figure 14b vary with time because of the continuously changing number of PEVs and the electricity price variations. In the optimal operation scenario, it was observed that the proposed algorithm stores energy in time periods of low electricity price (e. g., at 15:00), as the goal of the applied optimization strategy is to minimize the daily operation cost of the ADN. In the business-as-usual scenario, "dump charging" was applied to the PEVs. As shown in Figure 14a, the total power of the equivalent aggregate battery took exclusively negative values, which means that given the used generator convention, the PEVs only absorb the necessary amount of energy from the main grid in order to charge their batteries and reach the desired energy target at their disconnection time. In both of the examined scenarios, the obtained results verified that all PEVs reached their stored energy target, while all of their technical and operational constraints were satisfied. 

Figures 15a and 16a depict the active power of two indicative clusters of PEVs located at nodes 21 and 31 of the examined ADN, while Figures 15b and 16b depict their stored energy, respectively. Moreover, their corresponding limits are given in the same figures. It was noticed that both the active power that clusters of PEVs share with the network and their battery energy were kept between their permitted ranges. These quantities were obtained by the implementation of the optimal dispatch of the total active power of the network's equivalent aggregate PEV battery, according to the proposed flexibilities of the PEV clusters to change their power. The total power consumptions of the buildings and PEVs together with the ADN load, the active power the distribution network exchanges with the main electric grid, and RES generation are shown in stacked form in Figure 17. The total power consumptions of the buildings and PEVs together with the ADN load, the active power the distribution network exchanges with the main electric grid, and RES generation are shown in stacked form in Figure 17. Figure 18a indicates that the reactive power set-points of each PEV cluster resulted from the OPF problem solution in order to keep the voltages of the distribution network busses between their permissible bounds and to meet the power flow constraints. Specifically, the reactive power set-points resulted from the OPF exploitation are forwarded back to the PEVs' cluster agents to be optimally dispatched to each PEV they supervise. The maximum and minimum voltage bounds were set to 1. 1 and 0. 9 (p. u. ), respectively, while the nominal voltage was considered as 1 p. u. As shown in Figure 18b, all node voltages did not violate their bounds. The reactive powers of the PEV clusters and the voltages of the nodes of the examined ADN are indicated with different colors in Figure 18a Figure 18a indicates that the reactive power set-points of each PEV cluster resulted from the OPF problem solution in order to keep the voltages of the distribution network busses between their permissible bounds and to meet the power flow constraints. Specifically, the reactive power set-points resulted from the OPF exploitation are forwarded back to the PEVs' cluster agents to be optimally dispatched to each PEV they supervise. The maximum and minimum voltage bounds were set to 1. 1 and 0. 9 (p. u. ), respectively, while the nominal voltage was considered as 1 p. u. As shown in Figure 18b, all node voltages did not violate their bounds. The reactive powers of the PEV clusters and the voltages of the nodes of the examined ADN are indicated with different colors in Figures 18a and 18b, respectively. 

Appl. Sci. 2023, 13, x FOR PEER REVIEW 19 of 22

The total power consumptions of the buildings and PEVs together with the ADN load, the active power the distribution network exchanges with the main electric grid, and RES generation are shown in stacked form in Figure 17. Figure 18a indicates that the reactive power set-points of each PEV cluster resulted from the OPF problem solution in order to keep the voltages of the distribution network busses between their permissible bounds and to meet the power flow constraints. Specifically, the reactive power set-points resulted from the OPF exploitation are forwarded back to the PEVs' cluster agents to be optimally dispatched to each PEV they supervise. The maximum and minimum voltage bounds were set to 1. 1 and 0. 9 (p. u. ), respectively, while the nominal voltage was considered as 1 p. u. As shown in Figure 18b, all node voltages did not violate their bounds. The reactive powers of the PEV clusters and the voltages of the nodes of the examined ADN are indicated with different colors in Figure 18a The active power the distribution network exchanges with the main electric grid both in its optimal and business as usual operation is given in Figure 19. The proposed method aims to reduce the overall operation cost of the ADN by shifting the power demand in time periods with low electricity price. It was verified in the optimal operation scenario that the main electric power grid supplies the ADN with large amounts of power when the electricity price is low, while the opposite happens when the electricity price is high. Detailed simulation results showed that significant cost reduction in the range of 17% was achieved by the application of the suggested optimization algorithm in comparison with the business as usual operation scenario of the ADN. Therefore, as shown in Figure 19, although there were time periods when the active power exchanged between the ADN and the main electric grid received higher values in the optimal operation scenario in comparison with the business-as-usual scenario, the total ADN's operation cost was significantly reduced at the end of the 24-h time period. Moreover, the obtained results show that the total active energy the ADN needs to absorb from the main electric grid to meet its 24-h energy demand is reduced in the range of 6. 18%, when the suggested optimization technique is applied compared to the typical operation scenario of the ADN. The active power the distribution network exchanges with the main electric grid both in its optimal and business as usual operation is given in Figure 19. The proposed method aims to reduce the overall operation cost of the ADN by shifting the power demand in time periods with low electricity price. It was verified in the optimal operation scenario that the main electric power grid supplies the ADN with large amounts of power when the electricity price is low, while the opposite happens when the electricity price is high. Detailed simulation results showed that significant cost reduction in the range of 17% was achieved by the application of the suggested optimization algorithm in comparison with the business as usual operation scenario of the ADN. Therefore, as shown in Figure 19, although there were time periods when the active power exchanged between the ADN and the main electric grid received higher values in the optimal operation scenario in comparison with the business-as-usual scenario, the total ADN's operation cost was significantly reduced at the end of the 24-h time period. Moreover, the obtained results show that the total active energy the ADN needs to absorb from the main electric grid to meet its 24-h energy demand is reduced in the range of 6. 18%, when the suggested optimization technique is applied compared to the typical operation scenario of the ADN. The major information of the obtained cost resulting from the execution of the examined operation case studies is tabulated in Table 2. A significant cost reduction of 2478 m. u. /day was achieved as a result of the implementation of the suggested optimization algorithm in comparison with a typical operation of the ADN. In addition, when the uncertainty of the ambient temperature and the electricity price were taken into consideration, and a slight increase of 0. 92% in the daily operation cost of the examined system was observed. The proposed method only requires one round of communications between the agents. It was proven that the total time required for the computations and communications is very low, rendering the suggested method ideal for real-world applications in distribution networks hosting large building prosumers and PEVs. A typical average agent to agent communication latency is 0. 15 s according to [31]. The required computation time to model the buildings' loads in this study was 0. 1 s. Moreover, the execution of The major information of the obtained cost resulting from the execution of the examined operation case studies is tabulated in Table 2. A significant cost reduction of 2478 m. u. /day was achieved as a result of the implementation of the suggested optimization algorithm in comparison with a typical operation of the ADN. In addition, when the uncertainty of the ambient temperature and the electricity price were taken into consideration, and a slight increase of 0. 92% in the daily operation cost of the examined system was observed. The proposed method only requires one round of communications between the agents. It was proven that the total time required for the computations and communications is very low, rendering the suggested method ideal for real-world applications in distribution networks hosting large building prosumers and PEVs. A typical average agent to agent communication latency is 0. 15 s according to [31]. The required computation time to model the buildings' loads in this study was 0. 1 s. Moreover, the execution of the optimal operation scheduling of the examined ADN requires on average 1517. 2 s. Based on the aforementioned, the maximum expected time for the calculations and communications was T = 4 × 0. 15 s + 2 × 0. 1 s + 1517. 2 s = 1518 s, which is absolutely satisfactory for the day-ahead operation scheduling of such complex ADN.
section_name: Case Study

section_content: In this paper, an optimization method for the optimal and sustainable operation of active distribution networks hosting smart residential building prosumers, plug-in electric vehicle aggregators, and RES was proposed. The suggested power management system simultaneously satisfies a large number of operation and technical constraints of the ADN and its components. The implementation of the method was based on the exploitation of a properly designed hierarchical MAS. The goals of each type of agent and how they cooperate to accomplish them were fully outlined. Smart power dispatch techniques were also developed and applied to each cluster of buildings and electric vehicles, and additionally to each residential building and PEV hosted by the ADN to reduce the number of decision variables. Moreover, the algorithm achieved a notable reduction in the range of 17% in the daily operation cost of the examined system. The hosted PEVs and RES ensure the autonomous operation of the ADN, eliminating the need to invest in conventional polluting reducing in this way greenhouse gas emissions. Consequently, the suggested approach for the optimal operation of the ADN aligns with the growing need for sustainable development. Detailed simulations of a suitably modified IEEE 33-bus test case system proved the effectiveness of the proposed strategy. As a future extension of our work, advanced control methodologies providing ancillary services by building thermal and electrical energy systems and energy storage facilities can be developed and integrated to the proposed one. Moreover, a comparison of the PSO performance application to the examined problem with other heuristic optimization methods could a future endeavor.
section_name: Conclusions

section_name: Institutional Review Board Statement: Not applicable.

section_content: Funding: This research received no external funding.

section_content: Informed Consent Statement: Not applicable.
section_name: Institutional Review Board Statement: Not applicable.

section_name: Conflicts of Interest:

section_content: Data Availability Statement: Not applicable.

section_content: The authors declare no conflict of interest.
section_name: Conflicts of Interest:

section_content: where COP is the HVAC system performance coefficient and T max,b, T min,b are the internal temperature boundaries of the bth building ( • C). 

where P grid,max, P grid,min are the power exchange boundaries of the ADN with the main electric grid; P PV is the photovoltaic power production; P WT is the wind turbine power production; and P DNload is the load of the ADN.