Distributed Transactive Coordination of Residential Communities Aiming at Fulfilling Households’ Preferences

Transactive energy (TE) provides joint market and control functionality to manage distributed energy resources (DERs) in distribution networks. This work develops a real-time TE management framework that allows residential customers to actively join in the real-time transactive market with fulfilling households’ preferences including comfort, economical energy consumption, and privacy-preserving. In this regard, first, a user-friendly algorithm is developed to calculate the real-time willingness to pay (bid) for electric vehicles (EVs) and heating, ventilation, and air conditioning (HVAC) units considering customers’ preferences and concerns. Then, to preserve the privacy of households, the centralized market-clearing problem to maximize social welfare is decomposed into several subproblems using the alternating direction method of multipliers (ADMM) approach. Also, closed-form solutions to all subproblems are derived to simplify implementation and mitigate the computational complexity instead of solving optimization subproblems directly. This model is then implemented in a case study with several numbers of smart homes. The numerical results illustrate that the proposed distributed transactive model not only satisfies households’ comfort preferences but also decreases the average charging cost of EV batteries by 40% compared to the uncontrolled charging model. Further, the results show that our proposed model significantly mitigates the computational burden of the transactive market clearing problem compared to the centralized approach and the distributed approach without closed-form solutions.

Average net load at time t.

I. INTRODUCTION A. BACKGROUND AND MOTIVATION
The penetration of household-owned distributed energy resources (DERs), from solar photovoltaic (PV) systems, electric vehicles (EVs), and responsive loads, at the demand side of power systems, has been growing steadily in recent years. In parallel, technological advances in data acquisition, as well as consumer-level communication and control result in the existence of smart homes [1]. Smart homes are consumers/prosumers that are equipped with home energy management systems (HEMSs) to schedule responsive assets with two main goals: i) reducing energy payments and ii) maintaining an acceptable level of comfort. Moreover, the massive deployment of smart homes with small-scale DERs raises operational challenges. Thus, policymakers are rethinking to design of energy management mechanisms for more efficient integration of these types of resources into the distribution level of power systems [2], [3].
To help integrate prosumers into distribution systems, the concept of TE has been presented in the smart grid context. The TE management technique organizes an energy trading platform that allows prosumers to participate actively in the local electricity market. One area of concern for discussion of TE is related to the policy and market design. In [4], distribution level market designs are categorized into three main groups including peer-to-peer (P2P) models, organized prosumer groups, and prosumer-to-grid models. In the P2P models, each individual prosumer directly negotiates with its trading partners with the goal of maximizing its own benefits [5]. Moreover, a common example of the second group, i.e., organized prosumer groups, is the virtual power plant (VPP) which manages a large number of prosumers and allows them to participate in the electricity market in a collective way [6]. And finally, the concept of micro-grid (MG) can be introduced as an example of the third group.

B. RELATED WORKS
In the literature, several works have studied the TE market design to propose efficient coordination mechanisms for prosumers. These coordination mechanisms can be categorized into two classes, i.e., centralized and distributed models. In the centralized models, all prosumers determine and send their offered flexibility to a central energy management agent, and the optimization problem is solved by the central intermediary [7], [8], [9], [10], [11], [12]. Authors in [7] proposed a transactive coordination model to adjust HVAC loads in a double-auction market by the retail market operator (RMO) as a central intermediary. In [8], a coordination model using a centralized operational strategy has been proposed which is conducted by the distribution system operator (DSO). In this work, the DSO centrally manages the generation and consumption of prosumers and maintains the system operational constraints within safe boundaries. Reference [9] developed a transactive charging management framework for plugged-in EVs in a residential building. In this model, the EVs submit the real-time charging requirements to the building energy management system (BEMS), and then the optimization problem with the objective function of maximizing the profit of BEMS is solved to determine the charging decisions of EVs. The work reported in [10] proposed a real-time EV charging management model using a centralized market clearing scheme considering distribution network constraints. In this study, the EVs submit their estimated bids and offers respectively for charging and discharging modes to the RMO. Then, the RMO clears the real-time retail market and the charging/discharging decisions of EVs are determined. And finally, [11] developed a centralized transactive market platform to coordinate real-time charging of EVs with voltage management capability.
The above-reviewed articles have provided significant insights into the centralized TE management of prosumers. Although centralized approaches are easy to design and implement, due to some disadvantages such as privacy concerns and computational intractability, distributed coordination and control approaches have been extensively investigated in recent years. The distributed coordination approach is run by allowing market players to iteratively share information through two-way communication links. This category of coordination can be realized as decentralized and hierarchical schemes, where the former distributes the computations across agents, and the latter distributes the computational loads across both agents and coordinators [13]. In the previous works, several studies have examined the distributed coordination of prosumers [14], [15], [16], [17], [18], [19], [20], [21], [22]. Yu et al. [14] proposed an algorithm to determine the bidding strategy of prosumers for participating in the local market. Further, this reference presented a new distributed market-clearing model to manage the exchange of energy among prosumers. In [15], a novel optimization model based on the ADMM technique is developed to coordinate generation and demand units in the demand response program. In this model, the generation and aggregated demand units estimate the power generating cost function and the consumer's utility function, and accordingly, the social welfare maximization problem is solved in a distributed manner. A decentralized energy management framework for prosumers in the smart grid context has been presented in [16]. In this work, instead of the bilateral negotiation, an iterative matching procedure is utilized to mitigate the communication overhead. Although the above-reviewed distributed coordination models bring some advantages, the active participation of small-scale DERs such as EVs and HVAC units has not been considered.
Authors in [17] proposed a market platform to coordinate prosumers in the smart grid. In this study, a game theory-based approach is modeled to characterize the interactions among prosumers. In the presented model, each prosumer runs an optimization procedure to maximize its payoff. Authors in [18] developed a game theoretic bidding strategy framework that enables smart buildings to participate in decentralized energy trading. The bidding strategy of sellers is determined by considering the interactions among sellers and buyers/sellers with the objective of maximizing the profit of sellers. In [19], a hierarchical approach has been developed to manage prosumers in the distribution systems through the TE market. The presented model enables prosumers to join a P2P market by submitting their offering and bidding curves to the RMO. Also, [20] proposed a hierarchical TE model to coordinate smart homes with EVs and HVAC units. In this study, a bidding strategy algorithm has been developed to enable the active participation of home residents in the proposed TE market. And finally, authors in [21] proposed a decentralized energy trading framework among prosumers in the distribution system. According to the proposed model in this reference, each prosumer will determine the amount of energy that they are willing to trade. Accordingly, the trading pairs and the corresponding settlement prices are calculated.
Finally, Table 1 reports a summary of related research works and the proposed model from viewpoints of market players' preferences, their active participation, and the computational efficiency of the coordination model.

C. MAIN CONTRIBUTIONS
Regarding the above literature review, the main drawback of the reviewed studies is summarized in the lack of a transactive coordination model that enables smart homes i) to easily and actively participate in the real-time transactive market ii) to fulfill households' preferences including comfort, economical energy consumption, and privacy-preserving. This paper amends the above shortcoming by proposing a new real-time TE management framework to coordinate smart homes with EVs and HVAC units in a residential community.
In general, households are unwilling (and even unable) to determine the generating cost and utility functions to participate in the retail market. Thus, unlike [14], [15], [16], [17], [18] that have proposed market models with a large number of requirements for the involved parties (such as determining cost and utility functions), we propose a TE framework that enables households to easily participate in the retail market by developing a user-friendly bidding strategy algorithm for EVs and HVAC units. Moreover, unlike the reviewed studies in the realm of residential community-level market models that have not taken into account all preferences of customers, we propose a transactive coordination model that fully satisfies households' economic, comfort, and privacypreserving preferences. For example, the proposed TE-based coordination models in [14], [15], [16], [17], [18], and [19] have not addressed the customers' comfort issue. Besides, the transactive EV charging management models proposed in [9], [11], and [20] cannot guarantee to achieve the target stateof-charge (SOC) specified by the EV owner. In this paper, we propose a TE-based coordination framework for EVs and HVAC units that fulfills 100% satisfaction of EV owners and thermal comfort of households with no need to provide future driving plans. In the proposed model, households' comfort and economic preferences are satisfied using the proposed bidding strategy model. Besides, unlike the centralized coordination models that have not taken into account the privacy issue and computational efficiency, we employed the ADMM method for decomposing the centralized market clearing problem into several subproblems to preserve the privacy of households. In this regard, the smart homes only exchange information about their net loads with the RMO which makes that private information would never be shared with a third party. Also, to simplify implementation and improve computational efficiency, the closed-form solutions to all subproblems are derived. Regarding the above discussion, the major contributions of this study are highlighted below.
1) Proposing a real-time energy management model for transactive coordination of smart homes with EVs and HVAC units, which allows households to easily and actively participate in the local electricity markets. 2) Proposing a TE management model for smart homes that fulfills all preferences of households including comfort, economical energy consumption, and privacypreserving. In this regard, we propose a TE-based coordination model for EVs and HVAC units that not only decreases the payment of customers but also guarantees to achieve the target SOC at departure and maintain room temperature in the customer-specified comfort range with no need for private information (such as future driving plans and their temperature preferences). 3) In most studies in the realm of distributed marketclearing models, each market participant must solve an optimization subproblem to iteratively update the variables (e.g., [17], [18]). In the residential electricity market, it is more practical for smart homes to determine their EV charging and HVAC consumption without running optimization subproblems. Thus, in order to easy to implement and improve computational efficiency, the closed-form solutions to all subproblems are derived. In this regard, the simulation results show that the proposed model is suitable for a residential electricity market with a large number of smart homes and a shorter market-clearing time interval.

D. PAPER ORGANIZATION
The remainder of this paper proceeds as follows. The general structure or the proposed transactive market model is presented in Section II. The bidding strategy of EVs and HVAC units considering households' preferences is introduced in Section III. Afterward, the mathematical formulation of the distributed market-clearing problem is presented in Section IV. In this Section, the ADMM technique is employed in the form of multi-round demand-supply balancing price adjustment to reach the market equilibrium with closed-form updates. The simulation results are presented in Section V to evaluate the effectiveness of the proposed model, followed by the conclusion in Section VI.

II. PROBLEM DESCRIPTION
As stated earlier, this paper proposes a transactive coordination framework to manage smart homes with fulfilling households' preferences. In smart homes, HEMSs have two main controlling procedures, i.e., energy controller block and market controller block. The scheduling and management of available small-scale energy sources, responsive loads, and the exchanged power with the main grid are conducted by the energy controller block. On the other hand, the market controller block is responsible to participate in the retail electricity market to maintain the balance between the customer's comfort and energy payment [23] . Our focus in this study is related to the market controller block. Fig. 1 shows the flowchart of the proposed transactive market for the coordination of smart homes with EVs and HVAC units. In the proposed model, smart homes are enabled to participate in a real-time electricity market with a time interval of 15 minutes to trade energy with each other and the main grid. As shown in this figure, first, each HEMS collects its required data including time-dependent (electricity price and status of EV and HVAC unit) and time-independent data (desires of household). Then, the HEMS individually estimates the bid price and quantity of EV and HVAC unit using the proposed bidding strategy model. After that, the RMO clears the real-time retail electricity market to maximize social welfare in a distributed manner. Finally, the SOC level of EV batteries and the room temperature of all smart homes are updated to prepare the time-dependent data for the next time interval.

III. HOUSEHOLD-OWNED DERs' BIDDING STRATEGY
The market controller block is responsible to estimate the bid price-quantity of EVs and HVAC units. The methods of bidding strategy can be mainly categorized into VOLUME 10, 2022 three groups: i) optimization problem-based [14], ii) game theory-based [18], and iii) definite relational expressionbased [24]. The optimization problem-based method determines the bid/offer by solving an optimization problem while the game theory-based method deals with the interactions among agents. These two groups of bidding strategy models suffer from computational complexity and efficiency in realtime operation. In this regard, we developed a bidding model for EVs and HVAC units based on the relational expression method considering the customers' preferences and concerns. Fig. 2 illustrates the framework of the proposed bidding strategy model. As seen in this figure, each HEMS individually calculates the bid price-quantity of EV and HVAC unit based on the customer-specified input data (EV owner's departure time, target SOC level, and room temperature bounds), measured values by meters (current SOC level of EV battery and room temperature), and the estimated mean and standard deviation price over future time intervals that are sent by RMO.

A. EV's BIDDING MODEL
In general, the main purpose of customers in scheduling their responsive assets can be classified into comfort and economic criteria. In the case of the EV owner, the former relates to reaching the target SOC at departure and the latter is related to mitigating the charging cost of EV battery. This is essential to consider both criteria in the bidding strategy of EV owners. Also, the difference between the elapsed time required for reaching the target level of SOC (required time: RT ) and the time that the EV is plugged in (available time: AT ) allows timing flexibility that can be harnessed to provide grid services. Hence, when the value of RT is greater than or equal to AT , since the EV battery must be charged in the following time intervals until departure, the EV battery acts as an unresponsive load (bid price = ∞). Also, when the estimated electricity price is in the minimum value during the available time, the EV battery must be charged at the corresponding time interval (bid price = ∞). On the other hand, when the value of RT is less than AT and the electricity price is not at the minimum level, the charging of EV battery will be flexible (bid price = ∞). Based on these explanations, the EV's bid price in charging mode at time interval t is formulated as follows.
The EV's bid price is formulated according to the concept of quantile function (inverse cumulative distribution function). The quantile function of the Normal distribution is called the ''probit function'' which is expressed by means of the inverse error function (erf −1 ) [25]. Further, using the charging priority factor (Pr ch t ), the EV's bid price at time interval t is related to the estimated electricity price and the EV battery SOC level. The magnitude of Pr ch t represents the probability of the bid price is bigger than the market-clearing price over the corresponding time interval. For instance, if the electricity price is at its minimum value or the required time to reach the target level of SOC is greater than or equal to the available time, the EV battery must be charged with 100% probability, and therefore the charging priority factor must be one. On the other hand, if the electricity price is at its maximum value as well as the SOC level is equal to the target SOC (RT = 0), the charging priority factor must be zero. Therefore, this dimensionless parameter which has the value in the range of [0, 1] can be computed according to the price priority factor and the SOC priority factor as (2) − (4). Moreover, RT t and AT t can be calculated as (5) and (6), respectively.
From the viewpoint of a rational EV owner, once the estimated electricity price at the time interval t is closer to the maximum price than the minimum price at the plugged-in period since the estimated electricity price is relatively high, the EV owner prefers to charge the battery in the future hours with the lower electricity price. In this condition, as can be inferred from (3), the price priority factor is lower than 0.5 (0 < Pr price t < 0.5). On the contrary, when the estimated price is closer to the minimum price than the maximum value (0.5 < Pr price t < 1), the EV owner has more tendency to charge the battery at the corresponding time interval. In this regard, the proposed EV's bidding model decreases the probability of EV battery charging in the case of (0 < Pr price t < 0.5) and increases the probability of EV battery charging in the case of (0.5 < Pr price t < 1). Also, there is a similar relationship between the probability of EV battery charging and the SOC priority factor.
Besides, the EV's bid quantity can be calculated as follows. (8) where . represents the min function, and above equations express that the EV's bid quantity is the minimum of two parameters, i) rated charging power of EV battery, and ii) permissible charging power of EV battery due to the residual capacity.

B. HVAC's BIDDING MODEL
In order to extract the bid price of the HVAC unit, it is necessary to understand the behavior of thermostatic loads.
In the responsive HVACs, instead of trying to adjust the room temperature in a defined set-point, a customer-specified temperature range has been considered. In other words, responsive HVACs try to maintain the room temperature within the range of lower and upper bounds. Hence, a dimensionless parameter that represents the priority of the HVAC unit to be ON is defined. This parameter that changes within the range of [0, 1] is computed as follows.
The magnitude of Pr ON t represents the probability of the HVAC's bid price is bigger than the market-clearing price over the corresponding time interval. In the above equation, θ l and θ u are the customer-specified temperature lower and upper bounds, respectively, as well θ t is the room temperature at time interval t. In the traditional HVAC units without energy management systems, until the room temperature is within the range of (θ l , θ u ), the air-conditioner does not operate, and once the room temperature attains θ u , the HVAC turns on as long as the room temperature attains θ l . However, with the presented HVAC scheduling model, the responsive HVACs behave differently, although this model tries to maintain the room temperature within the customer-specified temperature range. Thus, the HVAC's bid price is formulated as follows.
where similar to the proposed EV's bidding strategy, the HVAC's bid price is computed using the probit function. According to (9) and (10), when the room temperature at time interval t is closer to the temperature lower bound than the temperature upper bound, i.e., 0 < Pr price t < 0.5, the proposed bidding model calculates a bid price lower than the estimated mean price which makes less pressure on the HVAC unit to be ON. On the contrary, once the room temperature at the corresponding time interval comes close to the temperature upper bound (θ t → θ u ), the proposed bidding model calculates a bid price greater than the estimated mean price which means more pressure on the HVAC unit to be in the ON mode.
Besides the bid price, the bid quantity of the HVAC unit has a constant value based on the HVAC sizing capacity. Moreover, the offer price of solar PV panels is considered zero, and their offer quantity is equal to the available solar power. Also, the unresponsive loads can participate in the retail electricity market with an infinite bid price.

IV. MARKET-CLEARING MECHANISM
In this section, first, the main assumptions of the proposed transactive coordination framework are described, then, the centralized market-clearing problem is formulated. Afterward, a distributed optimization algorithm based on the ADMM approach is developed to solve the market-clearing problem in a distributed manner. Finally, the closed-form solutions to all optimization subproblems are derived. The primary assumptions are represented as follows.
• Smart homes are assumed non-strategic and rational agents. In other words, each agent always takes beneficial decisions for itself, and each agent cannot forecast the decisions of other agents [26].
• The real-time electricity price in the main grid is assumed as a linear function of the imported power.
In other words, the price of the main grid is not constant and depends on the net consumption of smart homes [17].

A. CENTRALIZED MODEL
In the centralized market-clearing problem, local decisions are made centrally by having price and quantity bids/offers of market participants. In this regard, all responsive assets submit their estimated bids/offers to the RMO, and then, the market-clearing problem is solved to determine the clearing price and operational decisions of market participants. The real-time market-clearing procedure given the price-quantity bids of EVs and HVAC units, solar PV panel generation, and unresponsive loads is presented as follows.
max Obj = SW t ; ∀t ∈ T (11) } is the set of decision variables. In (11), SW t is the social welfare at time interval t, and the optimization problem tries to maximize the social welfare at VOLUME 10, 2022 each time interval. The first term in (12) is the summation of the product of EVs' and HVACs' bid prices and their electricity consumption. Note that the bid price of EVs and HVACs is calculated as (1)−(6) and (9)−(10), respectively. The second and third terms in (12) are the cost and revenue of exchanged electricity with the main grid. Also, γ t is the electricity price in the main grid at time interval t which is considered as γ t = αPG main t + β. Moreover, the power balance constraint at time interval t is stated as (13), where P PV t,h and P unres.

t,h
are respectively the available solar power and unresponsive active demand in smart home h at time interval t. Constraints (14) and (15) respectively impose the limitation of EV charging power and power consumption of HVAC unit. Finally, the imported and exported power from/to the main grid are limited as (16) and (17), respectively.
The above-described centralized market-clearing model is quadratic programming that can be solved using CPLEX solver in GAMS environment. As stated earlier, the centralized market-clearing approaches suffer from some disadvantages such as computational complexity and requiring private information about households (price-quantity bids). To amend these shortcomings, the described market-clearing problem is transformed into a distributed optimization problem.

B. DISTRIBUTED MODEL
In the proposed distributed market-clearing model, each smart home acts as an individual and autonomous market participant. This model preserves the information privacy of households and necessitates sending only limited border information from each market participant to determine the market equilibrium. In this regard, the centralized market-clearing problem, i.e., equations (11)−(17), is solved based on the ADMM approach in a distributed manner by allowing smart homes to iteratively share their limited border information through two-way communication links.
According to [27], the ADMM algorithm can be viewed as a form of price adjustment process from the Walrasian theory of general equilibrium. The idea of this algorithm is that the market operator seeks the solution in the direction of a market equilibrium via price adjustment. The information flow between smart homes and RMO in a residential community based on the ADMM algorithm is schematized in Fig. 3. As can be traced in this figure, the ADMM approach is an iterative solution method in which the RMO sends the updated price and the average net load to all smart homes. According to the received information, the smart homes individually update their net load, and then the updated net load is sent to the RMO. This iterative process will continue until the convergence criterion has been met.
The first step to apply the ADMM algorithm is to take an Augmented Lagrangian Relaxation (ALR) of the complicating constraint, i.e., (13), which results in the penalty function as follows.  (18) where λ t is the dual variable of the complicating constraint that represents the shadow price, and ρ is the augmented Lagrangian penalty parameter. Although some guidelines for choosing ρ can be found in [28] and [29], the literature does not offer a comprehensive method for this task. In this study, the empirical value is utilized. As stated earlier, using the ADMM algorithm, we can decompose the centralized optimization problem into several optimization subproblems as follows.
where k represents the current iteration number, and NL (k) t is the average net load at time interval t and iteration k which can be calculated as follows. Moreover, N and N h are respectively the total numbers of agents and smart homes (N = N h + 1).
Since the ADMM approach is an iterative update process, its convergence must be guaranteed. For a detailed discussion on the proof of convergence, Section 3.3 in [27] is referred. Here, when the objective functions of EVs, HVAC units, and RMO are proper and convex, we have convergence of the objective, residual, and dual variables. Furthermore, authors in [27] define two convergence criteria for ADMM, i.e., primal and dual stopping criteria. In this regard, the criteria defined in (30) and (31) are employed to determine the convergence of the algorithm (ε primal , ε dual ≥ 0).
After decomposing the optimization problem into several subproblems, we derive the closed-form expressions for the updates of variables. As can be seen in (19)−(26), all above optimization subproblems can be presented as a general quadratic problem as follows.
Since the quadratic problem is convex, obtaining the Karush-Kuhn-Tucker (KKT) conditions gives the optimal solution [30]. Therefore, the Lagrangian function of the optimization problem (32) can be written as: where µ 1 and µ 2 are the dual variables related to the constraint. The KKT conditions to calculate the optimal solution (x * , µ * 1 , µ * 2 ) are [30].
The first condition is simply a partial derivative of the Lagrangian function that must be equal to zero at the optimum. The second and third conditions are the complementary slackness conditions. Based on the KKT conditions, the updates of variables can be calculated in a closed-form. For this purpose, the dual variables are assumed equal to zero, i.e., (µ * 1 = µ * 2 = 0), and the equation (34) is solved as follows.
If the calculated value satisfies the constraints of (32), our assumption is valid and this point, i.e., ( −b 2a , 0, 0) is the optimal solution. However, if the calculated value is lower than zero, the point (0, µ * 1 , 0) is the optimum, and if the calculated value is greater than X , the point (X , 0, µ * 2 ) is the optimum [30]. Thus, the optimal solution of all subproblems is easily determined as follows.
Based on the above explanations, the market-clearing optimization problem is solved in a distributed manner with closed-form solutions. The proposed TE-based coordination model is summarized in Algorithm 1. After determining the transactive market-clearing price, this price signal is sent to all smart homes to implement the operational decisions associated with the charging of EV batteries and consumption of HVAC units. Moreover, to extend the presented transactive coordination framework to next time intervals, the SOC of EV battery and the room temperature must be updated. For this purpose, the mathematical formulation of the energy balance of EV battery and home temperature model can be found in [20].

V. CASE STUDY A. SIMULATION SETUP
The case under study consists of 1000 smart homes in a residential community all of them are equipped with responsive HVACs and half of them have the EV and rooftop solar PV panels. Also, EV batteries in this case study are assumed lithium-ion batteries whose data can be found in [10]. Moreover, as mentioned in [31], the degradation cost of this type of battery with 5% discount rate and 60% salvage value is about 80 $/MWh. This amount of degradation cost cannot convince EV owners to offer the flexibility of EV batteries in the discharging mode.
Moreover, EV owner's arrival and departure times as well as initial and target levels of SOC are uniformly and randomly selected in the specified range given in Table 2 [10]. The reason behind considering these values for arrival and departure times is that EV owners usually leave the parking station for work between 6:00 and 9:00 o'clock while they return home after 10 to 12 hours being outdoor, i.e., between VOLUME 10, 2022 16:00 to 21:00. Also, the capacity of the installed solar systems and the daily peak demand of smart homes are uniformly distributed between the minimum and maximum values given in Table 2. Further, to generate households' temperature preference ranges, the temperature lower and upper bounds are calculated as follows.
where r is a random number selected over the range of [0, 1]. Also, it is assumed that all responsive HVAC units are 16000 BTU Split Air conditioners (with a rated power of 4.7 kW) that operate in the cooling mode. Moreover, the estimated mean electricity price that is sent by RMO to all smart homes, the constant term of main grid electricity price, and the FIT price are shown in Fig. 4. The standard deviation price is assumed 10% of the estimated mean price, and finally, the hourly profile of unresponsive load and solar PV output can be found in [32].

B. NUMERICAL RESULTS AND ANALYSIS
The proposed distributed transactive market model is simulated in MATLAB software to investigate its effectiveness and applicability. In the first step of the simulation, the proposed model is evaluated from the viewpoint of solution precision and convergence. In this regard, we consider the 21:00 o'clock time interval and solve the market-clearing problem using the described centralized and distributed approaches. The clearing price for both clearing approaches is equal to 83.932 $/MWh which proves the precision of the proposed model. It is to be noted that for solving the distributed market-clearing problem, we choose ρ = 0.1 and ε = 10 −3 . Fig. 5 shows the convergence of the proposed distributed optimization problem for different initial price (λ (0) ). As seen in this figure, by choosing proper λ (0) , the equilibrium solution will be reached faster. Moreover, the market-clearing price and the EVs' bid price for five candidate smart homes (h 1 , h 101 , h 201 , h 301 , and h 401 ) within 24 hours are depicted in Fig. 6. Also, the charging scheduling of candidate EVs and their charging costs are shown in Fig. 7. As can be inferred from Fig. 6, after midnight once the electricity price in the main grid is low and the departure time is approaching, the EVs' bid price is greater than the transactive market-clearing price. Hence, the EV  battery is charged during this period as shown in Fig. 7. On the other hand, Fig. 6 shows that the bid price of EVs at the high price hours (21:00−24:00) is less than the TE market-clearing price to avoid charging EV batteries as illustrated in Fig. 7. Also, Fig. 6 shows that when the estimated electricity price is at its minimum value, the HEMS generates a bid price with infinite value to guarantee the charging of EV batteries at the current time interval. Note that infinite value for bid price is shown with 120 $/MWh. Moreover, to better investigate the effectiveness of the proposed transactive coordination framework from the viewpoints of EV battery charging cost and achieving the target SOC level at departure, we implement two other cases: i) dumb charging, i.e., EVs are charged as soon as they are plugged in, and ii) the EVs' bidding strategy model proposed in [11]. Table 3 shows the average charging cost of EVs and the satisfaction value of EV owners in the three aforementioned cases. The satisfaction value is the ratio of the number of EVs that reached the target level of SOC at departure to the total number of EVs. This table shows that our proposed model mitigates the average charging cost of EV batteries by 39% and 4% compared to cases i and ii, respectively. Also, this table reveals that our presented transactive coordination model fully guarantees to achieve the target level of SOC at departure while by implementing the EVs' bidding strategy model proposed in [11], 39 EVs failed to reach the target SOC level. Thus, based on the above explanations, the proposed TE-based coordination model fulfills the preferences of EV owners.  Furthermore, the market-clearing price, the bid price of HVAC unit, and the room temperature of a candidate smart home h 1 are shown in Fig. 8. Also, this figure shows ON/OFF modes of the corresponding HVAC unit within 24 hours. As can be traced in this figure, when the room temperature approaches the temperature upper bound, the HEMS generates a greater bid price to increase the probability of being in the ON mode of the HVAC unit at the corresponding time interval. On the other hand, when the room temperature approaches the temperature lower bound, the proposed model increases the probability of being in the OFF mode at the corresponding time interval by generating a lower HVAC's bid price. Thus, the room temperature will change between the lower and upper-temperature bounds ([θ l , θ u ]= [19.8, 24.2]). Also, this figure shows that due to the absence of solar gain and decrease internal loads (such as lighting and cooking loads) during the period of 24:00−09:00, the number of turning on the HVAC unit decreases. On the other hand, due to the presence of solar radiation during 10:00−16:00 and internal loads during 18:00−22:00, the number of turning on the HVAC unit increases. Moreover, to better illustrate the capability of the proposed model regarding the aspect of thermal comfort, the box plot of room temperature within 24 hours of the day for ten candidate smart homes is depicted in Fig. 9. As inferred from this figure, the room temperature remains between the temperature lower and upper bounds which are specified by households.

C. COMPUTATIONAL EFFICIENCY
Finally, the computational efficiency of the presented distributed transactive coordination model is investigated. In this regard, the running time of three cases, i.e., i) the proposed distributed model with closed-form solutions, ii) the distributed model without closed-form solutions, and iii) the centralized model, is reported in Table 4. It is worth mentioning that our proposed model (first case) is simulated in MATLAB software and the next two cases are  implemented in the GAMS environment and solved using the CPLEX solver. As shown in Table 4, when the number of smart homes increases, the running time of the centralized approach increases, too. However, since the computational load in the distributed market-clearing approaches is divided among agents, the running time does not much increase with increasing the number of smart homes. Moreover, the results show that by employing the closed-form solutions in distributed optimization, the running time decreases significantly (more than 350 times faster). Note that the running time of distributed approaches in Table 4 has been determined by dividing the actual running time by the number of agents. In a conclusion, and considering the communication delay in the range of milliseconds, the proposed distributed coordination model with a closed-form solution is more practical than other models for the real-time coordination of a residential community with a shorter market-clearing time interval (for instance 5-second-ahead market).

VI. CONCLUSION
In this study, we proposed a real-time transactive energy management model to coordinate household-owned DERs in residential communities. Based on the proposed model, the HEMSs were enabled to estimate the bid price-quantity of EVs and HVAC units to participate in the retail market considering the comfort and economic preferences of customers. After that, to preserve information privacy, the market-clearing optimization problem with the objective function of maximizing social welfare was solved in a distributed manner using the ADMM approach. Moreover, to simplify implementation and improve the computational efficiency of the proposed model, instead of direct solving optimization subproblems, closed-form solutions to all subproblems were derived. Finally, the proposed model was applied to a residential community with 1000 smart homes, and the simulation results demonstrated that the proposed coordination model properly satisfied the households' economic preferences (decreasing customers' energy payments) and comfort desires (achieving the target SOC level at departure and maintaining the room temperature in the customer-specified range). Furthermore, the numerical results illustrated that obtaining closed-form solutions greatly improved the computational performance.
Future works can focus on developing a distributed TE management framework to coordinate smart homes considering the constraints associated with three-phase unbalanced distribution networks. Another future research direction to extend the proposed model is about utilizing the flexibility of EV batteries in the vehicle-to-grid mode to enhance the reliability of distribution networks.
HOSSEIN SABER received the B.Sc. degree in electrical engineering from the Amirkabir University of Technology, Tehran, Iran, in 2014, and the M.Sc. and Ph.D. degrees in power system engineering from the Sharif University of Technology, Tehran, in 2016 and 2022, respectively. His research interests include power system planning and operation, transactive energy, renewable energy integration, distributed energy resources, and optimization and its application in power systems.
MEHDI EHSAN received the B.Sc. and M.Sc. degrees in electrical engineering from Technical College, Tehran University, Tehran, Iran, in 1963, and the Ph.D. and D.I.C. degrees in power engineering from Imperial College University London, London, U.K., in 1976. He is currently a Professor Emeritus with the Electrical Engineering Department, Sharif University of Technology, Tehran. His research interests include power system planning, electricity market, renewable energy, and power system dynamics. MATTI LEHTONEN received the master's and Licentiate degrees in electrical engineering from the Helsinki University of Technology, in 1984 and 1989, respectively, and the D.Tech. degree from the Tampere University of Technology, in 1992. He has been a Professor with the Helsinki University of Technology (currently, Aalto University), where he is the Head of Power Systems and High Voltage Engineering. His main research interests include power system planning and asset management, power system protection, including earth fault problems, harmonic related issues, and applications of information technology in distribution systems. VOLUME 10, 2022