An Optimization Based Power Usage Scheduling Strategy Using Photovoltaic-Battery System for Demand-Side Management in Smart Grid

: Due to rapid population growth, technology, and economic development, electricity demand is rising, causing a gap between energy production and demand. With the emergence of the smart grid, residents can schedule their energy usage in response to the Demand Response (DR) program offered by a utility company to cope with the gap between demand and supply. This work ﬁrst proposes a novel optimization-based energy management framework that adapts consumer power usage patterns using real-time pricing signals and generation from utility and photovoltaic-battery systems to minimize electricity cost, to reduce carbon emission, and to mitigate peak power consumption subjected to alleviating rebound peak generation. Secondly, a Hybrid Genetic Ant Colony Optimization (HGACO) algorithm is proposed to solve the complete scheduling model for three scenarios: without photovoltaic-battery systems, with photovoltaic systems, and with photovoltaic-battery systems. Thirdly, rebound peak generation is restricted by using Multiple Knapsack Problem (MKP) in the proposed algorithm. The presented model reduces the cost of using electricity, alleviates the peak load and peak-valley, mitigates carbon emission, and avoids rebound peaks without posing high discomfort to the consumers. To evaluate the applicability of the proposed framework comparatively with existing frameworks, simulations are conducted. The results show that the proposed HGACO algorithm reduced electricity cost, carbon emission, and peak load by 49.51%, 48.01%, and 25.72% in scenario I; by 55.85%, 54.22%, and 21.69% in scenario II, and by 59.06%, 57.42%, and 17.40% in scenario III, respectively, compared to without scheduling. Thus, the proposed HGACO algorithm-based energy management framework outperforms existing frameworks based on Ant Colony Optimization (ACO) algorithm, Particle Swarm Optimization (PSO) algorithm, Genetic Algorithm Hybrid Genetic Particle swarm


Introduction
Electrical energy is one of the most indispensable needs of human life. Developing countries cannot optimally meet this basic need for residents due to limited financial budgets and scarce generating stations. The electric utility companies involuntary move towards load shedding to partially satisfy their consumers. However, load shedding is not the unit hosting the Smart Home Controller (SHC) module (an issue that is strictly related to the task of developing efficient and tailored solution algorithms) and a comprehensive and detailed cost-benefit analysis of the proposed residential EMS were performed using approaches such as the ones presented to generate highly realistic sequences of events. EMS's modular design for a grid-connected battery-based microgrid was presented in [9]. The developed model was for power generation-side using MILP to handle charging and discharging of batteries, to encourage self-consumption, and to reduce operating costs.
The proposed model has been tested and experimentally validated at Alborg University at the Microgrid Research Laboratory. However, this optimization problem can be enhanced if power losses and DR programs are considered. In [10], a complete scheduling scheme including distributed generation and residential load was modeled using RESs. However, the carbon emission was not considered, which is interdependent in distributed generation.
To resolve the problems accompanied by mathematical methods, game-theoretic-based approaches are adopted. For example, in [11], an adaptive game-theoretic-based model is proposed to solve the DSM problem by reducing the Peak to Average Ratio (PAR) and saves the nearby cost location. A Nash game theory-based optimization model is developed for scheduling building energy consumption under utility and RESs. The proposed model minimizes energy cost, maintains consumers' comfort levels, and reduces peak demands within the imposed constraints. The model is verified with the case studies of the nearby location in Sydney. It also makes sure that the user does not make a profit if the user diverges from the consumption pattern assigned to the user. The numerous algorithms' performance parameters are assessed, and their effects have been discussed on the PAR and energy costs. However, the mechanism of Common Storage Facility (CSF) discharge on a bidding process has not been considered. In [12], a game theory-based, dynamic pricing strategy for the commercial and residential sector electricity market of Singapore was proposed. The model was evaluated with five loads and datasets prices to cover all events, i.e., weekdays, weekends, public holidays, and the highest/lowest demand in the year. Three strategies of the prices were compared and evaluated, i.e., the half-hourly Real-Time Pricing (RTP), Time-of-Use Price (TOUP), and Day-Night (DN) pricing. The outcomes show that the RTP increases the peak load reduction for the residential and commercial sectors by 10% and 5% percent. Furthermore, an increase in the profit by 15.5 percent and 18.7 percent has been observed, and a reduction in the total load is minimized for a realistic scenario. Moreover, tests on the satisfaction functions that are different from one another were performed, which includes many user types who knows the impact of RESs on DSM by taking the dynamic pricing technique and know that the impact of dynamic pricing on short-term Priced Elasticity Demands (PEDs) for the long term is not catered. The Stackelberg game approach and the DR model for trading electricity between utility companies were developed in [13]. The purpose was to balance the supply and demand by smoothing the load demand curve. The 1-leader was expressed by the interaction between the leader utility company and follower N-follower. The Stackelberg game was employed for solving the optimization problem. The RTP as a pricing function was adopted with the primary aim to encourage the user to join the game to determine the optimal power generation and power demands. However, the distribution network evaluation with the nodal pricing approach was not discussed. A hierarchical system model was introduced in [14], where multiple providers and prosumers interacted to set the best price and demands for the electricity market. The purpose of the model for overall energy management was to increase a prosumer's capacity to produce more energy and to reduce the dependency on the utility electricity service providers. Thus, in the proposed work, the price and demands have been improved considering the limitations and various providers and prosumers by creating a Stackelberg game to model two types of interactions: (i) provider-consumer and (ii) prosumer-prosumer. Hence, it is verified that there is a unique equilibrium solution, and it is evident from the results that the proposed method improves energy consumption and cost. A voltage and frequency relaying scheme-based DSM model is proposed in [15]. The purpose is to minimize the load on 11 kV distribution feeders in peak hours without blanket load shedding. This model's development is a crucial step towards cleaner production that minimizes load during peak hours and Green House Gas (GHG) emission. However, classification modeling to learn anomalous events and vitals are not considered. Game theory methods have their inherent limitations, which deprived them of optimal solutions. Thus, heuristic algorithms are adopted to cater to DSM problems. For instance, DSM framework is presented in [16], PSO algorithm is used to minimize the PAR and cost of the electricity, which results in achievement of the optimal sharing schedule and sharing the PEV battery with those nearby. However, the resultant system is complex. In [17], an optimal energy scheduling strategy for Home Energy Management (HEM) was developed. The purpose is to acquire the desired tradeoff between cost and benefit. However, the user comfort in terms of waiting time is increased while reducing cost and increasing benefits. The authors presented an efficient DSM system that minimizes the cost of electricity and PAR in [18]. However, users face frustration in terms of waiting time while reducing their costs. In [19], the authors presented a generic DSM model for HEM to minimize electricity cost, appliance waiting time, and PAR. However, the power grid's reliability and sustainability, and balance between supply and demand were not catered to, which are indispensable in DSM. The residential loads were controlled and monitored for a smart home in [20], in which the author has proposed the Grey Wolf Accretive Satisfaction Algorithm (GWASA) and have compared the achieved results with other algorithms that resultantly reduced the cost of electricity. However, the PAR was not addressed. In [21], an efficient heuristic algorithm-based EMC utilizing RESs, and TOUP and Incline Block Rate (IBR) tariffs was developed for DSM. The DSM problem formulated was mapped to reduce the electricity cost, user discomfort, and PAR. The simulation results confirmed that the required objectives were obtained and that the sustainability of the SG increased. However, the authors do not address the following issues: (i) appliances waiting time, (ii) frequency of interruption, and (iii) demand curve smoothing. An innovative home appliance scheduling framework was proposed in [22]. The Grey Wolf and Crow Search Optimization (GWCSO) algorithm was used and reduced the PAR and electricity cost. However RESs were not addressed. To reduce the PAR, appliance waiting time, and electricity cost for residential consumers, the generic DSM model was studied in [23]. A GA-based Energy Management Controller (EMC) was developed for DSM under DR program. The GA-based EMC scheduled the residential load, keeping in view the operation limitations of users. To avoid rebound peaks, a combined RTP and IBR tariff was used. The developed model is useful for both single and multiple users. However, the balance between supply and demand, user comfort, reliability, and sustainability of the grid was not catered. In [24], the authors proposed an incentive-based optimal energy consumption scheduling algorithm in HEM. The energy demand during peak hours were minimized using the TOUP and DR program. To enhance the cost-saving, a heuristic BPSO technique was used for appliance scheduling based on HEM and RES. However, Consumers' comfort were ignored, which is essential in energy consumption scheduling. An EMC was designed based on heuristic algorithms such as GA, Bacterial Foraging Optimization Algorithm (BFOA), Wind Driven Optimization (WDO), PSO, and Genetic Binary Particle Swarm Optimization (GBPSO) algorithms in [25] to reduce electricity price and PAR. However, the system model was more complicated. In [26], an optimal control strategy was proposed using GA to obtain the minimum cost of electricity based on the user's response, dynamic pricing, and equipment operating power. The proposed technique determines the optimal operating parameters of each piece of equipment. However, a limited number of appliances were taken into account. The residential consumer power scheduling for DR was discussed in [27]. For scheduling, two types of electric appliances, power-flexible and time-flexible, were considered. However, the PAR was ignored, which is strongly related to electricity cost. In SG, an advanced RTP algorithm for DSM was presented in [28] to reduce electricity cost. The main aim was to communicate among smart meters and utility by exchanging control messages, including real-time cost information and consumer energy consumption. However, the DSM was performed on increased system complexity.
A device and ESS scheduling schemes were presented in [29]. The consumers scheduled their devices by observing the low peak hours and by extending the electricity cost using smart electricity storage. The latest and updated comprehensive review of the literature in terms of proposed algorithms, objectives, and limitations are conducted and listed in Table 1. The proposed combination model is applied for energy management of the residential sector [5] SQP and BPSO The proposed model performed energy management efficiently The irregular and indeterminate renewable energy characteristics will raise substantial challenges Smart home energy management system model [6] MILP Efficiently schedules the household thermal and electrical appliance using time-varying pricing to minimize financial expenses and ensure peak demand clipping The system is more complicated A DR program is employed in different levels [7] MILP Each level is implemented with uncertainty consideration The technology barriers such as sensing, controlling, monitoring, and communication infrastructure and markets such as policies, regulation, and structure are not considered.
DSM of a home including smart appliances, EVs, ESS, and PV in [8] Indexed pricing models Maximize self-generation and minimize cost by reducing utility purchase Investigation on minimum software and hardware requirements for the unit hosting the SHC module is not addressed EMS modular design for a gridconnected battery-based microgrid in [9] MILP Promote self-consumption and reduce operating cost Optimization problem can be enhanced if power losses and DR programs are considered Optimal scheduling scheme for smart residential community [10] MILP To minimize electricity cost and peak load carbon emission is not considered An adaptive game-theoretic-based model is proposed to solve the DSM problem in [11] Game-theoretic model Minimizes energy cost, maintains consumers' comfort level, and reduces peak demands within the imposed constraints The mechanism of CSF discharge on a bidding process has not been considered Dynamic pricing strategy for the commercial and residential sector is proposed in [12] Game-theoretic model Peak load is reduced for the residential and commercial sectors Impact of dynamic pricing on short-term PEDs for the long term is not catered DR model for trading electricity between utility companies are developed in [13] Stackelberg game Balance the supply and demand by smoothing the load demand curve Distribution network evaluation with the nodal pricing approach is not discussed A hierarchical system model is introduced in [14] Stackelberg game Increased a prosumer's capacity to produce more energy and reduce the dependency on the utility electricity service providers The system is more complex A voltage and frequency relaying scheme based DSM model is proposed in [15] Game-theoretic model Minimizes load during peak hours and GHG emission Classification modeling to learn anomalous event and vitals are not considered.
DSM framework is presented [16] PSO To reduce PAR and electricity cost The system is more complex

Reference(s) Algorithms(s) Objective(s) Limitation(s)
For HEM, an optimal energy scheduling strategy is developed in [17] Polyblock approximation algorithm To obtain the desired tradeoff between cost and benefit DTR is increased An efficient DSM system is presented in [18] Scheduling algorithm Reduce the cost of electricity and PAR Increased waiting time A generic DSM model for HEM is presented [19] GA To reduce PAR, appliances waiting time and electricity cost Power grid reliability and sustainability are not cosidered Residential load for smart home is presented [20] GWASA To reduce electricity cost PAR is not addressed An efficient heuristic algorithm is developed in [21] Heuristic algorithms To reduce user discomfort, PAR, and electricity cost Demand curve smoothing is not considered Home appliance scheduling framework is proposed [22] GWCSO To reduce electricity cost and PAR RESs are not considered A DSM model is studied in [23] GA To reduce PAR, electricity cost, appliances waiting time and avoid rebound peaks Sustainability of power grid is considered An incentive-based optimal energy scheduling for HEM [24] BPSO To Minimize electricity cost and shift the load from high peak to low peak RESs integration is not addressed EMC is designed based on heuristic algorithms [25] Four heuristic algorithms To reduce electricity cost and PAR The system is more complex Ref. [26] GA and loop search optimization algorithm To minimize electricity cost Limited number of appliances are considered DR program is presented in [27] Power scheduling strategy To reduce electricity cost PAR is not considered DSM is presented in [28] Novel real-time pricing algorithm To minimize the electricity cost The system is more complex An intelligent energy management framework is presented in [29] Aggregator To reduce electricity cost by storing power during off-peak hours The system is more complex The above-discussed methods are valuable assets of literature, and all are capable of solving DSM problems. However, the mathematical techniques suffer from several drawbacks such as the incapability to cater to stochastic and nonlinear effects, the necessity of considering all the periods at once, shifting the load to unfeasible hours, and the risk of high-dimensionality of the problem. Furthermore, the mathematical models are much more complex and exhaust too much time, and returned solutions are not robust in a real-world context. The game theory-based methods suffer due to the techniques of solving games involving mixed strategies, particularly in a large pay-off matrix, being very complicated, and the competitive problems cannot be analyzed with the help of game theory. Furthermore, the assumption that players know their pay-offs and pay-offs of others is not practical. Similarly, heuristic algorithms suffer from the vast majority of cases being unable to deliver an optimal solution to the scheduling problem. For example, heuristic algorithms suffer from premature convergence that leads to losing population diversity and does not have standard parameters adjustment and termination criteria. Moreover, the above-discussed literature did not cater to electricity cost, carbon emission, user comfort, and PAR simultaneously. In this work, a novel HGACO algorithm-based energy management framework is proposed to simultaneously solve the DSM problems and to cater to all objectives. The novelty and major contribution of this work is as follows.
• An optimal energy management framework is developed utilizing the SG's two-way communication infrastructure under utility and RESs for solving the DSM problems. • The developed energy management framework has an EMC based on our proposed HGACO algorithm that schedules smart home loads. • The DR program's RTP scheme is mathematically modeled and implemented to actively engage consumers in DSM to facilitate both consumers and utility.
• A hybrid generation system comprises PV, ESS, and electric utility companies to resolve the energy management problems. • In addition to electricity cost and PAR, carbon emission and user discomfort in terms of waiting time are mathematically modeled and catered simultaneously. • To handle the power consumption of smart home appliances in a hybrid generation system, an objective function and constraints are developed that reduce the electricity cost, PAR, and carbon emissions and the maximize user comfort. • To demonstrate the efficiency of the proposed HGACO-based optimal energy management framework through simulations by comparing it with existing energy management frameworks based on GA, BPSO, HGPSO, and Ant Colony Optimization (ACO).
The organization of this work is as follows: The system model is described in Section 2, and the simulation results, performance, evaluation, and discussions are illustrated in Section 3. At the end, this work is concluded in Section 4.

System Model
In this work, a system model is proposed for optimal energy management in SG to simultaneously cater electricity cost, carbon emission, user discomfort, and PAR. An abstract view diagram of the proposed model is shown in Figure 1. The proposed model comprises Advanced Metering Infrastructure (AMI), smart meters, ESS, PV, smart home appliances, power grid, and In-Home Display (IHD). The DSM framework utilizing twoway communication infrastructure for optimal energy management is shown in Figure 1.

Advanced Metering Infrastructure/Two-Way Communication Infrastructure
AMI is the central processing unit of the proposed model, including Communication Module (CM) and Meter Data Management System (MDMS), which is shown in Figure 2. The AMI is used for automated bidirectional communication between the power supplier and smart meter. Moreover, the AMI is responsible for collecting and transmitting consumption data transmitted from distributed smart meters to power supplier company and for transmitting the DR signal in real-time to smart meters from the utility company. The energy consumption data is received by a concentrator and fed to the MDMS. The MDMS analyzes the received energy consumption data and extracts useful information from the data. The extracted favorable information is delivered to the power supply company. The detailed and useful information provided by AMI in real-time empowers the power supplier company to detect power outages, to measure electricity bill, to schedule maintenance, and to manage assets. The power supplier company provides price-based DR programs to AMI to encourage consumer participation in DSM via scheduling their energy usage pattern to reduce electricity cost, PAR, and carbon emission. The power supply company can also turn on and off household appliances to optimize energy consumption. Between the AMI and the EMC, a smart meter is mounted and used to read and to process the consumption data transmitted to the power grid. For further utilization, the DR signal is sent to the EMC. The EMC in the DSM framework receives the DR signal, power from RESs and utility company, and consumer's preferences to schedule consumer energy usage as shown in Figure 1. The EMC transmits the generated energy usage schedule to consumers via a two-way communication infrastructure.

Price-Based Demand Response Programs
Various types of price-based DR programs such as RTP, Critical Peak Pricing (CPP), TOUP, and Day-Ahead Pricing (DAP) exist in the literature [30]. Among these pricing signals, RTP provides better flexibility and encourages consumers to participate actively in DSM. Thus, we used the RTP signal in our work, where the day time horizon is divided into three price hours: on-peak price hours, mid-peak price hours, and off-peak price. The RTP signal is mathematically modeled as in Equation (1).
where φ 1 is on-peak hours, φ 2 is mid-peak hours, φ 3 is off-peak hours, and t 1 to t 24 are 24 day time slots. The EMC receives this RTP signal and power signals of RESs and utility to create consumer's energy usage schedule.

Renewable Energy Sources
In nature, RESs include PV, wind, fuel cell, tidal, biogas, etc. However, among RESs, PV is abundant, free (small operation and maintenance cost), and at ease for all consumers. Therefore, in this work, PV is considered as a renewable source. The houses and power grids are equipped with PV panels. The purpose is to effectively utilize energy from the PV system to minimize electricity cost, PAR, and carbon emission. The following mathematical equation determines the output power form PV system (2) [31].
where E pv is the output energy produced in an hour, ∂ pv is the energy efficiency of PV panel, and A pv is the area of PV panel. The outdoor temperature and solar irradiation are represented by Temp(t) and Irr(t), respectively, for the time interval t, and 0.005 is the temperature correction factor. The solar irradiation for an hour are modeled using the Weibull probability density function, which is illustrated in Equation (3).
where 0 < Irr(t) < ∞, ω is a weighted factor, ψ1 and ψ2 are the shape factors, and λ1 and λ2 are the scale factors. The EMC utilized the energy generated from a PV system for scheduling during on-peak hours and for storing it in ESS during off-peak hours or when the energy is surplus.

Energy Storage System
ESS is touted as a "Holy Grail" in alleviating greenhouse gas emission due to high penetration in electric vehicles, in plug-in electric vehicles, as backup generators during grid outages, and as storage with RESs. The purpose of ESS is to convert the power grid into a carbon-free system. The ESS when used with RESs such as PV panels, wind turbine, etc. takes the generated clean energy during daytime (sky is clear, shinny, and sunny) and stores it. The stored energy is sent back to the power grid on cloudy days, at night, or whenever required. Moreover, the ESS smoothes out the fluctuating nature of RESs up to some extent. Thus, the ESS significantly lowers greenhouse gas emissions and potentially reduces the electricity bills of prosumers exchanging energy with the power grid when demand is at peak and energy prices are highest [32]. In this work, the ESS stores energy during off-peak hours, when power is in surplus, or when the battery is empty (storage level is lower than the lower charging cutoff). The ESS is mainly to efficiently utilize the output of the PV system. During charging and discharging of ESS, some energy is lost; thus, the turn around in efficiency of ESS is mathematically modeled in Equation (4).
where PS is stored energy (kWh) at time t, µ ESS is ESS efficiency, η is time duration in our hours, EE Ch is power supplied (kW) from PV to ESS, and EE Dch is the power supplied (kW) from ESS to the load. Avoiding deep discharging/overcharging the following limits are set.
The EMC receives the RTP signal, the power signal of RESs and utility, and consumer's priorities of appliances operation to create an energy usage schedule.

Users' Smart Appliances
In the DSM framework, users' smart appliances, instead of interacting with each other, directly interact with EMC. The EMC would schedule the smart appliances' operation using the RTP signal, the power signal of RESs and utility, and consumers' priorities. In this work, home appliances are categorized into three types: Shiftable Interruptible Appliances (SIAs), Shiftable Uninterruptible Appliances (SUAs), and Regular Appliances (RAs). The RAs are not considered for the proposed model because RAs operated for 24 h consistently. Thus, the delayed or advanced operation for such appliances is not possible. That is why RAs do not participate in scheduling. Only the SIAs and SUAs interact with the proposed model's EMC and participate in scheduling for DSM to reduce electricity cost, PAR, and carbon emission. SIAs include humidifiers, water heaters, and dishwashers, and SUAs include clothes dryers, EVs, and washing machines. The parameter details of these appliances are listed in Table 2. This classification and parameters are adopted from [33]. The total energy consumption per day for SIAs can be determined using Equation (8) adopted from [34].
where E shi is total energy consumption, A s combination of SIAs, D shi ∈ A s represents all the appliances from SIAs, Ω shi represents the power consumption of each appliance, δ shi shows the on/off status of appliances, and β represents the unit price. The total cost per day of all the SIAs in time interval T can be calculated using Equation (9).
The total energy consumption per day for SUAs can be calculated using Equation (10).
where E shu is total energy consumption, A s is the combination of SUAs, D shu ∈ A s represents all the appliances from SUAs, Ω shu defines the power consumption of each appliance, δ shu shows the on/off status of the appliances, and β represents the unit price. Total cost per day of all the SUAs for time interval T is obtained using Equation (11).
In this work, the EMC is programmed based on our proposed HGACO algorithm to generate an optimal power usage schedule using the received the RTP signal, the power signal of RESs and utility, consumer's priority, and appliance power ratings. The developed power usage schedule is shared with smart appliances using a two-way communication infrastructure.

Proposed HGACO Algorithm
A novel algorithm is proposed, namely HGACO algorithm. The EMC controller is programmed using our proposed HGACO algorithm to perform DSM via optimal power usage scheduling, resulting in reduced electricity cost, carbon emission, PAR, and user discomfort. The HGACO algorithm control parameters are listed in Table 3. The detailed description of HGACO algorithm is as follows. HGACO algorithm is developed by hybridization of the ACO algorithm and GA. The motivation for this hybridization is that the ACO algorithm is capable of electricity cost and carbon emission reduction, while GA is effective in PAR reduction. Thus, we developed HGACO algorithm by applying a crossover and mutation operation of GA on the optimal global results obtained from the ACO algorithm to simultaneously reduce electricity cost, alleviate PAR, and minimize carbon emission. ACO is based on the following three steps: (i) problem definition, (ii) parameters initialization, and (iii) position update. In problem definition, the proposed model minimizes electricity cost, carbon emission, and PAR subjected to total energy consumption being less than the grid capacity. Different parameters such as swarm size represent the number of ants in our proposed model that are appliances, then initialize evaporation rate ∂ = 0.5, and then update the ACO position. Initially, each ant can choose any path, so we have six ants (6 appliances) and 24 paths (24 h). Each ant has a 1/24 probability to choose a path out of 24 paths. According to the ACO algorithm, one path is the minimum distance compared to other paths out of 24 paths. It is assumed that all paths have equal pheromones because we do not have previous knowledge of the solution paths at the start. During operation, knowledge is gained about the fitness of each path. Therefore, the pheromone on each path is updated first. The pheromone update formula confirms that the pheromone associated with the best solution increases while it decreases for other solutions, in other words, evaporates. The pheromone updates the formula as follows: where Equation (12), ∂ ∈ (0, 1) is a user-defined parameter known as evaporation rate, and the value of ∂ is 0.5. χ old ab is the pheromone amount in the beginning when the a th variable attains b th value. ∆χ k ab is the pheromone amount laid by the k th ant and is given by the following formula.
In Equation (13), Q is a constant. Usually Q = 2, and it is clear that, in initial iterations, when the difference between fbest and fworst is large, the ratio of fbest/fworst is small and Q is fbest/fworst. As the iterations progress, the difference between fbest and fworst will be small, the ratio fbest/fworst will tend to 1, and Q fbest/fworst will tend to Q = 2. This pheromone deposition property confirms that less pheromone is deposited in early iterations to avoid the suboptimal solution's stagnation. In Equation (12), only the best ants can deposit the pheromone. If there is more than one best ant at any iteration, then the summation extends the best ants. In this iteration, we have only one best ant, and therefore, the summation has only one term and the evaporation rate ∂ = 0 for the best ant. The pheromone update formula for best ant is as follows: For other ants, the updated formula is as follows: When the best path is selected, then the crossover operator is applied to further improve the global best derived from ACO. In the end, the global best results from the HGACO algorithm is passed through MKP, which further improves our desired results by checking the grid capacity if the scheduled load is greater than the grid capacity. Thus, the proposed algorithm will switch off the appliances that were operated more than the rest of the appliances and when the scheduled load is less than the grid capacity. Then, the proposed algorithm will switch on some appliances to achieve the optimal solution. The optimal global best schedule result is achieved after MKP. Then the appliances will be scheduled as follows: schedule the appliances without photovoltaic-battery systems, with PV, and with photovoltaic-battery systems, where the electricity cost is computed in Equations (9) and (11), where carbon emission is from Equation (17), and where PAR is from Equation (18). Then, check the condition: if the value for hour is less than 24, the program will run again for another hour to schedule all the smart appliances; if not, the program is terminated. The overall implementation flowchart of the proposed model is depicted in Figure 3.

Initialize HGACO Parameters
Construct Solution using the probability distribution (Pheromone Trail)

Find the fbest and bworst
Updating of Pheromone

Problem Formulation
The proposed model's main objectives are to minimize electricity cost by scheduling power consumption patterns consumers, to alleviate carbon emission, to maximize user comfort, to mitigate PAR, and to cope with the gap between demand and supply. First, every objective is elaborated and formulated individually. Then, the overall DSM problem is formulated. Electricity cost is the bill that a utility company issues to a consumer for the consumed electricity during the specified time interval. The proposed model includes two types of appliances: SIAs and SUAs. The cost paid by consumers for using SIAs is α a ξ shi and is formulated using Equation (9); the cost paid by consumers for using SUAs is α a ξ shu and is formulated as in Equation (10); and the total cost is mathematically modeled as in Equation (16).
where Π represents total electricity cost paid by the consumers for operating both SIAs and SUAs.
Carbon emission is the release of carbon into the atmosphere while operating both SIAs and SUAs. The mathematical formula for carbon emission as follows.
Equation (17) shows carbon emission in pounds, where avgEP represents the average amount of electricity price, ε shows the price per kWh, ς shows electricity emission factor, and represent hour in a day.
PAR is the ratio of peak power consumption to average power consumption for specific time slots. The reduction of PAR is beneficial for consumers and utility because it helps to minimize the gape between demand and supply. It is represented by PAR and mathematical formulated as follows: where the power used by appliance is Φ t in time t. User comfort is measured in terms of various aspects such as waiting time, energy consumption, temperature, air quality, illumination, humidity, and demographic profile of the smart home users [35]. This study measures user comfort in aspects of Delay Time Rate (DTR). The DTR is the waiting time that an appliance faces before starting operation. The consumers face delay because the EMC shifted the consumers' load from on-peak hours to off-peak hours by giving an incentive to them. The consumers' power usage pattern is different with and without scheduling because consumers' activities are shifted from high-price hours to low-price hours subjected to rebound peak avoidance. A tradeoff exists between electricity cost and DTR: those consumers who tolerate high DTR will pay less utility bill, and those who cannot accept DTR will pay a high utility bill. The user comfort in terms of DTR is formulated as follows in Equation (19).
The term w b coveys a DTR that each appliance faces due to delay or advances in operation, T o,unsch b,t represents the appliance status without scheduling, T o,sch b,t depicts appliance status with scheduling, and T lo b represents length of total operation timeslots. The heuristic-based EMC schedules the power usage pattern of consumers in response to the RTP signal and consumers priority. The maximum delay that an appliance can tolerate is determined by Equation (20).
where w d b represents the maximum delay that an appliance may face while shifting operation from on-peak hours to off-peak hours and T t b conveys the appliances total time interval. The user comfort is negatively related to the maximum delay, i.e., with the increase in w d b , the user comfort is compromised. The percentage discomfort can be computed using the Equation (21).
The overall objective function DSM problem is to alleviate electricity cost, to minimize carbon emission, to reduce user frustration, and to mitigate PAR by scheduling consumers energy consumption. The objective function is formulated as a minimization problem as follows.
The minimization problem in Equation (22) has the following constraints: Constraint (23) shows that the total PAR must be less than or equal to grid capacity P c . The grid capacity is the amount of power available from the power grid. This constraint helps to avoid power shortage or the blackout problem. Constraint (24) shows the scheduling interval. Constraint (25) shows the power consumption constraint in which the total power consumption before and after scheduling remains the same. Constraint (26) shows that appliance status before and after scheduling is not the same. Similarly, constraint (27) shows that the operation time of appliances before and after scheduling are the same, where I is the operation time of appliances and there are t 1 to t 24 time slots in a day.

Simulation Results, Performance Evaluation, and Discussions
The proposed model's simulations based on the HGACO algorithm are conducted in MATLAB R2013b compared to the benchmark algorithms GA, PSO, ACO, and HGPO. These algorithms are chosen as benchmark due to architectural similarities to the proposed algorithm. The control parameters for both proposed and benchmark algorithms are chosen subjected to pair assessment. The proposed model based on the HGACO algorithm and knapsack problem formulation to solve DSM problems result in electricity cost, carbon emission, PAR, and user discomfort reduction to enhance the reliability and sustainability of the power gird. Additionally, the proposed algorithm is capable of providing power to the utility giving peak hours from RESs. Two algorithms were taken: ACO effectively reduces carbon emission and electricity cost, whereas GA reduces PAR and MKP ensures the grid's reliability. The proposed HGACO algorithm and benchmark algorithms including RESs and ESS were compiled and run by considering three scenarios to evaluate the performance of said algorithms, where the first scenario is comprised without photovoltaic-battery systems, the second scenario only consists of PV, and the third scenario is comprised of photovoltaic-battery systems. Consider three power supply sources that are utility grid power supply, which is available 24 h a day; RES; and ESS to implement the proposed HGACO where the grid signals that are RTP, solar irradiance, and forecasted temperature is used in the proposed HGACO model, which are illustrated in Figures 4-6. The PV is considered a renewable source, and the power generated by PV system is dependent on solar irradiance and ambient temperature. The charging level of ESS and the estimated renewable energy is shown in Figures 7 and 8. The proposed and benchmark algorithmbased EMCs actively engage consumers in DR programs to schedule consumers' power usage using pricing signal (RTP), power signal from RESs and utility, and consumers preferences. The generated schedule without participating in the DR program and the proposed algorithm-based EMC that actively engages consumers in DR programs are shown in Tables 4 and 5, respectively.       From the above results listed in Tables 4 and 5, it is evident that the schedule generated by the proposed HGACO algorithm is optimal. This optimal schedule is because the proposed algorithm shifted the load to off-peak hours and mid-peak hours operating in on-peaks subjected to avoiding rebound peaks. The detailed discussion and evaluation of each scenario are presented in the subsequent sections.

Scenario I
In scenario I, the consumer's power usage schedule of the proposed algorithm and benchmark algorithms without photovoltaic-battery systems is discussed. In scenario I, the evaluation of each objective's achievement, such as electricity cost, PAR, carbon emission, and user comfort, is discussed as follows. The electricity cost of scheduled and unscheduled loads without photovoltaic-battery systems are illustrated in Figure 9 and Table 6. The maximum electricity cost of GA is 63.50 cents in time slot 7, that of PSO is 51.12 cents in time slot 4, that of ACO is 57.92 cents in time slot 16, that of HGPO is 63.76 cents in time slot 16, and that for the proposed HGACO algorithm is 48.36 cents in time slot 23. In 24 h, the unscheduled load's electricity cost is 921.19 cents compared to GA, PSO, ACO, HGPO, and HGACO, 660.86, 571.68, 512.69, 548.90, and 465.03 cents, respectively. Similarly, the total electricity cost evaluation of the proposed and existing algorithms is graphically shown in Figure 10. Thus, the proposed HGACO algorithm has a minimum electricity cost either per time slot or aggregated compared to the existing algorithms.    The assessment of PAR with and without scheduling is shown in Figure 11 and Table 7. The existing algorithms GA, PSO, ACO, and HGPO and the proposed algorithm HGACO minimized the PAR by 17.13, 13.38, 39.10, 4.64, and 25.72, respectively. The HGACO algorithm uniformly distributed the load in off-peak and mid-peak hours and achieved the desired objectives. In contrast, the benchmark algorithms generated reboud peaks while creating power usage schedules, which is dangerous for the reliability of the power grid. Thus, the proposed HGACO algorithm alleviated the PAR significantly compared to the existing algorithms.  In scenario I, the unscheduled and scheduled load's carbon emission is shown in Figure 12 and Table 8. The existing algorithms and the proposed algorithm emit less carbon compared to the without scheduling case. However, the proposed algorithm emits less carbon compared to all benchmark algorithms. The unscheduled load produces the maximum carbon emission at time slot 2, which is 6.49 pounds. In contrast, the existing algorithms GA, PSO, ACO, and HGPO emit maximum carbon at 4.65 pounds, 3.61 pounds, 4.02 pounds, and 3.86 pounds in time slot 21, respectively. Thus, all of the benchmark algorithms outperformed the without scheduling case in terms of carbon emission. However, the emission of carbon at time slot 21 of the proposed algorithm is 3.27, which is the lowest per time slot carbon emission compared to the existing algorithms. Similarly, the total carbon emission is discussed as follows: The without power usage scheduling case emits a total carbon emission of 116.78 pounds in scenario I. On the other hand, the benchmark algorithms GA, ACO, PSO, and HGPO and proposed algorithm HGACO emit total carbon at 83.77, 64.99, 72.47, 69.58, and 58.95 pounds, respectively. As compared to unscheduled carbon emission, GA reduced carbon emissions by 28.26 percent, ACO reduced carbon emissions by 44.34 percent, PSO reduced carbon emissions by 37.94 percent, HGPSO reduced carbon emissions by 40.41 percent, and HGACO reduced carbon emissions by 48.01 percent. Thus, the proposed algorithm is effective in carbon emission reduction either per time slot or in total.

Scenario II
In scenario II, the proposed model is compared with other benchmark algorithms via scheduling the home appliances with PV and achieving the best results, discussed as follows.
The electricity cost of scheduled and unscheduled load with PV is illustrated in Figure 13, and their numerical results are listed in Table 9. The maximum electricity cost of GA is 57.87 cents in time slot 7, that of PSO is 51.12 cents in time slot 4, that of ACO is 54.02 cents in time slot 22, that of HGPO is 59.14 cents in time slot 16, and that of HGACO algorithm is 48.36 cents in time slot 23. In 24 h, the unscheduled load's electricity cost is 816.68 cents compared to GA, PSO, ACO, HGPO, and HGACO algorithm, 556. 35, 467.17, 408.18, 444.39, and 360.52 cents, respectively. Similarly, the net electricity results for the proposed and existing algorithms compared to the without scheduling case is depicted in Figure 14. Thus, from the graphical and numerical results, it is evident that the proposed algorithm outperforms the existing algorithms in terms of per time slot and aggregated electricity cost.   The graphical and numerical results of PAR of scheduled and unscheduled load with PV are shown in Figure 15 and Table 10, respectively. The proposed HGACO algorithm and existing algorithms GA, PSO, ACO, HGPO, and HGACO reduced PAR by 21.69, 17.56, 34.49, 8.42, 13.29, respectively. The proposed algorithm uniformly distributes the load in off-peak hours and checks the grid capacity with the help of knapsack problem formulation to balance the load and to avoid rebound peaks. In contrast, the benchmark algorithms shift the load uniformly, resulting in rebound peaks that disturb the reliability of the power grid. From the results and discussion, it is evident that the proposed algorithm effectively shifts the load from peak hours to off-peak hours and reduced PAR, which is beneficial for both consumers and utility. Thus, the performance of the proposed algorithm is outstanding while scheduling with PV.  The performance evaluation of the proposed algorithm compared with existing algorithms in terms of carbon emission with and without scheduling using PV is depicted in Figure 16 and Table 11. From the results, it is evident that scheduling carbon emission to the environment is more than scheduling based on proposed and benchmark algorithm. On the other hand, the proposed HGACO algorithm reduced carbon emissions by 54.22% which is the highest reduction compared to the without and with scheduling based on existing algorithms. Thus, the proposed algorithm outperforms the existing algorithms in terms of carbon emission reduction.

Scenario III
In scenario III, the proposed algorithm and existing algorithms with photovoltaicbattery systems-based scheduling are performed to minimize electricity cost, to alleviate PAR, to reduce carbon emission, and to mitigate user discomfort. A detail discussion follows.
The electricity cost assessment using photovoltaic-battery systems with and without scheduling-based proposed algorithm and existing algorithms are depicted in Figure 17 and  Figure 18. The graphical and numerical results of the electricity cost validate that the electricity minimization of HGACO algorithm is significant compared to all other benchmark algorithms and without scheduling cases. Thus, the proposed HGACO algorithm is useful in terms of per time slot and aggregated cost reduction compared to the existing algorithms.  The PAR evaluation graphical and numerical results with and without scheduling, considering photovoltaic-battery systems is shown in Figure 19 and Table 13. The proposed algorithm HGACO algorithm minimize the PAR while adapting the behaviour of ACO and GA algorithms. The heuristic algorithms GA, PSO, ACO, and HGPO and the proposed HGACO algorithm minimize the PAR by 40.85, 32.29, 7.85, 4.96, and 17.40, respectively. The HGACO algorithm uniformly distributed the load in off-peak hours and achieved the desired objectives. Some of the benchmark algorithms create rebound peaks that disturb the reliability of the grid. From the results and discussion on PAR evaluation considering photovoltaic-battery systems, the proposed algorithm significantly reduces PAR compared to the existing algorithms, which is beneficial for both utility and consumers.  The carbon emission of unscheduled and scheduled loads considering photovoltaicbattery systems is shown in Figure 20 and in Table 14. The existing algorithms and the proposed algorithm emitted less carbon than the unscheduled load. The without scheduling maximum carbon emitted into the atmosphere is 5.44 pounds in time slot 21   The proposed HGACO algorithm-based scheduling was compared with other benchmark algorithm (GA, PSO, ACO, and HGPO)-based scheduling to evaluate the DTR that consumers face. The DTR evaluation of scheduled load using the proposed algorithm compared to benchmark algorithms are shown in Figure 21. The detailed discussion is as follows. In GA-based scheduling, average delays of 0.9, 1.6, and 0.5 h are confronted by SIAs such as humidifiers, water heaters, and dishwashers, respectively. Similarly, SUAs such as EVs, washing machines, and clothes dryers face average delays of 1.7, 2, and 0.75 h, respectively, depicted in Figure 21. The ACO algorithm-based EMC generated power usage schedule for SIAs such as humidifiers, water heaters, and dishwashers faces average delays of 1.4, 2, and 0.8 h. Likewise, the SUAs face delays of 2, 2, and 1.5 h observed for EVs, washing machines, and clothes dryers, respectively, which are illustrated in Figure 21.
The PSO-based EMC created power usage schedule faces delays of 1.95, 0.7, and 0.5 h for SIAs such as humidifiers, water heaters, and dishwashers, respectively. In a similar manner, SUAs confronted delays of 1.95, 2, and 1.75 h for EVs, washing machines, and clothes dryers, respectively, shown in Figure 21.
HGPO algorithm-based schedules introduce average delays of 1.2, 0.9, and 0.85 h for SIAs such as humidifiers, water heaters, and dishwashers, respectively. Likewise, average delays of 1.9, 2, and 1.5 h are posed to EVs, washing machines, and clothes dryers, respectively. This behavior is illustrated in Figure 21.
With HGACO-based power usage scheduling, average delays of 1.75, 2, and 1.6 h are posed to SIAs such as humidifiers, water heaters, and dishwashers, respectively. In a similar fashion, average delays of 2, 2, and 1.5 h are observed by SUAs such as EVs, washing machines, and clothes dryers, respectively. The DTR faced by consumers while using the HGACO algorithm is depicted in Figure 21. This evaluation concludes that a tradeoff exists between DTR and electricity because, when one wants to reduce their electricity cost, they may accept DTR.

Performance Tradeoff Analysis
The proposed HGACO algorithm confronted performance tradeoffs between different conflicting parameters while solving DSM problem via power usage scheduling. The first tradeoff analysis is observed between electricity cost and PAR. The proposed algorithm reduced the electricity cost significantly while the PAR increased a little bit. This tradeoff behavior is observed in all scenarios. However, this tradeoff is natural because it is observed for the proposed and existing algorithms. The second tradeoff analysis is visualized in the case of electricity cost and DTR. The proposed algorithm shifted the load from on-peak hours to off-peak hours to avoid rebound peaks and to reduce the electricity cost. Thus, the electricity cost is reduced significantly. However, while reducing the electricity cost, the DTR increased. Thus, the user will confront a little bit of discomfort. This tradeoff analysis is observed for both proposed and existing algorithms in all scenarios, which makes it evident that this tradeoff is natural and could not be completely avoided. However, the tradeoff between electricity cost and DTR is average for our proposed algorithm compared to existing algorithms. The performance tradeoff (cost and PAR, and cost and DTR) analyses for scenarios I, II, and II are listed in Tables 15-17, respectively. The tradeoff among unscheduled load, the benchmark, and proposed algorithms with PV is shown in Table 16; it shows that HGACO is best in terms of electricity cost, PAR, carbon emission, and DTR. The tradeoff among different algorithms and unscheduled load without photovoltaic-battery systems is shown in Figure 10, where the HGACO is best in terms of producing minimum electricity cost.

Conclusions
This study introduces an optimization-based energy management framework to schedule consumers' power usage pattern in response to the RTP signal under the grid and photovoltaic-battery system. Then, the HGACO algorithm is proposed, which is a hybrid of GA and ACO using MKP to solve the complete scheduling problem for all three scenarios: without photovoltaic-battery system, with the photovoltaic system, and with the photovoltaic-battery system. This study aims to stimulate consumers to participate in RES generation and power usage scheduling to resolve the DSM problem by coping with the gap between demand and generation. The purpose of solving the DSM problem is to facilitate utility and end-users by reducing electricity bill, peak load demand, and carbon emission and by avoiding rebound peak creation. To endorse the applicability of the HGACO algorithm-based energy management framework, simulations are conducted in comparison with existing frameworks based on the GA, PSO, ACO, and HGPO algorithms. The results show that the proposed HGACO algorithm reduced electricity cost, carbon emission, and peak load by 49.51%, 48.01%, and 25.72% in scenario I; by 55.85%, 54.22%, and 21.69% in scenario II; and by 59.06%, 57.42%, and 17.40% in scenario III, respectively, compared to without scheduling.