Joint scheduling optimization of a microgrid with integration of renewable energy sources and electric vehicles considering energy and reserve minimization

To lower operational costs as well as emissions when wind and solar resources are available in a microgrid (MG), this study discusses the scheduling of electric vehicles (EVs) and responsive demands simultaneously. To mitigate the effects associated with undispatchable energy sources such as wind and solar, the proposed system makes use of EVs for peak shaving and load curve changes, while responsive demands provide the reserves required to do so. In addition, a two‐stage model is provided to evaluate MG's planned running costs (energy and reserve). Costs related to generating and reserving electricity are minimized in Stage 1, while costs related to adjusting unit scheduling to account for fluctuations in wind and photovoltaic output are minimized in Stage 2. Converged barnacles mating optimizer (CBMO) is a highly effective and powerful optimization tool that is used to handle the resultant objective optimization issue. An MG consisting of multiple dispersed generations is used to implement the proposed model. It is worth mentioning that three scenarios have been defined to analyze the impact of joint scheduling of EVs and controllable loads on the MG's day‐ahead operation. The three cost terms, that is, the generation cost, the reserve cost, and the startup cost of units in this scenario, are derived as $745.6913, $10.5278, and $6.35, respectively, remarkably less than the values reported in Scenarios 1 and 2. In Scenario 1, the CBMO algorithm yielded a lower MG operational cost than methods by a margin of 843.2 $/day. Costs per day of operation in Scenario 2 are derived to be $819.3 using the CBMO technique, whereas in Scenario 3, they are determined to be $743.1.


| INTRODUCTION
Microgrids (MGs) are characterized as localized power systems that use distributed generation (DG) and active consumers with upstream system connectivity. As a result, MGs have the potential to facilitate the widespread adoption of renewable energy sources and plug-in electric vehicles (PEVs), therefore alleviating global ecological and climate-change issues. 1,2 In addition to improving power quality and decreasing operational costs, MGs would provide additional benefits to power systems, such as decreasing power losses owing to the close proximity of the load and the generating. It is possible for MGs to operate either in synchrony with the grid or independently of it. Grid-connected and islanded modes are the terms used to refer to such modes, respectively. Use of these features would reduce the need to curtail loads and improve the system's dependability and efficiency. 3 Nevertheless, new debates over the optimal method for operating MGs have arisen because of the accessibility of a wide variety of energy-generating sources, such as fuel cells (FCs), micro-turbines (MTs), diesel generators (DSGs), and wind turbine (WT) and photovoltaic (PV) powers and energy storage sources. In this way, one of the most important aspects of MG optimization is finding a solution to the environmental/ economic dispatch dilemma. Existing technologies need to be rethought covering environmental concerns, 4 since the power system, including smart grid, accounts for the lion's share of global emissions. 5 As a consequence, the electricity sector requires improved and more efficient scheduling technologies for allocating available resources. 6 PEVs and plug-in hybrid electric vehicles (PHEVs) are another topic receiving more attention because of the lessened environmental impact that they have. In addition to reducing demand on the world's oil supplies, the widespread adoption of such vehicles would boost efficiency and provide for more reliable sources of power. Due to their greater fuel economy and little environmental impact, electric vehicles (EVs) are witnessing significant global expansion. EVs and MGs may function as distributed energy storage units due to their ability to interchange both active and reactive power. 7 Vehicle-to-grid (V2G) technology enables vehicles to interact directly with electrical grids to perform a variety of useful functions, including reactive power compensation, voltage control, harmonic suppression, and main frequency control. 8 Considering the widespread adoption of DGs of all types-including MTs, FCs, WTs, PVs, and EVs-this research aims to determine how optimally MGs can operate in this new environment.

| Literature review
Researchers have been focusing considerably on MG functionality in their studies recently. In addition, many optimization strategies have been used to address the challenge of optimal operation scheduling by considering numerous loading conditions and various distinct objectives. Some prior optimization algorithms have struggled with a crucial issue: how to identify the most cost-effective units to dispatch. Many optimization algorithms, some of which include cost or profit while determining on overall power dispatch associated with MGs, have been published. Using a bi-level bidding mechanism, in the study by Li et al. 9 models the optimum energy and spinning reserve bids. Li et al. 10 discusses the economic dispatch of an MG in the context of a wide coverage of renewable energy sources (RESs) and demand-side control. The unit commitment (UC) problem in renewable energy MGs was investigated by Maroufi et al. 8 Previous research has focused on the single-objective framework, but has ignored greenhouse gas emissions. There is an abundance of literature in this field, but relatively few studies have examined the models associated with more complete MG functioning. Moreover, with the passage of the Clean Air Act Amendments in 1990, conventional pure economic scheduling is no longer capable of meeting the requirements of optimum MG operation. This means that problems related to the release of greenhouse gases need immediate attention. 11 Using demand response programs (DRPs) for the system's storage is another viable technique. The integration of RESs into the grid would be enhanced by such programs, and peak load would be shifted to off-peak hours. 12 As a result, the power system and, in particular, MGs would run more smoothly with loads that could be shifted and controlled.
The DRPs' role has been studied for a virtual power plant in the study by Faria et al., 13 intended to minimize the system's operating cost. Shiftable and controllable loads' and DG units' roles in supplying the required reserve have been investigated by Mazidi et al. 14 through a stochastic bi-level programming framework. A locational marginal price-based operation model was presented in Ref. 15 for virtual power plants, taking into consideration DRPs and storage systems. Demand-side management programs have also been studied by Macedo et al., 16 where the measurement data collected by smart meters would be used to derive the load profile and help train the artificial neural network for the sake of data classification. The discussion of the reported results indicated that the combined artificial neural network and demand-side management programs would be beneficial for promoting system performance. Mišák et al. 17 tested the demand-side programs for a real islanded MG using a heuristic optimization framework. Muttaqi et al. 18 presents a review of the operational and control issues during the design and operation of distribution systems and MGs and the corresponding solutions have also been suggested. A robust chanceconstrained optimization framework has been proposed by Esmaeel Nezhad et al. 19 for the uncertain scheduling of multicarrier energy hubs. An alternating direction method of multipliers-based decentralized method is developed by Javadi et al. 20 for the scheduling of energy hubs in MGs. In this respect, a mixed-integer linear programming (MILP) approach was used. Furthermore, the uncertainties of the energy hub scheduling problem were characterized by Javadi et al. 21 An MILP-based pool trading model has been presented in various studies [22][23][24] for local energy communities in MGs. In this respect, the impacts of energy storage systems and PV panels have been investigated.
In the study by Li et al., 25 a new bi-level optimum dispatching model for the CIES with an EVCS under multistakeholder situations is developed. In this framework, a unified demand response strategy is established to balance the relationship between energy consumption and supply while maintaining a satisfactory level of service for end users. By integrating time of use with realtime charging, it is possible to more effectively manage users' energy consumption and the actions of EVs (charging, discharging, and supplying spinning reserves), thereby maximizing the potential of demand response. The solution step involves transforming the original chance-constrained programming model into a readily solvable MILP form and then solving it by utilizing the CPLEX solver. This is accomplished with the help of sequence operation theory. To facilitate the involvement of battery swapping stations (BSSs) in controlling the economic functioning of an isolated microgrid (IMG), a novel bi-level optimum scheduling model is introduced to manage the scheduling issue between an IMG and EV BSSs in multistakeholder situations. The goal of the upper-level subproblem in the study by Li et al. 12 is to decrease IMG net costs, whereas the purpose of the lower-level subproblem is to maximize BSS revenues within the constraints of dynamic pricing based on demand responses in the upper-level choice. Using the demand response of EVs, a new optimum scheduling strategy is given by Li and Li 26 for renewable sources with IMGs. Initially, an MG scheduling model based on bi-level programming is provided in real-time costing settings, with the upper and lower levels aimed at minimizing the MG gross operational costs as well as the EV charging price. The second step is to propose a hybrid technique for solving the model, which is termed the JAYA-interior point approach.

| Contribution
This research proposes a method for MGs to function optimally when integrated with electrical vehicles as well as responsive demands. A portion of the required network reserve to compensate for the uncertainties of wind and PV is provided by the responsive demands, while EVs are utilized for peak shaving plus load curve modification. Outcomes from the simulation verify the scheduling's impact on decreasing operational expenditures and greenhouse gas emissions. To further determine the expected MG running cost, a two-stage optimization strategy is proposed. Power production and reserve power costs are determined first, and then the costs of rescheduling generation to account for fluctuations in wind and PV output are computed in the second stage. The converged barnacles mating optimizer (CBMO) is then utilized for follow-up optimization purposes. Detailed discussion follows the CBMO's testing on a grid-integrated MG. This strategy belongs to the group of evolutionary approaches that has a high rate of convergence and can escape from local optimums.
In a nutshell, this paper makes the following contributions: 1. Scheduling EVs and responsive demands for peak shaving simultaneously, while accommodating the uncertainty of wind and PV power. 2. Introducing a two-stage model constructed to analyze the expected operational costs of a MG while accounting for wind and PV power uncertainty.
The other sections of the paper are categorized as below, where MG assets are modeled in Section 2. The optimization problem is presented in Section 3. Section 4 describes the CBMO. The results are presented in Section 5. Lastly, Section 6 is devoted to concluding remarks.

| DRP modeling
Minimizing the total cost of the system depends on the DGs in an up-grid integrated MG performing at optimum efficiency. Operating costs are kept to a minimum on such grids by the operator making MG scheduling determinations a day or more in advance according to the expected power usage of renewable energy units. When it comes to reducing peak demand and, by extension, operating costs, DRPs are a great option. In this study, it is supposed that load response suppliers (those in charge of collecting responses from small customers) arrange the amounts of utilized load and their price into a design and offer them in the following day's market. 27 m L s and π L s refer to the load reduction and the introduced price, respectively. In light of this, the model of the load response program may be presented as follows: It is notable that m = 0 Lt 0 . In the case when the DRP is scheduled to load during time slot t, the value "1" is assigned to the binary variable Z Lt s , while the value "0" is assigned in all other cases.

| EVs modeling
To put it simply, a PHEV is an EV that operates on rechargeable batteries or another form of energy storage that can be completely charged by hooking up to an external source of power. When the battery power is low, PHEVs may still go great distances thanks to the provided fossil fuel. Variables such as charger type, battery state of charge (SOC), battery size, and number of PHEVs, charging mode, charging duration, and charging length should be investigated while modeling the performance of these vehicles. SOC is the percentage of the battery's total stored energy that is now usable. 27,28 Hence, it is difficult to forecast how much of a demand there will be for PHEV charging in general, whether at a public station or in a residential area. As such, this research addresses three distinct approaches to charging: (1) uncoordinated charging, (2) coordinated charging, and (3) smart charging. With the uncorrelated charging scheme, PHEVs are charged whenever they are connected to a power source. The data show that most PHEVs' daily trip consists of two segments: one occurring upon departure from the residence in the morning and another upon arrival home in the evening. With the hourly schedule, short trips are ignored. In this scenario, PHEV owners plug their vehicles in to charge when they arrive at their homes at approximately 6:00 p.m. A uniform probability density function (PDF) with a limited range at around 6:00 p.m. may be used to model the charging time. Vehicles may return their stored electricity to the grid during peak shaving, which occurs when grid demand is higher than the system's mean load and reduces the need to run costly peaking units. Recommended electrical market energy and reserve pricing for EVs are $0.83 and $0.07 per kWh, respectively.

| EVs' constraints
The amount of energy that has been stored by the end of time interval t may be found by solving Equation (3). Consideration of the EV's typical daily driving pattern is reflected in the data included in E V t ( , )

Trip
. The daily trip profile is essential information for the system operator to have, and it may be determined using appropriate prediction techniques. If there is an effective means of communication between all parties involved, the user may additionally communicate to the system operator their typical daily travel itinerary. 29 The charge/discharge in period t is not the only factor that has to be considered while balancing the batteries; any unused energy from the prior period must also be factored in. Every EV's charging η ( ) where Equations (4) and (5) show the lower and upper boundaries of the available energy in the EV's battery, respectively.
The EV's (V's) minimum required storage capacity at the conclusion of time period t (Wh).
Constraints (6) and (7) show how technical characteristics of the charging infrastructure and battery technology limit the rate at which an EV's battery may be discharged. The maximum rate is also established.
where As shown in constraints (8) and (9), the charging rate of the EV's battery is constrained in a manner analogous to the discharging rate. 27

| Renewable energy modeling
Considering the uncertainty of wind (PV) power requires a three-part PDF: an upper bound, a forecast value, and a lower bound. 30 The stochastic optimization problem takes as input the scenario tree constructed from this function. It follows that by selecting the forecasted power, the upper limit, and the lower limit, the corresponding probabilities are 50%, 25%, and 25%, respectively.

| OPTIMIZATION PROBLEM
3.1 | Cost function F P ( ) i minimizing the cost of operations is the first objective function, given by function AB in Equation (10). Maintaining the lowest feasible operating costs for the distributed energy resources (DERs) is the primary objective. A linear cost function is used to characterize the costs of energy sources. The system operator considers EVs to be yet another kind of DER; thus, it is necessary to account for their charging and discharging costs. The system operator will be responsible for paying for the energy used by discharged EVs, and the system operator will be paid for providing the necessary quantity of electricity when EV drivers need to charge their vehicles. The reimbursement rates assigned to the batteries of EVs that supply energy to the grid must be meticulously designed and must be substantially beyond the batteries' degradation cost if the V2G concept is to be used in a sustainable manner. 31

| Emission function
The emission function, such as the cost function, has to be developed in two phases because of the inherent uncertainties in wind and PV generation. The first step is to determine the environmental impact of the scheduled production of electricity for load and reserve purposes. Second, the pollution induced by variations in the performance of wind and PV powers is calculated into the scheduling of the units.

| Unified objective function
Including the weighted components, Equation (12) reflects the MG's objective function.

 
in which OF denotes the objective function's value. The objective function's cost and emission ratios may be adjusted by the non-negative factors ω 1 and ω 2 , whereas the i-th price per unit penalty coefficient Q r i , represents this modification. ω 1 = 1, ω 2 = 0, and ω 1 = 0, ω 2 = 1 are the possible adjustment coefficient values. In addition, the objective function must satisfy the equivalence ω 1 = ω 2 = 0.5 so that both the cost and the emission pollution are taken into account equally.

| Stage 1
To ensure that the power produced by DG units is sufficient to meet the overall load demand of the network, the power balance constraint is considered as one of the most essential constraints in MG planning.
•Power balance P t ( ) L indicates the system's hourly power demands.
• Power output constraints P w t is the wind power at time t that may be between P w LB t , and P w UB t , , with P w LB t , being the lower limit and P w UB t , being the upper limit. Similarly, P PV LB t , and P PV UB t , denote the PV lower and upper power limits at time t, respectively. In addition, u it , as a binary variable, takes on the value 1 if the unit i is scheduled to operate during time period t, and 0 else.
• Spinning reserve constraint ,max . ,min in which, at time interval t, point S of DRP L has a capacity of π Lt s and an energy cost of πe Lt s . • Startup cost of units At interval t, η it SU corresponds to the initial money cost for the ith unit.

| Stage 2
• Power balance equation in the mn scenario  (27) in which dr L t mn indicates the DRP's deployed reserve at time t in scenario mn, while ν Ltk s is a binary variable related to DRP's point S at time t in the same scenario mn.
•Load shedding and surplus renewable power It is noted that a negative sign would be assigned to the model used in (29) in case the DRP supplies the reserve up.

| Coupling constraints of the twostage problem
• The unit's power output: .
The reserve up and reserve down supplied by the ith unit at time slot t and scenario mn are denoted by r Gi u t . mn and r Gi d t . mn , respectively.
• Spinning reserve • Demand response reserve The real startup cost of the ith unit at time slot t and scenario mn is indicated by CC si t mn .

| Barnacles
Barnacles are known as a kind of tiny crustacean found on all solid offshore surfaces, including rocks, boat hulls, and pilings. Mid to late April is the spawning season for barnacles. Female and male reproductive organs are present in any barnacle; concurrently, however, egg fertilization must be performed by others. For this purpose, a sperm tube extends from one barnacle to another barnacle in close proximity to fertilize eggs. After emerging from their eggs, barnacle larvae are thrown into the sea to locate a rigid surface to attach to. Afterward, the larvae develop shell plates that cover the bodies. The penises of barnacles are lengthier than their bodies to compensate for fluctuating tides and a sluggish mode of life. A sort of mating barnacle consists of others from the same species with the radius of the penis as well as their competitors for mating. Differences in penis length may play a crucial role in characterizing mating group size and local mate competition. 32 This has inspired the development of the barnacles mating optimizer (BMO) 33,34 for solving optimization issues.

| Barnacles mating optimizer
Following is an explanation of the BMO methodology 35 :

(a) Initializing
Assume that the solution's starting barnacles are represented by the following matrix: n depicts the dimension of the population and N indicates the number of control variables restricted as (40) and (41): where l b and u b are the lower bound and the upper bound for the variable i, respectively. (b) Selection procedure Barnacles are chosen for mating depending on the penis length, p l . This choice is influenced by the following factors: • The selection process is carried out at random constrained to the penis length. • Each barnacle is permitted to donate or receive sperm to/from others. However, a barnacle may only be inseminated by a single barnacle at a time.

• If at a certain time the identical barnacle is chosen,
showing self-mating, such a choice would be ignored and the procedure would proceed with no new generation of offspring. • In case of surpassing the number of candidates from the threshold in any iteration, the sperm-cast procedure will be initiated. The above factors suggest that the BMO encompasses exploitation as well as exploration.
As an exploratory word, the sperm-cast procedure perpetuates the offspring generation. The following equations express this mathematically: It is noteworthy that b D and b M describe a parent couple. Equations (42) and (43) reveal that the selection was done at random and prove the first hypothesis.
(c) Reproduction In the absence of a mathematical representation for barnacles' proliferation, the BMO concentrates on the hereditary characteristics or genotype frequencies of the parents in the offspring generation, in accordance with the Hardy-Weinberg rule. In light of this theory, relation (44) determines the new offspring: It is noted that p depicts a pseudo-random value that is associated with a normal probability distribution within [0, 1], while q = (1 − p). Furthermore, X b N M is the mum variable and X b N D is the dad variable. When the value that was initially specified is exceeded by the initial setting, the sperm cast as the algorithm exploration term takes place. Relation (45) indicates the components making up this process: rand depicts a value chosen at random in the interval [0, 1], and the range is from 0 to 1. The mother barnacle is responsible for producing the new offspring that will be used in the exploring phase.
To deal with the extension of X that results from the increase of the population, the offspring are analyzed and combined with their parents. Next, the process of sorting is carried out to obtain the top results that account for 50% of solutions after the undesirable ones are removed.

| Converged algorithm
The BMO is a novel metaheuristic approach that solves optimization problems effectively. Although the BMO achieves good results based on the research by Li et al., 35 it has a notable drawback: it occasionally converges too early. This study uses two methods for optimizing algorithm performance. The first technique that may be utilized to adjust the algorithm's speed is quasioppositional. The quasi-opposite value X i would be specified as (46): X i shows oppositional-based learning. On the basis of oppositional-based learning, superior barnacles would be chosen by making a comparison with the opposite values. 35,36 X i , the candidate opposed to a candidate under consideration, would be derived as (47): Hence, X l and X u represent the minimum threshold and the maximum threshold for a solution region with dimensions D. In addition, a logistic map is used as a chaotic mechanism to increase population variety and eliminate the algorithm's local optimum downside. 36 This technique simulates the behavior of an algorithm using a pseudo-random process. Relation (49) depicts the model of the logistic map: where i indicates the barnacle in the population, j specifies the number of system generators, k represents the number of iterations, θ = 4, and σ j i k , establishes the chaotic iteration value. The initial value σ j k ,0 is indeed a random value in [0, 1]. Relation (50) is applied for updating the sperm cast accordingly:

| Validation of the CBMO algorithm
Diverse test functions have been discussed for the purpose of confirming the CBMO. To demonstrate the algorithm's effectiveness, the obtained results would be compared with some prominent metaheuristic algorithms, such as the crow search algorithm, 37 the teaching-learning-based optimization (TLBO), 38 the whale optimization algorithm, 39 and the basic BMO. 33 In addition, the population size for each algorithm is assumed to be 100 to provide the comparison. The functions used for analysis and comparison are shown in Table 1. The assumed dimension for all functions is 30 and the lower bound is 0. Table 2 shows the outcomes of deploying the algorithms to the test functions. It is also noteworthy that four measures are utilized for analyzing the obtained results. Each algorithm was independently executed 30 times to obtain reliable comparison results. As can be observed, the presented algorithm yields the lowest cost value, demonstrating its superior accuracy compared to the other studied algorithms.

| SIMULATION RESULTS
The MT, FC, PV, WT, and battery are all part of the testing system. Determining the optimal UC that minimizes cost and emissions is the objective. The scheduling window under consideration is a 24-hour hourly frame. The three main categories of air pollution-carbon dioxide (CO 2 ), sulfur dioxides (SO 2 ), and nitrogen oxides (NO x ) are covered in this case study. Load demand from the network and the daily load profile of the smart MG are comprised of The studied benchmark functions.

Function expression Dimension
Optimal value Range T A B L E 2 Comparative result for six benchmark functions.
Algorithm three distinct categories of consumers: domestic, business as shown Figure 1. 10 Power is also interchanged between the MG and the power grid through a power exchange connection at predetermined periods throughout the day, as defined by the MG Central controller (MGCC). Every DER in an MG is owned by a distinct entity, and those entities' local controllers are linked to the MGCC to facilitate the DERs' independent operation of the grid. In addition, the MGCC uses the optimization process to arrive at a solid and ideal strategy for the intelligent functioning of the MG. The higher and lower boundaries of generated power from DGs, bid coefficients (in cents of Euro per kilowatt-hour or €ct/kWh), and emission coefficients (in kilograms per megawatt-hour or kg/ MWh) are all listed by Li et al. 9,10 Figure 2A shows load demand and the RES data as shown Figure 2B,C. It is worth mentioning that three scenarios have been defined to analyze the impact of joint scheduling of EVs and controllable loads on the MG's day-ahead operation.
Scenario 1: Day-ahead operation excluding controllable loads and EVs. Scenario 2: Day-ahead operation with controllable loads while excluding EVs. Scenario 3: Day-ahead operation including both controllable loads and EVs.

| Scenario 1
In this case, the grid's load demand is met by a combination of RESs such as wind and PV as well as more traditional ones like MT, FC, and DSG. The MT, FC, and DSG provide the necessary reserve power due to the uncertainty of wind and solar electricity. The results of generation units are shown in Figures 3 and 4. The economic/emission dispatch outcomes reveal that the lowcost DSG serves as the base unit, providing both the load demand and reserve power. Since it can be run for most of the day, this generator may help keep system costs down. Despite the fact that all generators release some emissions, DSGs are the most polluting. Addressing this issue requires switching to sources of clean energy such as wind and solar power (emission free) or using low-emission units including FCs and MTs. These units are more expensive despite their lower emissions. As economic-emission dispatch is the goal, a reasonable balance between cost and pollution should be achieved. In this case, to cut down on emissions, the maximum allowable wind power is used during most of the day. It is noted that solar power generation would be associated with a higher cost than the wind power generation, causing it to be set at the predicted value. This issue leads to mitigating the reserve requirement supplied by the grid.
On the other hand, solar power generation is adjusted at its maximum value during on-peak time periods to alleviate the emissions caused by some units. It is worth mentioning that the generation cost in this scenario is calculated as $845.3254, while the reserve and start-up costs in this scenario are $25.3079 and $14.37, respectively. Besides, the total amount of emission produced by units would be 1169.391 kg in this scenario. The hourly dispatch of available sources as well as the reserve supplied by units in this scenario are illustrated in Figure 4.
HAI ET AL.

| Scenario 2
As wind power output rises, so too does the need for spinning and non spinning reserves, driving up the price of running the turbines. Reducing the reserve cost required to deal with the uncertainty of wind and PV energy is essential to lowering operating costs. As a result of their participation throughout the demand response scheme, the subscribers in this case are employed as a grid reserve capacity in the market alongside other power sources. In the auxiliary services sector, responsive loads are a major competitor for generators because of their reduced cost; this enables the operator to make use of emission-free wind and PV electricity. The distributed power results for these generators are shown in Figures 5 and 6. Notice that the uncertainty of wind and PV energies may be handled by incorporating demand response with supply from other sources. A hypothetical 10% of customers are interested in taking part in the demand response project. If the wind and PV powers decline to their minimum, the load response and units reserve are modified to compensate the supply shortages. The operator has determined that the peak times for load response capacity are at 10:00, 11:00, and 14:00 h. Acceptability of the DRP is at its highest during these times, at 100%, and drops to 66% at 13:00 h and 33% at all other periods. The responsive loads enable to take advantage of wind and PV energies at their peak levels for the majority of the 24 h, leading to emission reduction, as well as provide affordable reserve comparing to generators. services load response program can be attributed in large part to the participation of the subscribers. As Figure 7 illustrates, a significant part of the required reserve is met by the controllable loads. This issue would help alleviate the total cost. Besides, a broad comparison is provided in Figure 8 in terms of the reserve provision of units. As can be observed, controllable loads are capable of mitigating the amount of reserve supplied by the units.

| Scenario 3
EVs and their impacts on the day-ahead operation of the system have been addressed in this scenario where DRPs are also included. EVs and controllable loads would help procure the required reserve. The hourly power and reserve dispatch are shown in Figures 9 and 10, respectively. By providing the opportunity and infrastructure for EVs to transact power with the grid, they can serve the load demand by injecting power to the system over on-peak time slots and shifting the operation of expensive units like the MT as shown in this scenario. It is noteworthy that time slots 9-12 and 18-20 are the system's on-peak slots during which EVs serve the load demand by injecting power using their V2G capability. On the other hand, these EVs get charged over other time slots with shallow load demand to flatten the load profile of the system. As a result, the base load power generation F I G U R E 5 Generation units.
would continue its operation, and startup and shutdown costs would be significantly reduced. Figure 11 shows the role of EVs in alleviating the total operating cost of the system in Scenario 3. The values of the cost objective obtained in the three scenarios are compared in Figure 12. The reserve procured by the controllable loads in this scenario enables the network operator to deploy a higher value of renewable power generation. The three cost terms, that is, the generation cost, the reserve cost, and the startup cost of units in this scenario, are derived as $745.6913, $10.5278, and $6.35, respectively, remarkably less than the values reported in Scenarios 1 and 2.

| Comparative study
The MG total operating cost attained by the CBMO algorithm is shown in Table 3  across all optimization algorithms is shown in Figure 13. In comparison to GA, PSO, and TLBO, the findings show that the CBMO method needs the least average time to determine the optimal amount of the operational cost, at 0.08 min. The average amount of time that it takes for various approaches to solve Scenarios 2 and 3 is also listed in Figure 13. As a result, this demonstrates the CBMO algorithm's high computing effectiveness in solving the given issue. Each case study includes an analysis of the CBMO algorithm's performance based on 30 trial runs. According to the data in Table 4, the CBMO algorithm gets 28 hits on the way to the optimal solution out of 30 tries in all three situations. As can be seen in the table, the CBMO method has a much higher success rate (93.33%) in solving the operating cost minimization issue of MG than the other algorithms used to tackle the same problem. As a result, the CBMO algorithm has higher overall efficiency.

| CONCLUSIONS
This study investigated how optimal MGs are to function while dealing with both EVs and responsive demands. As well as this paper represents scheduling EVs and responsive demands for peak shaving simultaneously.    The proposed schedule's potential to lower operating costs and emissions was verified by simulation results. In addition, a two-phase optimization method is presented for determining operational costs. Power production and reserve power costs are computed in the first phase and the costs related to rescheduling producing units owing to fluctuations in wind and PV energies are computed in the second phase. The proposed strategy reduces systemwide emissions while simultaneously increasing incentives for EV and responsive load owners, as well as those who invest in wind and PV, in exchange for the money that they earn. To verify the greater efficiency of the technique in minimizing overall operating costs, three case studies were examined after the proposed optimization issue was addressed using the CBMO algorithm. Consequently, the CBMO approach was thoroughly evaluated in comparison to other widely used algorithms such as GA, PSO, GWO, and TLBO. The obtained results verify the efficiency of the presented framework in alleviating the total operating costs and emissions as well. Using the suggested approach, emissions would be reduced, while the incentives of EV owners, responsive loads, and renewable energy units would be enhanced. It is worth mentioning that three scenarios have been defined to analyze the impact of joint scheduling of EVs and controllable loads on the MG's day-ahead operation. The three cost terms, that is, the generation cost, the reserve cost, and the startup cost of units in this scenario, are derived as $745.6913, $10.5278, and $6.35, respectively, remarkably less than the values reported in Scenarios 1 and 2.