Demand Response Program for Efficient Demand-Side Management in Smart Grid Considering Renewable Energy Sources

A smart energy management controller can improve energy efficiency, save energy costs, and reduce carbon emissions and energy consumption while accurately catering to consumer consumption habits. Having integrated various renewable energy systems (RESs) and a battery storage system (BSS), we proposed an optimization-based demand-side management (DSM) scheduler and energy management controller (SEMC) for a smart home. The suggested SEMC creates a DSM-based operational plan regarding user-centered and comfort-aware preferences. Using the generated appliances operation plan, consumers can reduce energy costs, carbon emissions, peak-to-average ratio (PAR), improve their comfort in terms of thermal, illumination, and appliances usage preferences. A schedule for residential consumers is suggested using ant colony optimization (ACO), teaching learning-based optimization (TLBO), Jaya algorithm, rainfall algorithm, firefly algorithm, and our hybrid ACO and TLBO optimization (ACTLBO) algorithm. Five existing algorithms-based frameworks validate the DSM framework that relies on ACTLBO. The results validate that the integration of RESs and BSS, and adapting our proposed algorithm and SEMC under demand response program real-time price reduced the energy bill costs, PAR and CO2 in Case I: only external grid (EG) usage by 42.14%, 22.05%, and 28.33%, in Case II: EG with RESs by 21.79%, 11.27%, 17.02%, and in Case III: EG with RESs and BSS by 28.76%, 41.53%, 21.86%, respectively as compared to without employing SEMC. Moreover, the user-comfort (UC) improvement index-ratio with scheduling using ACTLBO is 7.77%, 24.73%, 5.00%, and 3.43% in aspects of indoor air quality, average delay, thermal, and visual, respectively. Simulation results show that the proposed DSM-based framework outperforms existing frameworks to reduce energy cost, reduce carbon emission, mitigate peak loads, and improve UC.

Design variable of i and j. X best (j) Best  Power procured from wind system. E bio CHP energy production. l total Total home load. α t /β t Operation start and end time of appliances. η Bearable delay. γ Emissions factor due to electricity. ϕ g (t) Total renewable energy at t. η sp Energy conversion efficiency factor. A sp Solar panel's area in (m 2 ). I rs (t) Sun irradiance at t. T a (t) Ambient temperature at t. α 1 , α 2 Shape factors. ζ Weighted factor. β 1 ,β 2 Scale factors.

B a
Wind turbine blade's area. W s (t) Air flow in (m/s) at t. ∂ Cumulative system efficiency.

E bio
Electricity production of CHP. Q f Fuel provided to CHP.

L v
Value of lower heating.

Q th
Cumulative thermal output. γ e Recovery efficiency.

Q br
Bio-gas recovery. C f CHP system capacity factor. E p t Electric vehicle's photovoltaic generation.
Remaining amount of energy of E p t . l τ Electric vehicle's consumption at τ time slot.

I. INTRODUCTION
Smart grids (SG) play an essential role as innovation drivers for green energy usage in various sectors, including industries, rural and urban, the environment, and information and communication technology (ICT). The future SG leverages innovative ICT and IoT to improve consumers' overall quality of life [1]. With rising population growth and advances in the industrial sector, it is estimated that residential and commercial energy demand will grow by 3% by the end of 2021 [2]. Buildings account for 33% of global energy consumption and 40% of CO 2 emissions, directly and indirectly, [3]. The global consumption of energy is increasing steadily. Using on-site renewable energy generation to manage energy consumption can help meet this demand. The electricity consumption in the residential sector accounts for about 40% of global electricity generation and could also steep as the world's vehicles become electrified. Conventional fuel operated power grids (PGs) provide 64.5 percent electricity in the world and emit significantly more carbon, with the generation and transportation sectors emitting about 40% and 24% of the carbon respectively [4]. The Energy Information Administration estimates that the average electricity bill in US grow more by 2.3 percent the following year [5]. This steep increase in cost and demand will necessitate alternative energy resources such as bio-thermal energy, solar energy, and wind energy. Researchers have proposed methods for generating power from renewable energy sources (RESs) to overcome the exponential growth in energy demand while simultaneously lowering carbon emissions and keeping costs low [8]. Traditional PGs need to be converted into SGs to utilize these RESs effectively. The SG can keep pace with the increasing demand by combining new RESs and VOLUME 10, 2022 advanced net metering infrastructure [10]. There is a lack of energy management and load control on the consumer side. There is also a deficit in communication infrastructure at PGs. Moreover, environmental and air pollution have increased due to fuel-based PGs' excessive carbon emissions. Based on this motivation, there are several approaches to optimally schedule the load for energy management in SG. The authors in [11] have presented an artificial neural network-based scheme for energy management and renewable energy integration in SG to reduce CO 2 emission and energy cost. Consequently, the consumer's costs of energy bills are reduced by 35%. Nevertheless, they did not consider UC and battery storage systems (BSS) integration, closely related to demand-side management. A generic home energy management system (HEMS) is suggested for grid-connected smart homes with RESs [12]. Their goals were to develop a plan to schedule household load, reduce energy costs based on demand response (DR) programs, and integrate RESs and BSS. A particle swarm optimization approach in HEMS is proposed to optimize load scheduling, energy demand, and distributed energy resources considering UC, RESs, BSS, and DR program [13]. In order to overcome user inconvenience, a heuristic-based algorithm is developed to create a user-friendly DSM approach. Residential loads in SG networks are scheduled using a genetic algorithm. With the help of a genetic algorithm in the real-time pricing (RTP) DR program, their primary objectives were to minimize both peak-to-average ratio (PAR) and the electricity bill costs and improve the UC level [14]. Residential energy management under dynamic price mechanism is suggested in [15] to integrate RESs and BSS into the SG community. They aimed to integrate RESs and reduce energy bill costs. In order to lower customers' electricity bills, DR strategies based on hourly pricing with an effective HEMS is suggested to determine the optimal appliance scheduling scheme. The proposed approach explicitly addresses consumer comfort by offering consumers an opportunity to shift consumption away from regular schedules during acceptable appliance deferral times [16]. In [17], the authors proposed a heuristic-based energy management controller to efficiently schedule smart home appliances in response to a utility demand response program to reduce energy costs, PAR, and CO 2 emission. Minimizing the energy bills, cost of generation, and also minimizing the inconvenience caused due to shifting of loads is a multi-objective optimization problem. In [18], the authors have suggested a genetic algorithm-based DSM technique for industrial and commercial micro-grid with one solarbased RES, two diesel generators, and BSS, with the dynamic pricing DR program of the utility grid. A multi-comfortbased optimization scheme for home energy management is proposed in [19] based on time and appliance-based priorities under DSM to schedule load and keep cost under user budget limits. Multiple agents have been suggested to manage different appliances, energy storage systems, and renewable energy from a smart home DSM system within the home area network. The proposed method maintains the user's comfort by controlling appliances and based on the activity of the user [20].
Various methods and techniques have been suggested for demand-side management, load scheduling, and UC. With the advancement of renewable technologies and smart grids, consumers can reduce their energy costs by shifting load to RESs. The authors in [21], suggested a comprehensive UC-aware energy management and optimization scheme to reduce energy consumption costs in aspects of illumination, thermal, and user preferences. In [22], a new method for smoothing renewable energy fluctuations on different timescales is proposed by utilizing multi-type DR resources. In their approach, a multi-objective robust scheduling model is developed that considers renewable energy and DR uncertainties.
In [23], an energy management controller is deployed at grid-level for battery storage management and PG management. In [24], a multi-objective HEMS is suggested employing grey wolf optimization to manage individual load with on-site generations, battery storage, and UC. In [25], energy management and optimization methods are suggested for grid battery storages to utilize it efficiently and provide multiple grid services. In [26], the authors proposed a local and global HEMS optimization framework for distributed energy sources and load scheduling considering user preferences. Using big data-based power generation forecasting techniques, the authors have proposed a distributed energy management approach in [27]. In order to capture the dynamics of interactions and interconnections among multiple market players, they formulate the energy management problem as a three-stage Stackelberg game. In their approach, the optimization of energy management is assisted by a deep learning-based wind power forecasting algorithm. In [28], a real-time EMS is suggested for a hybrid energy storage system is suggested for the electric vehicle. In [29]- [34], for demand-side management, the authors introduced heuristic-based algorithms, such as genetic algorithms (GA), wind-driven optimizations (WDO), ant colony optimizations (ACO), and particle swarm optimizations (PSO). Validation of the results is achieved by comparing them with benchmark schemes. According to the collected results, electricity costs and peak-to-average ratios (PARs) have been reduced by 29% and 36.2%, respectively. However, they did not incorporate renewable energy. To overcome the randomization problem in [35] and [36], the authors' employed Harris' Hawk optimization techniques along with integer linear programming (ILP). In addition to UC, the authors' primary goal is to analyze the costs' trade-offs and the mechanism for converting them into financial benefits. Their approach can be adapted to meet specific user robustly needs. Nonetheless, carbon reduction and renewable energy are not taken into account. Authors in [37], proposed a multi-objective-based GA for minimizing CO 2 emission and operating costs while overcoming the optimization challenge. In [38]- [40], researchers studied a smart residential building operating on the PG and utilizing electricity from an external grid. The integration of hybrid energy systems, including energy storage and wind and solar power, has been considered. A linearization-based multi-objective approach to smart home power management was implemented with plug-in hybrid electric vehicles (PHEVs) and renewable energy [41]. The objective was to reduce the variation in the load profile and lower electricity bill costs. However, UC was not considered. Using net metering and forecasts framework, the authors proposed an intelligent-based method for DSM in [42] and [43]. Their objectives were to reduce PAR, electricity bills, and CO 2 emissions. Moreover, under fluctuating temperature and sun irradiation, a maximum power point tracking (MPPT) and GA-ACO-based controller was employed to make the photovoltaic (PV) module function at its maximum power point [44]. A hybrid of genetic algorithm and ant colony optimization (HGACO) technique is suggested to solve the energy scheduling problem, reduce peak formation, cost, and carbon emissions [45]. In [46]- [49], a DSM scheme in the residential area for the reduction of power costs and PAR with the highest level of user satisfaction is suggested. They have used state-of-theart methods for this, including enhanced differential evolution (EDE), GA, firefly optimization algorithm (FOA), rainfall optimization algorithm (RFOA), optimal stopping rule (OSR), game theory, and teacher learning-based optimization (TLBO). In [50] and [51], authors have proposed a DSM-based HEMS that adopt the hybrid of GA, PSO, and WDO to curtail PAR, energy cost, and carbon emission and achieve maximum UC. In [52] and [53] an online and real-time energy management controller is suggested for grid-connected sustainable smart home considering UC. The authors in [54] have proposed a strategy for local energy production management, RESs usage efficiency, and reducing fuel-based generation consumption considering demand scheduling during peak hours for both grid-connected and island-connected modes. For both the direct and indirect distribution modes, particle swarm optimization is used to schedule the generation of distributed energy resources. An optimal multi-timescale demand-side scheduling framework is presented in [55] for industrial customers. The framework combines the day-ahead approach and the weekahead approach. Different DSM techniques offer distinct week-ahead and day-ahead scheduling capabilities in their multi-time scale framework that cooperate to create the optimal demand schedule. A DR program's load scheduling problems are addressed in [56]. The authors have developed and modeled an algorithmic foundation for these problems. They have developed an online algorithm that outputs scheduling decisions based on past and presents input only based on the AC optimal power flow model. As home energy usage increases and RESs are deployed, HEMS should simultaneously consider energy consumption priorities and on-site generation. A smart HEMS architecture is developed in [57] that considers both energy consumption and local generation simultaneously. It is proposed in [58] that DSM techniques can be used to control the loads within a smart home while taking into account the priority of time-varying appliances.
In their work, a method for quantifying time-varying priorities is presented concerning time and device-based features through an evolutionary accretive comfort algorithm (EACA). In order to generate the EACA optimal energy consumption pattern that would give maximum satisfaction within a predetermined budget, the input data regarding the power ratings of appliances, their time of use, and absolute comfort are taken into account. While the literature presented is an excellent start when it comes to understanding DSM in SG. However, the DSM challenge is tough to cater due to nonlinear consumer behaviour, variable and intermittent renewables, and finite fossil fuel resources. Furthermore, the literature reviewed focuses on lowering energy costs, reducing PAR, and minimizing the delay time for operating appliances. The intrinsic models cannot handle DSM problems simultaneously to reduce electricity bill costs, peak electricity consumption, PAR, carbon emissions, appliances delay, and user discomfort concerning indoor thermal, visual, and air quality. Furthermore, inherent models' performance is often compromised due to inherent limitations and the inability to handle conflicting objectives concerning user-centric and multiple comfort constraints. As a result, hybrid and integrated approaches are needed to solve this problem. In this context, a new technique, namely the hybrid antbased teaching-learning optimization (ACTLBO) algorithm, is introduced to solve issues associated with intrinsic models while dealing with the DSM problem and considering UC. The ACTLBO suggests and returns an optimal power usage scheduling in response to a demand response program real-time pricing (DRP-RTP). The novelty and main contributions of this work are listed below: • A practical optimization model is formulated for efficient demand-side management via power usage scheduling considering demand response and renewable energy sources in SG.
• Ant colony teaching-learning based optimization (ACTLBO) algorithm is proposed, which is a hybrid of ACO and TLBO algorithms to solve demand-side management problem.
• In addition to energy cost and PAR objectives, which are catered in [11]- [15], we formulate and investigate UC and carbon emission while solving the demand-side management problem. Also, the UC is modeled in terms of delay, indoor thermal, visual, air quality, and freshness.
• The efficacy and applicability of the proposed ACTLBO algorithm are endorsed by comparing it to the benchmark algorithms like ACO, TLBO, FOA, JOA, and RFOA in aspects of energy cost, carbon emission, PAR, and user discomfort minimization. The remaining paper is organized into five sections: Section II describes the proposed and existing methods for demand-side management, section III details the proposed system architecture for demand-side management, and section IV presents the simulation results. Section V concludes the work. VOLUME 10, 2022

II. PROPOSED AND EXISTING METHODS FOR DEMAND-SIDE MANAGEMENT
This section discusses the proposed method and the previously used optimization-based schemes for solving the DSM problems via power usage scheduling and energy optimization. Previously used techniques such as ILP, linear programming, mixed-integer linear programming (MILP), dynamic programming (DP) face issues in convergence, and they can not be used in a large number of appliances. We suggested a hybrid of two algorithms, namely ACO and TLBO, discussed in subsequent sections.

A. ANT COLONY OPTIMIZATION ALGORITHM
ACO algorithm is a meta-heuristic. To collect food and return to their colony, ants, like humans, use the quickest route possible. To retrace their steps, ants utilize a pheromone trail. Artificial ants and pheromones are created in ACO to find the shortest path across a graph. The ants will pursue the path with the most pheromone since pheromone is an evaporative element. The ACO algorithm, like other algorithms, starts by creating an initial solution from a limited number of solution components. The ant then moves along the graph, each vertex representing a solution component.The probability is given by the following formula [33]: where z represents an ant, state x calculates a set A z (x). The probability of the ant moving from x to y is p z xy . Symbol T xy denotes the pheromone level. The three steps of ACO are (i) main problem specification, (ii) parameter initialization, and (iii) ant position update. According to our problem specification, the ACO approach will optimize energy usage to reduce electricity bill costs, carbon emissions, and PAR. The swarm size parameter describes the number of appliances in our model, after which we initialize the evaporation rate to 0.5 and update the ACO location. At first, each ant selects any path; therefore, six ants represent home appliances, and 24 pathways represent 24 hours of scheduling. The 24 pathways have a 1/24 chance of choosing each ant. According to the ACO algorithm, one path out of 24 paths has the shortest distance. Because we do not know the solution pathways at the start, it is presumed that all of them have the same pheromones [45]. The values of parameters used in the ACO algorithm for simulation on which the best optimal scheduling and energy management scheme is achieved are listed in Table 2.

B. TEACHING LEARNING BASED OPTIMIZATION
The evolutionary-based algorithms adjust their behavior in response to the independent variable, including population size, number of generations, and crossover percentage. The TLBO, which was influenced by evolutionary algorithms. The student and teacher are the two fundamental components of TLBO. The initial component, named teacher, is a premature solution that learns from more mature solutions [46]. As the algorithm is intended for a teacher, the best person should significantly improve the characteristics of learners, the rest of the people. It is a population-based approach infers the global answer from a population of individuals (candidate solutions). The TLBO algorithm comprises two stages: the teacher and the learner phases. In the teacher phase, pupils learn from the teacher (the optimum answer for the whole population). In the learner phase, each individual strives to learn via contact with other individuals within the population. The following is the TLBO algorithm's behaviour [48]. Random data is used to build the population and initialize the individuals (values of the design variables). The algorithm will update the population after producing the first generation of individuals. The best solution from population is selected as teacher at the start of each iteration, and the mean of each variable is computed. These numbers are employed in the algorithm's two primary stages: the teacher and learner phases. In the teacher phase, the current generation has acquired teacher, X best is utilized to build a new version of each person X new using the equation [48]: In above equation, X (i, j) corresponds to the design variable j of the individual i, and it is modified by using the value of the teacher X best (j), the variable mean X m (j), and the T Factor . The T Factor can adopt the integer value 1 or 2 and is calculated using the following expression: Following the creation of a new individual, it is evaluated.
If the new individual's assessment result is better than the old one's, the old one gets replaced by the new one. Each learner is allocated a random contestant from the population during the learner stage. Both people are up for review. The partial teacher is labeled as the learner, and the other is labeled as the partial teacher, so that they may be used to build a new individual using the expression: Every time an X new (i, j) is created, the new person is assessed and compared to the original. If the new individual's appraisal is higher than the old one's, the new individual takes the place of the old one. Table 2 shows the values of the parameters used in the TLBO algorithm for simulation that produce the best optimal results.

C. FIREFLY OPTIMIZATION ALGORITHM
The firefly optimization algorithm (FOA) is a stochastic, nature-inspired meta-heuristic technique for solving optimization issues. It was recently introduced by Xin-Shi Yang. The behavior of light emission of fireflies inspires the FOA, which is the source of communication for food search and reproduction. The two most important roles of FOA are to recruit matting partners and possible prey. After establishing the light intensity and estimating the attraction of fireflies, the ideal method is to use the objective function to determine the fitness of all fireflies [47]. I (rf ), the light intensity emitted by a firefly, at a distance rf may be detected using physics principles of light and can be formulated using equation (5) [59]: where l o denotes the light intensity produced by the light source. The symbol γ denotes the medium's absorption coefficient. If γ given then intensity of light, I at distance r f is calculated using equation (6) [59]: The distance between the light source and the light observation point is represented by r f . This light intensity is linked to the attraction of fireflies in the FOA, and is determined using the following equation (7) [59]: where, β o denotes beauty at a distance of r f = 0. The Euclidean distance, or the distance between two fireflies x i and y j , is given by [59]: The location of the firefly can be adjusted according to the following equation in each generation [59]: In the above equation, α denotes the randomization parameter, is the random number generated in Gaussian distribution. The randomization parameter is used to regulate the size of the solution search space. When used to solve optimization problems, the FOA, like other optimization problems, has three main steps: (i) the initialization step, (ii) the firefly position altering step, and (iii) the termination step. A random search space is created during the initialization step, taking into account the variables utilized in the optimization function and the optimization function's associated value. In the firefly position change stage, the positions of fireflies are modified using a factor known as the randomization factor to find fresh solutions to the problem at concern. The algorithm comes to a halt in the termination step. As the initial solution space is unpredictable, there may be an unequal link between exploration and exploitation of the solution search space during the initialization stage, resulting in slower local and global convergence rates of the algorithm and worse solution quality. The randomization factor determines the motions of the firefly in the position change stage. If this value is not managed carefully, the quality of the problem's solution may suffer [59].
The association formed in the initialization and firefly position shifting phases between exploration and exploitation of the solution search space determines the optimal values obtained during the termination stage. If the algorithm completes and the values returned are the most optimal, no further processing is required [59]. The parameters used in the FOA algorithm and their respective values on which its best optimal scheduling for smart home appliances is obtained are listed in Table 2.

D. JAYA OPTIMIZATION ALGORITHM
The Jaya optimization algorithm (JOA) is a population-based approach for limited and unconstrained optimization problems. Jaya does not have any algorithm-specific controlling or tuning parameters, unlike other population-based heuristic algorithms. Only the population size and generations (the number of iterations) are specified, just like in TLBO. This approach is based on the idea that the best partial solution for a given issue may be found by avoiding the worst solution while moving towards the best partial solution. JOA outperformed other optimization approaches in regards to the best, worst, and mean values of several unconstrained benchmark functions [48]. The following is a description of the Jaya algorithm. Let function f (x) to be the minimised or maximised (objective function). Assume that there are n design variables, i.e., j = 1, 2, . . . , n and p possible solutions, i.e., population size, k = 1, 2, . . . , p at any iteration i. The best candidate gets the best f (x) value, i.e., f (x) b in the whole candidate solutions, whereas the worst candidate gets the worst f (x) value, i.e., f (x) w in the entire candidate solutions. If X j,k,i is the value of the j th variable for the k th candidate during the i th iteration, the following equation is used to change it: In above equation, symbol X j,b,i represents the value of variable j for the best candidate and X j,w,i represents the value of variable j for the worst candidate. The updated value of X j,k,i is X j,k,i , and r 1,j,i and r 2,j,i are two random values in the range [0, 1] for the j th variable generated in the i th iteration, respectively. The term r 1,j,i (X j,b,i |X j,k,i |) denotes the algorithm's propensity to get closer to the best solution, while r 2,j,i (X j,w,i |X j,k,i |) denotes the algorithm's inclination to avoid the worst solution. Only if the new candidate (X j,k,i ) provides a superior function evaluation is it approved. The acceptable function values at the conclusion of each iteration are saved, and these values are used as the input for the following iteration. Table 2 lists the parameters utilised in the JOA algorithm and the values that produce the most optimal scheduling scheme for home energy management and comfort.

E. RAINFALL OPTIMIZATION ALGORITHM
The rainfall optimization algorithm (RFOA) is suggested to schedule household appliances properly. RFOA imitates the VOLUME 10, 2022 movement of raindrops. In SEMC, raindrops are treated as appliances. A local search is performed to gather the water droplets in the deepest valley, and then finding the global best solution (i.e., sea level) is done [49]. RFOA particles behave like gradients falling and hills climbing. Population and parameters that will be used in RFOA optimization are initialized first. This method uses terms like 'raindrop', 'neighborhood', 'neighbor point', 'dominant, active and inactive drops', 'explosion process', 'raindrop rank', and 'merit order list'. Each term is defined further here.

1) RAINDROP
Within a population, a raindrop is a single particle. It's a vector used in optimization problems to keep track of the variables. It is used to make that the optimization problem's restrictions are met. The population size is represented by m, while the drop numbers are represented by i. Equation (11) is used to define it below: where n denotes the number of variables in the optimization problem, and xi,k denotes the number of variables in the optimization problem. The i th drop number is D i . The equation gives the constraint that was employed. The constraint used is given in equation (12) [49].
In above equation, for uniform distribution function U is used. The symbols lo k and up k are upper and lower limits.

2) NEIGHBORHOOD
In N-dimensional search space, the neighbourhood is the area surrounded by a raindrop with a radius of r. As raindrop values change, the neighbourhood changes as well.

3) NEIGHBOR POINT
Randomly generated points are said to be neighbors in optimization. For the neighbor point j of raindrop i symbol, NP i * j is used. Below are the equations for NP i * j (13) and (14) [49]: In above equations, i = 1, 2, 3, . . . , m, j = 1, 2, 3, . . . , np, and k = 1, 2, 3, . . . , n, and r represents real vector, r initial shows the initial neighborhood size and np is the neighborhood points.

4) DOMINANT DROP, ACTIVE DROP AND INACTIVE DROP
The dominating drop performs well in the neighborhood. It achieves the best possible solution to a given objective issue. The symbol NP d i denotes the dominant drop. The function F is used to solve an objective issue. To calculate the value of a raindrop (F(D i )) and its neighbouring point , apply the formulas below: A dominant neighbor variable is an active drop, and no dominant neighbor variable is an inactive drop.

5) EXPLOSION PROCESS
When the drop is inactive, the explosion process is initiated when it has no dominating neighbor during optimization or insufficient neighbors. This procedure is carried out to remove a raindrop from the circumstance. The explosion process takes N times to complete. The (np(ex)) is denotes the neighbors in explosion process for verification and given by equation (16) in [49].
where, symbol np is the neighbor points, eb is explosion base, ec is the explosion counter.

6) RAINDROPS RANK
There is a merit list in which all raindrops are assigned distinct ranks. Raindrop rankings are calculated using equation (17)- (18) in [49].
where, symbols ω 1 and ω 2 shows the weighting co-efficient. The value of symbols ω 1 andω 2 is 0.5. In each iteration t, symbols C1 t i and C2 t i shows the value of the objective function for raindrops changes and Rank t i denotes the rank of rain drop.

7) MERIT ORDER LIST
The rankings of raindrops are saved in ascending order using a merit list. A raindrop is removed from the merit list and used in the optimization problem. The raindrops are created at random in the first iteration. After each raindrop is created, a neighborhood is allocated to it, and neighbor points are produced at random according to the objective function's restrictions. Some limitations for allocating neighbour locations using equations (20) and (21) [49] are mentioned below: Each raindrop and its neighbors' cost are calculated separately. To determine the most dominant neighbor point, all neighborhood values are compared to the value of a raindrop. Table 2 lists the parameters utilized in the RFOA and the values that produce the most optimal scheduling scheme for home energy management and comfort.

F. OUR SUGGESTED HYBRID OF ACO AND TLBO ALGORITHM FOR DSM
The hybrid ant-based teaching-learning optimization (ACTLBO) is our proposed algorithm. ACTLBO combines the features of ACO and TLBO algorithms in a single package. This hybridization effectively minimizes PAR, energy bill cost, CO 2 emission and enhances UC-index considering thermal, visual, and indoor air quality comfort. However, ACO and TLBO suffer performance degradation for complex and high-dimensional optimization problems. In ACTLBO, the TLBO and ACO are combined so that the exploration and exploitation capabilities can be balanced so that the TLBO focuses mainly on exploring the unknown search space.
In contrast, ACO focuses on exploiting high-precision solutions in the known region. Moreover, this hybridization aims to improve the exploratory and exploitative search capabilities of the algorithm to return optimal appliance schedule for efficient energy management. The proposed hybrid technique combines TLBO with ACO to help the latter with exploration and global search. The performance of the TLBO algorithm is improved as the ACO produced best solution is given as an initial population [60]. It converges early and returns the best optimal usage schedule for efficient energy management. Further, the exploratory TLBO and ACO algorithms have been chosen because they successfully reduce cost, PAR and offer the best thermal and visual comfort. The hybrid ACTLBO combines the merits of TLBO in exploring solution space and the ACO algorithm in refining solutions. The ACTLBO has mainly two levels, where, in level one, the preliminary steps of TLBO are adopted for global search.
In level two, the ACO steps are implemented, the learner and teacher phase of the TLBO are adopted to the global best solution X g best , generated by ACO. The global best solution is passed as the generated population to the TLBO algorithm. Compared to the ACO and TLBO functioning in individual and random-based populations, the hybrid TLBO characteristics of global search and ACO fine-tuning provide satisfactory results. The algorithm 1, shows the proposed ACTLBO algorithm steps. Figure 1 illustrates the ACTLBO algorithm's flowchart. The initialization steps in the flowchart take inputs such as price signals, temperature, user desire for comfort, and RESs generating output values. The algorithm receives initialization inputs from ACO and TLBO, such as the number of iterations, population size, lower and upper bounds, the initial point during parameter setup. Following initialization, the ACO procedures are followed, followed by the TLBO learner and teacher phases, to determine X acgbest ; an optimal schedule pattern for scheduling in terms of reduced electricity bill cost, delay time, PAR, carbon emissions, and improved UC index-ratio. The ACO and TLBO parameters and constraints are all considered and used. The constraints and parameter values of the ACO and TLBO algorithms are put into practice as given in Table 2. Our proposed optimization algorithm is compared with existing algorithms' computational cost; convergence, and execution time. Computational cost relates to convergence rate and execution time: execution time is the time spent by algorithm during execution; and convergence rate is a rate at which an algorithm converges to epoch while returning optimal solution. The algorithm with a low compilation time and fast convergence rate is said to be fast. Compilation time is measured in seconds, and the convergence rate is determined by epochs number. In Table 1, we list the execution time and convergence rates of the proposed and existing algorithms. The proposed hybrid solution has variables that are concurrently optimized, which means that the optimum solution is achieved within a shortest possible time. Besides, the computational time is minimized as the best solution of past iteration restricts the solution space of the problem. The pareto optimality is achieved as the population with the best solution from ACO is used as input to the TLBO. This process prevents premature convergent and local optimum problem. This implies that the quantity of pheromone grows within the best objective function; thereby, leading to a feasible solution.

III. PROPOSED SYSTEM ARCHITECTURE FOR DEMAND-SIDE MANAGEMENT
We have considered a sub-urban area and a grid-connected smart building having advanced meter infrastructure with the smart scheduler and energy management controller (SEMC), which uses the ACTLBO method that we suggested for optimal demand-side management. The SEMC collect data, such as smart home appliances power rating, preferences of all appliances like urgent, shiftable, deffer-able, uninterruptible, interrupt-able, UC signal aspects of indoor luminance, air quality values, and temperature, i.e., freshness, concentration and humidity, RESs local generations like PV, WES, combined heat and power (CHP) a biomass co-generation system with energy storage systems such as residential BSS and EVS. Our suggested algorithm will check for an electric vehicle available at home and have enough energy to provide backup during peak hours. Through the home area network, smart appliances will interact with SEMC. The SEMC will control the scheduling of those appliances and perform optimal demand-side management. Figure 2 shows the proposed architecture of our system model for home appliances scheduling and on-site RESs, BSS management under DR programs. In this model, electric vehicles serve as a charging load and backup source if the home installed BSS is overloaded in peak hours. Additionally, it efficiently integrates the on-site RESs, such as solar power, wind power generation, and a micro-CHP system. Bio-gas micro-CHP can give substantial environmental benefits as compared to utilising power from fuel-operated grids and generating on-site thermal energy. CHP systems use less fuel to produce the same amount of energy by reusing heat created during power generation. This system includes the BSS model, which drains energy from the RESs and acts as a backup if the RESs are unavailable. Also, our approach suggests a smart meter infrastructure, enabling two-way communication between the user and the distributor. Consumers can share their demand information with the distribution system operators in advance, while distributors can share real-time, flat, day-ahead, and time-of-use pricing with customers.

A. PROBLEM FORMULATION
The demand-side management and scheduling problem are formulated to curtail energy costs, carbon emissions, PAR, delay, and enhance the UC index-ratio considering average delay, indoor air quality and freshness, TC, and VC levels. Our optimization problem is formulated in (22) [32]: where, E bill is defined as total electricity consumption of non-schedulable and schedulable appliances given below:

1) PAR
PAR is defined as the proportion of peak load, max(l total (t)) consumption in a time slot t to the total load consumption throughout the scheduled time [61]. PAR is calculated using equation (24):

2) CARBON EMISSIONS
Carbon emissions is calculated from the average cost of electricity per month, electricity price per kWh equal to 0.20 dollars, and the emission factor of electricity equal to 1.37 [61]:

3) DELAY TIME
Delay is the time appliances wait to be served and is calculated using the following equation [32]: Delay = (sum(abs(tS 1 ) − (tS 2 )))/sum(tS 2 ) In equation (25), symbol E bill (t), is the electricity bill for schedulable and non-schedulable load, ϕ g (t) is the total on-site RESs procured energy at time slot t, BSS(t) is the battery backup at time slot t. While EP(t) is real time pricing set by the utility company, the term CO 2 refers to carbon emission, while in (48) tS 1 and tS 2 represents the suggested scheduling pattern and non-scheduling pattern, and delay refers to the time it takes for an appliance to begin operating. subject to constraints (27)-(31) [33].
where, A sch l , A nsch l , a, O t denotes the schedulable appliance's load, non-schedulable appliances load, specific appliance, and duration of the appliance operating time, respectively. The symbols α t , η, and β t are the scheduled appliances' start, bearable wait duration, and finish time. In contrast, ϕ g (t) represents the overall renewable energy production, R g during time slot t. The BSS min and BSS max are the battery charge and discharge constraints provided by a manufacturing company.

B. PROPOSED SYSTEM MODEL ENERGY SOURCES 1) PHOTOVOLTAIC SOLAR ENERGY SYSTEM
The solar energy generated for 24 hours is first delivered to scheduled loads in each time slot and is represented by (32) [33], (32) In this equation the η sp indicates the conversion factor of energy efficiency of the solar panels, I rs (t) denotes the solar radiance in kW /m 2 at time slot t, A pv denotes the surface area of the panels in m 2 , is 0.005 is the correction factor of temperature, T a (t) indicates the ambient temperature in • C at t time slot and the standard room temperature is given 25 • C. The solar power depends on solar irradiance, which is intermittent in nature and depends on seasonal climate changes. In [6], authors' have presented an evaluation on optimization, modeling, possibilities, and constraints of a hybrid solar PV system. Despite the fact, the European PGs can generate at least 35% of its electricity using renewables alone [7]. However, to cope with the unpredictability of solar irradiance, in this work, we are using the forecasted solar irradiance from the time and date weather forecaster Islamabad, Pakistan [8].

2) ELECTRIC VEHICLE ON-BOARD PV
The electric vehicle energy generated by the solar panels on-board is used for driving operations, with the remainder being saved in an EVS. It is expected that the collected energy of the PV installed at the roof of EV would be used first for lights, driving tasks, and motor load [53], while the remaining energy is stored in the EVS. The E g t is the energy quantity obtained from the vehicle's onboard solar system. (33) where, the term t τ =0 lm τ 1 τ ( ω , τ ) depicts the cumulative electric vehicle's load scheduled at time slot t [53]. The term 1 τ ( ω , τ ) indicates whether the vehicle load scheduled lm τ , is served at time slot τ . The remaining energy is stored in EV battery and used only during peak hours and when the home BSS backup is overloaded.

3) WIND ENERGY SYSTEM
Weather and wind direction are the two most important factors influencing wind energy generation. The quantity of energy produced by a wind energy system is defined by [63], In this equation, , B a represent the density of air and turbine blade's area, respectively, whereas the W s (t) symbol represents the speed of the air in m/s. To cope with the unpredictable nature of wind in this work the forecasted data of wind speed are used [8].
The CHP system power efficiency is calculated by the formula given below [10]: where, E f is the system's total efficiency, V e represents the output electricity, Q th denotes the total system's thermal output, and symbol Q f indicates the input fuel energy. Equation (36) demonstrates how biogas may be used to generate electric power. The conversion of biogas into usable electrical energy and heat is defined in this equation [10]: where, E bio (t) denotes the generated electric power in kWh at time slot t, L c represents the lower calorific value of biogas, Q br symbolizes the recovery and accessibility of biogas, E f and γ e denotes the efficiency and recovery efficiency, respectively. As described in [10], the (37) is used to calculate the total power P chp of a micro-CHP generator. Where C f denotes capacity factor which is 80-90 percent plant accessibility and t denotes time in hours.

5) BATTERY STORAGE SYSTEM
The BSS stores the remaining renewable energy and acts as a backup during peak hours. The algorithm will also look for EV availability and backup storage. Because the discharging and charging of battery results in the gain or loss of electrical energy, so the battery system efficiency is shown below [33]: (38) subject to constraints: In (38), BSS(t) represents the stored electrical energy in ampere-hour at t hour slot, k denotes the time duration in hour, δ BSS is the battery efficiency, EP ch depicts the power VOLUME 10, 2022 of electricity in kW supplied to the battery at time slot t from available renewable energy resources and EP dch denotes electrical power in kW supplied to the home appliances from battery in hour slot t. In our system model, the BSS is considered to fill the intermittent nature of RESs, and it is charged from RESs at daytime, while it is used when the RESs are either not available or not sufficient. So, the charging and discharging do not occur at the same time.

6) EV STORAGE MOBILE BACKUP
The EV storage may be charged from home solar, wind energy, and external PG, as well as its onboard source, i.e., installed roof PV, depending on the overall load of the EV and the total source of the EV [53]. During peak hours, our algorithm and SEMC will check for the availability of an electric vehicle at home and the status of the battery to act as a mobile storage backup and transfer the load to EVS. The home EV availability and its EVS status are supposed and modeled as below: The home electric vehicle battery charging over 24 hours is shown in Figure 3(f).

C. ENERGY CONSUMPTION
There are smart schedulable, flexible, time elastic, power elastic, and non-schedulable appliances in smart home buildings (SHB) that use electricity from the external grid (EG) and on-site RESs and BSS. The energy consumption and usage time of the schedulable and non-schedulable load and the HVAC system are detailed below.

1) SCHEDULABLE AND NON-SCHEDULABLE APPLIANCES ENERGY CONSUMPTION
We assume that the SHB contains various appliance loads A l (t) that arrive over the 24 hours with temporal unpredictability and uncertainty. For a duration of λ, each A l (t) has a power rating of ς . The appliances are divided into two categories in this study: smart schedulable appliances and non-schedulable appliances. Smart appliances: washing machines, dishwashers, air conditioners, refrigerators, may all run automatically, and manually-operated [33], need human interaction. On the other hand, fixed-loads do not result in an energy bill or a reduction in PAR. Take into account that the SHB has mainly two groups of smart appliances, i.e., A sch l and A nsch l , where A sch l is the set of schedulable home appliances, i.e., can be allotted to run at off-peak periods, A sch l (t) = {la 1 , la 2 , la 3 , . . . , la m } and A nsch l is a set of non-schedulable home appliances, i.e., instantly operate in accordance with the time and preferences specified by the customer, A nsch l (t) = {lb 1 , lb 2 , lb 3 , . . . , lb n } over the scheduling hours of t ={1, 2, 3, . . . , 24}. Equations (44) and (45) define the energy usage of schedulable appliances M and non-schedulable appliances N , over a 24-hour period, respectively as in [33].
After accounting for all RESs and BSS, the electricity bill E bill at each time slot t can be computed using the following equation: where symbol τ is the duration during which the on-site RESs are either not available or insufficient, so then the load draw energy from the BSS.

2) HVAC ENERGY CONSUMPTION MODEL
The HVAC system is another flexible appliance for cooling, heating, and ventilation in a home or residential place. HVAC uses over half of total electrical power in the home, according to [52]. Heating the living room and indoor air conditioning are the two main modes of operation of an HVAC system in the winter and summer seasons, respectively. We concentrated in this work on season-based HVAC usage, i.e., heating in the winter and cooling in the summer season. According to [52], the interior temperature stability created by an HVAC system may be defined as below: where, T in t represents the indoor room temperature and T out t denotes the outdoor temperature, η e denotes the conversion efficiency of thermal, and A c is in kW / • F is the total thermal conductivity, moreover, the symbol, ε = e −τ/ω , where ω denotes the time constant of HVAC system.

D. USER-AWARE COMFORT MODEL
We calculated the UC in terms of wait time, less cost, indoor thermal, visual, air quality, and freshness as comfort-index in this work. The specifics and each comfort mathematical formulation are provided below.

1) DELAY COMFORT
Each appliance's serving time relates to the user's comfort. Equation (48) is used to calculate delay comfort as defined in [33]. Where Sc unsch (t) signifies the time allotted in the user unscheduled scheme, while Sc sch (t) represents the time allotted in the suggested scheduled scheme. Delay time and power consumption costs are both associated with UC.
Delay comfort = |Sc unsch (t) − Sc sch (t) | Sc sch (48) 2) VISUAL COMFORT The number of indoor light devices, intensity, and time to serve is connected to consumer visual comfort. While the quantity of intensity of indoor lights/luminous is taken as in [62], and it will be adjusted to user choice.
where, symbol N e is the total number of lightning appliances, V comfort (t) in (49)  , wait time both are in inverse relation, this relation may be defined numerically as follows [61]: where, D Lights U h denotes the preference of lights configured by the consumer, and D Lights S h is the suggested scheduled pattern of lights operating over 24 hours duration.

3) INDOOR THERMAL COMFORT
The adjustable HVAC system's cooling or heating temperature may be regulated within a defined range according to the user's preferences. The power consumption of the heating/cooling adjustable HVAC system may be changed to control the interior temperature. The indoor temperature of a room for a single individual to feel comfortable varies, ranging in between 20?∼25? [62]. The thermal UC is computed using equation (53). The inverse connection between thermal UC and delay waiting for time D HVAC w t may be represented mathematically as follows [61]: where, symbol T c denotes thermal UC, D HVAC U h is the user given preference for HVAC, and D HVAC S h is the suggested schedule pattern for operating HVAC over 24 hours duration.

4) AIR QUALITY AND FRESHNESS
Carbon emissions and concentration ratios in the environment quantify indoor air freshness and quality. The SHB's adaptive ventilation technology may change the concentration of indoor carbon. Interior excellent air quality may be kept VOLUME 10, 2022  regulated by venting fresh air into the indoor space based on user preferences. The indoor carbon concentration ratio is formulated as in [62]: The CO 2 concentration ζ t+1 in an indoor area of volume V can be adjusted by varying the fresh air Fr air amount in that area with respect to the accumulation quantity of the CO 2 concentration ζ t depending on the outdoor CO 2 concentration ζ out and the indoor carbon emission ζ in due to electricity usage. When the HVAC cooling mode is necessary, the equation (47) can be complemented to adjust the fresh air in a room. The desirable range values of air freshness are measured in carbon concentrations, which vary from 740ppm∼ 780ppm [62].

IV. RESULTS AND DISCUSSION
In this section, the proposed system model for demand-side management under DRP-RTP is evaluated utilizing electricity from the EG with on-site RESs like PV solar power, CHP, WES power, and BSS. Moreover, the results of our suggested ACTLBO, ACO, TLBO, FOA, JOA, and RFOA are evaluated for the electricity bill costs, PAR, carbon emissions, and UC considering user preferences for appliances usage and DRP-RTP. Figures 3(a)-(f) demonstrates the system inputs: price signal; RTP, forecasted temperature, wind speed, biomass availability, solar irradiance, and battery storage system charging, respectively. Figures 4(a), (b), and (c) show the predicted energy production of PV, CHP, WES, and the remaining renewable energy after battery charging, respectively. We considered that total RESs provided 90% of the energy during the scheduled time. Furthermore, 30 percent of on-site RESs are being utilized for BSS charging in available time slots t, with solar energy production contributing for 20%, CHP, and wind energies production contributing for 10%. The results are simulated for three cases, i.e., Case I: when the smart home is only utilizing electricity from EG, Case II: EG with RESs, and Case III: EG with RESs and BSS. Electricity bills, PAR, delay, and carbon emissions are calculated using the without scheduling (WS), ACO, TLBO, FOA, JOA, RFOA, and ACTLBO scheduling techniques.

A. ELECTRICITY BILL 1) CASE I: ELECTRICITY BILL COST USING EG ONLY
The energy bill (EB) for unscheduled and scheduled consumption, using energy from the EG without RESs and BSS, is depicted in Figure 5 Table 3 compares the electricity bill costs of all scheduling methods and the suggested algorithm over 24 hours.

2) CASE II: ELECTRICITY BILL COST USING EG WITH RESs
The energy bill EB for unscheduled and scheduled consumption, using energy from the EG with RESs is depicted in Figure 5(b The EB for unscheduled and scheduled consumption, using energy from the EG with RESs and BSS, is depicted in Figure 5(c Carbon emission is depicted in Figure 6(a

2) CASE II: CE USING EG WITH RESs
Carbon emission for this case is depicted in Figure 6(b  employing the suggested ACO, TLBO, FOA, JOA, RFOA, and ACTLBO algorithms, respectively. Nonetheless, compared to other exploratory methods, the ACTLBO approach considerably reduces PAR. Table 5 depicts the comparisons of PAR with each discussed algorithm with the suggested ACTLBO algorithm. 2) CASE II: PAR USING EG WITH RESs PAR with and without load scheduling in Case II is illustrated in Figure 7 Table 5 depicts the comparisons of PAR with each discussed algorithm with the suggested ACTLBO algorithm.

D. UC
The UC is taken in terms of appliances delay, energy bill costs, air quality, freshness, indoor lights, and temperature.

1) DELAY AND COST COMFORT
The user-level of comfort is associated with EB and scheduling of HVAC, indoor illumination, and air quality. To decrease EB, the user will regulate their home electric appliances by accepting and following the scheduling pattern given by SEMC. The average waiting schedule time of the household appliances for Case III managed through our proposed ACTLBO, TLBO, RFOA, ACO, JOA, and FOA algorithms are shown in Figure 8. There is less wait time in employing the ACO-based scheduling when serving the cloth washer and dryer loads. The suggested method has less than one hour or half-hour delay for cloth washers, HVAC, water heater, and light appliances. The best thermal and visual comfort values are found in ACO and TLBO. It also schedules the HVAC and lighting loads with the minimum possible delay. The ACTLBO algorithm reduces carbon emission, resulting in a lower CO 2 level in the atmosphere. As a result, the best possible indoor air quality is maintained. In the case of the ACTLBO algorithm, Table 6 shows the suggested pattern for scheduling of the household appliances in minutes along with the corresponding comfort compromising. The comfort compromising level is 5.13, 8.88, 5.00, 6.66, 3.43, and 17.14% in case of scheduling refrigerator, washer/dryer, HVAC, water heater, lights, and EV, respectively.

2) AIR QUALITY AND FRESHNESS
Air quality and freshness are calculated in terms of carbon concentration inside the house using equation (54). The desired level of carbon and emission due to usage of electricity of scheduling methods, i.e., ACO, TLBO, FOA, JOA, RFOA, and ACTLBO, is shown in Figure 9. CE in the case of WS is high as compared to scheduling algorithms. The suggested algorithms reduce electricity consumption from the main PG, which results in less electricity usage and shifts loads to RES and BSS, thus resulting in good quality comfort. VOLUME 10, 2022

3) INDOOR LIGHTS AND VISUAL COMFORT
To quantify the visual comfort of an indoor room, equations (49)-(50) are adopted, which are related to indoor lights devices ON/OFF status, delay, intensity level, and the number of lights in a room. Figure 8 shows that the minimum delay for lights is 29 minutes with ACO, TLBO, FOA, JOA, and 37 minutes in case of RFOA while 33 minutes in ACTLBO based scheduling.

4) INDOOR THERMAL COMFORT
The thermal comfort of a user is calculated by equations (52) and (53), which are related to indoor HVAC devices ON/OFF status, delay, and thermal level. Figure 8 shows that our suggested algorithm ACTLBO schedules the HVAC with a delay of 24 minutes and does not compromise too much of the UC level.

V. CONCLUSION
We considered a smart home utilizing power from the external grid, battery storage, and RESs like solar, wind generation, and thermal to move loads to it during peak hours and reduce cost, PAR, and carbon emission. The HVAC load is controlled alongside other deferrable and shiftable appliances to minimize load, alleviate costs, and reduce PAR. The scheduling problem is optimized using nature-inspired algorithms like ACO, TLBO, FOA, JOA, RFOA, and our proposed hybrid of ACO and TLBO. The proposed algorithm is compared to the existing optimization algorithms in MATLAB simulations. The results validate that the integration of RESs and BSS, and adapting our proposed algorithm and scheme under DRP-RTP reduced the energy bill, PAR and CO 2 in Case I: only EG usage by 42.14%, 22.05%, and 28.33%, in Case II: EG with RESs by 21.79%, 11.27%, 17.02%, and in Case III: EG with RESs and BSS by 28.76%, 41.53%, 21.86%, respectively as compared to without employing SEMC. Moreover, the UC improved index-ratio with scheduling is 7.77%, 24.73%, 5.00%, and 3.43% in terms of average delay, air quality, thermal, and visual, respectively. We will use real-time algorithms in future work and evaluate the performance of our proposed scheme in residential, industrial, automotive, and agricultural sectors with extensive load and on-site renewables. He is now an Advisor to the President of Saudi Electronic University. His research interests include artificial intelligence, big data, machine learning, NLP, digital image, signal processing, and smart energy.
SHERAZ KHAN received the Ph.D. degree in telecommunications from the School of Engineering and Technology, Asian Institute of Technology (AIT), Thailand. He is currently working as an Assistant Professor with the Department of Electrical Engineering, University of Engineering and Technology (UET), Mardan. His research interests include wireless regional area networks (WRANs), communications TV white spaces (TVWS) and smart grid communications, and machine learning applications in wireless communications.
OMAJI SAMUEL received the B.Sc. degree in statistics/computer science from the University of Agriculture Makurdi, Benue State Nigeria, the M.Sc. degree in information security from COMSATS University Islamabad, Islamabad, Pakistan, in 2015, and the Ph.D. degree in computer science from COMSATS University Islamabad. He is the former acting Dean with the Faculty of Computing and Informatics, Confluence University of Science and Technology (CUSTECH), Osara, Nigeria. Currently, he is with the Department of Computer Science, Edo State University, Uzairue, Nigeria. He has authored over 30 research articles in technical journals and international conferences. His research interests include data science, optimization, security and privacy, energy trading, blockchain, and smart grid. VOLUME 10, 2022