Hierarchal Energy management system with a local competitive power market for inter-connected multi-smart buildings

The energy management in new distribution paradigms are amongst one of core research dimension, particularly in smart grids. This paper proposes a hierarchal energy management system for inter-connected multi-smart buildings with an inclusion of local Power Market. As home appliances have huge contribution in load of buildings, the appliances are scheduled in order to minimize operational cost while taking into account the user comfort and other system constraints. The objectives of this paper aim to minimize operational cost, CO2 emissions, grid dependency while maximize user comfort and revenue. The proposed technique enables a prosumer with two options, either they can sell excess energy to the utility or can bid and sell in market with high price compare to utility. Besides increase in revenue, the consumer is enabled to buy electricity from utility or from local market with low prices compare to utility grid aiming at reducing operational cost. The proposed framework is evaluated across three algorithms namely, JAYA, teacher learning based optimization (TLBO) and Rao1, respectively. As per comparative analysis, the JAYA algorithm outperforms the others in achieving the aimed objectives in-terms of favorable achieved numerical values. Different cases are created in order to test the effectiveness of proposed system. The overall simulation results validate the proposed approach with highest operational cost reduction of 151.48%, peak load reduction 76.76%, grid dependency reduction 95.61%, and minimum emission of CO2 is 3.70 Kg/Day as compare to base case.


I. INTRODUCTION
The Residential buildings are one of the largest consumers of electricity, which uses about 37.4% of total electricity produce in the United States (US) in 2017 and 80% of the electricity in the United Arab Emirates [1] [2]. It is pointed out in [3] that an enormous amount of electricity is wasted in buildings due to the absence of automatic control and management systems. There are several reasons that the owner of building does not install energy management systems (EMS), such as lack of awareness, cost of system and no incentive, etc.
The EMS using a hybrid teaching learning genetics optimization (TLGO) that aims to increase the system's energy efficiency, incorporate renewable energy resources (RERs), while minimizing the energy costs and user discomfort levels [4]. In [5], a demand side management (DMS) system namely real time scheduling system is used for residential user has been introduced to minimize the operating cost with optimal scheduling of devices and increase the RERs usage, particularly considering the uncertainties in RER generation. A general architecture of EMS is proposed in [6] to achieve an optimal scheduling of appliances and ESS in response to the dynamic pricing that minimizes the operational cost and peak average ratio. A general EMS architecture in [7] is presented in smart grid environment, and utilizes a scheduling method based on grey wolf optimization (GWO) and particle swarm optimization (PSO), for residential users with restricted and multi-restricted scheduling.
Besides consideration of EMS on various modern distribution mechanisms under smart grid, smart buildings are among the prominent new research dimensions. The examination of power exchange effects in interconnected multi-building have carried out with two cases, first with and other is without power exchange capability. It is found that buildings with power exchange capability has low operating cost using mixed integer programing (MIP) and general algebraic modeling system (GAMS) based framework [8]. A multi-building framework is proposed for coordinated operation of building devices in order to minimize the peak demand and user discomfort during the event of demand response (DR) [9]. An EMS is proposed for interconnected multi energy hubs aimed to minimize the operating costs, carbon emissions and increase in system independency from the utility grid [10]. A framework based on decision rule approximation is employed for controlling the operation of buildings and energy hubs, is formulated as a stochastic multistage optimization problem that aims to reduce cooperatively total load of the system [11]. An optimization model is proposed in [12] that allows to manage daily energy consumption of both single and multiuser cases, with the inclusion of distributed energy resources (DERs) and batteries. A building energy management system is proposed in [13] manages the aggregation of different users in residential and commercial buildings with a common electric distribution system with a single connection to the grid. Energy exchange method between buildings in an off-grid mode using mixed integer linear programming is proposed in [14]. The proposed mixed integer nonlinear programming (MINLP) model in [15] manages the load and generation in order to minimize the operational cost of energy purchased from the utility grid in buildings.
The smart buildings have also considered as a candidate to combat environment issues such as CO2 emissions with optimal scheduling of RERs. According to a study, the overall world power generation plants produces nearly 10 billion tons of CO2 emission annually, which increase the greenhouse effect and global warming [16]. A mixed integer linear programming (MILP) optimization model is proposed to minimize the operational cost and CO2 emissions considering user preference in buildings including DERs [17]. A proposed EMS uses wireless communication technologies to smooth the peak power demand and reduces the CO2 emissions [18]. A proposed optimization model schedules the smart building power consumption with renewable & non-renewable resources in order to minimize electricity bill and CO2 emissions [19].
In recent times, electric vehicles (EV) are vital and prominent component of life as well as a decision variable for load-generation balance in the electrical grids. An intelligent hybrid EMS based on real coded genetic algorithm (RCGA) is proposed for smart homes with bidirectional power flow between homes and utility grid. Moreover, the various EV standard charging techniques are compared in [20]. The authors in [21] presents an stochastic dynamic programming based optimization scheme to minimize the charging cost of EV. An optimized framework for combined operation of EVs and RES taking into account the uncertainties of arrival and departure times of EVs, is proposed in [22]. A Grid-Home based EMS framework is proposed for the management of EV charging and discharging with effectively utilizing the photo voltaic (PV) system, in order to minimize consumer operational cost and PV generation curtailment [23]. A MILP based EMS is proposed to optimally schedule the home appliances and EV charging / discharging in order to minimize peak Average ratio (PAR), cost minimization and maximization of user comfort [24].
In the reviewed literature, a commendable works has carries across various perspectives of EMS, buildings with RERs with a selected set of objectives. However, none of them have considered a competitive power market environment with multiple smart building concepts under smart distribution mechanism that covers simultaneously a wide variety of aimed objectives. The bridging of limitations in the previous work is the very novelty of this work. This paper incorporates a local competitive power market in an inter-connected multibuilding environment so that the prosumers participate and sell their surplus energy to neighbor buildings at market clearing price (MCP) or to utility at utility export price (UEP). The main contributions of this paper are as follows: • A hierarchal EMS for multi-smart buildings • Minimizing the operational cost and user discomfort.
• Minimize peak demand, grid dependency and CO2 emissions. • Incorporate a local competitive power market among multi-smart buildings

A. SYSTEM ARCHITECTURE
The general architecture of proposed test system consists of three buildings shown in Fig.1, where each building comprises of two homes. Each home has appliances shown in Table II.
The components considered in test system includes RERs (PV arrays and wind turbine), energy storage system (ESS), building energy management system (BEMS), home energy management system (HEMS) and independent service operator (ISO). At low electric price period, user will purchase power from the utility and ESS will store it. Later, the devices will be powered by ESS during high electric price. The ESS is also able to store surplus RE generation during peak RER hours. Users can sell the surplus electricity produce via RER or ESS to the grid and the neighboring buildings.

B. MODELING OF EV
Several factors affect the modeling of an EV such as driving distance, driving style, selection of route, traffic, SOC at plugging-out time etc. We have only consider the effect of driving distance [21] and uses the data available in [25] [26].
If given and d, then can be computed using Eqn. (1). Note that is lower-bounded to prevent battery depletion. Eqn. (2) governs EV charging process:

C. MODELING OF BESS
The Eqn. (3) controlled the BESS charging and discharging.
Where, is BESS energy at i-th interval and ] denotes the a vector having charging and discharging powers, . ℎ and . ℎ are the efficiencies of BESS charging and discharging respectively, and T denotes simulation step.
. , ℎ is the positive value of battery charging power and . , ℎ is negative value of . At a time only one value will be occurred in µ .

Request time of appliance
Actual start time appliance k=3 Operation Characteristic ρ=0.001 Discomfort Coefficient

E. ELECTRICITY IMPORT AND EXPORT TARIFF
"Peak-valley tariff" is utilized for both buying (import) and selling (export) of the electricity in this work [28] [29] . This has three different tariff rates (peak, plain, and valley) for different hours of a day as mentioned in Table III. For simulation purpose, the mentioned building bid prices have used. The Comparison of the bid price to sell (B ) to neighbor buildings and selling (T ) tariffs to utility is also illustrated in Table II, which shows that both the tariffs are of different values. The seller is incentivized by making the values T less than B so that they will participate in local power market.

III. OPTIMIZATION MODEL
The goal of the proposed optimization model is to reduce the total operational costs over a finite horizon while satisfying the constraints like operational constraints of the devices, comfort constraint in the test system. The 24 hours of the day have divided into 120 time slots. Each hour comprises of 5 time slots, i.e. each slot is of 12-minutes [7]. The problem formulation has optimized using three optimization algorithms, namely JAYA, RAO and teacher learning base optimization (TLBO).

A. JAYA
It is a powerful population based optimization algorithm, as shown in Fig.2, based on concept that solution should moves towards best value and avoid the worst ones [30].
Let ( ) be the objective function to be maximized or minimized. Parameters required are number of iterations , number of variables (i.e. =1, 2,.,., ) and ( =1,2,.,., ) be the number of population. Let the best solution of ( ) is ( ) and worst ( ) in the entire population. If , , is the value of ℎ variable for the ℎ population during ℎ then the value will be modified by equation (5).
′ , , is the updated valve of , , . 1, , and 2, , are the two random variables in range of [0,1]. ′ , , will be accepted if its value is better. All accepted values will be input for the next iteration.

B. TLBO ALGORITHM
It is a nature-based optimization algorithm, as shown in Fig.3, which imitate the learning method of students from teacher in a class. Teacher is considered as the most learned one who delivered his knowledge to learners. The outcome of learner is affected by the quality of teacher. Learners get good grades or numbers if their teacher is good. This optimization process is mainly split into two parts one is "Teacher phase" and the other is "Learner phase" [31].

1) TEACHER PHASE
Depending on good teacher the mean knowledge of class increases from to .Let be the teacher and be the mean at iteration . Teacher try to move the knowledge of learner mean to its own level and the new mean will be as shown in Eqn. (6).
is the teacher factor, its value will be either 1 or 2. Such as Eqn. (7) modifies the existing solution.

2) LEARNER PHASE
In this phase learner try to increase his own knowledge by interacting with the any other random learner. Learners are selected randomly and a learner will learn new things from other learner if he has more knowledge compare to him. Learner modification is expressed as:

C. RAO ALGORITHM
It is a metaphor-less algorithm as shown in Fig.4, which is developed is similar to the concept of JAYA algorithm. The modification of new value of , , is given in Eqn. (8) as follows [32]:

D. OBJECTIVE FUNCTION
In our objective function we have to reduce the total operational cost of homes, BESS and also the discomfort of the occupant for 24-hours, as expressed in Eqn. (9).
Sensitivity: Internal BESS operation and maintenance cost ($/kW) P , P Electrical demand, BESS charging or discharging (kW) P , P Wind power (kW) PV power (kW) P Power purchase from building (kW) P EV charging (kW)

E. POWER BALANCE CONSTRAINTS
When BESS is charging (P is negative), the electrical power balance should be: During BESS discharging interval (P is positive), the electrical power balance should be:

F. EV CONSTRAINTS
To prevent EV battery from damage, SOC and charging of EV limits must be taken into account, EV parameters are shown in Table IV.
SOC ≤ SOC ≤ SOC (15) Where: denotes the of EV charging power upper limit (kW) is the maximum SOC of the EV battery.

G. BATTERY CONSTRAINTS
BESS minimum and maximum energy constraints must be taken into account. BESS parameters are shown in Table V.
Depending on charging or discharging of BESS, the rate of charge and discharge of energy in the BESS depends on limits of charge and discharge rate in succeeding hours. Equation (17) is for charging interval: Equation (18) is for discharging interval:

H. RENEWABLE ENERGY GENERATION
The RER (wind (2 kW) and PV (1.3 kW)) outputs mainly depends on the conditions of weather. A typical power output curve of wind and PV shown in Fig. 5 [33].

I. MARKET CLEARING PROCESS
There are two types of market clearing processes one is "Uniform MCP" and other is "Pay-as-Bid MCP". In Uniform MCP all the bidder (seller or buyer) will received same MCP even if they bid greater or less than MCP while in pay-as-bid MCP a system is to be design in which bidder will received just what they bid. Uniform MCP is very commonly used in electricity market and we also use this in this paper. Each prosumer bids at some offer price in order to sell its surplus electricity, each consumer bids to purchase its required electricity at a certain bid price. When the MCP is determined, all bid prices to sell which are lower than or equal to the MCP and all bids prices to purchase which are greater than or equal to the MCP are accepted. Other than these, all bids would be rejected [34].

J. DETERMINATION OF MARKET CLEARING PRICE
Sale bids are usually aggregated in ascending order while purchased bids are in descending order. The point where these two curves intersect is known as MCP. It is the lowest price which can provide enough electricity to satisfy accepted purchased bids. Bidders include all the buildings which are willing to sell their surplus energy and Utility. On the basis of biding mechanism there are two types of markets single-sided and double-sided bidding mechanism. Bidding in which only supplier bid is known as single-sided bidding while if bidding is done by both sides (supplier and buyer) this type of bidding is called double-sided bidding mechanism. We use single-sided bidding mechanism in this paper. The bidders are allowed to bid either in the blocks or as a linear form [35]. Figure. 6 is mainly divided into four parts: BEMS, HEMS, ISO and Market clearing process. The BEMS uses forecast model to forecasted the energy production from PV and wind [36][37] and send the forecasted RER profiles to HEMS. HEMS uses optimization model which has different optimization algorithms which uses the forecasted values of RER and generate an optimized schedule for all devices considering the objective function. net power (Pnet) profile is generated after subtracting the scheduled total load of building from RER profile for each n number of buildings. Pnet values less than zero means building have excess energy and it bids the amount of energy with some bid price to ISO, for simulation purpose bid prices are shown in Table II.
Similarly Pnet values greater than zero means building need energy. Next ISO gather the bid information (sell/purchase). The market clearing process uses bid information and determined market clearing price at which the buildings buy and sold energy to each other. Utility is also a participant in local market. If there is remaining energy after selling to buildings, the building will sell it to Utility at utility export price at that interval otherwise it will be curtailed. ISO is responsible for all the transactions between buildings and utility.

IV. SIMULATION RESULTS
Multiple simulation scenarios were presented in this section to demonstrate the importance of the proposed model. All the cases are summarized in Table VI.
In all cases energy can be purchased from and sold to neighbor buildings or utility grid. In all cases there is no RER in building 3 it means building 3 needs energy from neighbor buildings or from utility grid at every interval, it shows the effectiveness of local power market. Case 1 and case 2 are develop to compare building having RER with BESS and without BESS. Similarly case 3 and 4 include EV in those buildings which performs good in case 1 and 2 i.e. buildings having BESS.

A. BASE CASE
In this case total Scheduled load of buildings is supplied by utility only. The total operating cost of all three buildings in this case is -13.24$ per day, and it will be used as a reference for other cases. Negative sign indicates buildings have to pay while positive refers to the earned money after exporting power.

B. CASE 1
In this case PV is installed as illustrated in Table VI. The surplus power available in buildings can be store in BESS in and discharged when load is greater than generation. The charging and discharging of BESS and energy routing dependency on efficiency is already explained in [38]. The total daily best operational expenses of the buildings are -5.9334$ (B1=-0.9345$, B2=-0.9788$, B3=-4.0201$) in this case, which is 55% less than base case. It is clearly seen that B1 with BESS has less operational cost than B2. BESS is charged in intervals 42-53 when RER is more than load and discharged in 97-104 when load is more than RER in building 1. In intervals 37-40, 45-46, 50-55, and 58-96 energy is purchased from buildings at MCP. Similarly In interval 51-95 remaining energy is sold to utility shown in fig. 7. The MCP of case 2 is lower in most of intervals compare to case 1 because in those intervals surplus energy is available to bid in local market so those buildings which need energy during those intervals buy energy from neighbor buildings at lower prices compare to utility note that case 2 has wind RER. The MCP comparison of cases 1-2 have illustrated in fig. 8.

C. CASE 2
In this case, wind is installed as illustrated in Table VI and illustrated in fig. 9, the total daily best operational expenses of the buildings are 6.8141$ (B1=4.8857$, B2=4.7389$, B3=-2.8105$) in this case, positive value indicates the profit (revenueexpense). BESS is charged in intervals 2-6, 42-45 and 47-52 when RER is more than load and discharged in 38-42, 45-47 and 92-94 when load is more than RER in building 1. In intervals 8-38 and 49-119 energy is purchased from buildings at MCP and energy is sold to utility in intervals 1-38 and 51-120 at export price at that interval.

D. CASE 3
An EV is added with wind in this case, we have charge and schedule the EV such that the overall cost minimizes. There are multiple factors on which algorithm shifts the charging of EV. Those factors are prioritized according to the cost of power. The first one, EV gets charged in those hours where generation of RER is surplus means after fulfilling the critical load. The second is to shift the charging where there is low tariff (plain or valley tariff).
In interval 85-110 EV get charged and in intervals 2-6, 35-38 BESS get charged from surplus RER BESS discharge in interval 33-35and 38-44 as illustrated in fig. 10. The total daily best operational expenses of the buildings are 5.9433$ (B1=4.1005$, B2=4.7823$, B3=-2.9395$) in this case. The MCP comparison of cases 3-4 have illustrated in fig. 11 it is clearly seen that MCP of case 3 is lower than case 4 because of wind RER.

E. CASE 4
In this case PV is installed along with EV as illustrated in Table VI

A. COST REDUCTION
From case 1 to case 2 the cost reduction increases due to RERs combination and in case 3 and 4 it decreases because of the inclusion of EV and combination of PV and wind in buildings. In case 2 and 3 buildings generate profit if we see the combinations the common energy resource is wind energy, as demonstrated in fig. 13. In cases 2-3, JAYA out performs other algorithms with highest achieved value i.e. 151.48% and 144.90% of cost reduction from base case, respectively. In case 4, Rao tends to be a better means to achieve cost reduction of 45.87%. Lastly, TLBO is better in comparison with achieved cost reduction of 55.18% in case 1. By increasing the capacity of BESS operational cost reduces while capacities of wind and PV reduces operational cost and also increases revenue by selling excess energy. In case of wind more operational cost is reduces and more revenue generation compare to BESS and PV because of availability of generation in most intervals.

B. DISCOMFORT REDUCTION
From case 1 to 2 discomfort reduction increases and from case 3 onward it decreases because of inclusion of EV and combination of RERs, as demonstrated in fig. 14. The highest reduction value is found in case 2. By increasing the capacity of BESS, wind and PV discomfort reduces but in case of wind more discomfort is reduces compare to BESS and PV because of availability of generation in most intervals.

C. PEAK REDUCTION
In fig.15, from case 1 to 3 Peak reduction increases, after that it reduces because of RERs combinations. Maximum reduction is in case 2 and 3 because of wind energy combination. case 3 is the most notable one with highest achieved peak reduction. The Rao algorithm is comparatively better in cases 2 and 4, Jaya outperforms in cases 1 and 3. By increasing the capacities of BESS and wind, peak reduction increases while in case of PV it depends on load curve

D. GRID DEPENDENCY REDUCTION
In fig. 16 energy from grid decreases from case 1 to 3, then increases in case 4 because of unavailability of PV in most time slots. From the grid dependency reduction perspective, Jaya out performs other algorithms in cases 1 and 3 with achieved values of 29.73% and 95.61%, in comparison with base case values. Likewise, Rao show better results in cases 2 and 4, with achieved values of 95.19% and 20.80%, respectively. By increasing the capacities of BESS, PV and wind, the grid dependency reduction increases.

E. ENERGY FROM BUILDING
In fig. 17, energy purchased by buildings from other buildings increases in case 2 and 3 because of wind energy resource availability. The highest energy purchasing from buildings rather than grid across all cases and computational techniques aims towards case 6, with achieved values of 35.39% and 35.48%, from reference of base case.

F. CO2 EMISSIONS
Greenhouse gases have many effects on environment and health. They trap heat in them which cause climate to change, and they also contribute in air pollution and smog which causes respiratory disease. Some other effects are Extreme weather, food supply disruptions, and forest fires. One of the primary greenhouse gas is CO2, responsible for about three-quarters of emissions [39][ [40]. In fig. 18 it is clearly seen that with the inclusion of RER and enabling bidirectional flow among buildings CO2 emissions decreases. In cases 1 and 3 JAYA outperforms the compared algorithms with highest achieved CO2 reduction kg/day i.e. 59.10 and 3.70. RAO outperform other methods in case 2 and 4 with the achieved value of 4.00 and 66.60, respectively.

V. CONCLUSION
This work proposed a model of an inter-connected multismart buildings with the inclusion of local market in order to incentivize the consumer and utility grid. This work uses three optimization algorithms for optimum solution and its validation. The findings of six different simulation cases shows that by inter-connecting and inclusion of local power market the overall operating cost of system decreases and revenue increases by a prominent amount and this amount depends on the number and combination of energy resources. By adopting the proposed system the operational cost and user discomfort reduces while the export of energy to other buildings increases hence increase in revenue. On utility side peak demand reduces while grid independency increases. It can also be seen that those cases which have wind energy have less operational cost and user discomfort while increase in revenue, peak reduction, grid dependency reduction, and CO2 reduction compared to cases with PV. This is because of availability of energy in most of the intervals compare to PV. By increasing the capacities of wind and PV, more reduction in operational cost and user discomfort while more increase in above mentioned features. Among all threeoptimization algorithm, from reference of base case, JAYA outperformed in terms of highest cost reduction of 151.48% in case 2. The highest discomfort reduction is achieved with case 3. The highest peak load reduction is achieved with JAYA at 76.76%. The highest grid dependency reduction is achieved with JAYA at 95.61%. The highest energy purchase from buildings is achieved in case 3 across all techniques and cases, respectively. Finally, highest CO2 reductions have achieved in case 3 with JAYA, at 3.70 in achieved numerical values than others algorithms. The proposed system is highly flexible and yet robustness remains same when the number of buildings, homes and RER changes at a small cost of further computation.