Home-Microgrid Energy Management Strategy Considering EV’s Participation in DR

: Electric vehicles (EVs) have a lot of potential to play an essential role in the smart power grid. EVs not only can reduce the amount of emission yielded from fossil fuels but also can be considered as an energy storage system (ES) and a backup system. EVs could support the demand response (DR) strategy that is considered as utmost importance to shift electricity demand in peak hours. This article aims to assess the impact of the presence of EV on DR strategy in a home-mi-crogrid (H-MG). In order to reach the optimal set point, our energy management system (EMS) has been merged with differential evolution (DE) method . The results were auspicious and showed that the proposed method could decrease market clearing price (MCP) by 26% and increase the performance of DR by 17%.


Introduction
One of the biggest advantages of smart grid (SG) is the energy distributed in the consumption location, which provides flexibility to the energy demand response. The strategy of distributing the energy resources is based on consumer demand. One of the major power girds that adopts this strategy is the Home microgrid (H-MG). This SG has a significant role in reducing pollution besides supporting load demand supply, specifically during peak consumption periods [1]. Usually, the generated power in the H-MGs is supplied to the consumers, if the amount of the power demand is more than the generated power, the rest of the required power could be bought from the main grid. Since the energy demanded by the customers is discrete, with no specific time frame, the constant load does not exist. Therefore, the demand is changing continuously. For example, during the peak time, the consumer's load demand is more than off-peak time. So, H-MG buys electricity during peak hours from the grid whereas during non-peak hours, H-MG sells its excess power to the grid. In such conditions, using the energy storage (ES) for increasing H-MG reliability can be effective [2][3][4]. The presence of the ES in the consumer locations, can reduce the amount of energy required during peak time [5][6][7]. On the other hand, H-MG during off-peak hours can supply the energy required from the ES. As a result, the use of ES in supplying the energy required by H-MGs during load peak hours and non-peak hours prevents the demand for expensive generator activity. Also, this result will have a better impact on the environment as pollution caused by generators can be prevented. With this description, from an environmental point of view, using ES will be useful for both cost reduction and also reduction of pollutant's emission. Furthermore, Consumers who participate in demand response (DR) programs can reduce the costs of buying ES' expensive resources, where each consumer can communicate with several H-MGs existing in the grid structure [8][9][10]. In this programme, each consumer must decide the requested energy from the H-MG to maximize its efficiency. On the other hand, the H-MGs decide the amount of the generated energy and their prices to maximize the income and the profit [11]. Participating in DR programs and using the advantages such as buying power from H-MGs in off-peak (cheap periods) and selling power back in peak time (expensive periods) can have a positive effect on H-MGs' energy management. Many strategies in the DR program were provided to support the consumers by maximizing the profit amounts that are earned from their participation with the generated power [12].
Moreover, EVs with having merits such as low cost in refueling, zero emission, high efficiency and high safety and drawbacks such as high cost of their ES for replacing, not easy to recycle, low range of efficiency and the danger of heating up the lithium-ion ES, are believed to have great potential in DR participation due to vast growth in EVs numbers and their geographic distribution. This could be one of the solutions for the rising energy consumption as EV is considered an energy storage unit. Many researchers investigated the possibility of having EV as part of the power grid. Hussain et. al [13][14][15] proposed a number of fuzzy logic algorithms to improve EV owner's quality of experience and maximize the quality of performance for the parking lot operators under the operational constraints of the power grid. Uncertain parameters from the electric grid and EVs were considered in work mentioned. In paper [16], Artificial Intelligence was also utilized in creating the load model for demand response provisions in distribution systems. The model represented the total charging load at an electric vehicle charging station in terms of controllable parameters. The benefits of distribution systems from demand response, aggregator and EV users are defined in paper [17] where optimal scheduling of an EV aggregator for demand response was proposed. Moreover, the work in [18] proposed a coordinated optimization strategy considering nighttime deep peak regulation state of units and uncertain EV demand response. Whereas the work in [19] proposed a novel polynomial-time online algorithm and auction mechanism for emergency demand response to jointly incentivize EVs with energy to sell their energy and utilize the charging station's local generator to produce energy.
Based on all that has been discussed, this paper presents an EMS based on the DR program for an H-MG having EV as an energy storage unit. The impact of the EV participation in the DR programme was investigated. Besides, the paper shows the effect of the presence and the absence of EV on a H-MG. The EMS was designed to satisfy the main H-MG power demand using renewable energy resources. The heuristic algorithm differential evolution (DE) [7] which optimizes a problem to modify the solution in the search space with regard to the quality of response was implemented with this EMS to create optimal power management and the optimal set points to reduce Market Clearing Price (MCP) using dynamic pricing (DP).
The main contribution of this paper can be summarized as follows:  Simulation implementation of optimum energy management based on dynamic pricing in an H-MG by considering uncertainty.  Providing a comprehensive algorithm based on the participation of a mobility EV in order to improve the capability of DR. The rest of paper layout is as follows: section 2 covers a brief introduction for EV use in MG demand response, whereas section 3 is an overview of the proposed EMS. Section 4 presents the methodology. Section 5 covers all the constraints of the H-MG in a problem formulation. Section 6 presents the EMS simulation outcomes with the results and discussion. Finally, the paper is concluded in section 7.

Electric Vehicle (EV) in Home-Microgrids (H-MGs)
Energy could be stored in many ways such as pumped hydroelectric energy [20], compressed air energy [21], flywheel energy [22], batteries and thermal energy [23]. Although, Electric Vehicles (EVs) are considered as large batteries and an excellent option for energy storage. Besides, Electric Vehicles (EVs) are up on the rise now more than ever. Therefore, EVs are a good option to satisfy the grid's energy demands. As time progresses, we are seeing immense changes in our attitude towards the less environmentally friendly engines across the world-especially in Europe, China and the US [24]. A requirement of an ambitious and overarching policy framework could result in meeting the UK Government's goal of ending the distribution of fossil fueled vehicles and replacing them with (zero-emission vehicle) ZEV's by 2035 or earlier [25]. There are two successful frameworks to follow, the Norway model [26] or the California model [27]. Vast amounts of research have been dedicated to find good usage of EV in the micro grid demand response beside the main purpose being an ecofriendly transport vehicle [28][29][30][31][32]. EV has been considered to overcome the power generation fluctuations [33], and smoothed the wind power [34] and was part of the stochastic mixed-integer linear programming (MILP) model [35]. The research in this paper considers the use of EVs depending on their presence at home. In this respect, EVs are not only providing tax incentives and a reduction in the gasoline usage but they also increase the H-MGs capability which means better demand-side resiliency and electricity continuity [36].

An Overview of the Proposed Energy Management System (EMS)
The research in this paper is based on a H-MG that is connected to the global network, that enables this H-MG to exchange power and buy/sell from/to the global network. This operation will be EMS based on the DR. As observed in Figure 1, the system investigated in this paper is designed for an H-MG that has the photovoltaic (PV) cells as the main source. Whereas a Micro Turbine (MT) is there as a dispatchable generation resource. We consider responsive and non-responsive load demand in this H-MG. For the energy storge system design, an ES unit with capacity of 2kWh and EV with the capacity of 12kWh has been considered. During implementation, the system was designed based on daily work, time that the EV's owner goes to work from 09:00 to 18:00, and during this time, the EV is not connected to H-MG. EV is tolerant of excess power and as a prosumer, can inject power into loads at needed times. It should be noted that applying the MT is confined to the power shortage periods. MT during peak load plays a backup role in responding to the load's demands. Calculations related to exhaust gases caused by MT and its limitations, such as ramp-up/ down and operation times, have been omitted. Besides, the aggregated load profile is related to a real H-MG.

Methodology
The system considers an uncertainty unit in the design and the implementation. This unit is essential to cover the uncertainty in the load demand, power generated PV and MCP. The uncertainty unit in this paper is based on Taguchi orthogonal array test (TOAT) [37], this testing technique has proven its ability to provide reliable statistical information with the minimum number of tests, it has been described as a powerful yet simple tool. This feature also has a positive impact on the computing time, more information about this method implementation can be found in the authors previous publication [32]. Figure  2 illustrates the procedure followed in this research. Since extracted power from PV depends on weather conditions, an uncertainty unit is required. The unit will base its decision on five parameters as shown in the figure 2: PV, Market Clearing Price (MCP), load demands, system sell price (SSP), and system buy price (SBP). Predicted data from each parameter will be fed to the uncertainty unit for decision making. The uncertainty unit have been presented in depth by authors in [13]. The two imaginary keys S1 and S2 in Figure 2 illustrates the two scenarios adapted in this research. S1 is linked to EMS-DR without the EV usage whereas S2 is linked to EMS-DR with EV usage. The algorithm is designed in a way that both switches will never be both closed (running both operations at the same time) or open (that means there is no DR system in place) simultaneously. The DR system will start to operate when one switch is open while the second is closed. When S1 is closed and S2 is open, the DR strategy will be investigated without the presence of EV. Unlike the case where S2 is closed and S1 is open, the DR strategy will be investigated with the presence of EV. At each state, the DE optimization method is used in order to find optimal set points for satisfying the objective function. Finally, power data's buy and sell offers, based on dynamic pricing (DP), is sent to the MCP unit. In this unit, which authors discussed widely in [7,37], demand and supply curves intersect with each other at one point to create the optimal MCP. Differential Evolution (DE) algorithm [38] is the algorithm that supported the DP in its decision to enable the MCP to find the optimal offers. DE proved its potential as a powerful population-based metaheuristic search algorithm, it makes few or no assumptions about the underlying optimization problem and on the other hand DE can quickly explore very large design spaces. DE algorithm keeps evolving and optimizing the problem by iteratively improving a candidate solution. All in all, DE can find the optimal set points in other to reach the best amount of objective function.
The system is designed to prioritize the use of the energy produced by the renewable PV cells. The system specifies the amount of the excesses/shortage power based on the amount of the PV power and the demand power. The performance conditions of the EMS-DR (Energy Management System-Demand Response) algorithm are as follows: (a) Excess generation: As it can be seen from Figure 3, first, ES is charged. If there is still excess power generation, shifted power from previous intervals will be used to respond. If there is still excess power generation, it will be allocated to the grid for buying. If power shortage is less than the minimum capacity of MT, first of all, the battery will be discharged, and if there is still a power shortage, based on DR constraints, demand power will be shifted to future periods to respond.
(c) Power shortage within the micro turbine (MT) capacity: If the value of power shortage is within the MT capacity, then the MT will be operated and MT will be part of the circuit. If the MT excess generation occurs, then it returns to condition a). If there is still a power shortage, then it will return to condition b). Figure 4 represents the algorithm of power shortage. The "Excess generation" section in Figure 4 has been referred to Figure 3. When EV as a prosumer, is connected to H-MG, in a case of excess generation, it will be charged like ES. Furthermore, if there is power shortage, before shifting power to future intervals, EV as an energy storage should be discharged and respond to the load demand as possible.

Problem Formulation
The equations involved in the algorithm coding and setting are presented in this section, where the objective's function being considered is the maximization of profit. The objective function is written from the ownership of H-MG perspective.
Equation (1) represents the profit maximization formula, where R is the product revenue for the income ( ), and produced energy from: PV cells, discharged ES ( −), discharged EV ( −), MT, or/and selling power from the National Grid ( −). C indicates the costs of electricity consumption ( ) by PV cells, charged ES ( +), charged EV ( +), or/and buying power to the National Grid ( +). ∆ is the time step (hourly); which was considered as 1 h in this study. Therefore, the maximum profit could be calculated by summing the difference between R and C multiplied by ∆ for one day (24 h).
The constraints related to setting the power generation units (PV and MT) are presented in Equation (2). Minimum amount for PV and MT is zero and 3 kW, and maximum amount is 6 kW and 12 kW.
According to the existing energy storage ( ) units; the ES and EV, the energy capacity ( ) is represented in (3).
State of charge is a fundamental and essential parameter that reflects the battery's performance [3]. Therefore, the maximum and minimum limitation of is determined by the state of charge through the time ( ) which was set as shown in (4).
In addition, Equation (5) expresses the new state of charge at time t + 1 based on the absolute value of at time t summed with the difference between the charged and discharged power, through the time divided by at the which is the battery total capacity (which is a constant number). Therefore, the will always be updated after each period t using Equation (5) and the new charge condition of ES is identified.
The percentage is one of the important evaluation parameters used in this study.
is the discharge power at time t, is the charge power at time t, ∆ is the time step, and is the total capacity of the battery which is 2 kWh. As mentioned before, this parameter measures the state of charge for both ES and EV. When EV is part of the smart power network it will be treated the same as ES and it will satisfy the condition in Equation (5) but if EV was disseminated for a period of time from that network and then rejoins again then EV's state of charge ( ) should be calculated. That will provide the network with realistic information.
As mentioned in Section 2, since EV is away from home from 09:00 until 18:00, then it will not be connected to H-MG, and that will definitely affect the vehicle's state of charge because of the vehicle driving mileages. Therefore, Equation (6) [33] has been used in this paper to calculate the EV's present SoC (State of Charge). It depends on the distance travelled (∆ ), the efficiency coefficient ( ), and the battery's total capacity ( ). This equation has been used in Europe and the USA to calculate the SoC for EV. It is implemented only at 18:00 pm before EV is connected to H-MG again.
The value of shifted demand power in each time interval is presented in (7). Where is the ratio between the maximum shiftable power and the load demand, is the power load demand at time t, and is the available shifted power at time t.
≤ × Equation ( In Equation (9), the is the exchange power at time t and is the coefficient of total microgrid capacity. This coefficient is multiplied by the power produced from MT, PV cells, discharged ES ( −), and discharged EV ( −). As H-MG exchanges power with the national grid, Equation (10) is crucial to determine the power sold or bought to/from the grid for better use of the resources available and to control the exchanging process. ≤ Equation (11) provides a prevention from too much shifted power and accumulating non-responded power, the proposed EMS can buy power from the grid if the needed power is greater than a specific value. * is the limit coefficient when buying from the grid at time t which is 3 kW, and is the bought power from the grid. As mentioned before, ( +) represents the selling to the Grid condition whereas ( −) represents buying from the Grid condition.
The constraints related to dynamic pricing are defined in (12) to (13). The offered price ( ) should be between no value (zero) and market clearing price (MCP) at time t.
The buying offer , will be between zero and the system selling price ( ) as shown in Equation (12) where will be between zero and the system purchase price ( ) as shown in Equation (13).

Simulation Results
The simulations were performed on an Intel Core i5-3320M @ 2.60 GHz computer with 8 GB RAM. Pure MATLAB software was used to solve the optimization problems without using any special toolbox. The performance of the system proposed was investigated in 24-h intervals. As it can be observed from Figure 3, when there is no EV, ES plays an essential role in responding to load demands. This is when EV is part of the H-MG, EV manages to answer the load demands as an adjunct assistant. As it can be seen in Figure  5b, ES could be in fully charged mode for 80% of the day with the presence of EV, whereas based on Figure 5a the number is 65% when EV is not present there. In other words, EV manages to lower the pressure on ES.  Figure 6 which represents the DR profile, clearly shows that the presence of EV reduces the amount of the shifted power and helps the H-MG to increase its independence and profit, in that, once H-MG faces shortage power, it has to use MT or buy power from the grid to be able to answer to its shifted power which will cost the H-MG's, meaning the H-MG finds it hard to earn profit by selling power to the grid. The amount of shifted power when EV is/isn't connected to H-MG is presented in Table 1.  Based on these results, there are two main achievements. First, the amount of shifted power has been decreased from 9.2 kW to 1.1 kW. Next, the responsiveness percentage to the shifted load reduced from −87% to −41%; minus means that the amount of responded power is less than requested. Figure 7 illustrates the buy/sell amount of power from/to the grid with and without the presence of EV. As it was mentioned before, EV's performance could substantially reduce buying from the grid which means increasing the independency of H-MG. One of the reasons for selling too much power to the grid is the absence of EV. Since the H-MG is not able to fulfill the requirement beside considering DR constraints, H-MG will not be able to shift more power to the future intervals. Therefore, H-MG has to operate MT. Thus, after starting MT, the amount of production exceeds consumption, and H-MG has to sell the excess generation power. Although MT manages to respond to the required power, it should be noticed that one of the side effects of that is air pollution.   Figure, ~ , , , and , represent the MPC prediction value during each time interval, calculated MPC without considering EV, and calculated MPC with considering EV, respectively. Although in some intervals the amount of the calculated MCP by applied algorithm is more than the predicted MCP, in general, calculated MCP in accordance with predicted MCP shows cost reductions. In the presence of EV, calculated MCP illustrates 26% cost reduction while when EV is not connected to the H-MG, the cost reduced by 17%.

Conclusions
Electric vehicles for smart homes could be compared to a pump storage hydropower plant for power networks. They can store energy during low load hours, particularly during the night and answer loads during peak hours. On the other hand, customers' participation in DR strategy can contribute to a balance in supply and demand. Making a profit and reducing costs are the other advantages of DR for consumers. In this article, the impact of EV presence on DR in H-MG has been investigated. The proposed EMS has applied the DE optimization method to find optimum set points. The priority is using renewable resources. Yielded results show that proposed EMS manages to reduce the value of MCP and shifted power.
The model proposed showed great potential, therefore this encourages further investigation to consider other constraining parameters and create a robust system, such as considering the inter-temporal dependencies between the EV charging (or discharging) and the need to use the EV at a given time where the strategy for managing the EVs is to link the EV usage and lifestyle of the persons. For the future work, concentrating on the contract between customers and the providers can be of paramount importance. Partial participation for consumers in DR is more reflective of real-life situations.
Author Contributions: All persons who meet authorship criteria are listed as authors, and all authors certify that they have participated sufficiently in the work to take public responsibility for the content, including participation in the concept, design, analysis, writing, or revision of the manuscript. Furthermore, each author certifies that this material or similar material has not been and will not be submitted to or published in any other publication before its appearance in the Energies, MDPI. All in all, the contribution of all authors is almost equal. All authors have read and agreed to the published version of the manuscript.

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